Skip to content

Any sample USDT send example for testnet ? #204

@kunalransing

Description

@kunalransing

Hi,
I'm new to omni USDT. I didn't find any sample for sending omni usdt.
I used bitcoinj 0.15 send with output as below

        NetworkParameters parameters = to.getParameters();
	Transaction tran = new Transaction(parameters);
        SendRequest req = SendRequest.forTx(tran);
     	//req.aesKey = kit.wallet().getKeyCrypter().deriveKey(walletKey);
      	req.feePerKb = Coin.valueOf(5000);

        //This is the limited minimum transfer amount of bitcoin, so many usdt transfers will receive a btc of 0.00000546
        tran.addOutput(Coin.valueOf(546L), Address.fromString(params, adddress));

        //Build the output script of usdt. Note that the amount here is multiplied by 8 times 10
        String usdtHex = "6a146f6d6e69" + String.format("%016x", 31) + String.format("%016x", usdtAmount.longValue());  //omni protocol is 31
        tran.addOutput(Coin.valueOf(0L), new Script(Utils.HEX.decode(usdtHex)));

Then used bitcoinj to send tx.

Wallet.SendResult result = kit.wallet().sendCoins(req);

Actually I don't understand how Omni layer validates if the sender has usdt balance or not ?
I want test omni USDT on testnet but don't see any testnet explorer.
@msgilligan Please help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions