@rhinestone/sdk 2.0.0-beta.4 → 2.0.0-beta.41
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/dist/src/accounts/error.d.ts +2 -9
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +5 -11
- package/dist/src/accounts/hca.d.ts +25 -0
- package/dist/src/accounts/hca.d.ts.map +1 -0
- package/dist/src/accounts/hca.js +148 -0
- package/dist/src/accounts/index.d.ts +23 -10
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +170 -79
- package/dist/src/accounts/kernel.d.ts +1 -2
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +1 -8
- package/dist/src/accounts/nexus.d.ts +3 -2
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +33 -8
- package/dist/src/accounts/safe.d.ts +1 -2
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +3 -9
- package/dist/src/accounts/signing/common.d.ts +10 -4
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +48 -46
- package/dist/src/accounts/signing/message.d.ts.map +1 -1
- package/dist/src/accounts/signing/message.js +1 -4
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -1
- package/dist/src/accounts/signing/typedData.js +1 -4
- package/dist/src/accounts/startale.d.ts +1 -2
- package/dist/src/accounts/startale.d.ts.map +1 -1
- package/dist/src/accounts/startale.js +6 -9
- package/dist/src/actions/ecdsa.js +5 -5
- package/dist/src/actions/index.js +2 -2
- package/dist/src/actions/mfa.js +2 -2
- package/dist/src/actions/passkeys.js +2 -2
- package/dist/src/actions/smart-sessions.d.ts +29 -5
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +38 -10
- package/dist/src/errors/index.d.ts +6 -4
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +6 -6
- package/dist/src/execution/error.d.ts +42 -11
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +53 -15
- package/dist/src/execution/index.d.ts +18 -18
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +27 -42
- package/dist/src/execution/utils.d.ts +55 -14
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +629 -82
- package/dist/src/index.d.ts +270 -38
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +89 -116
- package/dist/src/jwt-server/jcs.d.ts +1 -1
- package/dist/src/jwt-server/jcs.js +4 -2
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +0 -5
- package/dist/src/modules/read.d.ts +3 -2
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +52 -4
- package/dist/src/modules/validators/core.d.ts +6 -6
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +42 -39
- package/dist/src/modules/validators/cross-chain-permits.d.ts +21 -0
- package/dist/src/modules/validators/cross-chain-permits.d.ts.map +1 -0
- package/dist/src/modules/validators/cross-chain-permits.js +111 -0
- package/dist/src/modules/validators/permissions.d.ts +1 -0
- package/dist/src/modules/validators/permissions.d.ts.map +1 -1
- package/dist/src/modules/validators/permissions.js +192 -18
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts +22 -0
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts.map +1 -0
- package/dist/src/modules/validators/policies/claim/arbiters.js +57 -0
- package/dist/src/modules/validators/smart-sessions.d.ts +38 -9
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +509 -92
- package/dist/src/orchestrator/caip2.d.ts +16 -3
- package/dist/src/orchestrator/caip2.d.ts.map +1 -1
- package/dist/src/orchestrator/caip2.js +38 -6
- package/dist/src/orchestrator/client.d.ts +2 -1
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +50 -24
- package/dist/src/orchestrator/consts.d.ts +1 -1
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +1 -1
- package/dist/src/orchestrator/destinations.d.ts +24 -0
- package/dist/src/orchestrator/destinations.d.ts.map +1 -0
- package/dist/src/orchestrator/destinations.js +59 -0
- package/dist/src/orchestrator/error.d.ts +95 -5
- package/dist/src/orchestrator/error.d.ts.map +1 -1
- package/dist/src/orchestrator/error.js +260 -4
- package/dist/src/orchestrator/index.d.ts +7 -5
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +4 -3
- package/dist/src/orchestrator/registry.d.ts +2 -1
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +13 -0
- package/dist/src/orchestrator/types.d.ts +92 -29
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/types.js +1 -5
- package/dist/src/orchestrator/wire.d.ts +30 -0
- package/dist/src/orchestrator/wire.d.ts.map +1 -0
- package/dist/src/orchestrator/wire.gen.d.ts +4290 -0
- package/dist/src/orchestrator/wire.gen.d.ts.map +1 -0
- package/dist/src/orchestrator/wire.gen.js +1 -0
- package/dist/src/orchestrator/wire.js +1 -0
- package/dist/src/smart-sessions/index.d.ts +6 -0
- package/dist/src/smart-sessions/index.d.ts.map +1 -0
- package/dist/src/smart-sessions/index.js +7 -0
- package/dist/src/types.d.ts +299 -31
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +59 -0
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +59 -0
- package/package.json +5 -9
- package/dist/src/actions/recovery.d.ts +0 -33
- package/dist/src/actions/recovery.d.ts.map +0 -1
- package/dist/src/actions/recovery.js +0 -189
package/dist/src/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { Address, Chain, HashTypedDataParameters, Hex, SignableMessage, SignedAuthorizationList, TypedData, TypedDataDefinition } from 'viem';
|
|
2
2
|
import type { UserOperationReceipt } from 'viem/account-abstraction';
|
|
3
3
|
import { type TransactionResult, type TransactionStatus, type UserOperationResult } from './execution/index.js';
|
|
4
|
-
import { type PreparedQuotes, type PreparedTransactionData, type PreparedUserOperationData, type QuoteSelection, type SignedTransactionData, type SignedUserOperationData } from './execution/utils.js';
|
|
4
|
+
import { type OwnerPasskeySignature, type OwnerSignature, type OwnerSignatureData, type PreparedQuotes, type PreparedTransactionData, type PreparedUserOperationData, type QuoteSelection, type SignAsOwnerOptions, type SignedTransactionData, type SignedUserOperationData } from './execution/utils.js';
|
|
5
5
|
import { MULTI_FACTOR_VALIDATOR_ADDRESS, OWNABLE_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS } from './modules/index.js';
|
|
6
6
|
import { type SessionDetails } from './modules/validators/smart-sessions.js';
|
|
7
|
-
import type { ApprovalRequired, AuxiliaryFunds, BridgeFill, IntentInput, IntentOpStatus, Portfolio, SettlementLayer, SplitIntentsInput, SplitIntentsResult, TokenRequirements, WrapRequired } from './orchestrator/index.js';
|
|
8
|
-
|
|
7
|
+
import type { AppFeeBalances, ApprovalRequired, AuxiliaryFunds, BridgeFill, ChainOperation, DestinationChain, FailureReason, IntentInput, IntentOpStatus, NonEvmAddress, NonEvmChain, OperationStatus, OriginSignature, Portfolio, Quote, SettlementLayer, SettlementLayerFilter, SignData, SplitIntentsInput, SplitIntentsResult, TokenRequirements, WrapRequired } from './orchestrator/index.js';
|
|
8
|
+
export type { AppFeeBalances, AppFeeRate } from './orchestrator/index.js';
|
|
9
|
+
import { hyperCoreMainnet, solanaMainnet, tronMainnet } from './orchestrator/index.js';
|
|
10
|
+
import type { AccountProviderConfig, AccountType, BundlerConfig, Call, CallInput, ChainSessionConfig, CrossChainPermissionInput, CrossChainPermit, CrossChainSettlementLayer, FromLeg, MultiFactorValidatorConfig, NonEvmTokenRequest, NonEvmTokenRequests, OwnableValidatorConfig, OwnerSet, ParamConstraint, PaymasterConfig, Permission, PermissionFunctionConfig, Permit2ClaimPolicy, Policy, ProviderConfig, RhinestoneAccountConfig, RhinestoneSDKConfig, Session, SessionDefinition, SignerSet, SourceCallInput, SourceCallProvidedFunds, TokenRequest, TokenSymbol, ToLeg, Transaction, UniversalActionPolicyParamCondition, UserOperationTransaction, WebauthnValidatorConfig } from './types.js';
|
|
9
11
|
interface SubmitTransactionOptions {
|
|
10
12
|
authorizations?: SignedAuthorizationList;
|
|
11
13
|
/**
|
|
@@ -16,54 +18,242 @@ interface SubmitTransactionOptions {
|
|
|
16
18
|
internal_dryRun?: boolean;
|
|
17
19
|
}
|
|
18
20
|
interface RhinestoneAccount {
|
|
21
|
+
/** The resolved account configuration. */
|
|
19
22
|
config: RhinestoneAccountConfig;
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Deploy the account on a given chain.
|
|
25
|
+
* @param chain Chain to deploy the account on
|
|
26
|
+
* @param params Optional deployment parameters (sponsorship)
|
|
27
|
+
* @returns `true` once the deployment is submitted
|
|
28
|
+
*/
|
|
29
|
+
deploy(chain: Chain, params?: {
|
|
22
30
|
sponsored?: boolean;
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
}): Promise<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Check whether the account is deployed on a given chain.
|
|
34
|
+
* @param chain Chain to check
|
|
35
|
+
* @returns `true` if the account is deployed, `false` otherwise
|
|
36
|
+
*/
|
|
37
|
+
isDeployed(chain: Chain): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Set up an existing account on a given chain by installing any missing modules.
|
|
40
|
+
* @param chain Chain to set the account up on
|
|
41
|
+
* @returns `true` once setup is submitted
|
|
42
|
+
*/
|
|
43
|
+
setup(chain: Chain): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Get the account initialization data, used to deploy the account onchain.
|
|
46
|
+
* @returns The factory address and factory data
|
|
47
|
+
*/
|
|
26
48
|
getInitData(): {
|
|
27
49
|
factory: Address;
|
|
28
50
|
factoryData: Hex;
|
|
29
51
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Prepare and sign the EIP-7702 account initialization data.
|
|
54
|
+
* @returns The init data signature
|
|
55
|
+
*/
|
|
56
|
+
signEip7702InitData(): Promise<Hex>;
|
|
57
|
+
/**
|
|
58
|
+
* Prepare a transaction for signing.
|
|
59
|
+
* @param transaction Transaction to prepare
|
|
60
|
+
* @returns The prepared transaction data
|
|
61
|
+
* @see {@link signTransaction} to sign the prepared transaction
|
|
62
|
+
* @see {@link submitTransaction} to submit the signed transaction
|
|
63
|
+
*/
|
|
64
|
+
prepareTransaction(transaction: Transaction): Promise<PreparedTransactionData>;
|
|
65
|
+
/**
|
|
66
|
+
* Get the typed-data messages to sign for a prepared transaction.
|
|
67
|
+
* @param preparedTransaction Prepared transaction data
|
|
68
|
+
* @param options Optional override; pass `{ intentId }` to inspect a specific quote from `preparedTransaction.quotes.all`
|
|
69
|
+
* @returns The origin, destination, and (when required) target-execution typed-data messages
|
|
70
|
+
* @see {@link prepareTransaction} to prepare the transaction data for signing
|
|
71
|
+
*/
|
|
72
|
+
getTransactionMessages(preparedTransaction: PreparedTransactionData, options?: QuoteSelection): {
|
|
33
73
|
origin: TypedDataDefinition[];
|
|
34
74
|
destination: TypedDataDefinition;
|
|
35
75
|
targetExecution?: TypedDataDefinition;
|
|
36
76
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Sign a prepared transaction as one configured owner. The returned signature
|
|
79
|
+
* can be serialized and shared with the party coordinating submission.
|
|
80
|
+
* @param preparedTransaction Prepared transaction data
|
|
81
|
+
* @param options Owner account, optional quote, and multi-factor validator ID
|
|
82
|
+
* @returns This owner's signature contribution
|
|
83
|
+
* @see {@link prepareTransaction} to prepare the transaction data for signing
|
|
84
|
+
* @see {@link assembleTransaction} to combine independent owner signatures
|
|
85
|
+
*/
|
|
86
|
+
signTransaction(preparedTransaction: PreparedTransactionData, options: SignAsOwnerOptions): Promise<OwnerSignature>;
|
|
87
|
+
/**
|
|
88
|
+
* Sign a prepared transaction with the transaction's configured signers.
|
|
89
|
+
* @param preparedTransaction Prepared transaction data
|
|
90
|
+
* @param options Optional override; pass `{ intentId }` to sign a specific quote from `preparedTransaction.quotes.all`
|
|
91
|
+
* @returns The signed transaction data
|
|
92
|
+
* @see {@link prepareTransaction} to prepare the transaction data for signing
|
|
93
|
+
* @see {@link submitTransaction} to submit the signed transaction
|
|
94
|
+
*/
|
|
95
|
+
signTransaction(preparedTransaction: PreparedTransactionData, options?: QuoteSelection): Promise<SignedTransactionData>;
|
|
96
|
+
/**
|
|
97
|
+
* Assemble independently collected owner signatures into a signed transaction.
|
|
98
|
+
* Signatures are deduplicated and ordered according to the configured owner set.
|
|
99
|
+
* Account thresholds are read from the local configuration; an explicit
|
|
100
|
+
* transaction signer set determines active MFA IDs and contributing owners.
|
|
101
|
+
* Callers must keep these synchronized with onchain owner and threshold changes.
|
|
102
|
+
* @param preparedTransaction The prepared transaction every owner signed
|
|
103
|
+
* @param signatures Owner signatures returned by `signTransaction` with an `owner` option
|
|
104
|
+
* @returns Signed transaction data ready for submission
|
|
105
|
+
* @see {@link signTransaction} to create each owner signature
|
|
106
|
+
* @see {@link submitTransaction} to submit the result
|
|
107
|
+
*/
|
|
108
|
+
assembleTransaction(preparedTransaction: PreparedTransactionData, signatures: OwnerSignature[]): Promise<SignedTransactionData>;
|
|
109
|
+
/**
|
|
110
|
+
* Sign the EIP-7702 authorizations required for a transaction.
|
|
111
|
+
* @param preparedTransaction Prepared transaction data
|
|
112
|
+
* @returns The signed authorization list
|
|
113
|
+
* @see {@link prepareTransaction} to prepare the transaction data for signing
|
|
114
|
+
*/
|
|
115
|
+
signAuthorizations(preparedTransaction: PreparedTransactionData): Promise<SignedAuthorizationList>;
|
|
116
|
+
/**
|
|
117
|
+
* Sign a message (EIP-191).
|
|
118
|
+
* @param message Message to sign
|
|
119
|
+
* @param chain Chain to sign the message for
|
|
120
|
+
* @param signers Signers to use, or `undefined` for the account default
|
|
121
|
+
* @returns The signature
|
|
122
|
+
* @see {@link signTypedData} to sign EIP-712 typed data
|
|
123
|
+
*/
|
|
124
|
+
signMessage(message: SignableMessage, chain: Chain, signers: SignerSet | undefined): Promise<Hex>;
|
|
125
|
+
/**
|
|
126
|
+
* Sign typed data (EIP-712).
|
|
127
|
+
* @param parameters Typed-data parameters
|
|
128
|
+
* @param chain Chain to sign the typed data for
|
|
129
|
+
* @param signers Signers to use, or `undefined` for the account default
|
|
130
|
+
* @returns The signature
|
|
131
|
+
* @see {@link signMessage} to sign an EIP-191 message
|
|
132
|
+
*/
|
|
133
|
+
signTypedData<typedData extends TypedData | Record<string, unknown> = TypedData, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(parameters: HashTypedDataParameters<typedData, primaryType>, chain: Chain, signers: SignerSet | undefined): Promise<Hex>;
|
|
134
|
+
/**
|
|
135
|
+
* Sign an orchestrator intent operation. Used by headless flows that prepare
|
|
136
|
+
* the intent outside the SDK but still need the SDK-owned smart-session
|
|
137
|
+
* signature packing and target-execution signature routing.
|
|
138
|
+
* @param signData Sign data returned by the orchestrator (origin/destination/targetExecution typed data)
|
|
139
|
+
* @param targetChain Chain where the destination execution runs
|
|
140
|
+
* @param signers Signers to use, or `undefined` for the account default
|
|
141
|
+
* @returns The intent signatures, ready for submission
|
|
142
|
+
* @see {@link signTransaction} for the canonical signing path
|
|
143
|
+
*/
|
|
144
|
+
signIntent(signData: SignData, targetChain: DestinationChain, signers?: SignerSet): Promise<SignedIntentData>;
|
|
145
|
+
/**
|
|
146
|
+
* Submit a signed transaction.
|
|
147
|
+
* @param signedTransaction Signed transaction data
|
|
148
|
+
* @param options Optional submission options (e.g. EIP-7702 `authorizations`)
|
|
149
|
+
* @returns The transaction result (an intent ID)
|
|
150
|
+
* @see {@link signTransaction} to sign the transaction data
|
|
151
|
+
* @see {@link signAuthorizations} to sign the required EIP-7702 authorizations
|
|
152
|
+
* @see {@link waitForExecution} to wait for the transaction to execute onchain
|
|
153
|
+
*/
|
|
154
|
+
submitTransaction(signedTransaction: SignedTransactionData, options?: SubmitTransactionOptions): Promise<TransactionResult>;
|
|
155
|
+
/**
|
|
156
|
+
* Prepare a user operation for signing.
|
|
157
|
+
* @param transaction User operation to prepare
|
|
158
|
+
* @returns The prepared user operation data
|
|
159
|
+
* @see {@link signUserOperation} to sign the prepared user operation
|
|
160
|
+
* @see {@link submitUserOperation} to submit the signed user operation
|
|
161
|
+
* @see {@link sendUserOperation} to prepare, sign, and submit in one call
|
|
162
|
+
*/
|
|
163
|
+
prepareUserOperation(transaction: UserOperationTransaction): Promise<PreparedUserOperationData>;
|
|
164
|
+
/**
|
|
165
|
+
* Sign a prepared user operation.
|
|
166
|
+
* @param preparedUserOperation Prepared user operation data
|
|
167
|
+
* @returns The signed user operation data
|
|
168
|
+
* @see {@link prepareUserOperation} to prepare the user operation data for signing
|
|
169
|
+
* @see {@link submitUserOperation} to submit the signed user operation
|
|
170
|
+
*/
|
|
171
|
+
signUserOperation(preparedUserOperation: PreparedUserOperationData): Promise<SignedUserOperationData>;
|
|
172
|
+
/**
|
|
173
|
+
* Submit a signed user operation.
|
|
174
|
+
* @param signedUserOperation Signed user operation data
|
|
175
|
+
* @returns The user operation result (a UserOp hash)
|
|
176
|
+
* @see {@link signUserOperation} to sign the user operation data
|
|
177
|
+
* @see {@link waitForExecution} to wait for the user operation to execute onchain
|
|
178
|
+
*/
|
|
179
|
+
submitUserOperation(signedUserOperation: SignedUserOperationData): Promise<UserOperationResult>;
|
|
180
|
+
/**
|
|
181
|
+
* Prepare, sign, and submit a user operation in a single call.
|
|
182
|
+
* @param transaction User operation to send
|
|
183
|
+
* @returns The user operation result (a UserOp hash)
|
|
184
|
+
* @see {@link waitForExecution} to wait for the user operation to execute onchain
|
|
185
|
+
*/
|
|
186
|
+
sendUserOperation(transaction: UserOperationTransaction): Promise<UserOperationResult>;
|
|
187
|
+
/**
|
|
188
|
+
* Wait for a submitted transaction or user operation to execute onchain.
|
|
189
|
+
* Polls the orchestrator until the intent reaches a terminal state; on failure
|
|
190
|
+
* an `IntentFailedError` is thrown.
|
|
191
|
+
* @param result The result returned by a submit/send call
|
|
192
|
+
* @returns The per-chain operation status (for intents) or a UserOp receipt
|
|
193
|
+
*/
|
|
46
194
|
waitForExecution(result: TransactionResult): Promise<TransactionStatus>;
|
|
47
195
|
waitForExecution(result: UserOperationResult): Promise<UserOperationReceipt>;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Get the account address.
|
|
198
|
+
* @returns The smart account address
|
|
199
|
+
*/
|
|
200
|
+
getAddress(): Address;
|
|
201
|
+
/**
|
|
202
|
+
* Get the account portfolio (token balances across chains).
|
|
203
|
+
* @param onTestnets Whether to query testnet balances (default is `false`)
|
|
204
|
+
* @returns The account balances
|
|
205
|
+
*/
|
|
206
|
+
getPortfolio(onTestnets?: boolean): Promise<Portfolio>;
|
|
207
|
+
/**
|
|
208
|
+
* Resolve the smart-session details for a set of sessions.
|
|
209
|
+
* @param sessions Sessions to resolve
|
|
210
|
+
* @returns The resolved session details
|
|
211
|
+
*/
|
|
212
|
+
experimental_getSessionDetails(sessions: Session[]): Promise<SessionDetails>;
|
|
213
|
+
/**
|
|
214
|
+
* Check whether a smart session is enabled on the account.
|
|
215
|
+
* @param session Session to check
|
|
216
|
+
* @returns `true` if the session is enabled
|
|
217
|
+
*/
|
|
218
|
+
experimental_isSessionEnabled(session: Session): Promise<boolean>;
|
|
219
|
+
/**
|
|
220
|
+
* Sign the data required to enable a smart session.
|
|
221
|
+
* @param details Session details to enable
|
|
222
|
+
* @returns The enable-session signature
|
|
223
|
+
*/
|
|
224
|
+
experimental_signEnableSession(details: SessionDetails): Promise<Hex>;
|
|
225
|
+
/**
|
|
226
|
+
* Get the account owners.
|
|
227
|
+
* @remarks Only returns ECDSA owners; owners managed by other validator types are not included.
|
|
228
|
+
* @param chain Chain to read the owners from
|
|
229
|
+
* @returns The owner addresses and threshold, or `null` if unavailable
|
|
230
|
+
*/
|
|
231
|
+
getOwners(chain: Chain): Promise<{
|
|
54
232
|
accounts: Address[];
|
|
55
233
|
threshold: number;
|
|
56
234
|
} | null>;
|
|
57
|
-
|
|
58
|
-
|
|
235
|
+
/**
|
|
236
|
+
* Get the account validator modules.
|
|
237
|
+
* @param chain Chain to read the validators from
|
|
238
|
+
* @returns The validator module addresses
|
|
239
|
+
*/
|
|
240
|
+
getValidators(chain: Chain): Promise<Address[]>;
|
|
241
|
+
/**
|
|
242
|
+
* Get the account executor modules.
|
|
243
|
+
* @param chain Chain to read the executors from
|
|
244
|
+
* @returns The executor module addresses
|
|
245
|
+
*/
|
|
246
|
+
getExecutors(chain: Chain): Promise<Address[]>;
|
|
247
|
+
}
|
|
248
|
+
interface SignedIntentData {
|
|
249
|
+
originSignatures: OriginSignature[];
|
|
250
|
+
destinationSignature: Hex;
|
|
251
|
+
targetExecutionSignature: Hex | undefined;
|
|
59
252
|
}
|
|
60
253
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @param config Account config (e.g. implementation vendor, owner signers, smart sessions)
|
|
64
|
-
* @returns account
|
|
254
|
+
* Stateful entry point that holds shared configuration (auth, provider, bundler,
|
|
255
|
+
* paymaster) and creates accounts from it.
|
|
65
256
|
*/
|
|
66
|
-
declare function createRhinestoneAccount(config: RhinestoneConfig): Promise<RhinestoneAccount>;
|
|
67
257
|
declare class RhinestoneSDK {
|
|
68
258
|
private authProvider;
|
|
69
259
|
private endpointUrl?;
|
|
@@ -72,13 +262,55 @@ declare class RhinestoneSDK {
|
|
|
72
262
|
private paymaster?;
|
|
73
263
|
private useDevContracts?;
|
|
74
264
|
private headers?;
|
|
265
|
+
/**
|
|
266
|
+
* Create a Rhinestone SDK instance.
|
|
267
|
+
* @param options Shared configuration applied to every account created by this instance
|
|
268
|
+
*/
|
|
75
269
|
constructor(options: RhinestoneSDKConfig);
|
|
270
|
+
/**
|
|
271
|
+
* Create an account using this instance's shared configuration.
|
|
272
|
+
* @param config Per-account configuration (owners, account type, modules, sessions)
|
|
273
|
+
* @returns The account instance
|
|
274
|
+
* @example
|
|
275
|
+
* ```ts
|
|
276
|
+
* import { RhinestoneSDK } from '@rhinestone/sdk'
|
|
277
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
278
|
+
*
|
|
279
|
+
* const owner = privateKeyToAccount('0x...')
|
|
280
|
+
*
|
|
281
|
+
* const sdk = new RhinestoneSDK({
|
|
282
|
+
* auth: { mode: 'apiKey', apiKey: process.env.RHINESTONE_API_KEY! },
|
|
283
|
+
* })
|
|
284
|
+
*
|
|
285
|
+
* const account = await sdk.createAccount({
|
|
286
|
+
* owners: { type: 'ecdsa', accounts: [owner] },
|
|
287
|
+
* })
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
76
290
|
createAccount(config: RhinestoneAccountConfig): Promise<RhinestoneAccount>;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
291
|
+
/**
|
|
292
|
+
* Get the current status of a submitted intent.
|
|
293
|
+
* @param intentId The intent ID returned when the transaction was submitted
|
|
294
|
+
* @returns The intent status
|
|
295
|
+
*/
|
|
296
|
+
getIntentStatus(intentId: string): Promise<TransactionStatus>;
|
|
297
|
+
/**
|
|
298
|
+
* Split a transaction into multiple intents across chains.
|
|
299
|
+
* @param input The intents to split
|
|
300
|
+
* @returns The split-intents result
|
|
301
|
+
*/
|
|
80
302
|
splitIntents(input: SplitIntentsInput): Promise<SplitIntentsResult>;
|
|
303
|
+
/**
|
|
304
|
+
* Get the integrator's accrued app-fee balance, as USD totals.
|
|
305
|
+
*
|
|
306
|
+
* App fees are earned by the integrator identified by this instance's API key
|
|
307
|
+
* (project-scoped, not tied to any account) and valued in USD at the moment
|
|
308
|
+
* each fee is collected, so the balance is not affected by later price
|
|
309
|
+
* movements of the collected tokens.
|
|
310
|
+
* @returns The withdrawable and pending app-fee balances in USD
|
|
311
|
+
*/
|
|
312
|
+
getAppFeeBalances(): Promise<AppFeeBalances>;
|
|
81
313
|
}
|
|
82
|
-
export { RhinestoneSDK,
|
|
83
|
-
export type { RhinestoneAccount, AccountType, RhinestoneAccountConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, TokenSymbol, CallInput, Call, TokenRequest, OwnerSet, OwnableValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, ChainSessionConfig, Session, SessionDefinition,
|
|
314
|
+
export { RhinestoneSDK, hyperCoreMainnet, solanaMainnet, tronMainnet, OWNABLE_VALIDATOR_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS, MULTI_FACTOR_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, };
|
|
315
|
+
export type { RhinestoneAccount, AccountType, RhinestoneAccountConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, TokenSymbol, CallInput, Call, TokenRequest, NonEvmTokenRequest, NonEvmTokenRequests, NonEvmAddress, OwnerSet, OwnableValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, SourceCallInput, SourceCallProvidedFunds, ChainSessionConfig, Session, SessionDefinition, Permission, PermissionFunctionConfig, ParamConstraint, Policy, Permit2ClaimPolicy, CrossChainPermissionInput, CrossChainPermit, FromLeg, ToLeg, CrossChainSettlementLayer, UniversalActionPolicyParamCondition, PreparedQuotes, PreparedTransactionData, Quote, QuoteSelection, SignAsOwnerOptions, SignedTransactionData, TransactionResult, PreparedUserOperationData, SignedUserOperationData, UserOperationResult, AuxiliaryFunds, BridgeFill, DestinationChain, NonEvmChain, IntentInput, IntentOpStatus, SettlementLayer, SettlementLayerFilter, SplitIntentsInput, SplitIntentsResult, Portfolio, TokenRequirements, WrapRequired, ApprovalRequired, OriginSignature, SignData, SignedIntentData, OperationStatus, FailureReason, ChainOperation, OwnerPasskeySignature, OwnerSignature, OwnerSignatureData, };
|
|
84
316
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACpB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAcpE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACpB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAcpE,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAEzB,MAAM,aAAa,CAAA;AACpB,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAG9B,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAS7B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAKL,8BAA8B,EAC9B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