client

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 65 Imported by: 0

README

Xpla client

The xpla client is a client for performing all functions within the xpriv.go library. The user mandatorily inputs chain ID.

Ready to run Xpla client

mnemonic, err := key.NewMnemonic()
if err != nil {
    fmt.Println(err)
}

priKey, err := key.NewPrivKey(mnemonic)
if err != nil {
    fmt.Println(err)
}

// Can check addr (string type)
addr, err := key.Bech32AddrString(priKey)

// Create new XPLA client
xplac := client.NewXplaClient("chain-id")

// Set private key
xplac = xplac.WithOptions(client.Options{PrivateKey: priKey})
Set URLs for xpla client
// Need LCD URL when broadcast transactions
xplac := client.NewXplaClient(
    "chain-id",    
).WithOptions(
    client.Options{
        LcdURL: "http://localhost:1317",
    }
)

// Need GRPC URL to query or broadcast tx
xplac := client.NewXplaClient(
    "chain-id",    
).WithOptions(
    client.Options{
        GrpcURL: "http://localhost:9090",
    }
)

// Need tendermint RPC URL when only "Query tx" methods
// i.e. xplad query tx, xplad query txs
xplac := client.NewXplaClient(
    "chain-id",    
).WithOptions(
    client.Options{
        RpcURL: "http://localhost:26657",
    }
)

// Need EVM RPC URL when use evm module
xplac := client.NewXplaClient(
    "chain-id",    
).WithOptions(
    client.Options{
        EvmRpcURL: "http://localhost:8545",
    }
)
Optional parameters of xpla client
type Options struct {    
    // Set private key
    PrivateKey     key.PrivateKey
    // Set account number of address
    AccountNumber  string
    // Set account sequence of address
    Sequence       string
    // Broadcast mode (sync,async,block)
    BroadcastMode  string	
    // Transaction gas limit
    GasLimit       string
    // Transaction gas price
    GasPrice       string
    // Transaction gas limit adjustment
    GasAdjustment  string
    // Transaction fee amount
    FeeAmount      string
    // Transaction sign mode
    SignMode       signing.SignMode
    // Set fee granter of transaction builder
    FeeGranter     sdk.AccAddress
    // Set timeout height of transaction builder
    TimeoutHeight  string
    // LCD URL
    LcdURL         string
    // GRPC URL
    GrpcURL        string
    // Tendermint RPC URL
    RpcURL         string
    // Ethereum VM RPC URL
    EvmRpcURL      string
    // Set user want pagination option
    Pagination     types.Pagination
    // Set output document name when created transaction with json file
    // "Generate only" is same that OutputDocument is not empty string 
    OutputDocument string	
    // Set VP by using json file
    VPPath string
    // Set VP by using string
    VPString string
}

Handle transactions

Create and sign tx
// Create signed transaction by using msg.
// e.g. Send coin of bank module
bankSendMsg := types.BankSendMsg {
    FromAddress: "xpla1g8ku0mt75j4p8luxzku6dkcxxvnc0tt352z0k9",
    ToAddress: "xpla1j3dtjvchp7ec3nnn6357jv8v8f29akx6p2u78g",
    Amount: "1000",
}

txbytes, err := xplac.BankSend(bankSendMsg).CreateAndSignTx()
Create unsigned tx
// Create unsigned transaction by using msg.
// e.g. Send coin of bank module
bankSendMsg := types.BankSendMsg {
    FromAddress: "xpla1g8ku0mt75j4p8luxzku6dkcxxvnc0tt352z0k9",
    ToAddress: "xpla1j3dtjvchp7ec3nnn6357jv8v8f29akx6p2u78g",
    Amount: "1000axpla",
}

txbytes, err := xplac.BankSend(bankSendMsg).CreateUnsignedTx()
Sign tx
addr, err := key.Bech32AddrString(priKey)
// Sign transaction with local transaction file.
signTxMsg := types.SignTxMsg{
    FileName:    "./unsignedTx.json",    
    FromAddress: addr,
}	

txbytes, err := xplac.SignTx(signTxMsg)
Multisign tx
// Multi sign transaction with local transaction file.
// It is able to sign when local keyring file and signature file exist.
txMultiSignMsg := types.TxMultiSignMsg{
    FileName: "./unsignedTx.json",
    GenerateOnly: true,
    FromName: "mykey",
    Offline: true,
    SignatureFiles: []string{"signatureFiles.json", ...},	
}

res, err := xplac.MultiSign(txMultiSignMsg)
Encode tx
// Encoding transaction by using base64
encodeTxMsg := types.EncodeTxMsg {
    FileName: "./unsignedTx.json",
}

res, err := xplac.EncodeTx(encodeTxMsg)
Decode tx
// Decoding transaction
decodeTxMsg := types.DecodeTxMsg{
    EncodedByteString: "CvwBCvkBCiUvY29zbW9zLmdvdi52MWJldGE......",
}

res, err := xplac.DecodeTx(decodeTxMsg)
Validate signatures of tx
validateSignaturesMsg := types.ValidateSignaturesMsg{
    FileName: "./signedTx.json",
    Offline: true,
}

res, err := xplac.ValidateSignatures(validateSignaturesMsg)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	PrivateKey     key.PrivateKey
	AccountNumber  string
	Sequence       string
	BroadcastMode  string
	GasLimit       string
	GasPrice       string
	GasAdjustment  string
	FeeAmount      string
	SignMode       signing.SignMode
	FeeGranter     sdk.AccAddress
	TimeoutHeight  string
	LcdURL         string
	GrpcURL        string
	RpcURL         string
	EvmRpcURL      string
	Pagination     types.Pagination
	OutputDocument string
	VPPath         string
	VPString       string
}

Optional parameters of xpla client.

type XplaClient

type XplaClient struct {
	ChainId        string
	EncodingConfig params.EncodingConfig
	Grpc           grpc1.ClientConn
	Context        context.Context
	VP             []byte

	Opts Options

	Module  string
	MsgType string
	Msg     interface{}
	Err     error
}

The xpla client is a client for performing all functions within the xpriv.go library. The user mandatorily inputs chain ID.

func NewXplaClient

func NewXplaClient(
	chainId string,
) *XplaClient

Make new xpla client.

func (*XplaClient) AccAddress

func (xplac *XplaClient) AccAddress(queryAccAddresMsg types.QueryAccAddressMsg) *XplaClient

Query for account by address.

func (*XplaClient) Accept

func (xplac *XplaClient) Accept(acceptMsg types.AcceptMsg) *XplaClient

Accept a participant to join the private chain

func (*XplaClient) AccountInfo

func (xplac *XplaClient) AccountInfo(accountInfoMsg types.AccountInfoMsg) *XplaClient

Query a account information which includes account address(hex and bech32), balance and etc.

func (*XplaClient) Accounts

func (xplac *XplaClient) Accounts() *XplaClient

Query all accounts.

func (*XplaClient) AddAdmin

func (xplac *XplaClient) AddAdmin(addAdminMsg types.AddAdminMsg) *XplaClient

Enroll additional admin of the private chain

func (*XplaClient) Admin

func (xplac *XplaClient) Admin() *XplaClient

Query all administrators in the private chain.

func (*XplaClient) AllAggregatedBlocks

func (xplac *XplaClient) AllAggregatedBlocks() *XplaClient

Query aggregated blocks are saved in the state DB.

func (*XplaClient) AllDIDs added in v0.0.2

func (xplac *XplaClient) AllDIDs() *XplaClient

Query all DIDs are activated.

func (*XplaClient) AllParticipants added in v0.0.2

func (xplac *XplaClient) AllParticipants() *XplaClient

Query all participants

func (*XplaClient) AllUnderReviews added in v0.0.2

func (xplac *XplaClient) AllUnderReviews() *XplaClient

Query to check all participate state under review

func (*XplaClient) AnchorAcc

func (xplac *XplaClient) AnchorAcc(anchorAccMsg types.AnchorAccMsg) *XplaClient

Query mapping info of the anchor account.

func (*XplaClient) AnchorBalances

func (xplac *XplaClient) AnchorBalances(anchorBalancesMsg types.AnchorBalancesMsg) *XplaClient

Query balances of the anchor account in the public chain.

func (*XplaClient) AnchorBlock

func (xplac *XplaClient) AnchorBlock(anchorBlockMsg types.AnchorBlockMsg) *XplaClient

Query Anchored block is recorded in the anchor contract of the public chain.

func (*XplaClient) AnchorInfo

func (xplac *XplaClient) AnchorInfo(anchorInfoMsg types.AnchorInfoMsg) *XplaClient

Query anchoring info includes from/end height and tx hash are saved in the state DB.

func (*XplaClient) AnchorParams added in v0.0.2

func (xplac *XplaClient) AnchorParams() *XplaClient

Query params of anchor module

func (*XplaClient) AnchorTxBody

func (xplac *XplaClient) AnchorTxBody(anchorTxBodyMsg types.AnchorTxBodyMsg) *XplaClient

Query anchoring transaction body in the public chain.

func (*XplaClient) AnchorVerify

func (xplac *XplaClient) AnchorVerify(anchorVerifyMsg types.AnchorVerifyMsg) *XplaClient

Check the consistency of the block in the private chain.

func (*XplaClient) AnnualProvisions

func (xplac *XplaClient) AnnualProvisions() *XplaClient

Query the current minting annual provisions value.

func (*XplaClient) AuthParams

func (xplac *XplaClient) AuthParams() *XplaClient

Query the current auth parameters.

func (*XplaClient) BankBalances

func (xplac *XplaClient) BankBalances(bankBalancesMsg types.BankBalancesMsg) *XplaClient

Query for account balances by address

func (*XplaClient) BankSend

func (xplac *XplaClient) BankSend(bankSendMsg types.BankSendMsg) *XplaClient

Send funds from one account to another.

func (*XplaClient) Block

func (xplac *XplaClient) Block(blockMsg ...types.BlockMsg) *XplaClient

Query block

func (*XplaClient) Broadcast

func (xplac *XplaClient) Broadcast(txBytes []byte) (*types.TxRes, error)

Broadcast the transaction. Default broadcast mode is "sync" if not xpla client has broadcast mode option. The broadcast method is determined according to the broadcast mode option of the xpla client. For evm transaction broadcast, use a separate method in this function.

func (*XplaClient) BroadcastAsync

func (xplac *XplaClient) BroadcastAsync(txBytes []byte) (*types.TxRes, error)

Broadcast the transaction with mode "Async". It takes precedence over the option of the xpla client.

func (*XplaClient) BroadcastBlock

func (xplac *XplaClient) BroadcastBlock(txBytes []byte) (*types.TxRes, error)

Broadcast the transaction with mode "block". It takes precedence over the option of the xpla client.

func (*XplaClient) CallSolidityContract

func (xplac *XplaClient) CallSolidityContract(callSolContractMsg types.CallSolContractMsg) *XplaClient

Call(as query) solidity contract.

func (*XplaClient) CancelSoftwareUpgrade

func (xplac *XplaClient) CancelSoftwareUpgrade(cancelSoftwareUpgradeMsg types.CancelSoftwareUpgradeMsg) *XplaClient

Cancel the current software upgrade proposal.

func (*XplaClient) ChangeAnchorAcc

func (xplac *XplaClient) ChangeAnchorAcc(changeAnchorAccMsg types.ChangeAnchorAccMsg) *XplaClient

Change anchor account of the validator in the private chain

func (*XplaClient) ClearContractAdmin

func (xplac *XplaClient) ClearContractAdmin(clearContractAdminMsg types.ClearContractAdminMsg) *XplaClient

Clears admin for a contract to prevent further migrations.

func (*XplaClient) CodeInfo

func (xplac *XplaClient) CodeInfo(codeInfoMsg types.CodeInfoMsg) *XplaClient

Prints out metadata of a code ID.

func (*XplaClient) CommunityPool

func (xplac *XplaClient) CommunityPool() *XplaClient

Query the amount of coins in the community pool.

func (*XplaClient) CommunityPoolSpend

func (xplac *XplaClient) CommunityPoolSpend(communityPoolSpendMsg types.CommunityPoolSpendMsg) *XplaClient

Submit a community pool spend proposal.

func (*XplaClient) ContractHistory

func (xplac *XplaClient) ContractHistory(contractHistoryMsg types.ContractHistoryMsg) *XplaClient

Prints out the code history for a contract given its address.

func (*XplaClient) ContractInfo

func (xplac *XplaClient) ContractInfo(contractInfoMsg types.ContractInfoMsg) *XplaClient

Prints out metadata of a contract given its address.

func (*XplaClient) ContractStateAll

func (xplac *XplaClient) ContractStateAll(contractStateAllMsg types.ContractStateAllMsg) *XplaClient

Prints out all internal state of a contract given its address.

func (*XplaClient) CreateAndSignTx

func (xplac *XplaClient) CreateAndSignTx() ([]byte, error)

Create and sign a transaction before it is broadcasted to xpla chain. Options required for create and sign are stored in the xpla client and reflected when the values of those options exist. Create and sign transaction must be needed in order to send transaction to the chain.

func (*XplaClient) CreateDID

func (xplac *XplaClient) CreateDID(createDIDMsg types.CreateDIDMsg) *XplaClient

Create new DID.

func (*XplaClient) CreateUnsignedTx

func (xplac *XplaClient) CreateUnsignedTx() ([]byte, error)

Create transaction with unsigning. It returns txbytes of byte type when output document options is nil. If not, save the unsigned transaction file which name is "outputDocument"

func (*XplaClient) CreateValidator

func (xplac *XplaClient) CreateValidator(createValidatorMsg types.CreateValidatorMsg) *XplaClient

Create new validator initialized with a self-delegation to it.

func (*XplaClient) DIDByMoniker added in v0.0.2

func (xplac *XplaClient) DIDByMoniker(didByMonikerMsg types.DIDByMonikerMsg) *XplaClient

Query DID by moniker.

func (*XplaClient) DeactivateDID

func (xplac *XplaClient) DeactivateDID(deactivateDIDMsg types.DeactivateDIDMsg) *XplaClient

Deactivate existed DID.

func (*XplaClient) DecodeTx

func (xplac *XplaClient) DecodeTx(decodeTxMsg types.DecodeTxMsg) (string, error)

Decode transaction which encoded by base64

func (*XplaClient) Delegate

func (xplac *XplaClient) Delegate(delegateMsg types.DelegateMsg) *XplaClient

Delegate liquid tokens to a validator.

func (*XplaClient) DenomMetadata

func (xplac *XplaClient) DenomMetadata(denomMetadataMsg ...types.DenomMetadataMsg) *XplaClient

Query the client metadata for coin denominations.

func (*XplaClient) Deny

func (xplac *XplaClient) Deny(denyMsg types.DenyMsg) *XplaClient

Deny a participant to join the private chain

func (*XplaClient) DeploySolidityContract

func (xplac *XplaClient) DeploySolidityContract(deploySolContractMsg types.DeploySolContractMsg) *XplaClient

Deploy soldity contract.

func (*XplaClient) DistCommission

func (xplac *XplaClient) DistCommission(queryDistCommissionMsg types.QueryDistCommissionMsg) *XplaClient

Query distribution validator commission.

func (*XplaClient) DistRewards

func (xplac *XplaClient) DistRewards(queryDistRewardsMsg types.QueryDistRewardsMsg) *XplaClient

Query all ditribution delegator rewards or rewards from a particular validator.

func (*XplaClient) DistSlashes

func (xplac *XplaClient) DistSlashes(queryDistSlashesMsg types.QueryDistSlashesMsg) *XplaClient

Query distribution validator slashes.

func (*XplaClient) DistributionParams

func (xplac *XplaClient) DistributionParams() *XplaClient

Query distribution parameters.

func (*XplaClient) Download

func (xplac *XplaClient) Download(downloadMsg types.DownloadMsg) *XplaClient

Downloads wasm bytecode for given code ID.

func (*XplaClient) EditValidator

func (xplac *XplaClient) EditValidator(editValidatorMsg types.EditValidatorMsg) *XplaClient

Edit an existing validator account.

func (*XplaClient) EncodeTx

func (xplac *XplaClient) EncodeTx(encodeTxMsg types.EncodeTxMsg) (string, error)

Encode transaction by using base64.

func (*XplaClient) EstimateGas

func (xplac *XplaClient) EstimateGas(invokeSolContractMsg types.InvokeSolContractMsg) *XplaClient

Query estimate gas.

func (*XplaClient) EthAccounts

func (xplac *XplaClient) EthAccounts() *XplaClient

Query all eth accounts.

func (*XplaClient) EthBlockNumber

func (xplac *XplaClient) EthBlockNumber() *XplaClient

Query latest block height(as number)

func (*XplaClient) EthChainID

func (xplac *XplaClient) EthChainID() *XplaClient

Query chain ID of ethereum type.

func (*XplaClient) EthCoinbase

func (xplac *XplaClient) EthCoinbase() *XplaClient

Query coinbase.

func (*XplaClient) EthGetBlockTransactionCount

func (xplac *XplaClient) EthGetBlockTransactionCount(ethGetBlockTransactionCountMsg types.EthGetBlockTransactionCountMsg) *XplaClient

Query the number of transaction a given block.

func (*XplaClient) EthGetFilterChanges

func (xplac *XplaClient) EthGetFilterChanges(ethGetFilterChangesMsg types.EthGetFilterChangesMsg) *XplaClient

Query filter changes.

func (*XplaClient) EthGetFilterLogs

func (xplac *XplaClient) EthGetFilterLogs(ethGetFilterLogsMsg types.EthGetFilterLogsMsg) *XplaClient

Query filter logs.

func (*XplaClient) EthGetLogs

func (xplac *XplaClient) EthGetLogs(ethGetLogsMsg types.EthGetLogsMsg) *XplaClient

Get logs.

func (*XplaClient) EthGetTransactionByBlockHashAndIndex

func (xplac *XplaClient) EthGetTransactionByBlockHashAndIndex(getTransactionByBlockHashAndIndexMsg types.GetTransactionByBlockHashAndIndexMsg) *XplaClient

Query transaction by block hash and index.

func (*XplaClient) EthGetTransactionReceipt

func (xplac *XplaClient) EthGetTransactionReceipt(getTransactionReceiptMsg types.GetTransactionReceiptMsg) *XplaClient

Query transaction receipt.

func (*XplaClient) EthNewBlockFilter

func (xplac *XplaClient) EthNewBlockFilter() *XplaClient

Query filter ID by eth new block filter.

func (*XplaClient) EthNewFilter

func (xplac *XplaClient) EthNewFilter(ethNewFilterMsg types.EthNewFilterMsg) *XplaClient

Query filter ID by eth new filter.

func (*XplaClient) EthNewPendingTransactionFilter

func (xplac *XplaClient) EthNewPendingTransactionFilter() *XplaClient

Query filter ID by eth new pending transaction filter.

func (*XplaClient) EthProtocolVersion

func (xplac *XplaClient) EthProtocolVersion() *XplaClient

ethereum protocol version.

func (*XplaClient) EthSyncing

func (xplac *XplaClient) EthSyncing() *XplaClient

Query the sync status object depending on the details of tendermint's sync protocol.

func (*XplaClient) EthUninstallFilter

func (xplac *XplaClient) EthUninstallFilter(ethUninstallFilterMsg types.EthUninstallFilterMsg) *XplaClient

Uninstall filter.

func (*XplaClient) EvmSendCoin

func (xplac *XplaClient) EvmSendCoin(sendCoinMsg types.SendCoinMsg) *XplaClient

Send coind by using evm client.

func (*XplaClient) ExecuteContract

func (xplac *XplaClient) ExecuteContract(executeMsg types.ExecuteMsg) *XplaClient

Execute a wasm contract.

func (*XplaClient) Exile

func (xplac *XplaClient) Exile(exileMsg types.ExileMsg) *XplaClient

Exile a participant from private chain

func (*XplaClient) FeeGrant

func (xplac *XplaClient) FeeGrant(grantMsg types.FeeGrantMsg) *XplaClient

Grant fee allowance to an address.

func (*XplaClient) FundCommunityPool

func (xplac *XplaClient) FundCommunityPool(fundCommunityPoolMsg types.FundCommunityPoolMsg) *XplaClient

Funds the community pool with the specified amount.

func (*XplaClient) GenDIDSign

func (xplac *XplaClient) GenDIDSign(genDIDSignMsg types.GenDIDSignMsg) *XplaClient

Gen the DID signature from DID key.

func (*XplaClient) GetAccountNumber

func (xplac *XplaClient) GetAccountNumber() string

Get account number

func (*XplaClient) GetBlockByHashOrHeight

func (xplac *XplaClient) GetBlockByHashOrHeight(getBlockByHashHeightMsg types.GetBlockByHashHeightMsg) *XplaClient

Query a block which is ethereum type information by retrieving hash or block height(as number).

func (*XplaClient) GetBroadcastMode

func (xplac *XplaClient) GetBroadcastMode() string

Get broadcast mode

func (*XplaClient) GetChainId

func (xplac *XplaClient) GetChainId() string

Get chain ID

func (*XplaClient) GetContext

func (xplac *XplaClient) GetContext() context.Context

Get xpla client context

func (*XplaClient) GetDID

func (xplac *XplaClient) GetDID(getDIDMsg types.GetDIDMsg) *XplaClient

Query DID info.

func (*XplaClient) GetEncoding

func (xplac *XplaClient) GetEncoding() params.EncodingConfig

Get encoding configuration

func (*XplaClient) GetEvmRpc

func (xplac *XplaClient) GetEvmRpc() string

Get RPC URL for evm module

func (*XplaClient) GetFeeAmount

func (xplac *XplaClient) GetFeeAmount() string

Get fee amount

func (*XplaClient) GetFeeGranter

func (xplac *XplaClient) GetFeeGranter() sdk.AccAddress

Get fee granter

func (*XplaClient) GetGasAdjustment

func (xplac *XplaClient) GetGasAdjustment() string

Get Gas adjustment

func (*XplaClient) GetGasLimit

func (xplac *XplaClient) GetGasLimit() string

Get gas limit

func (*XplaClient) GetGasPrice

func (xplac *XplaClient) GetGasPrice() string

Get Gas price

func (*XplaClient) GetGrpcClient

func (xplac *XplaClient) GetGrpcClient() grpc1.ClientConn

Get GRPC client connector

func (*XplaClient) GetGrpcUrl

func (xplac *XplaClient) GetGrpcUrl() string

Get GRPC URL to query or broadcast tx

func (*XplaClient) GetLcdURL

func (xplac *XplaClient) GetLcdURL() string

Get LCD URL

func (*XplaClient) GetModule

func (xplac *XplaClient) GetModule() string

Get module name

func (*XplaClient) GetMsg

func (xplac *XplaClient) GetMsg() interface{}

Get message

func (*XplaClient) GetMsgType

func (xplac *XplaClient) GetMsgType() string

Get message type of modules

func (*XplaClient) GetOutputDocument

func (xplac *XplaClient) GetOutputDocument() string

Get output document name

func (*XplaClient) GetPagination

func (xplac *XplaClient) GetPagination() *query.PageRequest

Get pagination

func (*XplaClient) GetPrivateKey

func (xplac *XplaClient) GetPrivateKey() key.PrivateKey

Get private key

func (*XplaClient) GetRpc

func (xplac *XplaClient) GetRpc() string

Get RPC URL of tendermint core

func (*XplaClient) GetSequence

func (xplac *XplaClient) GetSequence() string

Get account sequence

func (*XplaClient) GetSignMode

func (xplac *XplaClient) GetSignMode() signing.SignMode

Get transaction sign mode

func (*XplaClient) GetTimeoutHeight

func (xplac *XplaClient) GetTimeoutHeight() string

Get timeout block height

func (*XplaClient) GetTransactionByHash

func (xplac *XplaClient) GetTransactionByHash(getTransactionByHashMsg types.GetTransactionByHashMsg) *XplaClient

Query a transaction which is ethereum type information by retrieving hash.

func (*XplaClient) GetVP

func (xplac *XplaClient) GetVP(getVPMsg types.GetVPMsg) *XplaClient

Get the verifiable presentation which is able to use on the private chain for access control. Participants can acess the private chain when this presentation submit to chain as verifier. Only the VP owner can query by using DID signature

func (*XplaClient) GetVPByte

func (xplac *XplaClient) GetVPByte() []byte

Get verifiable presentation

func (*XplaClient) GovDeposit

func (xplac *XplaClient) GovDeposit(govDepositMsg types.GovDepositMsg) *XplaClient

Deposit tokens for an active proposal.

func (*XplaClient) GovParams

func (xplac *XplaClient) GovParams(govParamsMsg ...types.GovParamsMsg) *XplaClient

Query parameters of the governance process or the parameters (voting|tallying|deposit) of the governance process.

func (*XplaClient) HistoricalInfo

func (xplac *XplaClient) HistoricalInfo(historicalInfoMsg types.HistoricalInfoMsg) *XplaClient

Query historical info at given height.

func (*XplaClient) Inflation

func (xplac *XplaClient) Inflation() *XplaClient

Query the current minting inflation value.

func (*XplaClient) InitialAdmin

func (xplac *XplaClient) InitialAdmin(initialAdminMsg types.InitialAdminMsg) *XplaClient

Set the initial administrator of the private chain

func (*XplaClient) InstantiateContract

func (xplac *XplaClient) InstantiateContract(instantiageMsg types.InstantiateMsg) *XplaClient

Instantiate a wasm contract.

func (*XplaClient) InvariantBroken

func (xplac *XplaClient) InvariantBroken(invariantBrokenMsg types.InvariantBrokenMsg) *XplaClient

Submit proof that an invariant broken to halt the chain.

func (*XplaClient) InvokeSolidityContract

func (xplac *XplaClient) InvokeSolidityContract(invokeSolContractMsg types.InvokeSolContractMsg) *XplaClient

Invoke (as execute) solidity contract.

func (*XplaClient) IssueVC

func (xplac *XplaClient) IssueVC(issueVCMsg types.IssueVCMsg) *XplaClient

Get the verifiable credential which is able to use on the private chain for access control. Only the VC owner can query by using DID signature

func (*XplaClient) LibwasmvmVersion

func (xplac *XplaClient) LibwasmvmVersion() *XplaClient

Get libwasmvm version.

func (*XplaClient) ListCode

func (xplac *XplaClient) ListCode() *XplaClient

Query list all wasm bytecode on the chain.

func (*XplaClient) ListContractByCode

func (xplac *XplaClient) ListContractByCode(listContractByCodeMsg types.ListContractByCodeMsg) *XplaClient

Query list wasm all bytecode on the chain for given code ID.

func (*XplaClient) LoadAccount

func (xplac *XplaClient) LoadAccount(address sdk.AccAddress) (res authtypes.AccountI, err error)

LoadAccount gets the account info by AccAddress If xpla client has gRPC client, query account information by using gRPC

func (*XplaClient) Migrate

func (xplac *XplaClient) Migrate(migrateMsg types.MigrateMsg) *XplaClient

Migrate a wasm contract to a new code version.

func (*XplaClient) MintParams

func (xplac *XplaClient) MintParams() *XplaClient

Query the current minting parameters.

func (*XplaClient) ModulesVersion

func (xplac *XplaClient) ModulesVersion(queryModulesVersionMsg ...types.QueryModulesVersionMsg) *XplaClient

Query the list of module versions.

func (*XplaClient) MonikerByDID added in v0.0.2

func (xplac *XplaClient) MonikerByDID(monikerByDIDMsg types.MonikerByDIDMsg) *XplaClient

Query moniker by DID.

func (*XplaClient) MultiSign

func (xplac *XplaClient) MultiSign(txMultiSignMsg types.TxMultiSignMsg) ([]byte, error)

Sign created unsigned transaction with multi signatures.

func (*XplaClient) NetListening

func (xplac *XplaClient) NetListening() *XplaClient

actively listening for network connections.

func (*XplaClient) NetPeerCount

func (xplac *XplaClient) NetPeerCount() *XplaClient

Query the number of peers currently connected to the client.

func (*XplaClient) NetVersion

func (xplac *XplaClient) NetVersion() *XplaClient

Query current network ID.

func (*XplaClient) NodeInfo

func (xplac *XplaClient) NodeInfo() *XplaClient

Query node info

func (*XplaClient) ParamChange

func (xplac *XplaClient) ParamChange(paramChangeMsg types.ParamChangeMsg) *XplaClient

Submit a parameter change proposal.

func (*XplaClient) Participate

func (xplac *XplaClient) Participate(participateMsg types.ParticipateMsg) *XplaClient

Request to participate to the private chain.

func (*XplaClient) ParticipateSequence added in v0.0.2

func (xplac *XplaClient) ParticipateSequence(participateSequenceMsg types.ParticipateSequenceMsg) *XplaClient

Query participate sequence of the DID.

func (*XplaClient) ParticipateState

func (xplac *XplaClient) ParticipateState(participateStateMsg types.ParticipateStateMsg) *XplaClient

Query participate state of the DID.

func (*XplaClient) Pinned

func (xplac *XplaClient) Pinned() *XplaClient

Query list all pinned code IDs.

func (*XplaClient) Plan

func (xplac *XplaClient) Plan() *XplaClient

Query upgrade plan(if one exists).

func (*XplaClient) Proposer

func (xplac *XplaClient) Proposer(proposerMsg types.ProposerMsg) *XplaClient

Query the proposer of a governance proposal.

func (*XplaClient) Query

func (xplac *XplaClient) Query() (string, error)

Query transactions and xpla blockchain information. Execute a query of functions for all modules. After module query messages are generated, it receives query messages/information to the xpla client receiver and transmits a query message.

func (*XplaClient) QueryContract

func (xplac *XplaClient) QueryContract(queryMsg types.QueryMsg) *XplaClient

Calls contract with given address with query data and prints the returned result.

func (*XplaClient) QueryDelegation

func (xplac *XplaClient) QueryDelegation(queryDelegationMsg types.QueryDelegationMsg) *XplaClient

Query a delegation based on address and validator address, all out going redelegations from a validator or all delegations made by on delegator.

func (*XplaClient) QueryDeposit

func (xplac *XplaClient) QueryDeposit(queryDepositMsg types.QueryDepositMsg) *XplaClient

Query details of a deposit or deposits on a proposal.

func (*XplaClient) QueryEvidence

func (xplac *XplaClient) QueryEvidence(queryEvidenceMsg ...types.QueryEvidenceMsg) *XplaClient

Query for evidence by hash or for all (paginated) submitted evidence.

func (*XplaClient) QueryFeeGrants

func (xplac *XplaClient) QueryFeeGrants(queryFeeGrantMsg types.QueryFeeGrantMsg) *XplaClient

Query details of fee grants.

func (*XplaClient) QueryProposal

func (xplac *XplaClient) QueryProposal(queryProposal types.QueryProposalMsg) *XplaClient

Query details of a singla proposal.

func (*XplaClient) QueryProposals

func (xplac *XplaClient) QueryProposals(queryProposals types.QueryProposalsMsg) *XplaClient

Query proposals with optional filters.

func (*XplaClient) QueryRedelegation

func (xplac *XplaClient) QueryRedelegation(queryRedelegationMsg types.QueryRedelegationMsg) *XplaClient

Query a redelegation record based on delegator and a source and destination validator. Also, query all outgoing redelegatations from a validator or all redelegations records for one delegator.

func (*XplaClient) QuerySubspace

func (xplac *XplaClient) QuerySubspace(subspaceMsg types.SubspaceMsg) *XplaClient

Query for raw parameters by subspace and key.

func (*XplaClient) QueryUnbondingDelegation

func (xplac *XplaClient) QueryUnbondingDelegation(queryUnbondingDelegationMsg types.QueryUnbondingDelegationMsg) *XplaClient

Query all unbonding delegatations from a validator, an unbonding-delegation record based on delegator and validator address or all unbonding-delegations records for one delegator.

func (*XplaClient) QueryValidators

func (xplac *XplaClient) QueryValidators(queryValidatorMsg ...types.QueryValidatorMsg) *XplaClient

Query a validator or for all validators.

func (*XplaClient) QueryVote

func (xplac *XplaClient) QueryVote(queryVoteMsg types.QueryVoteMsg) *XplaClient

Query details of a single vote or votes on a proposal.

func (*XplaClient) Quit

func (xplac *XplaClient) Quit(quitMsg types.QuitMsg) *XplaClient

Quit from private chain

func (*XplaClient) Redelegate

func (xplac *XplaClient) Redelegate(redelegateMsg types.RedelegateMsg) *XplaClient

Redelegate illiquid tokens from one validator to another.

func (*XplaClient) RegisterAnchorAcc

func (xplac *XplaClient) RegisterAnchorAcc(registerAnchorAccMsg types.RegisterAnchorAccMsg) *XplaClient

Register anchor account of the validator in the private chain

func (*XplaClient) ReplaceDIDMoniker added in v0.0.2

func (xplac *XplaClient) ReplaceDIDMoniker(replaceDIDMonikerMsg types.ReplaceDIDMonikerMsg) *XplaClient

Replace DID moniker

func (*XplaClient) RevokeFeeGrant

func (xplac *XplaClient) RevokeFeeGrant(revokeGrantMsg types.RevokeFeeGrantMsg) *XplaClient

Revoke fee-grant.

func (*XplaClient) SetContractAdmin

func (xplac *XplaClient) SetContractAdmin(setContractAdminMsg types.SetContractAdminMsg) *XplaClient

Set new admin for a contract.

func (*XplaClient) SetWithdrawAddr

func (xplac *XplaClient) SetWithdrawAddr(setWithdrawAddrMsg types.SetwithdrawAddrMsg) *XplaClient

Change the default withdraw address for rewards associated with an address.

func (*XplaClient) SignTx

func (xplac *XplaClient) SignTx(signTxMsg types.SignTxMsg) ([]byte, error)

Sign created unsigned transaction.

func (*XplaClient) SigningInfos

func (xplac *XplaClient) SigningInfos(signingInfoMsg ...types.SigningInfoMsg) *XplaClient

Query a validator's signing information or signing information of all validators.

func (*XplaClient) Simulate

func (xplac *XplaClient) Simulate(txbuilder cmclient.TxBuilder) (*sdktx.SimulateResponse, error)

Simulate tx and get response If xpla client has gRPC client, query simulation by using gRPC

func (*XplaClient) SlashingParams

func (xplac *XplaClient) SlashingParams() *XplaClient

Query the current slashing parameters.

func (*XplaClient) SoftwareUpgrade

func (xplac *XplaClient) SoftwareUpgrade(softwareUpgradeMsg types.SoftwareUpgradeMsg) *XplaClient

Submit a software upgrade proposal.

func (*XplaClient) StakingParams

func (xplac *XplaClient) StakingParams() *XplaClient

Query the current staking parameters information.

func (*XplaClient) StakingPool

func (xplac *XplaClient) StakingPool() *XplaClient

Query the current staking pool values.

func (*XplaClient) StoreCode

func (xplac *XplaClient) StoreCode(storeMsg types.StoreMsg) *XplaClient

Upload a wasm binary.

func (*XplaClient) SubmitProposal

func (xplac *XplaClient) SubmitProposal(submitProposalMsg types.SubmitProposalMsg) *XplaClient

Submit a proposal along with an initial deposit.

func (*XplaClient) SuggestGasPrice

func (xplac *XplaClient) SuggestGasPrice() *XplaClient

Query suggested gas price.

func (*XplaClient) Syncing

func (xplac *XplaClient) Syncing() *XplaClient

Query syncing

func (*XplaClient) Tally

func (xplac *XplaClient) Tally(tallyMsg types.TallyMsg) *XplaClient

Query the tally of a proposal vote.

func (*XplaClient) Total

func (xplac *XplaClient) Total(totalMsg ...types.TotalMsg) *XplaClient

Query the total supply of coins of the chain.

func (*XplaClient) Tx

func (xplac *XplaClient) Tx(queryTxMsg types.QueryTxMsg) *XplaClient

Query for a transaction by hash <addr>/<seq> combination or comma-separated signatures in a committed block.

func (*XplaClient) TxsByEvents

func (xplac *XplaClient) TxsByEvents(txsByEventsMsg types.QueryTxsByEventsMsg) *XplaClient

Query for paginated transactions that match a set of events.

func (*XplaClient) Unbond

func (xplac *XplaClient) Unbond(unbondMsg types.UnbondMsg) *XplaClient

Unbond shares from a validator.

func (*XplaClient) Unjail

func (xplac *XplaClient) Unjail() *XplaClient

Unjail validator previously jailed for downtime.

func (*XplaClient) UpdateDID

func (xplac *XplaClient) UpdateDID(updateDIDMsg types.UpdateDIDMsg) *XplaClient

Update existed DID.

func (*XplaClient) UpgradeApplied

func (xplac *XplaClient) UpgradeApplied(appliedMsg types.AppliedMsg) *XplaClient

Block header for height at which a completed upgrade was applied.

func (*XplaClient) ValidateSignatures

func (xplac *XplaClient) ValidateSignatures(validateSignaturesMsg types.ValidateSignaturesMsg) (string, error)

Validate signature

func (*XplaClient) ValidatorOutstandingRewards

func (xplac *XplaClient) ValidatorOutstandingRewards(validatorOutstandingRewardsMsg types.ValidatorOutstandingRewardsMsg) *XplaClient

Query distribution outstanding (un-withdrawn) rewards for a validator and all their delegations.

func (*XplaClient) ValidatorSet

func (xplac *XplaClient) ValidatorSet(validatorSetMsg ...types.ValidatorSetMsg) *XplaClient

Query validator set

func (*XplaClient) Vote

func (xplac *XplaClient) Vote(voteMsg types.VoteMsg) *XplaClient

Vote for an active proposal, options: yes/no/no_with_veto/abstain.

func (*XplaClient) Web3ClientVersion

func (xplac *XplaClient) Web3ClientVersion() *XplaClient

Query web3 client version.

func (*XplaClient) Web3Sha3

func (xplac *XplaClient) Web3Sha3(web3Sha3Msg types.Web3Sha3Msg) *XplaClient

Query web3 sha3.

func (*XplaClient) WeightedVote

func (xplac *XplaClient) WeightedVote(weightedVoteMsg types.WeightedVoteMsg) *XplaClient

Vote for an active proposal, options: yes/no/no_with_veto/abstain.

func (*XplaClient) WithAccountNumber

func (xplac *XplaClient) WithAccountNumber(accountNumber string) *XplaClient

Set account number

func (*XplaClient) WithBroadcastMode

func (xplac *XplaClient) WithBroadcastMode(broadcastMode string) *XplaClient

Set broadcast mode

func (*XplaClient) WithChainId

func (xplac *XplaClient) WithChainId(chainId string) *XplaClient

Set chain ID

func (*XplaClient) WithContext

func (xplac *XplaClient) WithContext(ctx context.Context) *XplaClient

Set xpla client context

func (*XplaClient) WithEncoding

func (xplac *XplaClient) WithEncoding(encodingConfig params.EncodingConfig) *XplaClient

Set encoding configuration

func (*XplaClient) WithEvmRpc

func (xplac *XplaClient) WithEvmRpc(evmRpcUrl string) *XplaClient

Set RPC URL for evm module

func (*XplaClient) WithFeeAmount

func (xplac *XplaClient) WithFeeAmount(feeAmount string) *XplaClient

Set fee amount

func (*XplaClient) WithFeeGranter

func (xplac *XplaClient) WithFeeGranter(feeGranter sdk.AccAddress) *XplaClient

Set fee granter

func (*XplaClient) WithGasAdjustment

func (xplac *XplaClient) WithGasAdjustment(gasAdjustment string) *XplaClient

Set Gas adjustment

func (*XplaClient) WithGasLimit

func (xplac *XplaClient) WithGasLimit(gasLimit string) *XplaClient

Set gas limit

func (*XplaClient) WithGasPrice

func (xplac *XplaClient) WithGasPrice(gasPrice string) *XplaClient

Set Gas price

func (*XplaClient) WithGrpc

func (xplac *XplaClient) WithGrpc(grpcUrl string) *XplaClient

Set GRPC URL to query or broadcast tx

func (*XplaClient) WithOptions

func (xplac *XplaClient) WithOptions(
	options Options,
) *XplaClient

Set options of xpla client.

func (*XplaClient) WithOutputDocument

func (xplac *XplaClient) WithOutputDocument(outputDocument string) *XplaClient

Set output document name

func (*XplaClient) WithPagination

func (xplac *XplaClient) WithPagination(pagination types.Pagination) *XplaClient

Set pagination

func (*XplaClient) WithPrivateKey

func (xplac *XplaClient) WithPrivateKey(privateKey key.PrivateKey) *XplaClient

Set private key

func (*XplaClient) WithRpc

func (xplac *XplaClient) WithRpc(rpcUrl string) *XplaClient

Set RPC URL of tendermint core

func (*XplaClient) WithSequence

func (xplac *XplaClient) WithSequence(sequence string) *XplaClient

Set account sequence

func (*XplaClient) WithSignMode

func (xplac *XplaClient) WithSignMode(signMode signing.SignMode) *XplaClient

Set transaction sign mode

func (*XplaClient) WithTimeoutHeight

func (xplac *XplaClient) WithTimeoutHeight(timeoutHeight string) *XplaClient

Set timeout block height

func (*XplaClient) WithURL

func (xplac *XplaClient) WithURL(lcdURL string) *XplaClient

Set LCD URL

func (*XplaClient) WithVPByPath

func (xplac *XplaClient) WithVPByPath(vpPath string) *XplaClient

Set Verifiable Presentation by file path

func (*XplaClient) WithVPByString

func (xplac *XplaClient) WithVPByString(vp string) *XplaClient

Set Verifiable Presentation by string

func (*XplaClient) WithdrawAllRewards

func (xplac *XplaClient) WithdrawAllRewards() *XplaClient

Withdraw all delegations rewards for a delegator.

func (*XplaClient) WithdrawRewards

func (xplac *XplaClient) WithdrawRewards(withdrawRewardsMsg types.WithdrawRewardsMsg) *XplaClient

Withdraw rewards from a given delegation address, and optionally withdraw validator commission if the delegation address given is a validator operator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL