Documentation
¶
Index ¶
- Constants
- type ContractCallTx
- type ContractDeployTx
- type ContractInvokeTx
- type EbuycoinResponse
- type EvmCallResult
- type MultiSignature
- type Operation
- type PubKeyMultisigThreshold
- type PublicResp
- type SignEvmTx
- type SignedBatchTx
- type SignedEvmTx
- type SignedMultisigEvmTx
- type Ticker
- type V2AccountResult
- type V2ContractActResult
- type V2ConvertResult
- type V2EvmLog
- type V2GenKeyResult
Constants ¶
View Source
const ( MODE_DEFAULT = 0 MODE_ASYNC = 1 MODE_SYNC = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContractCallTx ¶
type ContractCallTx struct {
GasLimit uint64 `json:"gasLimit"` // gas限额
GasPrice string `json:"gasPrice"` // gas价格
Sender string `json:"sender"` // 交易发起者公钥
Privkey string `json:"privkey"` // 交易发起者私钥
Value string `json:"value"` // 金额,通常为0
ContractAddress string `json:"contract"` // 合约地址
Payload string `json:"payload"` // 负载数据,abi.pack(function+参数) hex编码字符串
}
func (*ContractCallTx) Check ¶
func (tx *ContractCallTx) Check() error
type ContractDeployTx ¶
type ContractDeployTx struct {
GasLimit uint64 `json:"gasLimit"` // gas限额
GasPrice string `json:"gasPrice"` // gas价格
Sender string `json:"sender"` // 交易发起者公钥
Privkey string `json:"privkey"` // 交易发起者私钥
Value string `json:"value"` // 交易金额,通常为0
Payload string `json:"payload"` // 合约部署字节码
Memo string `json:"memo"` // 备注
}
func (*ContractDeployTx) Check ¶
func (tx *ContractDeployTx) Check() error
type ContractInvokeTx ¶
type ContractInvokeTx struct {
GasLimit uint64 `json:"gasLimit"` // gas限额
GasPrice string `json:"gasPrice"` // gas价格
Sender string `json:"sender"` // 交易发起者公钥
Privkey string `json:"privkey"` // 交易发起者私钥
Value string `json:"value"` // 交易金额
ContractAddress string `json:"contract"` // 合约地址
Payload string `json:"payload"` // 合约负载 abi.pack(function+参数)
Memo string `json:"memo"` // 备注
}
func (*ContractInvokeTx) Check ¶
func (tx *ContractInvokeTx) Check() error
type EbuycoinResponse ¶
type EvmCallResult ¶
type MultiSignature ¶
type MultiSignature struct {
PubKey PubKeyMultisigThreshold `json:"pubKey"` // 多签公钥
Signatures []string `json:"signatures"` // 用户签名列表
}
type PubKeyMultisigThreshold ¶
type PublicResp ¶
type SignEvmTx ¶
type SignEvmTx struct {
CreatedAt uint64 `json:"createdAt"` // 时间戳,可选
GasLimit uint64 `json:"gasLimit"` // gas限额
GasPrice string `json:"gasPrice"` // gas价格,最低为1
Nonce uint64 `json:"nonce"` // 交易发起者nonce
Sender string `json:"sender"` // 交易发起者公钥
Body struct {
To string `json:"to"` // 交易接受者地址或合约地址
Value string `json:"value"` // 交易金额
Load string `json:"load"` // 合约负载,普通原声币转账时为空
Memo string `json:"memo"` // 备注
} `json:"body"`
PrivateKey string // 私钥
}
type SignedBatchTx ¶
type SignedBatchTx struct {
Mode int `json:"mode"` // 模式:0-default/commit 1-async 2-sync
CreatedAt uint64 `json:"createdAt"` // 时间戳,可选字段,秒/毫秒均可
GasLimit uint64 `json:"gasLimit"` // gas限额
GasPrice string `json:"gasPrice"` // gas价格,至少为1
Nonce uint64 `json:"nonce"` // 用户nonce,每次交易前从链上获取,每次交易nonce+1
Sender string `json:"sender"` // 交易发起者公钥
Ops []Operation `json:"operations"` // 交易列表,数量不可大于10000笔
Memo string `json:"memo"` // 备注,必须<256字节
Signature string `json:"signature"` // 交易签名的hex字符串
}
批量交易
func (*SignedBatchTx) Check ¶
func (tx *SignedBatchTx) Check() error
type SignedEvmTx ¶
type SignedEvmTx struct {
Mode int `json:"mode"` // 交易模式,默认为0;0-同步模式 1-全异步 2-半异步;如果tx执行时间较长、网络不稳定、出块慢,建议使用半异步模式。
CreatedAt uint64 `json:"createdAt"` // 时间戳,可选
GasLimit uint64 `json:"gasLimit"` // gas限额
GasPrice string `json:"gasPrice"` // gas价格,最低为1
Nonce uint64 `json:"nonce"` // 交易发起者nonce
Sender string `json:"sender"` // 交易发起者公钥
Body struct {
To string `json:"to"` // 交易接受者地址或合约地址
Value string `json:"value"` // 交易金额
Load string `json:"load"` // 合约负载,普通原声币转账时为空
Memo string `json:"memo"` // 备注
} `json:"body"`
Signature string `json:"signature"` // 交易签名
}
----合约相关
func (*SignedEvmTx) Check ¶
func (tx *SignedEvmTx) Check() error
type SignedMultisigEvmTx ¶
type SignedMultisigEvmTx struct {
Mode int `json:"mode"` // 交易模式,默认为0;0-同步模式 1-全异步 2-半异步;如果tx执行时间较长、网络不稳定、出块慢,建议使用半异步模式。
Deadline uint64 `json:"deadline"` // 有效截止时间
GasLimit uint64 `json:"gasLimit"` // gas限额
GasPrice string `json:"gasPrice"` // gas价格,最低为1
From string `json:"from"` // 多签账户地址
Nonce uint64 `json:"nonce"` // 多签账户nonce
To string `json:"to"` // 交易接受者地址或合约地址
Value string `json:"value"` // 交易金额
Load string `json:"load"` // 合约负载,普通原声币转账时为空
Memo string `json:"memo"` // 备注
Signature MultiSignature `json:"signature"` // 交易签名
}
----合约相关
func (*SignedMultisigEvmTx) Check ¶
func (tx *SignedMultisigEvmTx) Check() error
type Ticker ¶
type Ticker struct {
Amount string `json:"amount"` // 交易金额
High string `json:"high"` // 最高价
Vol string `json:"vol"` // 成交量
Last float64 `json:"last"` // 最新成交价
Low string `json:"low"` // 最低价
Buy float64 `json:"buy"` // 买入价
Sell float64 `json:"sell"` // 卖出价
Rose string `json:"rose"` // 振幅
Time int64 `json:"time"` // 时间戳 ms
}
type V2AccountResult ¶
type V2ContractActResult ¶
type V2ConvertResult ¶
type V2EvmLog ¶
type V2EvmLog struct {
Address common.Address `json:"address"` // 合约地址
Topics []common.Hash `json:"topics"` // 事件主题
Data []byte `json:"data"` // 数据
BlockNumber uint64 `json:"blockNumber"` // 区块高度
TxHash common.Hash `json:"transactionHash"` // 交易hash
TxIndex uint `json:"transactionIndex"` // 交易索引
BlockHash common.Hash `json:"blockHash"` // 区块hash
Index uint `json:"logIndex"` // 日志索引
Removed bool `json:"removed"` // 是否已移除
}
EVM事件日志
type V2GenKeyResult ¶
Click to show internal directories.
Click to hide internal directories.