Code Monkey home page Code Monkey logo

fantom_clientjs_utils's Introduction

Fantom Client JS Utils

The code implements JS library for simplified work with specific tools and interfaces of the Fantom Opera blockchain client ecosystem. There are several modules available in the library and they cover following client workflows:

  • Communication with the Fantom Ledger Nano S app.

    The library is compatible with the Fantom Ledger Nano S Application. Please follow instructions on the linked repository to deploy your copy of the Fantom Ledger HW wallet application.

  • Staking and rewards related SFC commands.

    The library contains a module for building transactions used to invoke a subset of Fantom Opera SFC contract operations. The calls covered by the library allow you to create and manage native tokens delegation and delegation rewards.

  • DeFi smart contract calls.

    The library contains a module for building transactions used to invoke Fantom DeFi smart contract commands and manage your ERC20 tokens.

How to use generated transactions

Most functions in the library allow you to build base transactions for certain smart contract calls. If the contract call mutates the blockchain state, e.g. if it changes anything inside the blockchain, you have to use signed transactions to invoke such call. The library is able to provide pre-formatted call structure, but you still need valid Web3, or similar provider to sign the transaction, fill the missing details (like the current gas price) and send the signed transaction to the Opera node for processing.

Please check the Web3.js documentation about your options for signing transactions and sending them to the block chain. You will need and API endpoint address of an Opera node, either local or remote, to be able to proceed.

How to use the Ledger module

Please note you absolutely have to use HTTPS for Fantom Ledger Application communication using this library. It utilizes U2F protocol to exchange data between your browser and the Ledger hardware token and the U2F protocol is available only if the origin of the web page uses secured channel.

You need to have the Fantom Ledger application installed on your Ledger token to have the other side to communicate with. If you don't, Please follow the Ledger manual and install your application. If not available, you can deploy it directly from our GitHub repository.

Fantom Ledger Nano S Application repository

In this case you app will not have the correct signature and so the Ledger device will always ask you for a permission before opening the app.

Available Scripts

npm run build

Builds the app for production to the build folder.
It correctly bundles in production mode and optimizes the build for the best performance.

npm test

Executes Mocha/Chai unit tests on the SFC support library. These tests cover building SFC transaction calls for the most common delegations and staking related operations supported by the SFC contract.

fantom_clientjs_utils's People

Contributors

dependabot[bot] avatar jenikd avatar skavel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.