Skip to content

Instantly share code, notes, and snippets.

@erin-koen
Last active May 1, 2020 15:24
Show Gist options
  • Save erin-koen/ed21d589417b2584ae2d6d4014bae94d to your computer and use it in GitHub Desktop.
Save erin-koen/ed21d589417b2584ae2d6d4014bae94d to your computer and use it in GitHub Desktop.
The Melon Bot's Balance Method
public async getBalances() {
// find the fund's accounting address
const accountingAddress = (await this.hub.getRoutes()).accounting;
// and instantiate a js representation of the contract
const accounting = new Accounting(this.environment, accountingAddress);
// to call the getFundHoldings method
const fundHoldings = await accounting.getFundHoldings();
// which returns an array of hodlings.
return fundHoldings as FundHolding[];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment