-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added smart-session support on base-sepolia
- Loading branch information
1 parent
d90370a
commit 45d4694
Showing
14 changed files
with
583 additions
and
834 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,82 @@ | ||
import { Address } from 'viem' | ||
|
||
/** | ||
* EIP7715Method | ||
*/ | ||
export const EIP7715_METHOD = { | ||
WALLET_GRANT_PERMISSIONS: 'wallet_grantPermissions' | ||
} | ||
|
||
// `data` is not necessary for this signer type as the wallet is both the signer and grantor of these permissions | ||
export type WalletSigner = { | ||
type: 'wallet' | ||
data: {} | ||
} | ||
|
||
// A signer representing a single key. | ||
// `id` is a did:key identifier and can therefore represent both Secp256k1 or Secp256r1 keys, among other key types. | ||
export type KeySigner = { | ||
type: 'key' | ||
data: { | ||
id: string | ||
} | ||
} | ||
|
||
// A signer representing a multisig signer. | ||
// Each element of `ids` is a did:key identifier just like the `key` signer. | ||
export type MultiKeySigner = { | ||
type: 'keys' | ||
data: { | ||
ids: string[] | ||
address?: Address | ||
} | ||
} | ||
|
||
// An account that can be granted with permissions as in ERC-7710. | ||
export type AccountSigner = { | ||
type: 'account' | ||
data: { | ||
id: `0x${string}` | ||
} | ||
} | ||
|
||
export enum SignerType { | ||
EOA, | ||
PASSKEY | ||
} | ||
|
||
export type Signer = { | ||
type: SignerType | ||
data: string | ||
} | ||
|
||
export type Permission = { | ||
type: PermissionType | ||
policies: Policy[] | ||
required: boolean | ||
data: any | ||
} | ||
export type Policy = { | ||
type: PolicyType | ||
data: any | ||
} | ||
export type PermissionType = | ||
| 'native-token-transfer' | ||
| 'erc20-token-transfer' | ||
| 'erc721-token-transfer' | ||
| 'erc1155-token-transfer' | ||
| { | ||
custom: any | ||
} | ||
export type PolicyType = | ||
| 'gas-limit' | ||
| 'call-limit' | ||
| 'rate-limit' | ||
| 'spent-limit' | ||
| 'value-limit' | ||
| 'time-frame' | ||
| 'uni-action' | ||
| 'simpler-signer' | ||
| { | ||
custom: any | ||
} |
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.