Execute SendCoin/Contract

This document describes how to 'Send Coins' and 'Execute Smart Contract'.

Steps

  1. Check Transaction Result

Search Gas Fee

Retreives the current network fee (gas fee) information for the network (blockchain) corresponding to the ChainID.

val gas = fncyWallet.(
    chainId = 3
)

See Also

getGasPrice

FncyGasPrice

Search Ticket Information

Before creating a ticket, it checks for transferability, nonce, gasLimit, etc.

There are three types of ticket transfers.

  • AssetTransfer : CoinTransfer

  • SmartContract : TokenTransfer & Contract Execution

  • WalletConnect : Used when connecting to WalletConnect

See Also

estimateTicket

FncyTicket

TicketType

Transfer Coin

val info = fncyWallet.estimateTicket(
    walletId = 10000L, //Wallet ID
    chainId = 3L, // bsc: 1, eth: 2, fncy: 3
    signatureType = TicketType.AssetTransfer, 
    toAddress = "0x1234...", //Address to Receive Coins
    transferVal = "1000000000000000000".toBigInteger(), //Quantity to Send (in wei)
    txGasPrice = "10000000000".toBigInteger(), //Gas Price (in wei)
    assetId = 6L, //Transfer Asset's Asset ID
    maxPriorityPerGas = BigInteger.ZERO, //For ETH Transfers
    maxFeePerGas = BigInteger.ZERO //For ETH Transfers
)

Transfer Token(Contract Execution)

val info = fncyWallet.estimateTicket(
    walletId = 10000L, //Wallet ID
    chainId = 3L, // bsc: 1, eth: 2, fncy: 3
    signatureType = TicketType.SmartContract, //
    toAddress = "0x1234...", //Address to Receive Coins
    transferVal = "0".toBigInteger(), //Quantity to Send (in wei)
    txGasPrice = "10000000000".toBigInteger(), //Gas Price (in wei)
    contractAddress = "0x1234...", //Contract Address
    txInput = "0x123456....", //Data
    assetId = 6L, //Transfer Asset's Asset ID
    maxPriorityPerGas = BigInteger.ZERO, //For ETH Transfers
    maxFeePerGas = BigInteger.ZERO //For ETH Transfers
)

WalletConnect

val info = fncyWallet.estimateTicket(
    walletId = 10000L, //Wallet ID
    chainId = 3L, // bsc: 1, eth: 2, fncy: 3
    signatureType = TicketType.WalletConnect, //
    toAddress = "0x1234...", //Address to Receive Coins
    transferVal = "1000000000000000000".toBigInteger(), //Quantity to Send (in wei)
    txGasPrice: "10000000000".toBigInteger(), //Gas Price (in wei)
    contractAddress: "0x1234...", //Contract Address
    txInput: "0x123456....", //Data
    assetId: 6L, //Transfer Asset's Asset ID
    maxPriorityPerGas = BigInteger.ZERO, //For ETH Transfers
    maxFeePerGas = BigInteger.ZERO //For ETH Transfers
)

Create Ticket

Registers ticket (transaction information) in the server to send to the network, and reterieves the UUID information for that ticket.

See Also

makeTicket

FncyTicketResult

Transfer Coin

val info = fncyWallet.makeTicket(
    walletId = 10000L, //Wallet ID
    chainId = 3L, // bsc: 1, eth: 2, fncy: 3
    signatureType = TicketType.AssetTransfer, 
    toAddress = "0x1234...", //Address to Receive Coinss
    transferVal = "1000000000000000000".toBigInteger(), //Quantity to Send (in wei)
    txGasPrice = "10000000000".toBigInteger(), //Gas Price (in wei)
    assetId = 6L, //Transfer Asset's Asset ID
    maxPriorityPerGas = BigInteger.ZERO, //For ETH Transfers
    maxFeePerGas = BigInteger.ZERO, //For ETH Transfers
    txGasLimit = "21000".toBigInteger() // Gas Limit
)

Transfer Token(Contract Execution)

val info = fncyWallet.makeTicket(
    walletId = 10000L, //Wallet ID
    chainId = 3L, // bsc: 1, eth: 2, fncy: 3
    signatureType = TicketType.SmartContract, 
    toAddress = "0x1234...", //Address to Receive Coins
    transferVal = "1000000000000000000".toBigInteger(), //Quantity to Send (in wei)
    txGasPrice = "10000000000".toBigInteger(), //Gas Price (in wei)
    contractAddress: "0x1234...", //Contract Address
    txInput: "0x123456....", //Data
    assetId = 6L, //Transfer Asset's Asset ID
    maxPriorityPerGas = BigInteger.ZERO, //For ETH Transfers
    maxFeePerGas = BigInteger.ZERO, //For ETH Transfers
    txGasLimit = "21000".toBigInteger() // Gas Limit
)

WalletConnect

val info = fncyWallet.makeTicket(
    walletId = 10000L, //Wallet ID
    chainId = 3L, // bsc: 1, eth: 2, fncy: 3
    signatureType = TicketType.WalletConnect, 
    toAddress = "0x1234...", //Address to Receive Coins
    transferVal = "1000000000000000000".toBigInteger(), //Quantity to Send (in wei)
    txGasPrice = "10000000000".toBigInteger(), //Gas Price (in wei)
    contractAddress: "0x1234...", //Contract Address
    txInput: "0x123456....", //Data
    assetId = 6L, //Transfer Asset's Asset ID
    maxPriorityPerGas = BigInteger.ZERO, //For ETH Transfers
    maxFeePerGas = BigInteger.ZERO, //For ETH Transfers
    txGasLimit = "21000".toBigInteger() // Gas Limit
)

Check Ticket Information

Use TicketUuid to get the ticket information corresponding to that Uuid.

val info = fncyWallet.getTicketInfo(
    ticketUuid = "ticketUuid", // Ticekt UUID
)

See Also

getTicketInfo

FncyTicket

Transfer Ticket

Ticket transfer requests the actual execution of a transaction using the ticket information registered on the server.

If the ticket transfer is successful, the transaction history is permanently included in the blockchain and cannot be changed or canceled.

Passes the issued ticket UUID and wallet password to execute an actual transaction with that ticket information.

To learn how to request a ticket UUID, read Create a ticket.

val result = fncyWallet.sendTicket(
    ticketUuids = "ticketUuid", // Ticekt UUID
    pinNumber = "000000" // Wallet Password
)

See Also

sendTicket

Last updated