Documentation ¶
Index ¶
- Constants
- Variables
- func Cors() gin.HandlerFunc
- func DecodeParams(method abi.MethodNum, params []byte) ([]byte, error)
- func EncodeParams(method abi.MethodNum, params string) ([]byte, error)
- func NewError(code int, msg string) *client.Response
- func Recovery() gin.HandlerFunc
- func ReturnError(c *gin.Context, res *client.Response)
- func ReturnOk(c *gin.Context, data interface{})
- func VerifyPermission(requestUrl string, allows []app.Permission) bool
- type Children
- type LoggerWriter
- type Meta
- type RouterResponse
- type Routers
- type Wallet
- func (w *Wallet) Balance(c *gin.Context)
- func (w *Wallet) ChangeBeneficiary(c *gin.Context)
- func (w *Wallet) ChangeControl(c *gin.Context)
- func (w *Wallet) ChangeOwner(c *gin.Context)
- func (w *Wallet) ChangeWorker(c *gin.Context)
- func (w *Wallet) ConfirmChangeBeneficiary(c *gin.Context)
- func (w *Wallet) ConfirmChangeWorker(c *gin.Context)
- func (w *Wallet) ControlList(c *gin.Context)
- func (w *Wallet) Decode(c *gin.Context)
- func (w *Wallet) Encode(c *gin.Context)
- func (w *Wallet) GetRouters(c *gin.Context)
- func (w *Wallet) IfOfflineWallet() gin.HandlerFunc
- func (w *Wallet) JWT() gin.HandlerFunc
- func (w *Wallet) Login(c *gin.Context)
- func (w *Wallet) Logout(c *gin.Context)
- func (w *Wallet) MsigAdd(c *gin.Context)
- func (w *Wallet) MsigAddApprove(c *gin.Context)
- func (w *Wallet) MsigAddCancel(c *gin.Context)
- func (w *Wallet) MsigAddPropose(c *gin.Context)
- func (w *Wallet) MsigApprove(c *gin.Context)
- func (w *Wallet) MsigCancel(c *gin.Context)
- func (w *Wallet) MsigChangeBeneficiaryApprove(c *gin.Context)
- func (w *Wallet) MsigChangeBeneficiaryPropose(c *gin.Context)
- func (w *Wallet) MsigChangeOwnerApprove(c *gin.Context)
- func (w *Wallet) MsigChangeOwnerPropose(c *gin.Context)
- func (w *Wallet) MsigChangeWorkerApprove(c *gin.Context)
- func (w *Wallet) MsigChangeWorkerPropose(c *gin.Context)
- func (w *Wallet) MsigConfirmChangeBeneficiaryApprove(c *gin.Context)
- func (w *Wallet) MsigConfirmChangeBeneficiaryPropose(c *gin.Context)
- func (w *Wallet) MsigConfirmChangeWorkerApprove(c *gin.Context)
- func (w *Wallet) MsigConfirmChangeWorkerPropose(c *gin.Context)
- func (w *Wallet) MsigCreate(c *gin.Context)
- func (w *Wallet) MsigInspect(c *gin.Context)
- func (w *Wallet) MsigLockApprove(c *gin.Context)
- func (w *Wallet) MsigLockCancel(c *gin.Context)
- func (w *Wallet) MsigLockPropose(c *gin.Context)
- func (w *Wallet) MsigSetControlApprove(c *gin.Context)
- func (w *Wallet) MsigSetControlPropose(c *gin.Context)
- func (w *Wallet) MsigSwapApprove(c *gin.Context)
- func (w *Wallet) MsigSwapCancel(c *gin.Context)
- func (w *Wallet) MsigSwapPropose(c *gin.Context)
- func (w *Wallet) MsigThresholdApprove(c *gin.Context)
- func (w *Wallet) MsigThresholdCancel(c *gin.Context)
- func (w *Wallet) MsigThresholdPropose(c *gin.Context)
- func (w *Wallet) MsigTransferApprove(c *gin.Context)
- func (w *Wallet) MsigTransferCancel(c *gin.Context)
- func (w *Wallet) MsigTransferPropose(c *gin.Context)
- func (w *Wallet) MsigUpdate(c *gin.Context)
- func (w *Wallet) MsigWalletList(c *gin.Context)
- func (w *Wallet) MsigWithdrawApprove(c *gin.Context)
- func (w *Wallet) MsigWithdrawPropose(c *gin.Context)
- func (w *Wallet) MustHaveNode() gin.HandlerFunc
- func (w *Wallet) MustUnlock() gin.HandlerFunc
- func (w *Wallet) NewRouter() *gin.Engine
- func (w *Wallet) NodeAdd(c *gin.Context)
- func (w *Wallet) NodeBest(c *gin.Context)
- func (w *Wallet) NodeDelete(c *gin.Context)
- func (w *Wallet) NodeList(c *gin.Context)
- func (w *Wallet) NodeUpdate(c *gin.Context)
- func (w *Wallet) Send(c *gin.Context)
- func (w *Wallet) Sign(c *gin.Context)
- func (w *Wallet) SignAndSend(c *gin.Context)
- func (w *Wallet) SignMsg(c *gin.Context)
- func (w *Wallet) Status(c *gin.Context)
- func (w *Wallet) TraceLogger() gin.HandlerFunc
- func (w *Wallet) Transfer(c *gin.Context)
- func (w *Wallet) TxHistory(c *gin.Context)
- func (w *Wallet) UseNode(c *gin.Context)
- func (w *Wallet) WalletCreate(c *gin.Context)
- func (w *Wallet) WalletList(c *gin.Context)
- func (w *Wallet) Withdraw(c *gin.Context)
Constants ¶
const ( CancelErr = "Cannot cancel another signers transaction" ApproveErr = "already approved this message" )
Variables ¶
var ( ParamErr = NewError(1001, "parameter mismatch") AuthErr = NewError(1002, "password verification failed") )
var HandlePermMap = map[string]app.Permission{ "/status": app.PermRead, "/login": app.PermWrite, "/logout": app.PermWrite, "/chain/decode": app.PermRead, "/chain/encode": app.PermRead, "/node/add": app.PermWrite, "/node/update": app.PermWrite, "/node/delete": app.PermWrite, "/node/use_node": app.PermWrite, "/node/list": app.PermRead, "/node/best": app.PermRead, "/wallet/create": app.PermWrite, "/wallet/list": app.PermRead, "/balance": app.PermRead, "/transfer": app.PermWrite, "/tx_history": app.PermRead, "/send": app.PermWrite, "/sign_msg": app.PermSign, "/sign": app.PermSign, "/sign_send": app.PermSign, "/miner/withdraw": app.PermWrite, "/miner/change_owner": app.PermWrite, "/miner/change_worker": app.PermWrite, "/miner/confirm_change_worker": app.PermWrite, "/miner/change_control": app.PermWrite, "/miner/control_list": app.PermRead, "/miner/change_beneficiary": app.PermWrite, "/miner/confirm_change_beneficiary": app.PermWrite, "/msig/list": app.PermRead, "/msig/add": app.PermWrite, "/msig/update": app.PermWrite, "/msig/inspect": app.PermRead, "/msig/create": app.PermWrite, "/msig/approve": app.PermWrite, "/msig/cancel": app.PermWrite, "/msig/transfer_propose": app.PermWrite, "/msig/transfer_approve": app.PermWrite, "/msig/transfer_cancel": app.PermWrite, "/msig/add_signer_propose": app.PermWrite, "/msig/add_signer_approve": app.PermWrite, "/msig/add_signer_cancel": app.PermWrite, "/msig/swap_propose": app.PermWrite, "/msig/swap_approve": app.PermWrite, "/msig/swap_cancel": app.PermWrite, "/msig/lock_propose": app.PermWrite, "/msig/lock_approve": app.PermWrite, "/msig/lock_cancel": app.PermWrite, "/msig/threshold_propose": app.PermWrite, "/msig/threshold_approve": app.PermWrite, "/msig/threshold_cancel": app.PermWrite, "/msig/change_owner_propose": app.PermWrite, "/msig/change_owner_approve": app.PermWrite, "/msig/withdraw_propose": app.PermWrite, "/msig/withdraw_approve": app.PermWrite, "/msig/change_worker_propose": app.PermWrite, "/msig/change_worker_approve": app.PermWrite, "/msig/confirm_change_worker_propose": app.PermWrite, "/msig/confirm_change_worker_approve": app.PermWrite, "/msig/set_control_propose": app.PermWrite, "/msig/set_control_approve": app.PermWrite, "/msig/change_beneficiary_propose": app.PermWrite, "/msig/change_beneficiary_approve": app.PermWrite, "/msig/confirm_change_beneficiary_propose": app.PermWrite, "/msig/confirm_change_beneficiary_approve": app.PermWrite, }
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
func Recovery ¶
func Recovery() gin.HandlerFunc
func VerifyPermission ¶
func VerifyPermission(requestUrl string, allows []app.Permission) bool
Types ¶
type LoggerWriter ¶
type LoggerWriter struct { gin.ResponseWriter // contains filtered or unexported fields }
type RouterResponse ¶
type Routers ¶
type Routers struct { Name string `json:"name,omitempty"` Path string `json:"path"` Hidden bool `json:"hidden"` Redirect string `json:"redirect,omitempty"` Component string `json:"component"` AlwaysShow bool `json:"alwaysShow,omitempty"` Meta Meta `json:"meta"` Children []Children `json:"children"` }
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func (*Wallet) ChangeBeneficiary ¶
ChangeBeneficiary Post
func (*Wallet) ConfirmChangeBeneficiary ¶
ConfirmChangeBeneficiary Post
func (*Wallet) ConfirmChangeWorker ¶
ConfirmChangeWorker Post
func (*Wallet) GetRouters ¶
func (*Wallet) IfOfflineWallet ¶
func (w *Wallet) IfOfflineWallet() gin.HandlerFunc
func (*Wallet) JWT ¶
func (w *Wallet) JWT() gin.HandlerFunc
func (*Wallet) MsigChangeBeneficiaryApprove ¶
MsigChangeBeneficiaryApprove Post
func (*Wallet) MsigChangeBeneficiaryPropose ¶
MsigChangeBeneficiaryPropose Post
func (*Wallet) MsigChangeOwnerApprove ¶
MsigChangeOwnerApprove Post
func (*Wallet) MsigChangeOwnerPropose ¶
MsigChangeOwnerPropose Post
func (*Wallet) MsigChangeWorkerApprove ¶
MsigChangeWorkerApprove Post
func (*Wallet) MsigChangeWorkerPropose ¶
MsigChangeWorkerPropose Post
func (*Wallet) MsigConfirmChangeBeneficiaryApprove ¶
MsigConfirmChangeBeneficiaryApprove Post
func (*Wallet) MsigConfirmChangeBeneficiaryPropose ¶
MsigConfirmChangeBeneficiaryPropose Post
func (*Wallet) MsigConfirmChangeWorkerApprove ¶
MsigConfirmChangeWorkerApprove Post
func (*Wallet) MsigConfirmChangeWorkerPropose ¶
MsigConfirmChangeWorkerPropose Post
func (*Wallet) MsigLockApprove ¶
MsigLockApprove Post
func (*Wallet) MsigLockPropose ¶
MsigLockPropose Post
func (*Wallet) MsigSetControlApprove ¶
MsigSetControlApprove Post
func (*Wallet) MsigSetControlPropose ¶
MsigSetControlPropose Post
func (*Wallet) MsigSwapApprove ¶
MsigSwapApprove Post
func (*Wallet) MsigSwapPropose ¶
MsigSwapPropose Post
func (*Wallet) MsigThresholdApprove ¶
MsigThresholdApprove Post
func (*Wallet) MsigThresholdCancel ¶
MsigThresholdCancel Post
func (*Wallet) MsigThresholdPropose ¶
MsigThresholdPropose Post
func (*Wallet) MsigTransferApprove ¶
MsigTransferApprove Post
func (*Wallet) MsigTransferCancel ¶
MsigTransferCancel Post
func (*Wallet) MsigTransferPropose ¶
MsigTransferPropose Post
func (*Wallet) MsigWithdrawApprove ¶
MsigWithdrawApprove Post
func (*Wallet) MsigWithdrawPropose ¶
MsigWithdrawPropose Post
func (*Wallet) MustHaveNode ¶
func (w *Wallet) MustHaveNode() gin.HandlerFunc
func (*Wallet) MustUnlock ¶
func (w *Wallet) MustUnlock() gin.HandlerFunc
func (*Wallet) NodeDelete ¶
func (*Wallet) TraceLogger ¶
func (w *Wallet) TraceLogger() gin.HandlerFunc