-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support VaultsV2 adapter & IronBank adapter
- Loading branch information
Showing
14 changed files
with
397 additions
and
1,152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v15.12.0 | ||
v14.17.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { TokenAbi } from "../abi"; | ||
import { ChainId } from "../chain"; | ||
import { Address, ContractService } from "../common"; | ||
import { Context } from "../context"; | ||
import { structArray } from "../struct"; | ||
|
||
import { ERC20 } from "../types"; | ||
|
||
const HelperAbi = [`function tokensMetadata(address[] memory) public view returns (${TokenAbi}[] memory)`]; | ||
|
||
export class HelperService<T extends ChainId> extends ContractService { | ||
static abi = HelperAbi; | ||
|
||
constructor(chainId: T, ctx: Context) { | ||
super(ctx.addresses.helper ?? HelperService.addressByChain(chainId), chainId, ctx); | ||
} | ||
|
||
static addressByChain(chainId: ChainId): string { | ||
switch (chainId) { | ||
case 1: // FIXME: doesn't actually exist | ||
case 250: // ditto | ||
case 1337: // ditto | ||
return "0x420b1099B9eF5baba6D92029594eF45E19A04A4A"; | ||
} | ||
} | ||
|
||
async tokens(addresses: Address[]): Promise<ERC20[]> { | ||
return await this.contract.tokensMetadata(addresses).then(structArray); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.