This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f67371
commit 31c4458
Showing
8 changed files
with
2,525 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
1,162 changes: 1,162 additions & 0 deletions
1,162
src/apps/tokemak/contracts/ethers/TokemakAccToke.ts
Large diffs are not rendered by default.
Oops, something went wrong.
900 changes: 900 additions & 0 deletions
900
src/apps/tokemak/contracts/ethers/factories/TokemakAccToke__factory.ts
Large diffs are not rendered by default.
Oops, something went wrong.
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
33 changes: 33 additions & 0 deletions
33
src/apps/tokemak/ethereum/tokemak.acc-toke.token-fetcher.ts
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,33 @@ | ||
import { Inject } from '@nestjs/common'; | ||
|
||
import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; | ||
import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; | ||
import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; | ||
import { GetUnderlyingTokensParams } from '~position/template/app-token.template.types'; | ||
|
||
import { TokemakContractFactory } from '../contracts'; | ||
import { TokemakAccToke } from '../contracts/ethers/TokemakAccToke'; | ||
|
||
@PositionTemplate() | ||
export class EthereumTokemakAccTokeTokenFetcher extends AppTokenTemplatePositionFetcher<TokemakAccToke> { | ||
groupLabel = 'accTOKE'; | ||
|
||
constructor( | ||
@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, | ||
@Inject(TokemakContractFactory) private readonly contractFactory: TokemakContractFactory, | ||
) { | ||
super(appToolkit); | ||
} | ||
|
||
getContract(address: string): TokemakAccToke { | ||
return this.contractFactory.tokemakAccToke({ network: this.network, address }); | ||
} | ||
|
||
async getAddresses(): Promise<string[]> { | ||
return ['0xa374a62ddbd21e3d5716cb04821cb710897c0972']; | ||
} | ||
|
||
async getUnderlyingTokenDefinitions({ contract }: GetUnderlyingTokensParams<TokemakAccToke>) { | ||
return [{ address: await contract.toke(), network: this.network }]; | ||
} | ||
} |
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