Web3MoveEx.Aptos.RPC (web3_move_ex v0.3.7)

Copy From: https://github.com/myastrallabs/stormstout

Api Docs: https://aptos.dev/nodes/aptos-api-spec/#/

Link to this section Summary

Link to this section Functions

Link to this function

build_event_path(map, address, event_handle, field)

Link to this function

build_resource(map, address, resource_type)

Link to this function

check_transaction_by_hash(client, hash, times \\ 3)

Link to this function

connect(endpoint)

Link to this function

connect(atom, network_type)

Link to this function

get_account(client, address)

Link to this function

get_collection_data(client, account, collection_name)

= AptosRPC.connect() {:ok, res} = Aptos.RPC.get_collection_data(

client,
"0xdc4e806913a006d86da8327a079d794435e2e3117fd418062ddf43943d663490",
"DummyDog"

)

Link to this function

get_events(client, event_key)

Link to this function

get_events(client, address, event_handle, field, query \\ [limit: 10])

Link to this function

get_faucet(client, address, amount \\ 100000000)

Link to this function

get_resource(client, address, resource_type)

Link to this function

get_resources(client, address, query \\ [])

Link to this function

get_table_item(client, table_handle, table_key)

Link to this function

get_table_item(client, table_handle, key_type, value_type, key)

https://fullnode.devnet.aptoslabs.com/v1/spec#/operations/get_table_item

Example by curl: curl --request POST --url https://fullnode.testnet.aptoslabs.com/v1/tables/0x55faf86aea81d23c0f8ec9bb5fa6ec8fed920a3482ea75d5bf27474a00d42198/item --header 'Content-Type: application/json' --data '{ "key_type": "0x1::string::String", "value_type": "0xb923303d20c38a120669ad0ed751a105f254b049e75a350111d566009df9ba11::addr_info::AddrInfo", "key": "0x73c7448760517E3E6e416b2c130E3c6dB2026A1d" }' {"addr":"0x73c7448760517E3E6e416b2c130E3c6dB2026A1d","addr_type":"0","chains":["Ethereum"],"created_at":"1668826549","description":"Cool Addr","expired_at":"1700362549","id":"1","msg":"33344091.1.nonce_geek","pubkey":"","signature":"0x","updated_at":"0"}%

Example to call by func: > Web3MoveEx.Aptos.RPC.get_table_item(client, "0x55faf86aea81d23c0f8ec9bb5fa6ec8fed920a3482ea75d5bf27474a00d42198", "0x1::string::String", "0xb923303d20c38a120669ad0ed751a105f254b049e75a350111d566009df9ba11::addr_info::AddrInfo", "0x73c7448760517E3E6e416b2c130E3c6dB2026A1d")

Link to this function

get_token_data(client, creator, collection_name, token_name)

= Aptos.RPC.connect() {:ok, result} = Aptos.RPC.get_token_data(

  client,
  "0xdc4e806913a006d86da8327a079d794435e2e3117fd418062ddf43943d663490",
  "DummyDog",
  "DummyDog 1"
)
Link to this function

get_transaction_by_hash(client, hash)

Link to this function

ledger_information(client)

Link to this function

submit_bcs_transaction(client, signed_transaction_in_bcs)