-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
7 changed files
with
244 additions
and
18 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
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import type { Amount } from "../amountUtils.js"; | ||
import type { Token } from "../types.js"; | ||
import type { Hex } from "viem"; | ||
import type { Address } from "viem/accounts"; | ||
|
||
export type ERC20 = Token<"erc20"> & { | ||
address: Address; | ||
decimals: number; | ||
}; | ||
|
||
export type ERC20Permit = ERC20 & { domainSeparator: Hex }; | ||
export type ERC20Permit = ERC20 & { version: string }; | ||
|
||
export type ERC20Data<TERC20 extends ERC20> = Amount<TERC20>; | ||
|
||
export type ERC20Amount<TERC20 extends ERC20> = ERC20Data<TERC20>; | ||
|
||
export type ERC20PermitData<TERC20 extends ERC20> = ERC20Data<TERC20> & { | ||
export type ERC20PermitData<TERC20 extends ERC20Permit> = ERC20Data<TERC20> & { | ||
nonce: bigint; | ||
}; | ||
|
||
export type ERC20PermitAmount<TERC20 extends ERC20> = ERC20PermitData<TERC20>; | ||
export type ERC20PermitAmount<TERC20 extends ERC20Permit> = | ||
ERC20PermitData<TERC20>; |
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,9 @@ | ||
import { describe, test } from "vitest"; | ||
|
||
describe("utils", () => { | ||
test.todo("can create erc20"); | ||
|
||
test.todo("can create permit erc20"); | ||
|
||
test.todo("can get typed data hash"); | ||
}); |
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