Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Empty is the empty string Empty string = "" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressAliasMap ¶ added in v0.3.1
type Authenticator ¶ added in v0.3.1
type ContractConfig ¶ added in v0.3.0
type ContractConfig struct { Address string `json:"address,omitempty" hcl:"address,omitempty" mapstructure:"address,omitempty"` // 合约地址 FuncSigns map[string]FuncSign `json:"func_sign" hcl:"func_sign" mapstructure:"func_sign"` // 函数签名 NativeTransfer bool `json:"native_transfer" mapstructure:"native_transfer"` // 原生转账 ChainIds []uint64 `json:"chain_ids,omitempty" hcl:"chain_ids,omitempty" mapstructure:"chain_ids,omitempty"` // 配置ChainID允许 }
func (*ContractConfig) IsChainIdAllowed ¶ added in v0.3.0
func (c *ContractConfig) IsChainIdAllowed(chainId uint64) bool
func (*ContractConfig) IsContractAllowed ¶ added in v0.3.0
func (c *ContractConfig) IsContractAllowed(contract string, chainId uint64) bool
func (*ContractConfig) IsFuncSignAllowed ¶ added in v0.3.0
func (c *ContractConfig) IsFuncSignAllowed(funcSign string) *FuncSign
type EthWalletBackend ¶
type Extra ¶ added in v0.3.1
type FuncSign ¶ added in v0.3.0
type FuncSign struct { Sign string `json:"sign,omitempty" hcl:"sign,omitempty" mapstructure:"sign,omitempty"` // 函数签名 MaxValue string `json:"max_value" hcl:"max_value" mapstructure:"max_value"` // 最大值 }
func (*FuncSign) IsFuncSignAllowed ¶ added in v0.3.0
type Policy ¶ added in v0.3.0
type Policy struct { ChainIds []uint64 `json:"chain_ids" hcl:"chain_ids" mapstructure:"chain_ids"` // 配置ChainID允许 EnableCreateContract bool `json:"enable_create_contract" hcl:"enable_create_contract" mapstructure:"enable_create_contract"` // 是否允许创建合约 Contract map[string]ContractConfig `json:"contract" hcl:"contract" mapstructure:"contract"` // 操作合约白名单 }
func (*Policy) IsChainIdAllowed ¶ added in v0.3.0
func (*Policy) IsContractAllowed ¶ added in v0.3.0
func (p *Policy) IsContractAllowed(contract string, chainId uint64) *ContractConfig
func (*Policy) IsTxAllowed ¶ added in v0.3.0
type SocialID ¶ added in v0.3.1
type SocialID struct { User string `json:"user" mapstructure:"user"` // User is the user id of the discord / twitter / telegram user Password string `json:"password,omitempty" mapstructure:"password,omitempty"` // Password is the password of the discord / twitter / telegram user Mobile string `json:"mobile,omitempty" mapstructure:"mobile,omitempty"` // Mobile is the mobile of the discord / twitter / telegram user TwoFASecret string `json:"two_fa_secret,omitempty" mapstructure:"two_fa_secret,omitempty"` // TwoFASecret is the two-factor authentication secret of the discord / twitter / telegram user GAuth *Authenticator `json:"g_auth,omitempty" mapstructure:"g_auth,omitempty"` // GAuth is the Google authenticator of the discord / twitter / telegram user UpdateTime int64 `json:"update_time" mapstructure:"update_time"` // UpdateTime is the update time of the socialId NameSpaces []string `json:"namespaces,omitempty" mapstructure:"namespaces,omitempty"` // NameSpaces is the namespaces of the socialId App string `json:"app" mapstructure:"app,omitempty"` // App is the app of the socialId }
SocialID is a struct that contains the information of a discord / twitter / telegram user
type Wallet ¶ added in v0.3.0
type Wallet struct { PublicKey string `json:"public_key,omitempty" mapstructure:"public_key,omitempty"` // PublicKey is the public key of the wallet Address string `json:"address" mapstructure:"address"` UpdateTime int64 `json:"update_time" mapstructure:"update_time,omitempty"` // key pair update time }
Wallet is an Ethereum Wallet
type WalletExtra ¶ added in v0.3.1
type WalletExtra struct { Wallet `mapstructure:",squash"` Mnemonic string `json:"mnemonic" mapstructure:"mnemonic,omitempty"` // Mnemonic is the mnemonic of the wallet PrivateKey string `json:"private_key" mapstructure:"private_key,omitempty"` // PrivateKey is the private key of the wallet //PublicKey string `json:"public_key,omitempty"` // PublicKey is the public key of the wallet AddressAlias AddressAliasMap `json:"address_alias,omitempty" mapstructure:"address_alias,omitempty"` // Address is the address of the wallet NameSpaces []string `json:"namespaces,omitempty" mapstructure:"namespaces,omitempty"` // 用于项目区分 CryptoType string `json:"crypto_type,omitempty" mapstructure:"crypto_type,omitempty"` // 加密曲线区分 Extra Extra `json:"extra" mapstructure:"extra,omitempty"` // 用于标签 }
WalletExtra is an Ethereum Wallet
func (*WalletExtra) GetAddress ¶ added in v0.3.1
func (w *WalletExtra) GetAddress(chain string) string
func (*WalletExtra) SignEthTx ¶ added in v0.3.1
func (w *WalletExtra) SignEthTx(unsignTx *types.Transaction) (*types.Transaction, error)
Click to show internal directories.
Click to hide internal directories.