Execute SendCoin/Contract

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

circle-exclamation

Steps

// Sample Usage
let wallet: FncyWallet = let wallet: FncyWallet = try await fncyWallet.getWallet()
// 1. Gas Price Search
let gas: GasPriceInfo = try await self.fncyWallet.getGasPrice(chainId: 3)
// 2. Ticket Search
let estimateResult:
 FncyTicket = try await fncyWallet.estimateTicket(wid: wallet.wid,
                                                  chainId: 3,
                                                  signatureType: .assetTransfer,
                                                  toAddress: wallet.walletAddress,
                                                  assetId: 6)
// 3. Ticket 생성
let ticketUUID = try await fncyWallet.makeTicket(wid: wallet.wid,
                                                 chainId: 3,
                                                 signatureType: .assetTransfer,
                                                 toAddress: wallet.walletAddress,
                                                 transferVal: "100000",
                                                 txGasPrice: gasPriceInfo.middleGasPrice.description,
                                                 assetId: 6)
                                                   
print("ticketUUID : ", ticketUUID)

// 4. Ticket Trasnfer
let txId = try await fncyWallet.sendTicket(ticketUuid: ticketUUID, 
                                           pinNumber: "111111")
// 5. Transaction Result check
print("txID : ", txId)
//txID : 0xc19f68e548c2ed933291aa4cbc9748b4d2b0de4bf1a5516f0b74579fb8e13b54

Search Gas Fee

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

See Also

getGasPrice

GasPriceInfo

Search Ticket Information

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

Depending on the type of asset you're sending, or whether you're sending via WalletConnect, you'll need to select the correct ticket type.

  • AssetTransfer : CoinTransfer

  • SmartContract : TokenTransfer & Contract Execution

  • WalletConnect : Used when connecting to WalletConnect

See Also

estimateTicket

FncyTicket

TicketType

Transfer Coin

Transfer Token(Contract Execution)

WalletConnect

Create Ticket

Registers a ticket (transaction information) with the server to send to the network, and recieves the ticket's TicketUUID (TicketUUID).

circle-info

If the ticket creation fails, the TicketUUID does not returned.

See Also

makeTicket

TicketType

Transfer Coin

Transfer Token(Contract Execution)

WalletConnect

Check Ticket Information

You can use the issued ticket UUID to search information about that ticket.

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

See Also

getTicketInfo

FncyTicket

Transfer Ticket

circle-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.

Passes the issued ticket UUID and wallet password to execute a transaction corresponding to the ticket.

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

Check Transaction Result

Search the returned txId in FncyScanarrow-up-right