Documentation ¶
Index ¶
Constants ¶
View Source
const ( CHAIN_CALL_FOR_BIZ = "/api/contract/chainCallForBiz" CHAIN_CALL = "/api/contract/chainCall" SHAKE_HAND = "/api/contract/shakeHand" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChainCallOption ¶
ChainCallOption 链调用选项
func WithParam ¶
func WithParam(key string, value any) ChainCallOption
type Client ¶
type Client interface { // CreateAccount 创建账户 CreateAccount(ctx context.Context, account, kmsID string, gas int) (string, error) // Deposit 存证 Deposit(ctx context.Context, content string, gas int) (string, error) // DeploySolidity 部署Solidity合约 DeploySolidity(ctx context.Context, name, code string, gas int) (string, error) // AsyncCallSolidity 异步调用Solidity合约 AsyncCallSolidity(ctx context.Context, contractName, methodSign, inputParams, outTypes string, gas int) (string, error) // QueryTransaction 查询交易 QueryTransaction(ctx context.Context, hash string) (string, error) // QueryReceipt 查询交易回执 QueryReceipt(ctx context.Context, hash string) (string, error) // QueryBlockHeader 查询块头 QueryBlockHeader(ctx context.Context, blockNumber int64) (string, error) // QueryBlockBody 查询块体 QueryBlockBody(ctx context.Context, blockNumber int64) (string, error) // QueryLastBlock 查询最新块高 QueryLastBlock(ctx context.Context) (string, error) // QueryAccount 查询账户 QueryAccount(ctx context.Context, account string) (string, error) }
Client 发送请求使用的客户端
type Config ¶
type Config struct { BizID string `json:"biz_id"` // 链ID (a00e36c5) TenantID string `json:"tenant_id"` // 租户ID AccessID string `json:"access_id"` // AccessID AccessKey *lib_crypto.PrivateKey `json:"access_key"` // AccessKey Account string `json:"account"` // 链账户 MyKmsKeyID string `json:"mykmskey_id"` // 托管标识 }
Config 客户端配置
type Identity ¶
type Identity struct {
Data string `json:"data"`
}
Identity 链账户对应的Identity
func GetIdentityByName ¶
GetIdentityByName 根据链账户名称获取对应的Identity
Click to show internal directories.
Click to hide internal directories.