Default Values
Our SDK comes with default values (opens in a new tab) such as gas cost, gas limit, and provider, so you can simply import and use right away.
import { BakoSafe } from 'bakosafe'
const bakoSafe = new BakoSafe()
// setup gas
bakoSafe.setGasConfig({
//on decimal values, on usage is converted to bn()
GAS_LIMIT: 1000000,
GAS_PRICE: 1,
})
// setup provider
bakoSafe.setProviders({
PROVIDER: 'https://beta-5.fuel.network/graphql',
BAKO_API: 'https://api-safe.bako.global',
BAKO_DAPP: 'https://safe.bako.global',
})
Custom Values
However, you can configure custom values when initializing the SDK to meet the specifications of your dApp.
import { BakoSafe } from 'bakosafe'
const bakoSafe = new BakoSafe()
// get setup gas
const gasConfig = {
GAS_LIMIT: bakoSafe.getGasConfig('GAS_LIMIT'),
GAS_PRICE: bakoSafe.getGasConfig('GAS_PRICE'),
}
// get setup provider
const providers = {
PROVIDER: bakoSafe.getProviders('CHAIN_URL'),
BAKO_API: bakoSafe.getProviders('SERVER_URL'),
BAKO_DAPP: bakoSafe.getProviders('CLIENT_URL'),
}
If you want to implement your own API to store some data off-chain similar to how Bako Safe works in the Bako Ecosystem method, simply access this link (opens in a new tab) to better understand which endpoints you need to implement in your own API. And check the implementation interface of each service, on module/types.ts
(for example: predicates/types.ts
).
Running on a Local Node
If you are running a FuelVM local node (opens in a new tab), you might point the provider to your local node.