Documentation
¶
Overview ¶
Package sdk is the entrance of the entire SDK function. SDKConfig is used to configure SDK parameters.
The SDK mainly provides the functions of the following modules, including: admin, bank, keys, nft, params, record, service, token, validator
As a quick start:
options := []types.Option{ types.KeyDAOOption(store.NewMemory(nil)), } cfg, err := types.NewClientConfig(nodeURI, chainID, options...) if err != nil { panic(err) } client := sdk.NewIRITAClient(cfg)
Index ¶
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- type IRITAClient
- func (client *IRITAClient) AppCodec() codec.Marshaler
- func (client *IRITAClient) Codec() *codec.LegacyAmino
- func (client *IRITAClient) Manager() types.BaseClient
- func (client *IRITAClient) Module(name string) types.Module
- func (client *IRITAClient) RegisterModule(ms ...types.Module)
- func (client *IRITAClient) SetLogger(logger log.Logger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterInterfaces ¶ added in v1.1.0
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
RegisterInterfaces registers the sdk message type.
func RegisterLegacyAminoCodec ¶ added in v1.1.0
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the sdk message type.
Types ¶
type IRITAClient ¶
type IRITAClient struct { types.BaseClient Bank bank.BankI Token token.TokenI Record record.RecordI NFT nft.NFTI Service service.ServiceI Key keys.KeyI // contains filtered or unexported fields }
func NewIRITAClient ¶
func NewIRITAClient(cfg types.ClientConfig) IRITAClient
func (*IRITAClient) AppCodec ¶
func (client *IRITAClient) AppCodec() codec.Marshaler
func (*IRITAClient) Codec ¶
func (client *IRITAClient) Codec() *codec.LegacyAmino
func (*IRITAClient) Manager ¶
func (client *IRITAClient) Manager() types.BaseClient
func (*IRITAClient) RegisterModule ¶
func (client *IRITAClient) RegisterModule(ms ...types.Module)
func (*IRITAClient) SetLogger ¶ added in v1.1.0
func (client *IRITAClient) SetLogger(logger log.Logger)
Directories
¶
Path | Synopsis |
---|---|
client
|
|
legacy
Package legacy contains a global amino Cdc which is deprecated but still used in several places within the SDK.
|
Package legacy contains a global amino Cdc which is deprecated but still used in several places within the SDK. |
types
Package types defines a custom wrapper for google.protobuf.Any which supports cached values as well as InterfaceRegistry which keeps track of types which can be used with Any for both security and introspection
|
Package types defines a custom wrapper for google.protobuf.Any which supports cached values as well as InterfaceRegistry which keeps track of types which can be used with Any for both security and introspection |
unknownproto
unknownproto implements functionality to "type check" protobuf serialized byte sequences against an expected proto.Message to report: a) Unknown fields in the stream -- this is indicative of mismatched services, perhaps a malicious actor b) Mismatched wire types for a field -- this is indicative of mismatched services Its API signature is similar to proto.Unmarshal([]byte, proto.Message) in the strict case if err := RejectUnknownFieldsStrict(protoBlob, protoMessage, false); err != nil { // Handle the error.
|
unknownproto implements functionality to "type check" protobuf serialized byte sequences against an expected proto.Message to report: a) Unknown fields in the stream -- this is indicative of mismatched services, perhaps a malicious actor b) Mismatched wire types for a field -- this is indicative of mismatched services Its API signature is similar to proto.Unmarshal([]byte, proto.Message) in the strict case if err := RejectUnknownFieldsStrict(protoBlob, protoMessage, false); err != nil { // Handle the error. |
keys/secp256k1/internal/secp256k1
nolint:gocritic Package secp256k1 wraps the bitcoin secp256k1 C library.
|
nolint:gocritic Package secp256k1 wraps the bitcoin secp256k1 C library. |
Package modules is to warpped the API provided by each module of IRITA
|
Package modules is to warpped the API provided by each module of IRITA |
bank
Package bank is mainly used to transfer coins between accounts,query account balances, and implement interface rpc.BankI As a quick start: TransferNFT coins to other account client := test.NewClient() amt := types.NewIntWithDecimal(1, 18) coins := types.NewCoins(types.NewCoin("point", amt)) to := "iaa1rgnu8grzt6mwnjg7jss7w0sfyjn67g4et0hzfz" baseTx := types.BaseTx{ From: "test1", Gas: 20000, Memo: "test", Mode: types.Commit, } result,err := client.BankI.Send(to,coins,baseTx) fmt.Println(result) BurnNFT some coins from your account client := test.NewClient() amt := types.NewIntWithDecimal(1, 18) coins := types.NewCoins(types.NewCoin("point", amt)) baseTx := types.BaseTx{ From: "test1", Gas: 20000, Memo: "test", Mode: types.Commit, } result,err := client.BankI.BurnNFT(coins, baseTx) fmt.Println(result) Set account memo client := test.NewClient() result,err := client.BankI.SetMemoRegexp("testMemo", baseTx) fmt.Println(result) Queries account information client := test.NewClient() result,err := client.BankI.QueryAccount("iaa1rgnu8grzt6mwnjg7jss7w0sfyjn67g4et0hzfz") fmt.Println(result) Queries the token information client := test.NewClient() result,err := client.BankI.QueryTokenStats("point") fmt.Println(result)
|
Package bank is mainly used to transfer coins between accounts,query account balances, and implement interface rpc.BankI As a quick start: TransferNFT coins to other account client := test.NewClient() amt := types.NewIntWithDecimal(1, 18) coins := types.NewCoins(types.NewCoin("point", amt)) to := "iaa1rgnu8grzt6mwnjg7jss7w0sfyjn67g4et0hzfz" baseTx := types.BaseTx{ From: "test1", Gas: 20000, Memo: "test", Mode: types.Commit, } result,err := client.BankI.Send(to,coins,baseTx) fmt.Println(result) BurnNFT some coins from your account client := test.NewClient() amt := types.NewIntWithDecimal(1, 18) coins := types.NewCoins(types.NewCoin("point", amt)) baseTx := types.BaseTx{ From: "test1", Gas: 20000, Memo: "test", Mode: types.Commit, } result,err := client.BankI.BurnNFT(coins, baseTx) fmt.Println(result) Set account memo client := test.NewClient() result,err := client.BankI.SetMemoRegexp("testMemo", baseTx) fmt.Println(result) Queries account information client := test.NewClient() result,err := client.BankI.QueryAccount("iaa1rgnu8grzt6mwnjg7jss7w0sfyjn67g4et0hzfz") fmt.Println(result) Queries the token information client := test.NewClient() result,err := client.BankI.QueryTokenStats("point") fmt.Println(result) |
keys
Package keys allows you to manage your local tendermint keystore (wallets) for iris.
|
Package keys allows you to manage your local tendermint keystore (wallets) for iris. |
service
Package service bridge the gap between the blockchain world and the conventional business application world, by mediating a complete lifecycle of off-chain services -- from their definition, binding (provider registration), invocation, to their governance (profiling and dispute resolution).
|
Package service bridge the gap between the blockchain world and the conventional business application world, by mediating a complete lifecycle of off-chain services -- from their definition, binding (provider registration), invocation, to their governance (profiling and dispute resolution). |
uuid
reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/codec.go reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/generator.go Package uuid reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/uuid.go
|
reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/codec.go reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/generator.go Package uuid reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/uuid.go |
Click to show internal directories.
Click to hide internal directories.