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

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

Uploaded Python 2

Supported by

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