icon-gateway
Installation
npm i @fortmatic/icon-gateway fortmatic icon-sdk-js
Setup
; const fmPhantom = 'YOUR_API_KEY' rpcUrl: 'https://bicon.net.solidwallet.io/api/v3' chainId: 2 chainType: 'ICON';const phantomProvider = fmPhantom; const fmIconService = phantomProvider;
Whitelabel SDK method
Please go to fortmatic doc (https://docs.fortmatic.com/whitelabel-sdk/client-js-sdk) to check Whitelabel SDK method like User Authentication and Get User Metadata
Usage
Build the transaction object using builder class.
/* Build `IcxTransaction` instance for sending ICX. */ const txObj = valueIconAmount versionIconConverter ; /* Build `MessageTransaction` instance for sending data. */ const txObj = versionIconConverter dataIconConverter ; /* Build `DeployTransaction` instance for deploying SCORE. */ const txObj = versionIconConverter content`0x` ; /* Build `CallTransaction` instance for executing SCORE function. */ const txObj = versionIconConverter method'hello'
By passing txObj instance to fmIconService.sendTransaction() method, it will automatically sign the transaction with current user and generate transaction object including signature, and send to ICON node.
const txhash = await fmIconService; console; window