FNCY Chain
FNCY 2.0.2 (ENG)
FNCY 2.0.2 (ENG)
  • Introduction
  • Getting Started
  • Design
    • Structure
    • Three Main Sets of Participants
    • PoSA Consensus
    • Governance
    • Staking
    • Mining Reward
    • Gas Fee
    • Runtime Upgrade
    • Cross-Chain Bridge
    • Security
  • Build On FNCY Chain
    • RPC Endpoints
    • Testnet Faucet
    • Block Explorer
      • Token Listing
    • BEP20 Token
    • NFT
    • Validator Requirements
    • NFT Market
      • FNCY Marketplace
  • For Developers
    • JSON-RPC
    • FNCY Chain API
      • Wallet API
      • Transaction API
      • Blockchain API
    • Wallet
      • FNCY Wallet
      • Use MetaMask for FNCY Chain
      • SDK
        • Android
          • Install
          • Guide
            • Initialize
            • Create/Restore Wallet
            • Wallet Search
            • Execute SendCoin/Contract
            • Transaction Search
            • Other Features
          • Methods
          • Domain
          • ETC
        • iOS
          • Install
          • Guide
            • Initialize
            • Create/Restore Wallet
            • Wallet Search
            • Execute SendCoin/Contract
            • Transaction Search
            • Other Features
          • Methods
          • Domain
          • ETC
    • Smart Contract
      • Deployment
        • Truffle
        • Hardhat
        • Remix IDE
      • Verify Your Contract on FncyScan
    • Gasless Transaction
    • with FNCY
      • FNCY Login
      • GAME AUTH Login
  • Tokenomics
  • Ecosystem Partner
  • FNCY Governance Partner
Powered by GitBook
On this page
  • Steps
  • Search Gas Fee
  • Search Ticket Information
  • Transfer Coin
  • Transfer Token(Contract Execution)
  • WalletConnect
  • Create Ticket
  • Transfer Coin
  • Transfer Token(Contract Execution)
  • WalletConnect
  • Check Ticket Information
  • Transfer Ticket
  • Check Transaction Result
  1. For Developers
  2. Wallet
  3. SDK
  4. iOS
  5. Guide

Execute SendCoin/Contract

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

PreviousWallet SearchNextTransaction Search

Send coins and executing smart contracts is possible from wallet security level 2.

To learn about wallet security, read .

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.

let gas: GasPriceInfo = try await fncyWallet.getGasPrice(chainId: 3)

See Also

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

Transfer Coin

let ticketData: FncyTicket = try await fncyWallet.estimateTicket(
wid: 10000, //Wallet ID
chainId: 3, // bsc: 1, eth: 2, fncy: 3
signatureType: TicketType.assetTransfer, 
toAddress: "0x1234...", //Address to Receive Coins
transferVal: "1000000000000000000", //Quantity to Send (in wei)
txGasPrice: "10000000000", //Gas Price (in wei)
assetId: 6, //Transfer Asset's Asset ID
maxPriorityPerGas: nil, //For ETH Transfers
maxFeePerGas: nil //For ETH Transfers
)

Transfer Token(Contract Execution)

let ticketData: FncyTicket = try await fncyWallet.estimateTicket(
wid: 10000, //Wallet ID
chainId: 3, // bsc: 1, eth: 2, fncy: 3
signatureType: TicketType.smartContract, //
toAddress: "0x1234...", //Address to Receive Coins
transferVal: "0", //Quantity to Send (in wei)
txGasPrice: "10000000000", //Gas Price (in wei)
contractAddress: "0x1234...", //Contract Address
txInput: "0x123456....", //Data
assetId: 6, //Transfer Asset's Asset ID
maxPriorityPerGas: nil, //For ETH Transfers
maxFeePerGas: nil //For ETH Transfers
)

WalletConnect

let ticketData: FncyTicket = try await fncyWallet.estimateTicket(
wid: 10000, //Wallet ID
chainId: 3, // bsc: 1, eth: 2, fncy: 3
signatureType: TicketType.walletConnect, //
toAddress: "0x1234...", //Address to Receive Coins
transferVal: "1000000000000000000", //Quantity to Send (in wei)
txGasPrice: "10000000000", //Gas Price (in wei)
contractAddress: "0x1234...", //Contract Address
txInput: "0x123456....", //Data
assetId: 6, //Transfer Asset's Asset ID
maxPriorityPerGas: nil, //For ETH Transfers
maxFeePerGas: nil //For ETH Transfers
)

Create Ticket

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

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

See Also

Transfer Coin

let ticketUUID: String = try await fncyWallet.makeTicket(
wid: 10000, //Wallet ID
chainId: 3, // bsc: 1, eth: 2, fncy: 3
signatureType: TicketType.assetTransfer, 
toAddress: "0x1234...", //Address to Receive Coins
transferVal: "1000000000000000000", //Quantity to Send (in wei)
txGasPrice: "10000000000", //Gas Price (in wei)
assetId: 6, //Transfer Asset's Asset ID
maxPriorityPerGas: nil, //For ETH Transfers
maxFeePerGas: nil, //For ETH Transfers
txGasLimit: 21000 // Gas Limit
)

Transfer Token(Contract Execution)

let ticketUUID: String = try await fncyWallet.makeTicket(
wid: 10000, //Wallet ID
chainId: 3, // bsc: 1, eth: 2, fncy: 3
signatureType: TicketType.smartContract, //
toAddress: "0x1234...", //Address to Receive Coins
transferVal: "0", //Quantity to Send (in wei)
txGasPrice: "10000000000", //Gas Price (in wei)
contractAddress: "0x1234...", //Contract Address
txInput: "0x123456....", //Data
assetId: 6, //Transfer Asset's Asset ID
maxPriorityPerGas: nil, //For ETH Transfers
maxFeePerGas: nil, //For ETH Transfers
txGasLimit: 21000 // Gas Limit
)

WalletConnect

let ticketUUID: String = try await fncyWallet.makeTicket(
wid: 10000, //Wallet ID
chainId: 3, // bsc: 1, eth: 2, fncy: 3
signatureType: TicketType.walletConnect, //
toAddress: "0x1234...", //Address to Receive Coins
transferVal: "1000000000000000000", //Quantity to Send (in wei)
txGasPrice: "10000000000", //Gas Price (in wei)
contractAddress: "0x1234...", //Contract Address
txInput: "0x123456....", //Data
assetId: 6, //Transfer Asset's Asset ID
maxPriorityPerGas: nil, //For ETH Transfers
maxFeePerGas: nil, //For ETH Transfers
txGasLimit: 21000 // Gas Limit
)

Check Ticket Information

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

let ticket: FncyTicket = try await fncyWallet.getTicketInfo(ticketUuid: "ticketUUID")

See Also

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 a transaction corresponding to the ticket.

let txId: String = try await fncyWallet.sendTicket(
ticketUuid: "ticketUuid", // Ticket UUID
pinNumber: "000000" // Wallet Password
)

Check Transaction Result

let txId = try await fncyWallet.sendTicket(ticketUuid: "ticketUuid"
                                           pinNumber: "000000")                                                                 
print(txId)
// 0xc19f68e548c2ed933291aa4cbc9748b4d2b0de4bf1a5516f0b74579fb8e13b54
// FncyScan(Testnet): https://fncyscan-testnet.fncy.world/tx/0xc19f68e548c2ed933291aa4cbc9748b4d2b0de4bf1a5516f0b74579fb8e13b54

To learn how to request a ticket UUID, read

To learn how to request a ticket UUID, read

Search the returned txId in

FncyScan
Wallet Security Level
Search Gas Fee
Search Ticket information
Create Ticket
Transfer Ticket
Check Transaction Result
Create a ticket.
Create a ticket.
TicketType
TicketType
getGasPrice
estimateTicket
makeTicket
getTicketInfo
GasPriceInfo
FncyTicket
FncyTicket