package
0.1.3
Repository: https://github.com/xpladev/xpla.go.git
Documentation: pkg.go.dev

# README

Wasm module

Usage

(Tx) Store code

// can instantiate only store msg sender
storeMsg := types.StoreMsg {
    FilePath: "./wasmcontract.wasm",
    InstantiatePermission: "instantiate-only-sender" //optional. if method is empty string, everybody
}

// can instantiate address
// method and address must be seperated by "."
storeMsg := types.StoreMsg {
    FilePath: "./wasmcontract.wasm",
    InstantiatePermission: "instantiate-only-address.xpla19w2r47nczglwlpfynqe5769cwkwq5fvmzu5pu7" 
}

txbytes, err := xplac.StoreCode(storeMsg).CreateAndSignTx()
res, _ := xplac.Broadcast(txbytes)

(Tx) Instantiate contract

instantiateMsg := types.InstantiateMsg {
    CodeId: "1",
    Amount: "10",
    Label: "Contract instant",
    InitMsg: `{"owner":"xpla19w2r47nczglwlpfynqe5769cwkwq5fvmzu5pu7"}`,
}
txbytes, err := xplac.InstantiateContract(instantiateMsg).CreateAndSignTx()
res, _ := xplac.Broadcast(txbytes)

(Tx) Execute contract

executeMsg := types.ExecuteMsg {
    ContractAddress: "xpla14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s525s0h",
    Amount: "0",
    ExecMsg: `{"execute_method":{"execute_key":"execute_test","execute_value":"xpla19w2r47nczglwlpfynqe5769cwkwq5fvmzu5pu7"}}`,
}
txbytes, err := xplac.ExecuteContract(executeMsg).CreateAndSignTx()
res, _ := xplac.Broadcast(txbytes)

(Tx) Clear contract admin

clearContractAdminMsg := types.ClearContractAdminMsg{
    ContractAddress: "xpla14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s525s0h",
}
txbytes, err := xplac.ClearContractAdmin(clearContractAdminMsg).CreateAndSignTx()
res, _ := xplac.Broadcast(txbytes)

(Tx) Set contract admin

setContractAdminMsg := types.SetContractAdminMsg{
    ContractAddress: "xpla14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s525s0h",
    NewAdmin: "xpla19w2r47nczglwlpfynqe5769cwkwq5fvmzu5pu7",
}

txbytes, err := xplac.SetContractAdmin(setContractAdminMsg).CreateAndSignTx()
res, _ := xplac.Broadcast(txbytes)

(Tx) Migrate

migrateMsg := types.MigrateMsg{
    ContractAddress: "xpla14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s525s0h",
    CodeId: "123",
    MigrateMsg: "json encoded migrate msg",
}

txbytes, err := xplac.Migrate(migrateMsg).CreateAndSignTx()

(Query) contract

queryMsg := types.QueryMsg {
    ContractAddress: "xpla14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s525s0h",
    QueryMsg: `{"query_method":{"query":"query_test"}}`,
}

response, _ := xplac.QueryContract(queryMsg).Query()

(Query) list code

response, _ := xplac.ListCode().Query()

(Query) list contract by code

listContractByCodeMsg := types.ListContractByCodeMsg {
    CodeId: "1",
}

response, err := xplac.ListContractByCode(listContractByCodeMsg).Query()

(Query) Download contract wasm file

downloadMsg := types.DownloadMsg{
    CodeId: "1",
    DownloadFileName: "test",
}

response, err := xplac.Download(downloadMsg).Query()

(Query) code info

codeInfoMsg := types.CodeInfoMsg{
    CodeId: "1",
}

response, err := xplac.CodeInfo(codeInfoMsg).Query()

(Query) Contract info

contractInfoMsg := types.ContractInfoMsg {
    ContractAddress: "xpla14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s525s0h",
}

response, err := xplac.ContractInfo(contractInfoMsg).Query()

(Query) all contract state

contractStateAllMsg := types.ContractStateAllMsg{
    ContractAddress: "xpla14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s525s0h",
}

response, err := xplac.ContractStateAll(contractStateAllMsg).Query()

(Query) contract history

contractHistoryMsg := types.ContractHistoryMsg {
    ContractAddress: "xpla14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s525s0h",
}

response, err := xplac.ContractHistory(contractHistoryMsg).Query()

(Query) pinned

response, err := xplac.Pinned().Query()

(Query) Lib wasmvm version

response, err := xplac.LibwasmvmVersion().Query()

# Functions

No description provided by the author
(Tx) make msg - clear contract admin.
(Query) make msg - code info.
(Query) make msg - history.
(Query) make msg - contract info.
(Query) make msg - contract state all.
(Query) make msg - download.
(Tx) make msg - execute.
(Tx) make msg - instantiate.
(Query) make msg - libwasmvm version.
(Query) make msg - list code.
(Query) make msg - list contract by code.
(Tx) make msg - migrate.
(Query) make msg - pinned.
(Query) make msg - query contract.
(Tx) make msg - set contract admin.
(Tx) make msg - store code.
Make new query decoder.
No description provided by the author
No description provided by the author
Query client for wasm module.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author