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

How do we get user wallet from this backend ? #176

Open jktan0504 opened 5 months ago

jktan0504 commented 5 months ago
func getWallet(api *ton.APIClient) *wallet.Wallet {
    words := strings.Split("birth pattern then forest walnut then phrase walnut fan pumpkin pattern then cluster blossom verify then forest velvet pond fiction pattern collect then then", " ")
    w, err := wallet.FromSeed(api, words, wallet.V3)
    if err != nil {
        panic(err)
    }
    return w
}

any correct flow for this ? How do I get user wallet without user insert this seed

xssnick commented 5 months ago

Hi, if you want to authorize user with his wallet and request transaction, you need tonconnect

jktan0504 commented 5 months ago

@xssnick thanks =).

I am thinking the correct authentication flow for my backend API which is able to know user wallet without getting user private key or seeds.

are we able to handle this from our backend, lets say my backend api service, so my frontend can just hit my endpoint for /mint-nft

xssnick commented 5 months ago

Maybe you need this: https://docs.ton.org/develop/dapps/ton-connect/developers#ton-connect-go

You can build message using tonutils-go and pass serialized binary boc to tonconnect to execute transaction

jktan0504 commented 5 months ago

@xssnick thanks for your replied.

Would you like to share me more detail about this ? Can I drop you email or something ?