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.3-py2-none-any.whl (6.2 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: terra_mantle-0.1.3-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.3-py2-none-any.whl
Algorithm Hash digest
SHA256 061adad10bd4d0572a069f65bc96bc2a6e19d6aa61012bfbad53839c4011f92c
MD5 08ab6bc90782aa4cd7719ae364d955ec
BLAKE2b-256 2abcb6ef8ee4e886efa4ad4ac1e24d27c5f98b62253e9b8d7a268622a81db947

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