Giter Club home page Giter Club logo

Comments (4)

Athiriyya avatar Athiriyya commented on June 2, 2024 1

So, to get Jewel inventory on DFK Chain, you'll want to do:

rpc_server = 'https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc'
w3 = Web3(Web3.HTTPProvider(rpc_server))
amount_wei = w3.eth.get_balance(account_address)
amount = w3.fromWei(amount_wei, 'ether')

This is because Jewel is the 'Ethereum' of the DFK Chain. There is also wJEWEL, which IS an ERC20 token. That's what gets awarded in gardening quests, for example. By some magic I don't totally understand, that wrapped Jewel gets turned into normal Jewel.

from dfktools.

timtan-github avatar timtan-github commented on June 2, 2024

Found that it's likely the contract address for CV Jewel isn't "0x4f60a160D8C2DDdaAfe16FCC57566dB84D674BD6" as per "get_realm_item_list". Looking at dfk-chain explorer, CV jewel is supposedly "Wrapped JEWEL - 0xCCb93dABD71c8Dad03Fc4CE5559dC3D89F67a260" but if you call balanceOf function with Wrapped JEWEL address on a wallet, it seems to return 0. Very strange...

from dfktools.

timtan-github avatar timtan-github commented on June 2, 2024

Ahh noted on the gas token part. I'm still very new to web3 dev work. Thanks for clarifying.

Nah, I'm using DFK Chain RPC. I swapped it out in my scripts. I've also had to change the UniswapV2Factory.py contract to reflect the DFK Chain's address to get my scripts to run. Otherwise it would be throwing errors. Basically, the current UniswapV2Factory.py script is pointing to the C-Chain address.

from dfktools.

timtan-github avatar timtan-github commented on June 2, 2024

Hey Athiriyya, yup that works! I'm still figuring out how to work with gas tokens properly for swaps. Thanks!

from dfktools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.