ton-org / ton

Most popular TON Typescript Library
MIT License
89 stars 25 forks source link

how can i get my wallet address memo or tag #39

Open segun-flexible opened 1 month ago

segun-flexible commented 1 month ago

const { TonClient, WalletContractV4, internal } = require("@ton/ton"); const { mnemonicNew, mnemonicToPrivateKey } = require("@ton/crypto");

    // Create Client
    const client = new TonClient({
        endpoint: 'https://toncenter.com/api/v2/jsonRPC',
        /* apiKey: "jsjs" */
    });

    const mnemonics = [
        'camera', 'hunt', 'hunt',
        'race', 'private', 'category',
        'virtual', 'escape', 'awkward',
        'update', 'mammal', 'length',
        'safe', 'pool', 'laptop',
        'red', 'crowd', 'steak',
        'gorilla', 'daughter', 'just',
        'autumn', 'disease', 'perfect'
    ];

    // Generate new key
    //let mnemonics = await mnemonicNew();

    let keyPair = await mnemonicToPrivateKey(mnemonics);

    // Create wallet contract
    let workchain = 0; // Usually you need a workchain 0
    let wallet = WalletContractV4.create({ workchain, publicKey: keyPair.publicKey });
    let contract = client.open(wallet);
Inffix commented 1 month ago

You can get your wallet contract address using contract.address.toString() Memo is a comment on transactions coming to the wallet, the wallet does not have such a parameter. It is necessary to identify the recipient of the transfer to exchanges, for example

segun-flexible commented 1 month ago

You can get your wallet contract address using contract.address.toString() Memo is a comment on transactions coming to the wallet, the wallet does not have such a parameter. It is necessary to identify the recipient of the transfer to exchanges, for example

I try to send Ton from my wallet I created to another wallet on Bybit, they required me to send input Memo while sending, but since there is no place to input memo In my code, I just send it like that without putting the memo, till today I didn't see the Ton inside my Bybit account