Hi, I'm new here and I am struggling with decoding/encoding a TLB scheme:
https://docs.dedust.io/reference/tlb-schemes#asset
this one.
native$0000 = Asset;
jetton$0001 workchain_id:int8 address:uint256 = Asset;
extra_currency$0010 currency_id:int32 = Asset;
I'm trying to encode Asset and use it to query methods from the DeDust smart contracts for testing purposes.
For example: 'get_vault_address' in the factory contract:
https://docs.dedust.io/reference/factory who take a 'slice' of Asset.
I don't really know how to encode this properly. if I understand, for Native coin (TON) I just have to encode 4 bits ("0000") and that'is.
If I want to encode a Jetton, I store 4 bits ("0001") then I store a int8 (0 for the workchain) then a uint256 (so I guess the uint256 representation of the hexadecimal address ?
But everything I try does not work. I am sure I am missing a simple piece of the puzzle but I don't know what right now
Oct 9, 2023, 10:31 AM
If I try to query it through tonapi.io or TonViewer I have exit code : 7 most of the time
Oct 9, 2023, 10:33 AM
What get method are you calling? Also, get methods don't usually require encoding inputs.
Oct 9, 2023, 12:24 PM
'get_vault_address'
but since it requires a "slice" type i thought it would be the encoded Asset type
So do you know the answer ? I already tried to simply put the token address, it give me a cell but if I deserialize it the vault address is incorrect.
Oct 9, 2023, 1:58 PM