# Execute SendCoin/Contract

### Steps

1. [Search Gas Fee](#search-gas-fee)
2. [Search Ticket information](#search-ticket-information)
3. [Create Ticket](#create-ticket)
4. [Transfer Ticket](#transfer-ticket)
5. Check Transaction Result &#x20;

## Search Gas Fee

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

<pre class="language-kotlin"><code class="lang-kotlin">val gas = fncyWallet.<a data-footnote-ref href="#user-content-fn-1">getGasPrice</a>(
    chainId = 3
)
</code></pre>

#### See Also

[getGasPrice](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-getgasprice)

[FncyGasPrice](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/domain#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](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-estimateticket)

[FncyTicket](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/domain#fncyticket)

[TicketType](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/etc#tickettype)

### Transfer Coin

```kotlin
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)

```kotlin
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

```kotlin
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](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-maketicket)

[FncyTicketResult](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/domain#fncyticketresult)

### Transfer Coin

```kotlin
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)

<pre class="language-kotlin"><code class="lang-kotlin">val info = fncyWallet.makeTicket(
<strong>    walletId = 10000L, //Wallet ID
</strong>    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
)
</code></pre>

### WalletConnect

<pre class="language-kotlin"><code class="lang-kotlin"><strong>val info = fncyWallet.makeTicket(
</strong>    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
)
</code></pre>

## Check Ticket Information

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

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

#### See Also

[getTicketInfo](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-getticketinfo)

[FncyTicket](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/domain#fncyticket)

## Transfer Ticket

{% hint style="info" %}
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.
{% endhint %}

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](#create-ticket).

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

#### See Also

[sendTicket](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-sendticket)

[^1]: <https://app.gitbook.com/o/sxbvsaQu6S0zvfR1DBLL/s/XGH1RW6E8fNQHFadoXQF/~/changes/13/for-developers/mobile-app/fncy-wallet-sdk/ios/methods#func-getgasprice>
