Documentation
¶
Index ¶
- Constants
- type BaseWaasParam
- type CreateSettlementTxResData
- type CreateSettlementTxResVinItem
- type CreateSettlementTxResVoutItem
- type MPCNodeExecRecord
- type PageData
- type Response
- type SignMessageParam
- type TransactionWAAS
- type TransferHistoryWAASDTO
- type TxInfo
- type VaultInfoOfOpenApi
- type VinItem
- type VoutItem
- type WaaSAddressBookResult
- type WaaSAddressCheckDTOData
- type WaaSAddressCheckParam
- type WaaSAddressInfoData
- type WaaSAddressPathParam
- type WaaSCoinDTOData
- type WaaSCoinDTOParam
- type WaaSCreateBatchWalletParam
- type WaaSCreateWalletInfo
- type WaaSGenerateChainAddressParam
- type WaaSGetAddressBalanceParam
- type WaaSGetWalletBalanceDTOData
- type WaaSListAddedChainsDTOData
- type WaaSListAddedChainsParam
- type WaaSListAddressesParam
- type WaaSListAddressesResult
- type WaaSListWalletsParam
- type WaaSListWalletsResult
- type WaaSMPCNodeRequestRes
- type WaaSMessageHashResult
- type WaaSMpcNodeExecRecordDTO
- type WaaSMpcNodeStatusDTOData
- type WaaSSignRawDataParam
- type WaaSSignRawDataRes
- type WaaSTransferAddressBookParam
- type WaaSTransferAddressSwitchDTOData
- type WaaSUpdateWalletParam
- type WaaSUpdateWalletRes
- type WaaSVaultIdDTO
- type WaaSVaultInfoData
- type WaaSVaultInfoParam
- type WaaSWalletInfoData
- type WaasChainData
- type WaasChainParam
- type WaasMpcNodeExecRecordParam
- type WalletTransactionCancelWAASParam
- type WalletTransactionQueryBySinoIdParam
- type WalletTransactionQueryWAASParam
- type WalletTransactionQueryWAASRequestIdParam
- type WalletTransactionQueryWAASTxHashdParam
- type WalletTransactionSendDataWAASParam
- type WalletTransactionSendWAASParam
- type WalletTransactionSpeedupWAASParam
- type WhiteAddress
Constants ¶
View Source
const ( FakePublicKey = "" /* 182-byte string literal not displayed */ FakePrivateKey = "" /* 300-byte string literal not displayed */ BaseUrl = "https://api.sinohope.com" BizApiKey = "BIZ-API-KEY" BizApiNone = "BIZ-API-NONCE" BizApiSignature = "BIZ-API-SIGNATURE" MPCProxyStatusOk = 200 MPCProxySuccess = true )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseWaasParam ¶
type CreateSettlementTxResData ¶
type CreateSettlementTxResData struct {
SinoId int64 `json:"sinoId,omitempty"`
RequestId string `json:"requestId,omitempty"`
ReplacedSinoId string `json:"replacedSinoId,omitempty"`
ChainSymbol string `json:"chainSymbol,omitempty"`
TxDirection int `json:"txDirection,omitempty"`
Transaction TxInfo `json:"transaction,omitempty"`
State int `json:"state,omitempty"`
Note string `json:"note,omitempty"`
}
type MPCNodeExecRecord ¶
type MPCNodeExecRecord struct {
RequestID string `json:"requestId,omitempty"` //用户发起业务自己生成的唯一请求id
SinoID string `json:"sinoId,omitempty"` // sinohope 根据当前业务生成的唯一id
RequestTime int64 `json:"requestTime,omitempty"` //请求时间
Param string `json:"param,omitempty"` // 发给 MPC Node的参数
BusinessExecType int `json:"businessExecType,omitempty"` // 业务执行类型(KeyGen 类型请求:1,signTx 类型请求:2,signMessage 类型请求:3,signRawData 类型请求:4)
BusinessExecStatus int `json:"businessExecStatus,omitempty"` // 业务执行状态 (进行中:0,成功:1,失败:2)
IsSuccess bool `json:"isSuccess,omitempty"` // 是否成功
FailedReason string `json:"failedReason,omitempty"` // 失败原因
}
type PageData ¶
type PageData struct {
PageIndex int `json:"pageIndex,omitempty"`
PageSize int `json:"pageSize,omitempty"`
TotalSize int `json:"totalSize,omitempty"`
List json.RawMessage `json:"list,omitempty"`
}
type SignMessageParam ¶
type SignMessageParam struct {
RequestId string `json:"requestId,omitempty"` // 请求方交易的requestId
ChainSymbol string `json:"chainSymbol,omitempty"` // 链
HdPath string `json:"hdPath,omitempty"` // bip32、bip44的推导路径
SignAlgorithm string `json:"signAlgorithm,omitempty"` // 支持签名算法: (personal_sign、signTypedData、eth_signTypedData_v3、eth_signTypedData_v4)
Message string `json:"message,omitempty"` // 待签名的字符串信息
}
type TransactionWAAS ¶
type TransactionWAAS struct {
TxHash string `json:"txHash,omitempty"`
From string `json:"from,omitempty"`
FromTag string `json:"fromTag,omitempty"`
To string `json:"to,omitempty"`
ToTag string `json:"toTag,omitempty"`
Amount string `json:"amount,omitempty"`
FeeAsset string `json:"feeAsset,omitempty"`
FeePrice string `json:"feePrice,omitempty"`
FeeStep string `json:"feeStep,omitempty"`
State int `json:"state,omitempty"`
Nonce string `json:"nonce,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
Note string `json:"note,omitempty"`
Fee float64 `json:"fee,omitempty"`
TransactionFee float64 `json:"transactionFee,omitempty"`
Asset string `json:"asset,omitempty"`
Decimal int `json:"decimal,omitempty"`
CurrentTime int64 `json:"currentTime,omitempty"`
ExpireTime int64 `json:"expireTime,omitempty"`
ExpireBlockHeight int64 `json:"expireBlockHeight,omitempty"`
ReferBlockHeight int64 `json:"referBlockHeight,omitempty"`
ChainId string `json:"chainId,omitempty"`
Vin []CreateSettlementTxResVinItem `json:"vin,omitempty"`
Vout []CreateSettlementTxResVoutItem `json:"vout,omitempty"`
}
type TransferHistoryWAASDTO ¶
type TransferHistoryWAASDTO struct {
BaseWaasParam
List []CreateSettlementTxResData `json:"list,omitempty"`
}
type TxInfo ¶
type TxInfo struct {
TxHash string `json:"txHash,omitempty"`
ActionType string `json:"actionType,omitempty"`
From string `json:"from,omitempty"`
FromTag string `json:"fromTag,omitempty"`
To string `json:"to,omitempty"`
ToTag string `json:"toTag,omitempty"`
Amount string `json:"amount,omitempty"`
AssetId string `json:"assetId,omitempty"`
Decimal int `json:"decimal,omitempty"`
ContractAddress string `json:"contractAddress,omitempty"`
FeeAsset string `json:"feeAsset,omitempty"`
FeeAssetDecimal int `json:"feeAssetDecimal,omitempty"`
UsedFee string `json:"usedFee,omitempty"`
Fee string `json:"fee,omitempty"`
GasPrice string `json:"gasPrice,omitempty"`
GasLimit string `json:"gasLimit,omitempty"`
Nonce string `json:"nonce,omitempty"`
InputData string `json:"inputData,omitempty"`
ExpireTime int `json:"expireTime,omitempty"`
ExpireBlockHeight int `json:"expireBlockHeight,omitempty"`
ReferBlockHeight int `json:"referBlockHeight,omitempty"`
Vin []VinItem `json:"vin,omitempty"`
Vout []VoutItem `json:"vout,omitempty"`
}
type VaultInfoOfOpenApi ¶
type WaaSAddressBookResult ¶
type WaaSAddressBookResult struct {
BaseWaasParam
List []*WhiteAddress `json:"list,omitempty"`
}
type WaaSAddressCheckDTOData ¶
type WaaSAddressCheckDTOData struct {
IsValid bool `json:"isValid,omitempty"` // 检查结果
}
type WaaSAddressCheckParam ¶
type WaaSAddressInfoData ¶
type WaaSAddressInfoData struct {
ID string `json:"id,omitempty"` // 地址id
Address string `json:"address,omitempty"` // 链地址
HdPath string `json:"hdPath,omitempty"` // 地址对应的path
Encoding int `json:"encoding,omitempty"` // 地址类型(例:BTC链:Legacy(P2PKH)格式:0,Native SegWit(Bech32)格式:2)
Pubkey string `json:"pubkey,omitempty"` // 公钥
}
type WaaSAddressPathParam ¶
type WaaSAddressPathParam struct {
VaultId string `json:"vaultId,omitempty"` // 金库id
WalletId string `json:"walletId,omitempty"` // 钱包id
Index int `json:"index,omitempty"` // 用于区分同一个钱包的同一个cointype 下的不同地址
AlgorithmType int `json:"algorithmType,omitempty"` // 算法类型(0: "ECDSA:secp256k1", 1: "EdDSA:ed25519")
CoinType int `json:"coinType,omitempty"` // 参考slip-44 https://github.com/satoshilabs/slips/blob/master/slip-0044.md 中定义的coin type常量,使用none-hardened 的版本。根据业界常规做法,对于所有 eth-like 公链,可共用以太坊的 coin type 60
}
type WaaSCoinDTOData ¶
type WaaSCoinDTOParam ¶
type WaaSCreateBatchWalletParam ¶
type WaaSCreateBatchWalletParam struct {
Count int `json:"count,omitempty"` // 创建多少个 默认值为 1
VaultId string `json:"vaultId,omitempty"`
WalletInfos []WaaSCreateWalletInfo `json:"walletInfos,omitempty"` // 钱包信息 如果不为空 count值必须 walletInfos的数量一致
RequestId string `json:"requestId,omitempty"`
}
type WaaSCreateWalletInfo ¶
type WaaSGenerateChainAddressParam ¶
type WaaSGenerateChainAddressParam struct {
RequestId string `json:"requestId,omitempty"` // 请求ID
VaultId string `json:"vaultId"` // the vault id
WalletId string `json:"walletId,omitempty"` // 钱包id
Count int `json:"count,omitempty"` // 创建多少个,不传默认为1
ChainSymbol string `json:"chainSymbol,omitempty"` // 链名称 简称 链标识 具有唯一性
}
type WaaSListAddedChainsDTOData ¶
type WaaSListAddedChainsDTOData struct {
ChainSymbol string `json:"chainSymbol,omitempty"` // 链名称 简称 链标识
FirstAddressInfo WaaSAddressInfoData `json:"firstAddressInfo,omitempty"` // 地址
}
type WaaSListAddressesParam ¶
type WaaSListAddressesParam struct {
VaultId string `json:"vaultId"` // the vault id
WalletId string `json:"walletId,omitempty"` // 钱包id
ChainSymbol string `json:"chainSymbol,omitempty"` // 链名称 简称 链标识
PageIndex int `json:"pageIndex,omitempty"` // 当前页码,首页为0,默认0
PageSize int `json:"pageSize,omitempty"` // 每页数据条数(不得小于1,不得大于50)
}
type WaaSListAddressesResult ¶
type WaaSListAddressesResult struct {
BaseWaasParam
List []*WaaSAddressInfoData `json:"list,omitempty"`
}
type WaaSListWalletsParam ¶
type WaaSListWalletsResult ¶
type WaaSListWalletsResult struct {
BaseWaasParam
List []*WaaSWalletInfoData `json:"list,omitempty"` // wallets
}
type WaaSMPCNodeRequestRes ¶
type WaaSMPCNodeRequestRes struct {
BaseWaasParam
List []*MPCNodeExecRecord `json:"list,omitempty"`
}
type WaaSMessageHashResult ¶
type WaaSMpcNodeExecRecordDTO ¶
type WaaSMpcNodeExecRecordDTO struct {
RequestId string `json:"requestId,omitempty"` // 用户发起业务自己生成的唯一请求id
SinoId string `json:"sinoId,omitempty"` // sinoId sinohope 根据当前业务生成的唯一id
RequestTime string `json:"requestTime,omitempty"` // 请求时间 格式 "2022-02-02 00:00:00"
Param string `json:"param,omitempty"` // 参数
Result string `json:"result,omitempty"` // 失败原因
BusinessExecType int `json:"businessExecType,omitempty"` // 业务执行类型(KeyGen 类型请求:1,signTx 类型请求:2,signMessage 类型请求:3,signRawData 类型请求:4)
BusinessExecStatus int `json:"businessExecStatus,omitempty"` // 业务执行状态 (进行中:0,成功:1,失败:2)
FailedReason string `json:"failedReason,omitempty"` // 失败原因
}
type WaaSSignRawDataParam ¶
type WaaSSignRawDataParam struct {
VaultId string `json:"vaultId,omitempty"` // 金库id
RequestId string `json:"requestId,omitempty"` // 唯一id 用户自己生成的请求唯一id, 用于重试
WalletId string `json:"walletId,omitempty"` // 钱包id
HdPath string `json:"hdPath,omitempty"` // 地址对应的path, eth 示例 m/1/1/60/0
RawData string `json:"rawData,omitempty"` // 签名数据
}
type WaaSSignRawDataRes ¶
type WaaSSignRawDataRes struct {
SinoId string `json:"sinoId,omitempty"` // sinohope 对此业务的唯一标识
}
type WaaSTransferAddressSwitchDTOData ¶
type WaaSTransferAddressSwitchDTOData struct {
RiskControlEnabled bool `json:"riskControlEnabled,omitempty"` // 风控开关 (true 开启, false 关闭)
}
type WaaSUpdateWalletParam ¶
type WaaSUpdateWalletRes ¶
type WaaSUpdateWalletRes struct {
UpdateWallet bool `json:"updateWallet"` // 修改结果
}
type WaaSVaultIdDTO ¶
type WaaSVaultIdDTO struct {
VaultId string `json:"vaultId,omitempty"` // 金库id
}
type WaaSVaultInfoData ¶
type WaaSVaultInfoData struct {
BusinessType int `json:"businessType,omitempty"`
VaultInfoOfOpenApiList []VaultInfoOfOpenApi `json:"vaultInfoOfOpenApiList,omitempty"`
}
type WaaSVaultInfoParam ¶
type WaaSVaultInfoParam struct {
BusinessType int `json:"businessType,omitempty"`
VaultInfoOfOpenApiList []VaultInfoOfOpenApi `json:"vaultInfoOfOpenApiList,omitempty"`
}
type WaaSWalletInfoData ¶
type WaasChainData ¶
type WaasChainParam ¶
type WaasChainParam struct {
ChainSymbol string `json:"chainSymbol,omitempty"` // 链名称 简称 链标识 具有唯一性
}
type WaasMpcNodeExecRecordParam ¶
type WaasMpcNodeExecRecordParam struct {
BusinessExecType int `json:"businessExecType,omitempty"` // 业务执行类型(KeyGen 类型请求:1,signTx 类型请求:2,signMessage 类型请求:3,signRawData 类型请求:4)
BusinessExecStatus int `json:"businessExecStatus,omitempty"` // 业务执行状态 (进行中:0,成功:1,失败:2)
SinoId string `json:"sinoId,omitempty"` // sinoId,不传按照分页查询
PageIndex int `json:"pageIndex,omitempty"` // 当前页码,首页为1
PageSize int `json:"pageSize,omitempty"` // 每页数据条数(不得小于1,不得大于50)
}
type WalletTransactionQueryBySinoIdParam ¶
type WalletTransactionQueryBySinoIdParam struct {
SinoIds string `json:"sinoIds,omitempty"` // 通过sinoId查询获取已确认交易记录列表,sinoid是sinohope唯一标识交易id,以逗号分割,不能为空且不能大于50个
}
type WalletTransactionQueryWAASParam ¶
type WalletTransactionQueryWAASParam struct {
PageIndex int `json:"pageIndex,omitempty"` // 当前页码,首页为 1
PageSize int `json:"pageSize,omitempty"` // 每页数据条数(不得小于1,不得大于50;默认 10)
Address string `json:"address"` // 链地址
SinoIds string `json:"sinoIds,omitempty"` // 通过sinoIds查询获取已确认交易记录列表,sinoid是sinohope唯一标识交易id,以逗号分割,sinoid不能大于50个
RequestIds string `json:"requestIds,omitempty"` // 通过requestIds查询获取已确认交易记录列表,requestId以逗号分割,requestId不能大于50个
TxHash string `json:"txHash,omitempty"` // 交易hash
ChainSymbol string `json:"chainSymbol"` // 链标识
AssetId string `json:"assetId,omitempty"` // 资产id
StartUpdateTime string `json:"startUpdateTime,omitempty"` // 根据更新时间查询,开始时间 传了开始时间,开始结束也得带上 格式 "2022-02-02 00:00:00"
EndUpdateTime string `json:"endUpdateTime,omitempty"` // 根据更新时间查询,结束时间 传了结束时间,开始时间也得带上 格式 "2022-02-02 00:00:00"
}
type WalletTransactionQueryWAASRequestIdParam ¶
type WalletTransactionQueryWAASRequestIdParam struct {
RequestIds string `json:"requestIds,omitempty"` // 通过requestIds查询获取已确认交易记录列表,requestId以逗号分割,不能为空且不能大于50个
}
type WalletTransactionSendDataWAASParam ¶
type WalletTransactionSendDataWAASParam struct {
WalletId string `json:"walletId,omitempty"` // 钱包id
RequestId string `json:"requestId,omitempty"` // 请求方交易的requestId
ChainSymbol string `json:"chainSymbol,omitempty"` // 链标识
From string `json:"from,omitempty"` // from 地址
To string `json:"to,omitempty"` // to地址
ToTag string `json:"toTag,omitempty"` // 交易的memo
Amount string `json:"amount,omitempty"` // 金额
Fee string `json:"fee,omitempty"` // 手续费 对于 UTXO 类的非EVM兼容链的交易,自设置fee, 如参数为 UTXO 资产转账提供,表示每字节的手续费
FeeRate string `json:"fee_rate,omitempty"` // 手续费费率 1:快 2:中 3:慢
GasPrice string `json:"gasPrice,omitempty"` // gasprice
GasLimit string `json:"gasLimit,omitempty"` // gaslimit
Note string `json:"note,omitempty"` // 备注:用于用户自己需要的一些备注信息
InputData string `json:"inputData,omitempty"` // 以太坊交易data
VaultId string `json:"vaultId,omitempty"` // 金库id
}
type WalletTransactionSendWAASParam ¶
type WalletTransactionSendWAASParam struct {
WalletId string `json:"walletId,omitempty"` // 钱包id
RequestId string `json:"requestId,omitempty"` // 请求方交易的requestId
ChainSymbol string `json:"chainSymbol,omitempty"` // 链标识
AssetId string `json:"assetId,omitempty"` // 资产id
From string `json:"from,omitempty"` // from 地址
To string `json:"to,omitempty"` // to地址
ToTag string `json:"toTag,omitempty"` // memo
Amount string `json:"amount,omitempty"` // 金额
Fee string `json:"fee,omitempty"` // 手续费 对于 UTXO 类的非EVM兼容链的交易,自设置fee, 如参数为 UTXO 资产转账提供,表示每字节的手续费
FeeRate string `json:"fee_rate,omitempty"` // 手续费费率 1:快 2:中 3:慢
GasPrice string `json:"gasPrice,omitempty"` // 交易gasPrice,燃料价格,ETH 账号模型适用,单位为 wei
GasLimit string `json:"gasLimit,omitempty"` // 交易gasLimit,燃料上限,ETH 账号模型适用
Note string `json:"note,omitempty"` // 备注:用于用户自己需要的一些备注信息
VaultId string `json:"vaultId,omitempty"` // 金库id
}
type WalletTransactionSpeedupWAASParam ¶
type WalletTransactionSpeedupWAASParam struct {
RequestId string `json:"requestId"` // 当前请求的requestId
SinoId string `json:"sinoId"` // 要加速的交易的sinoId
ChainSymbol string `json:"chainSymbol"` // 链标识
GasLimit string `json:"gasLimit,omitempty"` // 交易gasLimit,燃料上限,ETH 账号模型适用
GasPrice string `json:"gasPrice,omitempty"` // 交易gasPrice,燃料价格,ETH 账号模型适用,单位为 wei
Fee string `json:"fee,omitempty"` // 手续费 对于 UTXO 类的非EVM兼容链的交易,自设置fee, 如参数为 UTXO 资产转账提供,表示每字节的手续费
}
type WhiteAddress ¶
type WhiteAddress struct {
Address string `json:"address,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.