Skip to main content

Terra mantle client

Project description

Mantle client

Wasm query only

wasm_query = {
    'marketState': {
        'contractAddress': 'terra15dwd5mj8v59wpj0wvt233mf5efdff808c5tkal',  # moneyMarket.market
        'query': {
            'state': {}
        }
    },
    'govState': {
        'contractAddress': 'terra16ckeuu7c6ggu52a8se005mg5c0kd2kmuun63cu',  # gov
        'query': {
            'state': {}
        }
    }
}

mantle_result = mantle(wasm_query=wasm_query)

print(mantle_result)

Endpoint options

# default mantle_endpoint is 'https://tequila-mantle.anchorprotocol.com'
mantle_result = mantle(wasm_query=wasm_query, mantle_endpoint='https://mantle.anchorprotocol.com')

print(mantle_result)

With graphql query

from mantle import mantle

query_variables = {
    'wallet_address': 'terra12hnhh5vtyg5juqnzm43970nh4fw42pt27nw9g9'
}

query = """
  query queryName ($wallet_address: String!) {
    LastSyncedHeight

    nativeTokenBalances: BankBalancesAddress(Address: $wallet_address) {
      Result {
        Denom
        Amount
      }
    }
  }
"""

wasm_query = {
    'marketState': {
        'contractAddress': 'terra15dwd5mj8v59wpj0wvt233mf5efdff808c5tkal',  # moneyMarket.market
        'query': {
            'state': {}
        }
    },
    'govState': {
        'contractAddress': 'terra16ckeuu7c6ggu52a8se005mg5c0kd2kmuun63cu',  # gov
        'query': {
            'state': {}
        }
    }
}

mantle_result = mantle(wasm_query=wasm_query, query=query,
                       query_variables=query_variables)

print(mantle_result)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terra_mantle-0.1.4-py2-none-any.whl (6.2 kB view details)

Uploaded Python 2

File details

Details for the file terra_mantle-0.1.4-py2-none-any.whl.

File metadata

  • Download URL: terra_mantle-0.1.4-py2-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for terra_mantle-0.1.4-py2-none-any.whl
Algorithm Hash digest
SHA256 97dfe5aaaa773cd48a8edc59c4a5bfb287bc984b4a12b5fce670cdb9312e0645
MD5 488645b5b98b01f2f94363a6afe8434f
BLAKE2b-256 7bf9ea09221c8a1fabad015106035e3b88189841213fdd183c6e66d112f2c010

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page