@prism-ing/wallet 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +596 -0
- package/SPEC.md +192 -0
- package/dist/backends/squads-recovery-backend.d.ts +59 -0
- package/dist/backends/squads-recovery-backend.d.ts.map +1 -0
- package/dist/backends/squads-recovery-backend.js +81 -0
- package/dist/backends/squads-recovery-backend.js.map +1 -0
- package/dist/backends/squads-types.d.ts +74 -0
- package/dist/backends/squads-types.d.ts.map +1 -0
- package/dist/backends/squads-types.js +22 -0
- package/dist/backends/squads-types.js.map +1 -0
- package/dist/backends/zerodev-policy-mapper.d.ts +41 -0
- package/dist/backends/zerodev-policy-mapper.d.ts.map +1 -0
- package/dist/backends/zerodev-policy-mapper.js +127 -0
- package/dist/backends/zerodev-policy-mapper.js.map +1 -0
- package/dist/backends/zerodev-session-backend.d.ts +43 -0
- package/dist/backends/zerodev-session-backend.d.ts.map +1 -0
- package/dist/backends/zerodev-session-backend.js +63 -0
- package/dist/backends/zerodev-session-backend.js.map +1 -0
- package/dist/backends/zerodev-types.d.ts +104 -0
- package/dist/backends/zerodev-types.d.ts.map +1 -0
- package/dist/backends/zerodev-types.js +13 -0
- package/dist/backends/zerodev-types.js.map +1 -0
- package/dist/create-wallet.d.ts +89 -0
- package/dist/create-wallet.d.ts.map +1 -0
- package/dist/create-wallet.js +235 -0
- package/dist/create-wallet.js.map +1 -0
- package/dist/cross-chain.d.ts +64 -0
- package/dist/cross-chain.d.ts.map +1 -0
- package/dist/cross-chain.js +200 -0
- package/dist/cross-chain.js.map +1 -0
- package/dist/errors.d.ts +115 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +97 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/base58.d.ts +8 -0
- package/dist/internal/base58.d.ts.map +1 -0
- package/dist/internal/base58.js +34 -0
- package/dist/internal/base58.js.map +1 -0
- package/dist/internal/eip712.d.ts +41 -0
- package/dist/internal/eip712.d.ts.map +1 -0
- package/dist/internal/eip712.js +182 -0
- package/dist/internal/eip712.js.map +1 -0
- package/dist/internal/file-spend-persistence.d.ts +9 -0
- package/dist/internal/file-spend-persistence.d.ts.map +1 -0
- package/dist/internal/file-spend-persistence.js +58 -0
- package/dist/internal/file-spend-persistence.js.map +1 -0
- package/dist/internal/onebalance-client.d.ts +59 -0
- package/dist/internal/onebalance-client.d.ts.map +1 -0
- package/dist/internal/onebalance-client.js +2 -0
- package/dist/internal/onebalance-client.js.map +1 -0
- package/dist/internal/onebalance-http-client.d.ts +25 -0
- package/dist/internal/onebalance-http-client.d.ts.map +1 -0
- package/dist/internal/onebalance-http-client.js +161 -0
- package/dist/internal/onebalance-http-client.js.map +1 -0
- package/dist/internal/onebalance-types.d.ts +201 -0
- package/dist/internal/onebalance-types.d.ts.map +1 -0
- package/dist/internal/onebalance-types.js +39 -0
- package/dist/internal/onebalance-types.js.map +1 -0
- package/dist/internal/platform.d.ts +14 -0
- package/dist/internal/platform.d.ts.map +1 -0
- package/dist/internal/platform.js +22 -0
- package/dist/internal/platform.js.map +1 -0
- package/dist/internal/quote-verifier.d.ts +71 -0
- package/dist/internal/quote-verifier.d.ts.map +1 -0
- package/dist/internal/quote-verifier.js +172 -0
- package/dist/internal/quote-verifier.js.map +1 -0
- package/dist/internal/recovery-manager.d.ts +29 -0
- package/dist/internal/recovery-manager.d.ts.map +1 -0
- package/dist/internal/recovery-manager.js +161 -0
- package/dist/internal/recovery-manager.js.map +1 -0
- package/dist/result.d.ts +132 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +114 -0
- package/dist/result.js.map +1 -0
- package/dist/schemas.d.ts +184 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +76 -0
- package/dist/schemas.js.map +1 -0
- package/dist/session-keys.d.ts +53 -0
- package/dist/session-keys.d.ts.map +1 -0
- package/dist/session-keys.js +345 -0
- package/dist/session-keys.js.map +1 -0
- package/dist/signers/node-signing-backend.d.ts +11 -0
- package/dist/signers/node-signing-backend.d.ts.map +1 -0
- package/dist/signers/node-signing-backend.js +120 -0
- package/dist/signers/node-signing-backend.js.map +1 -0
- package/dist/signers/ows-adapter.d.ts +70 -0
- package/dist/signers/ows-adapter.d.ts.map +1 -0
- package/dist/signers/ows-adapter.js +53 -0
- package/dist/signers/ows-adapter.js.map +1 -0
- package/dist/signers/ows-signing-backend.d.ts +25 -0
- package/dist/signers/ows-signing-backend.d.ts.map +1 -0
- package/dist/signers/ows-signing-backend.js +192 -0
- package/dist/signers/ows-signing-backend.js.map +1 -0
- package/dist/signers/secure-enclave-backend.d.ts +19 -0
- package/dist/signers/secure-enclave-backend.d.ts.map +1 -0
- package/dist/signers/secure-enclave-backend.js +201 -0
- package/dist/signers/secure-enclave-backend.js.map +1 -0
- package/dist/signers/secure-enclave-types.d.ts +98 -0
- package/dist/signers/secure-enclave-types.d.ts.map +1 -0
- package/dist/signers/secure-enclave-types.js +12 -0
- package/dist/signers/secure-enclave-types.js.map +1 -0
- package/dist/types.d.ts +371 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the iOS Secure Enclave signing backend.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The {@link SecureEnclaveNativeBridge} interface abstracts the React Native
|
|
6
|
+
* native module boundary. The Swift implementation lives in `apps/mobile`;
|
|
7
|
+
* this keeps `@prism-ing/wallet` free of React Native dependencies.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Native bridge to iOS Secure Enclave APIs.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* The implementation is a React Native native module that calls:
|
|
16
|
+
* - `SecKeyCreateRandomKey` for key generation (P-256 Secure Enclave key)
|
|
17
|
+
* - `SecKeyCreateEncryptedData` / `SecKeyCreateDecryptedData` for
|
|
18
|
+
* encrypting/decrypting secp256k1 + ed25519 private keys
|
|
19
|
+
* - `LAContext.evaluatePolicy` for biometric gating (Face ID / Touch ID)
|
|
20
|
+
*
|
|
21
|
+
* Private keys never leave the Secure Enclave in plaintext. The secp256k1
|
|
22
|
+
* and ed25519 keys are stored encrypted by the Secure Enclave's P-256 key,
|
|
23
|
+
* decrypted in-process only after biometric authentication succeeds.
|
|
24
|
+
*/
|
|
25
|
+
export interface SecureEnclaveNativeBridge {
|
|
26
|
+
/**
|
|
27
|
+
* Generate a new key pair encrypted by the Secure Enclave.
|
|
28
|
+
*
|
|
29
|
+
* @param tag - Unique identifier for this key in the Keychain.
|
|
30
|
+
* @returns The public key bytes (uncompressed secp256k1 for EVM,
|
|
31
|
+
* raw ed25519 for Solana) and the Solana public key bytes.
|
|
32
|
+
*/
|
|
33
|
+
generateKey(tag: string): Promise<{
|
|
34
|
+
readonly evmPublicKey: Uint8Array;
|
|
35
|
+
readonly solanaPublicKey: Uint8Array;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Sign data using the key identified by `tag`.
|
|
39
|
+
* Triggers biometric authentication before decrypting the key.
|
|
40
|
+
*
|
|
41
|
+
* @param tag - Key identifier in the Keychain.
|
|
42
|
+
* @param data - The data to sign (hash for EVM, message for Solana).
|
|
43
|
+
* @param biometricPrompt - Text shown to the user during Face ID / Touch ID.
|
|
44
|
+
* @returns The raw signature bytes.
|
|
45
|
+
*/
|
|
46
|
+
sign(tag: string, data: Uint8Array, biometricPrompt: string): Promise<{
|
|
47
|
+
readonly signature: Uint8Array;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Sign Solana transaction data using the ed25519 key for `tag`.
|
|
51
|
+
* Triggers biometric authentication before decrypting the key.
|
|
52
|
+
*
|
|
53
|
+
* @param tag - Key identifier in the Keychain.
|
|
54
|
+
* @param data - The serialized Solana transaction message bytes.
|
|
55
|
+
* @param biometricPrompt - Text shown to the user during Face ID / Touch ID.
|
|
56
|
+
* @returns The 64-byte ed25519 signature.
|
|
57
|
+
*/
|
|
58
|
+
signSolana(tag: string, data: Uint8Array, biometricPrompt: string): Promise<{
|
|
59
|
+
readonly signature: Uint8Array;
|
|
60
|
+
}>;
|
|
61
|
+
/** Check whether a key with the given tag exists in the Keychain. */
|
|
62
|
+
keyExists(tag: string): Promise<boolean>;
|
|
63
|
+
/** Delete the key with the given tag from the Keychain. */
|
|
64
|
+
deleteKey(tag: string): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Begin an authenticated context. Evaluates biometrics once and keeps
|
|
67
|
+
* the LAContext alive for subsequent sign/signSolana calls until
|
|
68
|
+
* endAuthContext() is called.
|
|
69
|
+
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* Optional. When not implemented, each sign call triggers its own
|
|
72
|
+
* biometric prompt. When implemented, enables batched signing.
|
|
73
|
+
*/
|
|
74
|
+
beginAuthContext?(prompt: string): Promise<{
|
|
75
|
+
readonly contextId: string;
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* End the authenticated context. Subsequent sign calls will require
|
|
79
|
+
* a new biometric prompt.
|
|
80
|
+
*/
|
|
81
|
+
endAuthContext?(contextId: string): Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
/** Configuration for the Secure Enclave signing backend. */
|
|
84
|
+
export interface SecureEnclaveConfig {
|
|
85
|
+
/** The native bridge to iOS Secure Enclave APIs. */
|
|
86
|
+
readonly nativeBridge: SecureEnclaveNativeBridge;
|
|
87
|
+
/**
|
|
88
|
+
* Unique key tag for this wallet in the iOS Keychain.
|
|
89
|
+
* Defaults to `'prism-wallet-default'`.
|
|
90
|
+
*/
|
|
91
|
+
readonly keyTag?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Text shown during biometric authentication prompts.
|
|
94
|
+
* Defaults to `'Authorize transaction'`.
|
|
95
|
+
*/
|
|
96
|
+
readonly biometricPrompt?: string;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=secure-enclave-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-enclave-types.d.ts","sourceRoot":"","sources":["../../src/signers/secure-enclave-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;OAMG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAChC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC;QAClC,QAAQ,CAAC,eAAe,EAAE,UAAU,CAAC;KACtC,CAAC,CAAC;IAEH;;;;;;;;OAQG;IACH,IAAI,CACF,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,UAAU,EAChB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC;QAAE,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IAE/C;;;;;;;;OAQG;IACH,UAAU,CACR,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,UAAU,EAChB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC;QAAE,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IAE/C,qEAAqE;IACrE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzC,2DAA2D;IAC3D,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtC;;;;;;;;OAQG;IACH,gBAAgB,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE3E;;;OAGG;IACH,cAAc,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AAED,4DAA4D;AAC5D,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,QAAQ,CAAC,YAAY,EAAE,yBAAyB,CAAC;IAEjD;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the iOS Secure Enclave signing backend.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The {@link SecureEnclaveNativeBridge} interface abstracts the React Native
|
|
6
|
+
* native module boundary. The Swift implementation lives in `apps/mobile`;
|
|
7
|
+
* this keeps `@prism-ing/wallet` free of React Native dependencies.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=secure-enclave-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-enclave-types.js","sourceRoot":"","sources":["../../src/signers/secure-enclave-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for @prism-ing/wallet.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* These interfaces define the public contract for wallet operations.
|
|
6
|
+
* The {@link PrismSigner} interface is the most important —
|
|
7
|
+
* router packages depend on it for signer injection.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
import type { Address, Hex, Bps, Result } from './result.js';
|
|
12
|
+
import type { WalletError } from './errors.js';
|
|
13
|
+
/**
|
|
14
|
+
* Platform-agnostic signing interface.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* This is the contract that router packages depend on.
|
|
18
|
+
* Implementations exist for iOS Secure Enclave (OWS native),
|
|
19
|
+
* Node.js (OWS CLI), and browser (software fallback).
|
|
20
|
+
*
|
|
21
|
+
* External consumers can provide their own implementation
|
|
22
|
+
* without depending on `@prism-ing/wallet` for signing.
|
|
23
|
+
*/
|
|
24
|
+
export interface PrismSigner {
|
|
25
|
+
/** Sign a raw message hash (EVM: UserOperation hash or EIP-191). */
|
|
26
|
+
signMessage(message: Hex): Promise<Hex>;
|
|
27
|
+
/** Sign an EIP-712 typed data payload. */
|
|
28
|
+
signTypedData(payload: TypedDataPayload): Promise<Hex>;
|
|
29
|
+
/** Sign a Solana VersionedTransaction in-place. */
|
|
30
|
+
signTransaction<T>(tx: T): Promise<T>;
|
|
31
|
+
/** The EVM smart account address (ERC-4337 counterfactual). */
|
|
32
|
+
readonly evmAddress: Address;
|
|
33
|
+
/** The Solana account address (base58). */
|
|
34
|
+
readonly solanaAddress: string;
|
|
35
|
+
}
|
|
36
|
+
/** EIP-712 typed data payload for structured signing. */
|
|
37
|
+
export interface TypedDataPayload {
|
|
38
|
+
readonly domain: Record<string, unknown>;
|
|
39
|
+
readonly types: Record<string, readonly TypedDataField[]>;
|
|
40
|
+
readonly primaryType: string;
|
|
41
|
+
readonly message: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
/** A single field in an EIP-712 type definition. */
|
|
44
|
+
export interface TypedDataField {
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly type: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A fully initialized wallet account with signing and balance capabilities.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* Created via {@link createWallet}. Provides unified access to EVM and
|
|
53
|
+
* Solana accounts, cross-chain balances, and recovery management.
|
|
54
|
+
*/
|
|
55
|
+
export interface WalletAccount {
|
|
56
|
+
/** The underlying signer for this account. */
|
|
57
|
+
readonly signer: PrismSigner;
|
|
58
|
+
/** The EVM smart account address (ERC-4337 counterfactual). */
|
|
59
|
+
readonly evmAddress: Address;
|
|
60
|
+
/** The Solana account address. */
|
|
61
|
+
readonly solanaAddress: string;
|
|
62
|
+
/** Fetch the unified cross-chain balance. */
|
|
63
|
+
getBalance(): Promise<UnifiedBalance>;
|
|
64
|
+
/** Deposit funds to the account. */
|
|
65
|
+
deposit(params: DepositParams): Promise<TxResult>;
|
|
66
|
+
/** Poll the execution status of a cross-chain transaction. */
|
|
67
|
+
getTransactionStatus(quoteId: string): Promise<TxResult>;
|
|
68
|
+
/** Access the recovery manager for this account. */
|
|
69
|
+
recover(): RecoveryManager;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A wallet that requires recovery setup before full activation.
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* Returned by {@link createProductionWallet} on iOS. Provides read-only
|
|
76
|
+
* access (balance, tx status) and recovery setup, but NOT deposit or
|
|
77
|
+
* cross-chain operations. Call {@link WalletPendingRecovery.activateWallet}
|
|
78
|
+
* after setting up at least one recovery guardian.
|
|
79
|
+
*/
|
|
80
|
+
export interface WalletPendingRecovery {
|
|
81
|
+
/** The underlying signer for this account. */
|
|
82
|
+
readonly signer: PrismSigner;
|
|
83
|
+
/** The EVM smart account address (ERC-4337 counterfactual). */
|
|
84
|
+
readonly evmAddress: Address;
|
|
85
|
+
/** The Solana account address. */
|
|
86
|
+
readonly solanaAddress: string;
|
|
87
|
+
/** Fetch the unified cross-chain balance (read-only, no recovery needed). */
|
|
88
|
+
getBalance(): Promise<UnifiedBalance>;
|
|
89
|
+
/** Poll the execution status of a cross-chain transaction. */
|
|
90
|
+
getTransactionStatus(quoteId: string): Promise<TxResult>;
|
|
91
|
+
/** Access the recovery manager to set up guardians. */
|
|
92
|
+
recover(): RecoveryManager;
|
|
93
|
+
/**
|
|
94
|
+
* Activate the wallet after at least one guardian is configured.
|
|
95
|
+
*
|
|
96
|
+
* @returns A `Result` containing the full `WalletAccount` or
|
|
97
|
+
* `RECOVERY_NOT_CONFIGURED` error if no guardians have been set up.
|
|
98
|
+
*/
|
|
99
|
+
activateWallet(): Result<WalletAccount, WalletError>;
|
|
100
|
+
}
|
|
101
|
+
/** Unified balance across all chains. */
|
|
102
|
+
export interface UnifiedBalance {
|
|
103
|
+
/** Total USD value as a decimal string (e.g. '2847.32'). */
|
|
104
|
+
readonly totalUsd: string;
|
|
105
|
+
/** Per-chain breakdown. */
|
|
106
|
+
readonly breakdown: readonly ChainBalance[];
|
|
107
|
+
}
|
|
108
|
+
/** Balance on a single chain. */
|
|
109
|
+
export interface ChainBalance {
|
|
110
|
+
readonly chainId: number;
|
|
111
|
+
readonly chainName: string;
|
|
112
|
+
readonly balanceUsd: string;
|
|
113
|
+
readonly tokens: readonly TokenBalance[];
|
|
114
|
+
}
|
|
115
|
+
/** Balance of a single token on a single chain. */
|
|
116
|
+
export interface TokenBalance {
|
|
117
|
+
readonly symbol: string;
|
|
118
|
+
readonly address: string;
|
|
119
|
+
readonly amount: string;
|
|
120
|
+
readonly amountUsd: string;
|
|
121
|
+
readonly decimals: number;
|
|
122
|
+
}
|
|
123
|
+
/** Deposit parameters. */
|
|
124
|
+
export interface DepositParams {
|
|
125
|
+
readonly token: Address;
|
|
126
|
+
readonly amount: bigint;
|
|
127
|
+
readonly chainId: number;
|
|
128
|
+
}
|
|
129
|
+
/** Result of a submitted transaction. */
|
|
130
|
+
export interface TxResult {
|
|
131
|
+
readonly txHash: string;
|
|
132
|
+
readonly status: TxStatus;
|
|
133
|
+
}
|
|
134
|
+
/** Transaction lifecycle status. */
|
|
135
|
+
export type TxStatus = 'submitted' | 'confirmed' | 'failed';
|
|
136
|
+
/** Parameters for a cross-chain swap via OneBalance. */
|
|
137
|
+
export interface CrossChainSwapParams {
|
|
138
|
+
readonly tokenIn: Address;
|
|
139
|
+
readonly chainIn: number;
|
|
140
|
+
readonly tokenOut: Address;
|
|
141
|
+
readonly chainOut: number;
|
|
142
|
+
readonly amount: bigint;
|
|
143
|
+
readonly slippageBps?: Bps;
|
|
144
|
+
}
|
|
145
|
+
/** Result of a cross-chain swap. */
|
|
146
|
+
export interface SwapResult {
|
|
147
|
+
readonly txHash: string;
|
|
148
|
+
readonly amountOut: bigint;
|
|
149
|
+
readonly status: TxStatus;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Manages wallet recovery via passkey, second device, or trusted contact.
|
|
153
|
+
*
|
|
154
|
+
* @remarks
|
|
155
|
+
* Recovery never requires the original OWS key — it rotates the
|
|
156
|
+
* smart contract's authorized signer to a new key.
|
|
157
|
+
*/
|
|
158
|
+
export interface RecoveryManager {
|
|
159
|
+
/** Set up iCloud Keychain passkey as a recovery guardian. */
|
|
160
|
+
setupPasskey(): Promise<PasskeyGuardian>;
|
|
161
|
+
/** Add a second device as a recovery guardian. */
|
|
162
|
+
addDeviceGuardian(deviceEvmAddress: Address, deviceSolanaAddress: string): Promise<void>;
|
|
163
|
+
/** Add a trusted contact as a recovery guardian (EVM only). */
|
|
164
|
+
addContactGuardian(ethAddress: Address): Promise<void>;
|
|
165
|
+
/** Initiate recovery with a new signer on a new device. */
|
|
166
|
+
initiateRecovery(newSigner: PrismSigner): Promise<RecoveryTx>;
|
|
167
|
+
}
|
|
168
|
+
/** A registered passkey guardian. */
|
|
169
|
+
export interface PasskeyGuardian {
|
|
170
|
+
readonly id: string;
|
|
171
|
+
readonly type: 'passkey';
|
|
172
|
+
}
|
|
173
|
+
/** A pending recovery transaction. */
|
|
174
|
+
export interface RecoveryTx {
|
|
175
|
+
readonly recoveryId: string;
|
|
176
|
+
readonly status: 'pending' | 'executed' | 'cancelled';
|
|
177
|
+
readonly newEvmAddress: Address;
|
|
178
|
+
readonly newSolanaAddress: string;
|
|
179
|
+
}
|
|
180
|
+
/** EVM recovery operations via ZeroDev Social Recovery module. */
|
|
181
|
+
export interface EvmRecoveryBackend {
|
|
182
|
+
/** Register a guardian address on the ZeroDev Social Recovery module. */
|
|
183
|
+
addGuardian(guardianAddress: Address): Promise<void>;
|
|
184
|
+
/** Execute signer rotation: `removeValidator(old)` + `addValidator(new)`. */
|
|
185
|
+
rotateValidator(oldSigner: Address, newSigner: Address, guardianProof: Uint8Array): Promise<string>;
|
|
186
|
+
}
|
|
187
|
+
/** Solana recovery operations via Squads V4. */
|
|
188
|
+
export interface SolanaRecoveryBackend {
|
|
189
|
+
/** Add a new member to the Squads multisig (guardian registration). */
|
|
190
|
+
addMember(solanaAddress: string): Promise<string>;
|
|
191
|
+
/** Execute member rotation: `multisigAddMember(new)` + `multisigRemoveMember(old)`. */
|
|
192
|
+
rotateMember(oldSigner: string, newSigner: string, guardianProof: Uint8Array): Promise<string>;
|
|
193
|
+
}
|
|
194
|
+
/** Passkey backend for iCloud Keychain guardian registration. */
|
|
195
|
+
export interface PasskeyBackend {
|
|
196
|
+
/** Register a new passkey credential. Returns the credential ID. */
|
|
197
|
+
register(rpId: string): Promise<{
|
|
198
|
+
id: string;
|
|
199
|
+
publicKey: Uint8Array;
|
|
200
|
+
}>;
|
|
201
|
+
/** Sign a challenge with an existing passkey. Returns the assertion. */
|
|
202
|
+
sign(credentialId: string, challenge: Uint8Array): Promise<Uint8Array>;
|
|
203
|
+
}
|
|
204
|
+
/** Injected backends for recovery operations. */
|
|
205
|
+
export interface RecoveryBackends {
|
|
206
|
+
readonly evm?: EvmRecoveryBackend;
|
|
207
|
+
readonly solana?: SolanaRecoveryBackend;
|
|
208
|
+
readonly passkey?: PasskeyBackend;
|
|
209
|
+
}
|
|
210
|
+
/** Supported OneBalance smart account type. ERC-4337 counterfactual accounts. */
|
|
211
|
+
export type AccountType = 'kernel-v3.1-ecdsa';
|
|
212
|
+
/** Configuration for {@link createWallet}. */
|
|
213
|
+
export interface WalletConfig {
|
|
214
|
+
/** OWS signer configuration. Same wallet name = same keys across sessions. */
|
|
215
|
+
readonly signer: SignerConfig;
|
|
216
|
+
/** OneBalance API key. */
|
|
217
|
+
readonly oneBalanceApiKey: string;
|
|
218
|
+
/** OneBalance smart account type. Defaults to 'kernel-v3.1-ecdsa'. */
|
|
219
|
+
readonly accountType?: AccountType;
|
|
220
|
+
/** Chains to initialize accounts on. Defaults to Base + Solana. */
|
|
221
|
+
readonly chains?: readonly number[];
|
|
222
|
+
/** Recovery configuration. */
|
|
223
|
+
readonly recovery?: RecoveryConfig;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* OWS signer configuration.
|
|
227
|
+
*
|
|
228
|
+
* @remarks
|
|
229
|
+
* Controls how keys are created, stored, and accessed via OWS.
|
|
230
|
+
* The wallet name is the persistence key — same name = same wallet.
|
|
231
|
+
*
|
|
232
|
+
* Auth hierarchy: apiKey > passphrase > OWS_PASSPHRASE env var.
|
|
233
|
+
*/
|
|
234
|
+
export interface SignerConfig {
|
|
235
|
+
/** OWS wallet name. Same name = same wallet across sessions. */
|
|
236
|
+
readonly walletName: string;
|
|
237
|
+
/** Owner passphrase for OWS vault. Omit to use OWS_PASSPHRASE env var or apiKey. */
|
|
238
|
+
readonly passphrase?: string;
|
|
239
|
+
/** Agent API key (ows_key_...). Enables policy-gated, scoped access. */
|
|
240
|
+
readonly apiKey?: string;
|
|
241
|
+
/** Custom vault path. Defaults to ~/.ows/. Useful for testing. */
|
|
242
|
+
readonly vaultPath?: string;
|
|
243
|
+
}
|
|
244
|
+
/** Recovery setup configuration. */
|
|
245
|
+
export interface RecoveryConfig {
|
|
246
|
+
/** EVM recovery via ZeroDev Social Recovery. */
|
|
247
|
+
readonly evm?: {
|
|
248
|
+
readonly guardians: readonly Address[];
|
|
249
|
+
readonly threshold: number;
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Policy constraints for a scoped session key.
|
|
254
|
+
*
|
|
255
|
+
* @remarks
|
|
256
|
+
* Session keys limit what an agent or automated process can do
|
|
257
|
+
* without holding the root signer. Every field is optional —
|
|
258
|
+
* omitted fields mean "no restriction" for that dimension.
|
|
259
|
+
*/
|
|
260
|
+
export interface SessionKeyPolicy {
|
|
261
|
+
/** Unix timestamp (seconds) when this session key expires. */
|
|
262
|
+
readonly expiresAt: number;
|
|
263
|
+
/** Allowed asset identifiers (aggregated like "ob:usdc" or CAIP-19). Empty = all allowed. */
|
|
264
|
+
readonly allowedAssets?: readonly string[];
|
|
265
|
+
/** Maximum amount per operation in smallest unit. Omit for no cap. */
|
|
266
|
+
readonly maxAmountPerOp?: string;
|
|
267
|
+
/** Maximum cumulative spend in smallest unit across all operations. Omit for no cap. */
|
|
268
|
+
readonly maxTotalAmount?: string;
|
|
269
|
+
/** Allowed destination addresses. Empty = any destination. */
|
|
270
|
+
readonly allowedRecipients?: readonly string[];
|
|
271
|
+
/** Allowed chain IDs. Empty = all chains. */
|
|
272
|
+
readonly allowedChains?: readonly number[];
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* An active session key with its policy and cumulative state.
|
|
276
|
+
*
|
|
277
|
+
* @remarks
|
|
278
|
+
* Created via {@link SessionKeyManager.createSessionKey}.
|
|
279
|
+
* The session signer implements PrismSigner and enforces
|
|
280
|
+
* policy checks before delegating to the underlying signer.
|
|
281
|
+
*/
|
|
282
|
+
export interface SessionKeyHandle {
|
|
283
|
+
/** Unique session identifier. */
|
|
284
|
+
readonly sessionId: string;
|
|
285
|
+
/** The scoped signer — delegates to root but enforces policy. */
|
|
286
|
+
readonly signer: PrismSigner;
|
|
287
|
+
/** The policy governing this session. */
|
|
288
|
+
readonly policy: SessionKeyPolicy;
|
|
289
|
+
/** Cumulative amount spent in this session (smallest unit). */
|
|
290
|
+
readonly totalSpent: string;
|
|
291
|
+
/** Whether this session key is still active. */
|
|
292
|
+
readonly isActive: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* Promise that resolves when on-chain registration completes.
|
|
295
|
+
* Resolves to the transaction hash on success, or rejects on failure.
|
|
296
|
+
* `undefined` if no `SessionKeyBackend` was provided.
|
|
297
|
+
*
|
|
298
|
+
* @remarks
|
|
299
|
+
* Callers who need on-chain enforcement guarantees should await this
|
|
300
|
+
* before using the session signer. Without awaiting, the session key
|
|
301
|
+
* may have only client-side enforcement.
|
|
302
|
+
*/
|
|
303
|
+
readonly onChainRegistration: Promise<string> | undefined;
|
|
304
|
+
/**
|
|
305
|
+
* Promise that resolves when persisted spend state has been loaded.
|
|
306
|
+
* `undefined` if no `SpendPersistence` was provided.
|
|
307
|
+
*
|
|
308
|
+
* @remarks
|
|
309
|
+
* Await this before using the session signer to ensure cumulative
|
|
310
|
+
* spend tracking starts from the correct persisted value.
|
|
311
|
+
*/
|
|
312
|
+
readonly initialized?: Promise<void>;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Manages creation, enforcement, and revocation of session keys.
|
|
316
|
+
*
|
|
317
|
+
* @remarks
|
|
318
|
+
* Session keys are ephemeral signers scoped by a {@link SessionKeyPolicy}.
|
|
319
|
+
* They wrap the root PrismSigner and enforce policy checks client-side
|
|
320
|
+
* before any signing operation. On-chain enforcement is handled by the
|
|
321
|
+
* ZeroDev permission validator when a {@link SessionKeyBackend} is provided.
|
|
322
|
+
*/
|
|
323
|
+
export interface SessionKeyManager {
|
|
324
|
+
/** Create a new session key with the given policy. */
|
|
325
|
+
createSessionKey(policy: SessionKeyPolicy): SessionKeyHandle;
|
|
326
|
+
/** Revoke a session key by ID. Returns true if the session existed. */
|
|
327
|
+
revokeSessionKey(sessionId: string): boolean;
|
|
328
|
+
/** Get all active session keys. */
|
|
329
|
+
getActiveSessions(): readonly SessionKeyHandle[];
|
|
330
|
+
/** Get a session key by ID. Returns undefined if not found or revoked. */
|
|
331
|
+
getSession(sessionId: string): SessionKeyHandle | undefined;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Backend for on-chain session key registration.
|
|
335
|
+
*
|
|
336
|
+
* @remarks
|
|
337
|
+
* Consumers inject this to register session keys with ZeroDev's
|
|
338
|
+
* permission validator. When omitted, session keys are enforced
|
|
339
|
+
* client-side only (still useful for agent policy enforcement).
|
|
340
|
+
*/
|
|
341
|
+
export interface SessionKeyBackend {
|
|
342
|
+
/** Register a session key on-chain with the given policy. */
|
|
343
|
+
registerSessionKey(sessionAddress: Address, policy: SessionKeyPolicy): Promise<string>;
|
|
344
|
+
/** Revoke a session key on-chain. */
|
|
345
|
+
revokeSessionKey(sessionAddress: Address): Promise<string>;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Persistence adapter for session key spend tracking.
|
|
349
|
+
*
|
|
350
|
+
* @remarks
|
|
351
|
+
* When {@link SessionKeyPolicy.maxTotalAmount} is set, either this or a
|
|
352
|
+
* {@link SessionKeyBackend} must be provided to ensure cumulative caps
|
|
353
|
+
* survive process restarts. Without persistence, in-memory spend tracking
|
|
354
|
+
* resets — silently undermining the cap.
|
|
355
|
+
*/
|
|
356
|
+
export interface SpendPersistence {
|
|
357
|
+
/** Load current cumulative spend for a session. Returns 0n if no record exists. */
|
|
358
|
+
load(sessionId: string): Promise<bigint>;
|
|
359
|
+
/** Persist the cumulative spend for a session. */
|
|
360
|
+
save(sessionId: string, amount: bigint): Promise<void>;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Runtime platform for OWS signer selection.
|
|
364
|
+
*
|
|
365
|
+
* @remarks
|
|
366
|
+
* Used internally to select the correct signing implementation.
|
|
367
|
+
* iOS uses Secure Enclave via Swift bridge. Node and Browser use
|
|
368
|
+
* OWS software signing.
|
|
369
|
+
*/
|
|
370
|
+
export type Platform = 'ios' | 'node' | 'browser';
|
|
371
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,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gB,GAAG,gBAAgB,CAAC;IAE7D,uEAAuE;IACvE,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAE7C,mCAAmC;IACnC,iBAAiB,IAAI,SAAS,gBAAgB,EAAE,CAAC;IAEjD,0EAA0E;IAC1E,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAAC;CAC7D;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,kBAAkB,CAChB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB,qCAAqC;IACrC,gBAAgB,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5D;AAMD;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,kDAAkD;IAClD,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAMD;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@prism-ing/wallet",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Production-grade, framework-agnostic wallet SDK. OWS + OneBalance + ZeroDev + Squads.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"README.md",
|
|
16
|
+
"SPEC.md",
|
|
17
|
+
"CHANGELOG.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/cdsiren/prism.git",
|
|
23
|
+
"directory": "packages/wallet"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/cdsiren/prism/tree/main/packages/wallet#readme",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/cdsiren/prism/issues"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"wallet",
|
|
31
|
+
"crypto",
|
|
32
|
+
"evm",
|
|
33
|
+
"solana",
|
|
34
|
+
"account-abstraction",
|
|
35
|
+
"onebalance",
|
|
36
|
+
"signing",
|
|
37
|
+
"self-custodial",
|
|
38
|
+
"cross-chain",
|
|
39
|
+
"erc-4337"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:watch": "vitest",
|
|
49
|
+
"test:coverage": "vitest run --coverage",
|
|
50
|
+
"lint": "eslint src/",
|
|
51
|
+
"docs:build": "typedoc --treatWarningsAsErrors",
|
|
52
|
+
"docs:dev": "typedoc --watch --preserveWatchOutput",
|
|
53
|
+
"clean": "rm -rf dist docs"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@noble/curves": "^1.9.0",
|
|
57
|
+
"@noble/hashes": "^1.8.0",
|
|
58
|
+
"@open-wallet-standard/core": "^1.2.4",
|
|
59
|
+
"zod": "^3.23.0"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@prism-ing/test-utils": "workspace:*",
|
|
63
|
+
"fast-check": "^3.22.0",
|
|
64
|
+
"typedoc": "^0.27.0",
|
|
65
|
+
"typedoc-plugin-markdown": "^4.4.0",
|
|
66
|
+
"typescript": "^5.7.0",
|
|
67
|
+
"vitest": "^3.0.0"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@sqds/multisig": ">=2.0.0",
|
|
71
|
+
"@zerodev/sdk": ">=5.0.0",
|
|
72
|
+
"viem": ">=2.0.0"
|
|
73
|
+
},
|
|
74
|
+
"peerDependenciesMeta": {
|
|
75
|
+
"@zerodev/sdk": {
|
|
76
|
+
"optional": true
|
|
77
|
+
},
|
|
78
|
+
"@sqds/multisig": {
|
|
79
|
+
"optional": true
|
|
80
|
+
},
|
|
81
|
+
"viem": {
|
|
82
|
+
"optional": true
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|