Background
Providers
Communication with the blockchain is typically done through a provider and local models of smart contracts and their ABIs.
To achieve this, our examples use the fuels.ts library. To instantiate a provider you will need a data source. There are two options:
JSON RPC URL: If you are working with Ethereum mainnet or a local fork, you can access the blockchain through a JSON RPC URL. An example of this can be found in the Sail Rust Integration Guide.
Wallet Browser Extension: If you are connecting to a wallet browser extension, these wallets embed a source directly into the Javascript window object as window.fuel. This object surfaces information about the user’s wallets and provides the ability to communicate with the connected chain. It can be used with fuels.js to construct a provider.
Developing and Testing
To test your code, we recommend utilizing a local fork of Fuel. To help facilitate easy testing, here is more information for running a local node. We recommend testing locally as opposed to on the testnet as it can sometimes be congested and running locally makes for the best developer experience.
Notable SDK Structures
Sail
This is the base struct to interact with the Rust and Typescript client it gives you access to all the functionality of the exchange. Once initiallized with a Provider and a Wallet it can be used to call any function in the client.