@dynamic-labs-wallet/node-evm 0.0.354 → 0.1.0-request-signing
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/index.cjs +1237 -189
- package/index.esm.js +1214 -192
- package/package.json +9 -8
- package/src/client/accountAdapter.d.ts +4 -3
- package/src/client/accountAdapter.d.ts.map +1 -1
- package/src/client/client.d.ts +110 -31
- package/src/client/client.d.ts.map +1 -1
- package/src/client/earn.client.d.ts +35 -0
- package/src/client/earn.client.d.ts.map +1 -0
- package/src/client/earn.constants.d.ts +42 -0
- package/src/client/earn.constants.d.ts.map +1 -0
- package/src/client/earn.types.d.ts +33 -0
- package/src/client/earn.types.d.ts.map +1 -0
- package/src/client/gasless.client.d.ts +54 -0
- package/src/client/gasless.client.d.ts.map +1 -0
- package/src/client/gasless.constants.d.ts +63 -0
- package/src/client/gasless.constants.d.ts.map +1 -0
- package/src/client/gasless.types.d.ts +148 -0
- package/src/client/gasless.types.d.ts.map +1 -0
- package/src/client/index.d.ts +6 -0
- package/src/client/index.d.ts.map +1 -1
- package/src/delegatedClient.d.ts +66 -9
- package/src/delegatedClient.d.ts.map +1 -1
- package/src/delegatedGasless.d.ts +78 -0
- package/src/delegatedGasless.d.ts.map +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.d.ts.map +1 -1
- package/src/utils.d.ts +3 -1
- package/src/utils.d.ts.map +1 -1
- package/src/zerodev/types.d.ts +4 -3
- package/src/zerodev/types.d.ts.map +1 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { EIP7702Authorization, GetEVMSponsoredTransactionStatusResponse, GetEVMSponsoredTransactionStatusResponseStatusEnum, SponsorEVMTransactionRequest } from '@dynamic-labs-wallet/core';
|
|
2
|
+
import type { ServerKeyShare, TraceContext, WalletMetadata } from '@dynamic-labs-wallet/node';
|
|
3
|
+
import type { Hex } from 'viem';
|
|
4
|
+
/**
|
|
5
|
+
* The only thing the gasless intent builder needs to know about a wallet, so a
|
|
6
|
+
* caller holding just an address (delegated access) can drive the same code as
|
|
7
|
+
* one holding full `WalletMetadata`.
|
|
8
|
+
*/
|
|
9
|
+
export type GaslessWalletRef = {
|
|
10
|
+
accountAddress: string;
|
|
11
|
+
};
|
|
12
|
+
/** A single call within a sponsored transaction batch. */
|
|
13
|
+
export type SponsoredTransactionCall = {
|
|
14
|
+
/** Hex-encoded calldata to execute on the target. */
|
|
15
|
+
data: Hex;
|
|
16
|
+
/** Target contract address. */
|
|
17
|
+
target: Hex;
|
|
18
|
+
/** Amount of native token (in wei) to send with the call. */
|
|
19
|
+
value: bigint;
|
|
20
|
+
};
|
|
21
|
+
/** Serialized EIP-7702 authorization for JSON transport. */
|
|
22
|
+
export type SerializedAuthorization = EIP7702Authorization & {
|
|
23
|
+
/** Contract address to delegate to. */
|
|
24
|
+
address: Hex;
|
|
25
|
+
/** ECDSA signature r component. */
|
|
26
|
+
r: Hex;
|
|
27
|
+
/** ECDSA signature s component. */
|
|
28
|
+
s: Hex;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Lifecycle status of a sponsored transaction relay request.
|
|
32
|
+
*
|
|
33
|
+
* - `pending`: accepted by the relayer, not yet broadcast to the chain.
|
|
34
|
+
* - `submitted`: broadcasted to the chain, waiting for confirmation.
|
|
35
|
+
* - `success`: finalized successfully on-chain.
|
|
36
|
+
* - `failure`: terminal failure.
|
|
37
|
+
*/
|
|
38
|
+
export type SponsoredTransactionStatus = `${GetEVMSponsoredTransactionStatusResponseStatusEnum}`;
|
|
39
|
+
/** Uses public status literals and Hex hashes instead of the generated enum and string. */
|
|
40
|
+
export type SponsoredTransactionStatusResult = Omit<GetEVMSponsoredTransactionStatusResponse, 'status'> & {
|
|
41
|
+
/** Current relay state for the request. */
|
|
42
|
+
status: SponsoredTransactionStatus;
|
|
43
|
+
/** On-chain transaction hash once the relay has broadcast / confirmed it. */
|
|
44
|
+
transactionHash?: Hex;
|
|
45
|
+
};
|
|
46
|
+
/** The signed payload ready to be sent to the sponsorship API. */
|
|
47
|
+
export type SignedSponsoredTransaction = Omit<SponsorEVMTransactionRequest, 'calls' | 'userId'> & {
|
|
48
|
+
/** EIP-7702 authorization for delegation, if needed. */
|
|
49
|
+
authorization?: SerializedAuthorization;
|
|
50
|
+
/** The batch of calls to execute. */
|
|
51
|
+
calls: SponsoredTransactionCall[];
|
|
52
|
+
/** The relayer address signed in the EIP-712 intent. */
|
|
53
|
+
relayer: Hex;
|
|
54
|
+
/** EIP-712 signature over the AuthorizedExecutions typed data. */
|
|
55
|
+
signature: Hex;
|
|
56
|
+
/** The user's wallet address. */
|
|
57
|
+
walletAddress: Hex;
|
|
58
|
+
};
|
|
59
|
+
/** Parameters for `is7702DelegationActive`. */
|
|
60
|
+
export type Is7702DelegationActiveParams = {
|
|
61
|
+
/** Target chain ID. */
|
|
62
|
+
chainId: number;
|
|
63
|
+
/** RPC URL used to read the wallet's on-chain code. */
|
|
64
|
+
rpcUrl: string;
|
|
65
|
+
/** The wallet address to check delegation for. */
|
|
66
|
+
walletAddress: Hex;
|
|
67
|
+
};
|
|
68
|
+
/** Parameters for `sign7702Authorization`. */
|
|
69
|
+
export type Sign7702AuthorizationParams<TWallet extends GaslessWalletRef = WalletMetadata> = {
|
|
70
|
+
/** Target chain ID. */
|
|
71
|
+
chainId: number;
|
|
72
|
+
/** Optional externally supplied server key shares. */
|
|
73
|
+
externalServerKeyShares?: ServerKeyShare[];
|
|
74
|
+
/** EOA nonce; fetched from the chain via `rpcUrl` when omitted. */
|
|
75
|
+
nonce?: number;
|
|
76
|
+
/** Optional password protecting the key. */
|
|
77
|
+
password?: string;
|
|
78
|
+
/** RPC URL used to fetch the EOA nonce when `nonce` is omitted. */
|
|
79
|
+
rpcUrl?: string;
|
|
80
|
+
/** Metadata for the wallet signing the authorization. */
|
|
81
|
+
walletMetadata: TWallet;
|
|
82
|
+
};
|
|
83
|
+
/** Parameters for `getAvailableEvmGaslessRelayer`. */
|
|
84
|
+
export type GetAvailableEvmGaslessRelayerParams = {
|
|
85
|
+
/** Target chain ID. */
|
|
86
|
+
chainId: number;
|
|
87
|
+
/** Optional trace context for request correlation. */
|
|
88
|
+
traceContext?: TraceContext;
|
|
89
|
+
};
|
|
90
|
+
/** Parameters for `signSponsoredTransaction`. */
|
|
91
|
+
export type SignSponsoredTransactionParams<TWallet extends GaslessWalletRef = WalletMetadata> = {
|
|
92
|
+
/** Pre-signed EIP-7702 authorization; resolved automatically when omitted. */
|
|
93
|
+
authorization?: SerializedAuthorization;
|
|
94
|
+
/** When true, auto-sign a 7702 authorization if the wallet is not yet delegated. */
|
|
95
|
+
autoDelegate?: boolean;
|
|
96
|
+
/** The batch of calls to execute. */
|
|
97
|
+
calls: SponsoredTransactionCall[];
|
|
98
|
+
/** Target chain ID. */
|
|
99
|
+
chainId: number;
|
|
100
|
+
/** Optional externally supplied server key shares. */
|
|
101
|
+
externalServerKeyShares?: ServerKeyShare[];
|
|
102
|
+
/** Explicit bitmap nonce; a random unused one is generated when omitted. */
|
|
103
|
+
nonce?: bigint;
|
|
104
|
+
/** Optional password protecting the key. */
|
|
105
|
+
password?: string;
|
|
106
|
+
/** RPC URL used for delegation checks and nonce validation. */
|
|
107
|
+
rpcUrl?: string;
|
|
108
|
+
/** Optional trace context for request correlation. */
|
|
109
|
+
traceContext?: TraceContext;
|
|
110
|
+
/** Intent validity window in seconds. */
|
|
111
|
+
validForSeconds?: number;
|
|
112
|
+
/** Metadata for the wallet signing the transaction. */
|
|
113
|
+
walletMetadata: TWallet;
|
|
114
|
+
};
|
|
115
|
+
/** Parameters for `getEVMSponsoredTransactionStatus`. */
|
|
116
|
+
export type GetEVMSponsoredTransactionStatusParams = {
|
|
117
|
+
/** The relay request id returned by `relaySponsoredTransaction`. */
|
|
118
|
+
requestId: string;
|
|
119
|
+
/** Optional trace context for request correlation. */
|
|
120
|
+
traceContext?: TraceContext;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Parameters for `relaySponsoredTransaction` / `sendSponsoredTransaction`: either a pre-signed
|
|
124
|
+
* transaction or the inputs to sign one, optionally relayed on behalf of an end user.
|
|
125
|
+
*/
|
|
126
|
+
export type RelaySponsoredTransactionParams<TWallet extends GaslessWalletRef = WalletMetadata> = {
|
|
127
|
+
/** A previously signed sponsored transaction. */
|
|
128
|
+
signedTransaction: SignedSponsoredTransaction;
|
|
129
|
+
/** Optional trace context for request correlation. */
|
|
130
|
+
traceContext?: TraceContext;
|
|
131
|
+
/** Relay on behalf of this end user; omit to relay as the authenticated service user. */
|
|
132
|
+
userId?: string;
|
|
133
|
+
} | (SignSponsoredTransactionParams<TWallet> & {
|
|
134
|
+
/** Relay on behalf of this end user; omit to relay as the authenticated service user. */
|
|
135
|
+
userId?: string;
|
|
136
|
+
});
|
|
137
|
+
/** Parameters for `waitForSponsoredTransaction`. */
|
|
138
|
+
export type WaitForSponsoredTransactionParams = {
|
|
139
|
+
/** Poll interval in milliseconds. */
|
|
140
|
+
pollInterval?: number;
|
|
141
|
+
/** The relay request id to poll. */
|
|
142
|
+
requestId: string;
|
|
143
|
+
/** Overall timeout in milliseconds before giving up. */
|
|
144
|
+
timeout?: number;
|
|
145
|
+
/** Optional trace context for request correlation. */
|
|
146
|
+
traceContext?: TraceContext;
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=gasless.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gasless.types.d.ts","sourceRoot":"","sources":["../../src/client/gasless.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,wCAAwC,EACxC,kDAAkD,EAClD,4BAA4B,EAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC9F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;I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AE,OAAO,CAAC;CACzB,CAAC;AAEF,yDAAyD;AACzD,MAAM,MAAM,sCAAsC,GAAG;IACnD,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,+BAA+B,CAAC,OAAO,SAAS,gBAAgB,GAAG,cAAc,IACzF;IACE,iDAAiD;IACjD,iBAAiB,EAAE,0BAA0B,CAAC;IAC9C,sDAAsD;IACtD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,yFAAyF;IACzF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD,CAAC,8BAA8B,CAAC,OAAO,CAAC,GAAG;IACzC,yFAAyF;IACzF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEP,oDAAoD;AACpD,MAAM,MAAM,iCAAiC,GAAG;IAC9C,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC"}
|
package/src/client/index.d.ts
CHANGED
|
@@ -2,4 +2,10 @@ export * from './accountAdapter.js';
|
|
|
2
2
|
export * from './client.js';
|
|
3
3
|
export * from './constants.js';
|
|
4
4
|
export * from '../utils.js';
|
|
5
|
+
export { createEvmEarnClient } from './earn.client.js';
|
|
6
|
+
export type { EvmEarnClientDeps } from './earn.client.js';
|
|
7
|
+
export type { ClaimEarnRewardsParams, DepositToEarnVaultParams, EarnExecutionStep, EarnTransactionResult, EvmEarnWalletParams, ExecuteEarnTransactionParams, WithdrawFromEarnVaultParams, } from './earn.types.js';
|
|
8
|
+
export { ERROR_EARN_APPROVAL_FAILED, ERROR_EARN_CHAIN_MISMATCH, ERROR_EARN_CHAIN_REQUIRED, ERROR_EARN_MISSING_EVM_TRANSACTION, ERROR_EARN_NOT_EVM_WALLET, } from './earn.constants.js';
|
|
9
|
+
export type { GaslessWalletRef, SerializedAuthorization, SignedSponsoredTransaction, SponsoredTransactionCall, SponsoredTransactionStatus, SponsoredTransactionStatusResult, } from './gasless.types.js';
|
|
10
|
+
export { AUTHORIZED_EXECUTIONS_TYPES, BATCH_CALL_OPDATA_AUTH_MODE, DEFAULT_VALID_FOR_SECONDS, DELEGATION_CODE_PREFIX, DELEGATION_CONTRACT_ADDRESS, ERROR_GASLESS_MISSING_REQUEST_ID, ERROR_GASLESS_MISSING_YPARITY, ERROR_GASLESS_RELAY_FAILED, ERROR_GASLESS_RPC_REQUIRED, ERROR_GASLESS_RPC_REQUIRED_FOR_AUTO_DELEGATE, ERROR_GASLESS_TIMEOUT, EVM_GASLESS_DEFAULT_POLL_INTERVAL_MS, EVM_GASLESS_DEFAULT_TIMEOUT_MS, UGD_ABI, } from './gasless.constants.js';
|
|
5
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,YAAY,EACV,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,kCAAkC,EAClC,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,EAC1B,4CAA4C,EAC5C,qBAAqB,EACrB,oCAAoC,EACpC,8BAA8B,EAC9B,OAAO,GACR,MAAM,wBAAwB,CAAC"}
|
package/src/delegatedClient.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { SignMessageContext } from '@dynamic-labs-wallet/core';
|
|
2
|
+
import type { DelegatedWalletClient, RawSignPreImage, ServerKeyShare } from '@dynamic-labs-wallet/node';
|
|
3
3
|
import { type TransactionSerializable, type TypedData } from 'viem';
|
|
4
4
|
export type DelegatedEvmClientConfig = {
|
|
5
5
|
environmentId: string;
|
|
@@ -7,6 +7,8 @@ export type DelegatedEvmClientConfig = {
|
|
|
7
7
|
baseMPCRelayApiUrl?: string;
|
|
8
8
|
apiKey: string;
|
|
9
9
|
debug?: boolean;
|
|
10
|
+
/** @default true — see `CoreConfig.errorLogging` */
|
|
11
|
+
errorLogging?: boolean;
|
|
10
12
|
};
|
|
11
13
|
export type DelegatedEvmWalletClient = DelegatedWalletClient & {
|
|
12
14
|
readonly chainName: 'EVM';
|
|
@@ -14,59 +16,114 @@ export type DelegatedEvmWalletClient = DelegatedWalletClient & {
|
|
|
14
16
|
/**
|
|
15
17
|
* Creates a delegated EVM wallet client for functional operations
|
|
16
18
|
*/
|
|
17
|
-
export declare const createDelegatedEvmWalletClient: ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug, }: DelegatedEvmClientConfig) => DelegatedEvmWalletClient;
|
|
19
|
+
export declare const createDelegatedEvmWalletClient: ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug, errorLogging, }: DelegatedEvmClientConfig) => DelegatedEvmWalletClient;
|
|
18
20
|
/**
|
|
19
21
|
* Signs a message using delegated signing for EVM
|
|
20
22
|
*/
|
|
21
|
-
export declare const delegatedSignMessage: (client: DelegatedEvmWalletClient, { walletId, walletApiKey, keyShare, message, context, onError, }: {
|
|
23
|
+
export declare const delegatedSignMessage: (client: DelegatedEvmWalletClient, { walletId, shareSetId, walletApiKey, keyShare, message, derivationPath, context, onError, }: {
|
|
22
24
|
walletId: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional. The `shareSetId` from the `wallet.delegation.created`
|
|
27
|
+
* webhook payload — a `WaasWallets.id`. NOT `keyShares[].id` from
|
|
28
|
+
* `byWalletAddress` (that's a `WalletKeyShares.id`, a different
|
|
29
|
+
* primary key). Omit and the server resolves the right share set
|
|
30
|
+
* by walletId + shareSetType.
|
|
31
|
+
*/
|
|
32
|
+
shareSetId?: string;
|
|
23
33
|
walletApiKey: string;
|
|
24
34
|
keyShare: ServerKeyShare;
|
|
25
35
|
message: string;
|
|
36
|
+
derivationPath?: Uint32Array;
|
|
26
37
|
context?: SignMessageContext;
|
|
27
38
|
onError?: (error: Error) => void;
|
|
28
39
|
}) => Promise<string>;
|
|
29
40
|
/**
|
|
30
41
|
* Signs a transaction using delegated signing for EVM
|
|
31
42
|
*/
|
|
32
|
-
export declare const delegatedSignTransaction: (client: DelegatedEvmWalletClient, { walletId, walletApiKey, keyShare, transaction, }: {
|
|
43
|
+
export declare const delegatedSignTransaction: (client: DelegatedEvmWalletClient, { walletId, shareSetId, walletApiKey, keyShare, transaction, derivationPath, context, onError, }: {
|
|
33
44
|
walletId: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional. The `shareSetId` from the `wallet.delegation.created`
|
|
47
|
+
* webhook payload — a `WaasWallets.id`. NOT `keyShares[].id` from
|
|
48
|
+
* `byWalletAddress` (that's a `WalletKeyShares.id`, a different
|
|
49
|
+
* primary key). Omit and the server resolves the right share set
|
|
50
|
+
* by walletId + shareSetType.
|
|
51
|
+
*/
|
|
52
|
+
shareSetId?: string;
|
|
34
53
|
walletApiKey: string;
|
|
35
54
|
keyShare: ServerKeyShare;
|
|
36
55
|
transaction: TransactionSerializable;
|
|
56
|
+
derivationPath?: Uint32Array;
|
|
57
|
+
context?: SignMessageContext;
|
|
58
|
+
onError?: (error: Error) => void;
|
|
37
59
|
}) => Promise<string>;
|
|
38
60
|
/**
|
|
39
61
|
* Signs typed data using delegated signing for EVM
|
|
40
62
|
*/
|
|
41
|
-
export declare const delegatedSignTypedData: (client: DelegatedEvmWalletClient, { walletId, walletApiKey, keyShare, typedData, }: {
|
|
63
|
+
export declare const delegatedSignTypedData: (client: DelegatedEvmWalletClient, { walletId, shareSetId, walletApiKey, keyShare, typedData, derivationPath, onError, }: {
|
|
42
64
|
walletId: string;
|
|
65
|
+
/**
|
|
66
|
+
* Optional. The `shareSetId` from the `wallet.delegation.created`
|
|
67
|
+
* webhook payload — a `WaasWallets.id`. NOT `keyShares[].id` from
|
|
68
|
+
* `byWalletAddress` (that's a `WalletKeyShares.id`, a different
|
|
69
|
+
* primary key). Omit and the server resolves the right share set
|
|
70
|
+
* by walletId + shareSetType.
|
|
71
|
+
*/
|
|
72
|
+
shareSetId?: string;
|
|
43
73
|
walletApiKey: string;
|
|
44
74
|
keyShare: ServerKeyShare;
|
|
45
75
|
typedData: TypedData;
|
|
76
|
+
derivationPath?: Uint32Array;
|
|
77
|
+
onError?: (error: Error) => void;
|
|
46
78
|
}) => Promise<string>;
|
|
47
79
|
/**
|
|
48
80
|
* Signs EIP-7702 authorization using delegated signing for EVM
|
|
49
81
|
*/
|
|
50
|
-
export declare const delegatedSignAuthorization: (client: DelegatedEvmWalletClient, { walletId, walletApiKey, keyShare, authorization, }: {
|
|
82
|
+
export declare const delegatedSignAuthorization: (client: DelegatedEvmWalletClient, { walletId, shareSetId, walletApiKey, keyShare, authorization, derivationPath, onError, }: {
|
|
51
83
|
walletId: string;
|
|
84
|
+
/**
|
|
85
|
+
* Optional. The `shareSetId` from the `wallet.delegation.created`
|
|
86
|
+
* webhook payload — a `WaasWallets.id`. NOT `keyShares[].id` from
|
|
87
|
+
* `byWalletAddress` (that's a `WalletKeyShares.id`, a different
|
|
88
|
+
* primary key). Omit and the server resolves the right share set
|
|
89
|
+
* by walletId + shareSetType.
|
|
90
|
+
*/
|
|
91
|
+
shareSetId?: string;
|
|
52
92
|
walletApiKey: string;
|
|
53
93
|
keyShare: ServerKeyShare;
|
|
54
94
|
authorization: any;
|
|
95
|
+
derivationPath?: Uint32Array;
|
|
96
|
+
onError?: (error: Error) => void;
|
|
55
97
|
}) => Promise<any>;
|
|
56
98
|
/**
|
|
57
99
|
* Signs a pre-formatted (raw) message using delegated signing for EVM.
|
|
58
100
|
* The message must be a hex string representing already-hashed data.
|
|
101
|
+
*
|
|
102
|
+
* Provide either `rawSign` — the pre-image the digest comes from — or an
|
|
103
|
+
* explicit `context`, so a policy-enabled wallet can evaluate the request.
|
|
59
104
|
*/
|
|
60
|
-
export declare const delegatedSignRawMessage: (client: DelegatedEvmWalletClient, { walletId, walletApiKey, keyShare, message, context, onError, }: {
|
|
105
|
+
export declare const delegatedSignRawMessage: (client: DelegatedEvmWalletClient, { walletId, shareSetId, walletApiKey, keyShare, message, derivationPath, context, rawSign, onError, }: {
|
|
61
106
|
walletId: string;
|
|
107
|
+
/**
|
|
108
|
+
* Optional. The `shareSetId` from the `wallet.delegation.created`
|
|
109
|
+
* webhook payload — a `WaasWallets.id`. NOT `keyShares[].id` from
|
|
110
|
+
* `byWalletAddress` (that's a `WalletKeyShares.id`, a different
|
|
111
|
+
* primary key). Omit and the server resolves the right share set
|
|
112
|
+
* by walletId + shareSetType.
|
|
113
|
+
*/
|
|
114
|
+
shareSetId?: string;
|
|
62
115
|
walletApiKey: string;
|
|
63
116
|
keyShare: ServerKeyShare;
|
|
64
117
|
message: string;
|
|
118
|
+
derivationPath?: Uint32Array;
|
|
65
119
|
context?: SignMessageContext;
|
|
120
|
+
rawSign?: RawSignPreImage;
|
|
66
121
|
onError?: (error: Error) => void;
|
|
67
122
|
}) => Promise<string>;
|
|
68
123
|
/**
|
|
69
124
|
* Revoke delegation - delegates to the node package
|
|
70
125
|
*/
|
|
71
|
-
export declare const revokeDelegation: (client: DelegatedEvmWalletClient,
|
|
126
|
+
export declare const revokeDelegation: (client: DelegatedEvmWalletClient, { walletId }: {
|
|
127
|
+
walletId: string;
|
|
128
|
+
}) => Promise<void>;
|
|
72
129
|
//# sourceMappingURL=delegatedClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegatedClient.d.ts","sourceRoot":"","sources":["../../packages/src/delegatedClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"delegatedClient.d.ts","sourceRoot":"","sources":["../../packages/src/delegatedClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAkB,eAAe,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAUxH,OAAO,EAAwC,KAAK,uBAAuB,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AAM1G,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oDAAoD;IACpD,YAAY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, type TraceContext } from '@dynamic-labs-wallet/node';
|
|
2
|
+
import { type Hex } from 'viem';
|
|
3
|
+
import type { SerializedAuthorization, SignedSponsoredTransaction, SponsoredTransactionCall } from './client/gasless.types.js';
|
|
4
|
+
import { type DelegatedEvmWalletClient } from './delegatedClient.js';
|
|
5
|
+
export declare const ERROR_DELEGATED_GASLESS_CREDENTIALS_REQUIRED = "Delegated key share, wallet ID, and wallet API key are required to sponsor a transaction";
|
|
6
|
+
export declare const ERROR_DELEGATED_GASLESS_USER_ID_REQUIRED = "userId is required \u2014 a delegated wallet is always owned by an end user, so a sponsored transaction cannot be attributed to the calling service";
|
|
7
|
+
/** Identifies the delegated wallet and its owner for a sponsored transaction. */
|
|
8
|
+
export type DelegatedGaslessWallet = {
|
|
9
|
+
/** The wallet's delegated key share, decrypted from `encryptedDelegatedShare`. */
|
|
10
|
+
keyShare: ServerKeyShare;
|
|
11
|
+
/**
|
|
12
|
+
* Optional. The `shareSetId` from the `wallet.delegation.created`
|
|
13
|
+
* webhook payload — a `WaasWallets.id`. NOT `keyShares[].id` from
|
|
14
|
+
* `byWalletAddress` (that's a `WalletKeyShares.id`, a different
|
|
15
|
+
* primary key). Omit and the server resolves the right share set
|
|
16
|
+
* by walletId + shareSetType.
|
|
17
|
+
*/
|
|
18
|
+
shareSetId?: string;
|
|
19
|
+
/** UUID of the end user who owns this wallet — the `userId` field of the webhook payload. */
|
|
20
|
+
userId: string;
|
|
21
|
+
/** The wallet's EOA address — the `publicKey` field of the webhook payload. */
|
|
22
|
+
walletAddress: Hex;
|
|
23
|
+
/** The wallet's API key, decrypted from `encryptedWalletApiKey`. */
|
|
24
|
+
walletApiKey: string;
|
|
25
|
+
/** The `walletId` from the `wallet.delegation.created` webhook payload. */
|
|
26
|
+
walletId: string;
|
|
27
|
+
/** Receives server-side errors (e.g. policy denials) emitted after `room_created`. */
|
|
28
|
+
onError?: (error: Error) => void;
|
|
29
|
+
};
|
|
30
|
+
/** Parameters for `delegatedSign7702Authorization`. */
|
|
31
|
+
export type DelegatedSign7702AuthorizationParams = DelegatedGaslessWallet & {
|
|
32
|
+
/** Target chain ID. */
|
|
33
|
+
chainId: number;
|
|
34
|
+
/** EOA nonce; fetched from the chain via `rpcUrl` when omitted. */
|
|
35
|
+
nonce?: number;
|
|
36
|
+
/** RPC URL used to fetch the EOA nonce when `nonce` is omitted. */
|
|
37
|
+
rpcUrl?: string;
|
|
38
|
+
};
|
|
39
|
+
/** Parameters for `delegatedSignSponsoredTransaction` / `delegatedSendSponsoredTransaction`. */
|
|
40
|
+
export type DelegatedSignSponsoredTransactionParams = DelegatedGaslessWallet & {
|
|
41
|
+
/** Pre-signed EIP-7702 authorization; resolved automatically when omitted. */
|
|
42
|
+
authorization?: SerializedAuthorization;
|
|
43
|
+
/** When true, auto-sign a 7702 authorization if the wallet is not yet delegated. */
|
|
44
|
+
autoDelegate?: boolean;
|
|
45
|
+
/** The batch of calls to execute. */
|
|
46
|
+
calls: SponsoredTransactionCall[];
|
|
47
|
+
/** Target chain ID. */
|
|
48
|
+
chainId: number;
|
|
49
|
+
/** Explicit bitmap nonce; a random unused one is generated when omitted. */
|
|
50
|
+
nonce?: bigint;
|
|
51
|
+
/** RPC URL used for delegation checks and nonce validation. */
|
|
52
|
+
rpcUrl?: string;
|
|
53
|
+
/** Optional trace context for request correlation. */
|
|
54
|
+
traceContext?: TraceContext;
|
|
55
|
+
/** Intent validity window in seconds. */
|
|
56
|
+
validForSeconds?: number;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Signs an EIP-7702 authorization delegating the end user's EOA to the UGD
|
|
60
|
+
* contract, using the customer-held key share.
|
|
61
|
+
*/
|
|
62
|
+
export declare const delegatedSign7702Authorization: (client: DelegatedEvmWalletClient, params: DelegatedSign7702AuthorizationParams) => Promise<SerializedAuthorization>;
|
|
63
|
+
/**
|
|
64
|
+
* Signs the EIP-712 AuthorizedExecutions intent for a batch of calls, resolving
|
|
65
|
+
* a first-use 7702 authorization along the way when the wallet is not yet delegated.
|
|
66
|
+
*
|
|
67
|
+
* The returned payload can be relayed later with `sendSponsoredTransaction` on a
|
|
68
|
+
* `DynamicEvmWalletClient`, which needs no key share to submit an already-signed intent.
|
|
69
|
+
*/
|
|
70
|
+
export declare const delegatedSignSponsoredTransaction: (client: DelegatedEvmWalletClient, params: DelegatedSignSponsoredTransactionParams) => Promise<SignedSponsoredTransaction>;
|
|
71
|
+
/**
|
|
72
|
+
* Signs, relays, and waits for a sponsored transaction on behalf of the wallet's
|
|
73
|
+
* owner, resolving once the relayer reports an on-chain hash.
|
|
74
|
+
*/
|
|
75
|
+
export declare const delegatedSendSponsoredTransaction: (client: DelegatedEvmWalletClient, params: DelegatedSignSponsoredTransactionParams) => Promise<{
|
|
76
|
+
transactionHash: Hex;
|
|
77
|
+
}>;
|
|
78
|
+
//# sourceMappingURL=delegatedGasless.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegatedGasless.d.ts","sourceRoot":"","sources":["../../packages/src/delegatedGasless.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAwC,KAAK,GAAG,EAAqB,MAAM,MAAM,CAAC;AAEzF,OAAO,KAAK,EAEV,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,sBAAsB,CAAC;AAI9B,eAAO,MAAM,4CAA4C,6FACmC,CAAC;AAE7F,eAAO,MAAM,wCAAwC,wJAC6F,CAAC;AAEnJ,iFAAiF;AACjF,MAAM,MAAM,sBAAsB,GAAG;IACnC,kFAAkF;IAClF,QAAQ,EAAE,cAAc,CAAC;IACzB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6FAA6F;IAC7F,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IA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E,eAAe,EAAE,GAAG,CAAA;CAAE,CA8BlC,CAAC"}
|
package/src/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './client/index.js';
|
|
2
2
|
export * from './delegatedClient.js';
|
|
3
|
+
export { delegatedSendSponsoredTransaction, delegatedSign7702Authorization, delegatedSignSponsoredTransaction, ERROR_DELEGATED_GASLESS_CREDENTIALS_REQUIRED, ERROR_DELEGATED_GASLESS_USER_ID_REQUIRED, type DelegatedGaslessWallet, type DelegatedSign7702AuthorizationParams, type DelegatedSignSponsoredTransactionParams, } from './delegatedGasless.js';
|
|
3
4
|
export * from './zerodev/index.js';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,iCAAiC,EACjC,8BAA8B,EAC9B,iCAAiC,EACjC,4CAA4C,EAC5C,wCAAwC,EACxC,KAAK,sBAAsB,EAC3B,KAAK,oCAAoC,EACzC,KAAK,uCAAuC,GAC7C,MAAM,uBAAuB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
package/src/utils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { SignMessageEvmTransaction } from '@dynamic-labs-wallet/core';
|
|
1
2
|
import { type EcdsaPublicKey, type EcdsaSignature } from '@dynamic-labs-wallet/node';
|
|
2
|
-
import { type TypedData } from 'viem';
|
|
3
|
+
import { type TransactionSerializable, type TypedData } from 'viem';
|
|
4
|
+
export declare const mapTransactionToEvmTransaction: (transaction: TransactionSerializable) => SignMessageEvmTransaction;
|
|
3
5
|
export declare const formatEVMMessage: (message_: string | {
|
|
4
6
|
raw: string | Uint8Array;
|
|
5
7
|
}) => `0x${string}`;
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAe,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAe,MAAM,2BAA2B,CAAC;AAElG,OAAO,EASL,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EAEf,MAAM,MAAM,CAAC;AAGd,eAAO,MAAM,8BAA8B,gBAAiB,uBAAuB,KAAG,yBAYpF,CAAC;AAEH,eAAO,MAAM,gBAAgB,aAAc,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,kBAQ/E,CAAC;AAEF,eAAO,MAAM,eAAe,cAAe,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,WA6BhF,CAAC;AAEF,eAAO,MAAM,uBAAuB,cAAe,cAAc,kBAMhE,CAAC;AAEF,eAAO,MAAM,oBAAoB,qBAAsB;IAAE,YAAY,EAAE,cAAc,CAAA;CAAE;;;CAQtF,CAAC"}
|
package/src/zerodev/types.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ZerodevBundlerProvider } from '@dynamic-labs-wallet/core';
|
|
2
|
+
import type { ServerKeyShare, WalletMetadata } from '@dynamic-labs-wallet/node';
|
|
3
3
|
import type { KernelAccountClient } from '@zerodev/sdk';
|
|
4
4
|
import type { Chain, Client, Hex, RpcSchema, Transport } from 'viem';
|
|
5
5
|
import type { SmartAccount } from 'viem/account-abstraction';
|
|
6
6
|
import type { DynamicEvmWalletClient } from '../client/client.js';
|
|
7
7
|
import type { createDelegatedEvmWalletClient, DelegatedEvmWalletClient } from '../delegatedClient.js';
|
|
8
8
|
export type ZeroDevKernelOptions = {
|
|
9
|
-
|
|
9
|
+
walletMetadata: WalletMetadata;
|
|
10
10
|
networkId: string;
|
|
11
11
|
password?: string;
|
|
12
12
|
externalServerKeyShares?: ServerKeyShare[];
|
|
13
13
|
delegated?: {
|
|
14
14
|
delegatedClient: ReturnType<typeof createDelegatedEvmWalletClient>;
|
|
15
15
|
walletId: string;
|
|
16
|
+
shareSetId: string;
|
|
16
17
|
walletApiKey: string;
|
|
17
18
|
keyShare: ServerKeyShare;
|
|
18
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/zerodev/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/zerodev/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KA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