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

如何设置excess地址 #204

Closed arvin-lau closed 1 month ago

arvin-lau commented 2 months ago

` token := jetton.NewJettonMasterClient(api, address.MustParseAddr(contractAddrStr))

    // find our jetton wallet
    tokenWallet, err := token.GetJettonWallet(context.Background(), wallet.WalletAddress())
    if err != nil {
        return nil, err
    }
    comment, err := pkgTonWallet.CreateCommentCell(memo)
    if err != nil {
        return nil, err
    }
    transferPayload, err := tokenWallet.BuildTransferPayloadV2(address.MustParseAddr(toStr), address.MustParseAddr(responseToStr), tlb.MustFromNano(value, tokenDecimal), tlb.MustFromTON("0.000000001"), comment, nil)
    if err != nil {
        return nil, err
    }
    unsignedTx = pkgTonWallet.SimpleMessage(tokenWallet.Address(), tlb.MustFromTON("0.05"), transferPayload)

`

构建交易,发现excess地址永远是jetton收款地址(to),如何将excess设置成发送方地址(from)?

arvin-lau commented 2 months ago
  1. response address一旦设置成了付款地址(from),那么notify也会跟着变成from地址,而excess地址依旧是收款地址(https://tonviewer.com/transaction/5a820fa0634b5e09fb39fb1dd93b983c7046f8d1b06f06f1f8081d213d850275)
  2. response address地址设置成收款地址(to),那么notify和excess都会是收款地址 (https://tonviewer.com/transaction/6a9d454846865d3c4862096f10cf05f3935a01eec6df294d5d070bd28442707a)
  3. 总结: 更改不了excess地址,他只能是收款地址,这是代码本身的设定还是我使用时出了问题?
xssnick commented 2 months ago

Hi, this is how jetton wallet contract works, there are only 2 addresses can be passed to contract, exess goes to response address

arvin-lau commented 1 month ago

Thanks for you reply. I've found the cause of the problem, it's a problem with my usage, tonutils-go is fine.