To use defire from an account, there is no need to do anything else but initialize defire library with that account. It is possible to create many defire instances, each on with a different account.
const defire1 = Defire({ privateKey: "[PRIVATE KEY 1]" }, { network: 'rinkeby' });const defire2 = Defire({ privateKey: "[PRIVATE KEY 2]" }, { network: 'rinkeby' });const defire3 = Defire({ privateKey: "[PRIVATE KEY 3]" }, { network: 'rinkeby' });
Visit this page for more information on how to initialize it.
Object fields
address string Address of the Defire main account |
A query to get the list of assets that Defire main account holds.
const assets = await defire.query.getAssets();
Returns |
This method returns a |
A query to check Defire main account balance of an asset.
const balance = await defire.query.balance(defire.Assets.DAI);
Method parameters |
address Smart contract address of the asset. |
Returns |
This method returns a |
A query method to check if a Defire main account holds an asset.
const result = await defire.query.hasAsset(defire.Assets.DAI);
Method parameters |
address Smart contract address of the asset. |
Returns |
This method returns a |
An action method that executes the operation from Defire main account.
const result = await defire.actions.execute(operation);
Method parameters |
operation DeFi operation to be executed. |
Returns |
This method returns a |
An action method to execute many DeFi operations from Defire main account.
const result = await defire.actions.execute([operation1, operation2, operation3]);
Method parameters |
operations DeFi operations to be executed. |
Returns |
This method returns a |