xssnick / tonutils-go

TON SDK Library in pure Golang for interacting with The Open Network ecosystem using native protocols, such as ADNL, RLDP and etc.
Apache License 2.0
464 stars 95 forks source link

parse Tact map #168

Closed wd-idonan closed 6 months ago

wd-idonan commented 7 months ago

How to parse the map in Tact using Golang when I call get method ts script: async getMap(provider: ContractProvider) { let builder = new TupleBuilder(); let source = (await provider.get('map', builder.build())).stack; let result = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), source.readCellOpt()); return result; }

xssnick commented 7 months ago

Use LoadDict during slice (cell) reading, you can find some examples in tests

wd-idonan commented 6 months ago

thank you