@rhinestone/sdk 1.0.0-alpha.2 → 1.0.0-alpha.21
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/custom.d.ts +18 -0
- package/dist/src/accounts/custom.d.ts.map +1 -0
- package/dist/src/accounts/custom.js +121 -0
- package/dist/src/accounts/custom.test.d.ts +2 -0
- package/dist/src/accounts/custom.test.d.ts.map +1 -0
- package/dist/src/accounts/custom.test.js +64 -0
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +2 -0
- package/dist/src/accounts/index.d.ts +22 -13
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +192 -186
- package/dist/src/accounts/index.test.js +3 -3
- package/dist/src/accounts/json-rpc/index.d.ts +5 -0
- package/dist/src/accounts/json-rpc/index.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/index.js +16 -0
- package/dist/src/accounts/json-rpc/index.test.d.ts +2 -0
- package/dist/src/accounts/json-rpc/index.test.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/index.test.js +16 -0
- package/dist/src/accounts/json-rpc/providers.d.ts +4 -0
- package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/providers.js +14 -0
- package/dist/src/accounts/json-rpc/providers.test.d.ts +2 -0
- package/dist/src/accounts/json-rpc/providers.test.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/providers.test.js +15 -0
- package/dist/src/accounts/kernel.d.ts +9 -10
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +3 -14
- package/dist/src/accounts/kernel.test.js +10 -15
- package/dist/src/accounts/nexus.d.ts +14 -13
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +121 -93
- package/dist/src/accounts/nexus.test.js +13 -14
- package/dist/src/accounts/safe.d.ts +5 -7
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +25 -35
- package/dist/src/accounts/safe.test.js +9 -10
- package/dist/src/accounts/signing/common.d.ts +27 -0
- package/dist/src/accounts/signing/common.d.ts.map +1 -0
- package/dist/src/accounts/signing/common.js +142 -0
- package/dist/src/accounts/signing/message.d.ts +5 -0
- package/dist/src/accounts/signing/message.d.ts.map +1 -0
- package/dist/src/accounts/signing/message.js +47 -0
- package/dist/src/accounts/signing/passkeys.d.ts +29 -0
- package/dist/src/accounts/signing/passkeys.d.ts.map +1 -0
- package/dist/src/accounts/signing/passkeys.js +90 -0
- package/dist/src/accounts/signing/passkeys.test.d.ts +2 -0
- package/dist/src/accounts/signing/passkeys.test.d.ts.map +1 -0
- package/dist/src/accounts/signing/passkeys.test.js +73 -0
- package/dist/src/accounts/signing/typedData.d.ts +5 -0
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -0
- package/dist/src/accounts/signing/typedData.js +35 -0
- package/dist/src/accounts/startale.d.ts +20 -0
- package/dist/src/accounts/startale.d.ts.map +1 -0
- package/dist/src/accounts/startale.js +100 -0
- package/dist/src/accounts/startale.test.d.ts +2 -0
- package/dist/src/accounts/startale.test.d.ts.map +1 -0
- package/dist/src/accounts/startale.test.js +96 -0
- package/dist/src/accounts/utils.d.ts +2 -1
- package/dist/src/accounts/utils.d.ts.map +1 -1
- package/dist/src/accounts/utils.js +7 -0
- package/dist/src/actions/index.d.ts +145 -7
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +373 -23
- package/dist/src/actions/index.test.js +35 -17
- package/dist/src/actions/smart-session.d.ts +8 -2
- package/dist/src/actions/smart-session.d.ts.map +1 -1
- package/dist/src/actions/smart-session.js +6 -0
- package/dist/src/execution/compact.d.ts +130 -3
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +94 -1
- package/dist/src/execution/error.d.ts +2 -9
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +4 -13
- package/dist/src/execution/index.d.ts +3 -4
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +35 -80
- package/dist/src/execution/smart-session.d.ts +1 -1
- package/dist/src/execution/smart-session.d.ts.map +1 -1
- package/dist/src/execution/smart-session.js +12 -17
- package/dist/src/execution/utils.d.ts +19 -14
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +222 -97
- package/dist/src/index.d.ts +17 -15
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +108 -21
- package/dist/src/modules/index.d.ts +3 -22
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +5 -65
- package/dist/src/modules/index.test.js +3 -17
- package/dist/src/modules/omni-account.d.ts +2 -4
- package/dist/src/modules/omni-account.d.ts.map +1 -1
- package/dist/src/modules/omni-account.js +4 -8
- package/dist/src/modules/read.d.ts +5 -6
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +7 -37
- package/dist/src/modules/validators/core.d.ts +8 -8
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +126 -42
- package/dist/src/modules/validators/core.test.js +7 -7
- package/dist/src/modules/validators/smart-sessions.d.ts +3 -3
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +10 -9
- package/dist/src/modules/validators/smart-sessions.test.js +4 -4
- package/dist/src/orchestrator/client.d.ts +5 -3
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +159 -95
- package/dist/src/orchestrator/consts.d.ts +3 -2
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +4 -2
- package/dist/src/orchestrator/index.d.ts +3 -4
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +1 -9
- package/dist/src/orchestrator/registry.d.ts +10 -13
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +75 -395
- package/dist/src/orchestrator/registry.test.d.ts.map +1 -0
- package/dist/src/orchestrator/registry.test.js +137 -0
- package/dist/src/orchestrator/types.d.ts +78 -16
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/utils.d.ts +1 -3
- package/dist/src/orchestrator/utils.d.ts.map +1 -1
- package/dist/src/orchestrator/utils.js +0 -102
- package/dist/src/types.d.ts +69 -26
- package/dist/src/types.d.ts.map +1 -1
- package/dist/test/consts.d.ts +2 -2
- package/dist/test/consts.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/src/actions/registry.d.ts +0 -7
- package/dist/src/actions/registry.d.ts.map +0 -1
- package/dist/src/actions/registry.js +0 -7
- package/dist/src/actions/registry.test.d.ts.map +0 -1
- package/dist/src/actions/registry.test.js +0 -25
- package/dist/src/modules/registry.d.ts +0 -13
- package/dist/src/modules/registry.d.ts.map +0 -1
- package/dist/src/modules/registry.js +0 -67
- /package/dist/src/{actions → orchestrator}/registry.test.d.ts +0 -0
|
@@ -1,15 +1,10 @@
|
|
|
1
|
+
import type { SupportedChain, SupportedMainnet, SupportedOPStackMainnet, SupportedOPStackTestnet, SupportedTestnet } from '@rhinestone/shared-configs';
|
|
1
2
|
import type { Address, Hex } from 'viem';
|
|
2
|
-
import { UserOperationReceipt } from 'viem/account-abstraction';
|
|
3
|
-
import type { arbitrum, arbitrumSepolia, base, baseSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, sepolia, zksync } from 'viem/chains';
|
|
4
|
-
type SupportedTestnet = typeof sepolia.id | typeof baseSepolia.id | typeof arbitrumSepolia.id | typeof optimismSepolia.id | typeof polygonAmoy.id;
|
|
5
|
-
type SupportedMainnet = typeof mainnet.id | typeof base.id | typeof arbitrum.id | typeof optimism.id | typeof polygon.id | typeof zksync.id;
|
|
6
|
-
type SupportedOPStackMainnet = typeof optimism.id | typeof base.id;
|
|
7
|
-
type SupportedOPStackTestnet = typeof optimismSepolia.id | typeof baseSepolia.id;
|
|
8
|
-
type SupportedChain = SupportedMainnet | SupportedTestnet;
|
|
3
|
+
import type { UserOperationReceipt } from 'viem/account-abstraction';
|
|
9
4
|
type SupportedTokenSymbol = 'ETH' | 'WETH' | 'USDC' | 'USDT';
|
|
10
5
|
type SupportedToken = SupportedTokenSymbol | Address;
|
|
11
|
-
type
|
|
12
|
-
type AccountStatus = 'NOT_DEPLOYED' |
|
|
6
|
+
type SmartAccountType = 'GENERIC' | 'ERC7579';
|
|
7
|
+
type AccountStatus = 'NOT_DEPLOYED' | SmartAccountType;
|
|
13
8
|
declare const INTENT_STATUS_PENDING = "PENDING";
|
|
14
9
|
declare const INTENT_STATUS_FAILED = "FAILED";
|
|
15
10
|
declare const INTENT_STATUS_EXPIRED = "EXPIRED";
|
|
@@ -46,6 +41,17 @@ interface Execution {
|
|
|
46
41
|
value: bigint;
|
|
47
42
|
data: Hex;
|
|
48
43
|
}
|
|
44
|
+
type SettlementLayer = 'SAME_CHAIN' | 'ACROSS' | 'ECO';
|
|
45
|
+
interface IntentOptions {
|
|
46
|
+
topupCompact: boolean;
|
|
47
|
+
sponsorSettings?: SponsorSettings;
|
|
48
|
+
settlementLayers?: SettlementLayer[];
|
|
49
|
+
}
|
|
50
|
+
interface SponsorSettings {
|
|
51
|
+
gasSponsored: boolean;
|
|
52
|
+
bridgeFeesSponsored: boolean;
|
|
53
|
+
swapFeesSponsored: boolean;
|
|
54
|
+
}
|
|
49
55
|
interface PortfolioToken {
|
|
50
56
|
symbol: string;
|
|
51
57
|
decimals: number;
|
|
@@ -64,7 +70,17 @@ interface PortfolioToken {
|
|
|
64
70
|
}
|
|
65
71
|
type Portfolio = PortfolioToken[];
|
|
66
72
|
interface IntentInput {
|
|
67
|
-
account:
|
|
73
|
+
account: {
|
|
74
|
+
address: Address;
|
|
75
|
+
accountType: SmartAccountType;
|
|
76
|
+
setupOps: {
|
|
77
|
+
to: Address;
|
|
78
|
+
data: Hex;
|
|
79
|
+
}[];
|
|
80
|
+
delegations?: Record<number, {
|
|
81
|
+
contract: Address;
|
|
82
|
+
}>;
|
|
83
|
+
};
|
|
68
84
|
destinationChainId: number;
|
|
69
85
|
destinationExecutions: Execution[];
|
|
70
86
|
destinationGasUnits?: bigint;
|
|
@@ -73,9 +89,7 @@ interface IntentInput {
|
|
|
73
89
|
amount?: bigint;
|
|
74
90
|
}[];
|
|
75
91
|
accountAccessList?: AccountAccessList;
|
|
76
|
-
|
|
77
|
-
accountType: DeployedAccountStatus;
|
|
78
|
-
};
|
|
92
|
+
options: IntentOptions;
|
|
79
93
|
}
|
|
80
94
|
type SettlementSystem = 'SAME_CHAIN' | 'ACROSS';
|
|
81
95
|
interface IntentCost {
|
|
@@ -103,7 +117,7 @@ interface IntentOpElement {
|
|
|
103
117
|
chainId: string;
|
|
104
118
|
idsAndAmounts: [[string, string]];
|
|
105
119
|
beforeFill: boolean;
|
|
106
|
-
smartAccountStatus:
|
|
120
|
+
smartAccountStatus: SmartAccountType;
|
|
107
121
|
mandate: {
|
|
108
122
|
recipient: Address;
|
|
109
123
|
tokenOut: [[string, string]];
|
|
@@ -124,7 +138,7 @@ interface IntentOp {
|
|
|
124
138
|
elements: IntentOpElement[];
|
|
125
139
|
serverSignature: string;
|
|
126
140
|
signedMetadata: {
|
|
127
|
-
quotes: unknown
|
|
141
|
+
quotes: Record<Address, unknown[]>;
|
|
128
142
|
tokenPrices: Record<string, number>;
|
|
129
143
|
opGasParams: Record<string, {
|
|
130
144
|
l1BaseFee: string;
|
|
@@ -135,8 +149,49 @@ interface IntentOp {
|
|
|
135
149
|
estimatedCalldataSize: number;
|
|
136
150
|
};
|
|
137
151
|
gasPrices: Record<string, string>;
|
|
152
|
+
account: AccountWithContext;
|
|
138
153
|
};
|
|
139
154
|
}
|
|
155
|
+
interface Account {
|
|
156
|
+
address: Address;
|
|
157
|
+
accountType: SmartAccountType;
|
|
158
|
+
setupOps: Pick<Execution, 'to' | 'data'>[];
|
|
159
|
+
delegations?: Delegations;
|
|
160
|
+
emissaryConfig?: EmissarySetupConfig;
|
|
161
|
+
}
|
|
162
|
+
type AccountWithContext = Omit<Account, 'delegations'> & {
|
|
163
|
+
accountContext: {
|
|
164
|
+
[chainId: number]: AccountStatus;
|
|
165
|
+
};
|
|
166
|
+
requiredDelegations?: Delegations;
|
|
167
|
+
};
|
|
168
|
+
interface Delegation {
|
|
169
|
+
contract: Address;
|
|
170
|
+
}
|
|
171
|
+
type Delegations = Record<number, Delegation>;
|
|
172
|
+
interface EmissarySetupConfig {
|
|
173
|
+
configId: number;
|
|
174
|
+
validatorAddress: Address;
|
|
175
|
+
emissaryAddress: Address;
|
|
176
|
+
emissaryConfig: EmissaryConfig;
|
|
177
|
+
emissaryEnable: EmissaryEnable;
|
|
178
|
+
}
|
|
179
|
+
interface EmissaryConfig {
|
|
180
|
+
configId: number;
|
|
181
|
+
allocator: Address;
|
|
182
|
+
scope: number;
|
|
183
|
+
resetPeriod: number;
|
|
184
|
+
validator: Address;
|
|
185
|
+
validatorConfig: Hex;
|
|
186
|
+
}
|
|
187
|
+
interface EmissaryEnable {
|
|
188
|
+
allocatorSig: Hex;
|
|
189
|
+
userSig: Hex;
|
|
190
|
+
expires: bigint;
|
|
191
|
+
nonce: bigint;
|
|
192
|
+
allChainIds: bigint[];
|
|
193
|
+
chainIndex: bigint;
|
|
194
|
+
}
|
|
140
195
|
interface IntentRoute {
|
|
141
196
|
intentOp: IntentOp;
|
|
142
197
|
intentCost: IntentCost;
|
|
@@ -150,12 +205,19 @@ interface IntentResult {
|
|
|
150
205
|
type SignedIntentOp = IntentOp & {
|
|
151
206
|
originSignatures: Hex[];
|
|
152
207
|
destinationSignature: Hex;
|
|
208
|
+
signedAuthorizations?: readonly {
|
|
209
|
+
chainId: number;
|
|
210
|
+
address: Address;
|
|
211
|
+
nonce: number;
|
|
212
|
+
yParity: number;
|
|
213
|
+
r: Hex;
|
|
214
|
+
s: Hex;
|
|
215
|
+
}[];
|
|
153
216
|
};
|
|
154
217
|
interface TokenConfig {
|
|
155
218
|
symbol: string;
|
|
156
219
|
address: Address;
|
|
157
220
|
decimals: number;
|
|
158
|
-
balanceSlot: (address: Address) => Hex;
|
|
159
221
|
}
|
|
160
222
|
export type TokenPrices = {
|
|
161
223
|
[key in SupportedTokenSymbol]?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../orchestrator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../orchestrator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAEpE,KAAK,oBAAoB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAC5D,KAAK,cAAc,GAAG,oBAAoB,GAAG,OAAO,CAAA;AAEpD,KAAK,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAA;AAC7C,KAAK,aAAa,GAAG,cAAc,GAAG,gBAAgB,CAAA;AAEtD,QAAA,MAAM,qBAAqB,YAAY,CAAA;AACvC,QAAA,MAAM,oBAAoB,WAAW,CAAA;AACrC,QAAA,MAAM,qBAAqB,YAAY,CAAA;AACvC,QAAA,MAAM,iCAAiC,wBAAwB,CAAA;AAC/D,QAAA,MAAM,uBAAuB,cAAc,CAAA;AAC3C,QAAA,MAAM,oBAAoB,WAAW,CAAA;AACrC,QAAA,MAAM,0BAA0B,iBAAiB,CAAA;AACjD,QAAA,MAAM,qBAAqB,YAAY,CAAA;AAEvC,KAAK,YAAY,GACb,OAAO,qBAAqB,GAC5B,OAAO,qBAAqB,GAC5B,OA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AU,cAAc;IACtB,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,GAAG,CAAA;IACzB,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,QAAQ,CAAA;IACd,OAAO,EAAE,oBAAoB,CAAA;CAC9B;AAED,UAAU,2BAA2B;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,aAAa,CAAA;IAC5B,YAAY,EAAE,OAAO,CAAA;IACrB,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;CACF;AAED,UAAU,sBAAsB;IAC9B,SAAS,EAAE,KAAK,CAAA;IAChB,aAAa,EAAE,EAAE,CAAA;IACjB,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,iBAAiB,EAAE,2BAA2B,EAAE,CAAA;CACjD;AAED,KAAK,iBAAiB,GAAG,sBAAsB,EAAE,CAAA;AAEjD,YAAY,EACV,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,SAAS,EACT,cAAc,GACf,CAAA;AACD,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,GACtB,CAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { IntentOp } from './types';
|
|
2
|
-
declare function getIntentOpHash(intentOp: IntentOp): `0x${string}`;
|
|
3
1
|
declare function convertBigIntFields(obj: any): any;
|
|
4
|
-
export {
|
|
2
|
+
export { convertBigIntFields };
|
|
5
3
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../orchestrator/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../orchestrator/utils.ts"],"names":[],"mappings":"AAAA,iBAAS,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAwB1C;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -1,108 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getIntentOpHash = getIntentOpHash;
|
|
4
3
|
exports.convertBigIntFields = convertBigIntFields;
|
|
5
|
-
const viem_1 = require("viem");
|
|
6
|
-
function getClaimProofer(settlementSystem) {
|
|
7
|
-
switch (settlementSystem) {
|
|
8
|
-
case 'ACROSS':
|
|
9
|
-
return '0x1990c54b361C42e23E90d60Eb84071b50b04bE4a';
|
|
10
|
-
case 'SAME_CHAIN':
|
|
11
|
-
return viem_1.zeroAddress;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function getIntentOpHash(intentOp) {
|
|
15
|
-
const notarizedChainElement = intentOp.elements[0];
|
|
16
|
-
const settlementSystem = notarizedChainElement.mandate.qualifier.settlementSystem;
|
|
17
|
-
const claimProofer = getClaimProofer(settlementSystem);
|
|
18
|
-
return (0, viem_1.hashTypedData)({
|
|
19
|
-
domain: {
|
|
20
|
-
name: 'The Compact',
|
|
21
|
-
version: '1',
|
|
22
|
-
chainId: BigInt(notarizedChainElement.chainId),
|
|
23
|
-
verifyingContract: '0xa2E6C7Ba8613E1534dCB990e7e4962216C0a5d58',
|
|
24
|
-
},
|
|
25
|
-
types: {
|
|
26
|
-
MultichainCompact: [
|
|
27
|
-
{ name: 'sponsor', type: 'address' },
|
|
28
|
-
{ name: 'nonce', type: 'uint256' },
|
|
29
|
-
{ name: 'expires', type: 'uint256' },
|
|
30
|
-
{ name: 'elements', type: 'Element[]' },
|
|
31
|
-
],
|
|
32
|
-
Element: [
|
|
33
|
-
{ name: 'arbiter', type: 'address' },
|
|
34
|
-
{ name: 'chainId', type: 'uint256' },
|
|
35
|
-
{ name: 'commitments', type: 'Lock[]' },
|
|
36
|
-
{ name: 'mandate', type: 'Mandate' },
|
|
37
|
-
],
|
|
38
|
-
Lock: [
|
|
39
|
-
{ name: 'lockTag', type: 'bytes12' },
|
|
40
|
-
{ name: 'token', type: 'address' },
|
|
41
|
-
{ name: 'amount', type: 'uint256' },
|
|
42
|
-
],
|
|
43
|
-
Mandate: [
|
|
44
|
-
{ name: 'target', type: 'Target' },
|
|
45
|
-
{ name: 'originOps', type: 'Op[]' },
|
|
46
|
-
{ name: 'destOps', type: 'Op[]' },
|
|
47
|
-
{ name: 'q', type: 'bytes32' },
|
|
48
|
-
],
|
|
49
|
-
Target: [
|
|
50
|
-
{ name: 'recipient', type: 'address' },
|
|
51
|
-
{ name: 'tokenOut', type: 'Token[]' },
|
|
52
|
-
{ name: 'targetChain', type: 'uint256' },
|
|
53
|
-
{ name: 'fillExpiry', type: 'uint256' },
|
|
54
|
-
{ name: 'claimProofer', type: 'address' },
|
|
55
|
-
],
|
|
56
|
-
Token: [
|
|
57
|
-
{ name: 'token', type: 'address' },
|
|
58
|
-
{ name: 'amount', type: 'uint256' },
|
|
59
|
-
],
|
|
60
|
-
Op: [
|
|
61
|
-
{ name: 'to', type: 'address' },
|
|
62
|
-
{ name: 'value', type: 'uint256' },
|
|
63
|
-
{ name: 'data', type: 'bytes' },
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
primaryType: 'MultichainCompact',
|
|
67
|
-
message: {
|
|
68
|
-
sponsor: intentOp.sponsor,
|
|
69
|
-
nonce: BigInt(intentOp.nonce),
|
|
70
|
-
expires: BigInt(intentOp.expires),
|
|
71
|
-
elements: intentOp.elements.map((element) => ({
|
|
72
|
-
arbiter: element.arbiter,
|
|
73
|
-
chainId: BigInt(element.chainId),
|
|
74
|
-
commitments: element.idsAndAmounts.map((token) => ({
|
|
75
|
-
lockTag: (0, viem_1.slice)((0, viem_1.toHex)(BigInt(token[0])), 0, 12),
|
|
76
|
-
token: (0, viem_1.slice)((0, viem_1.toHex)(BigInt(token[0])), 12, 32),
|
|
77
|
-
amount: BigInt(token[1]),
|
|
78
|
-
})),
|
|
79
|
-
mandate: {
|
|
80
|
-
target: {
|
|
81
|
-
recipient: element.mandate.recipient,
|
|
82
|
-
tokenOut: element.mandate.tokenOut.map((token) => ({
|
|
83
|
-
token: (0, viem_1.slice)((0, viem_1.toHex)(BigInt(token[0])), 12, 32),
|
|
84
|
-
amount: BigInt(token[1]),
|
|
85
|
-
})),
|
|
86
|
-
targetChain: BigInt(element.mandate.destinationChainId),
|
|
87
|
-
fillExpiry: BigInt(element.mandate.fillDeadline),
|
|
88
|
-
claimProofer: claimProofer,
|
|
89
|
-
},
|
|
90
|
-
originOps: element.mandate.preClaimOps.map((op) => ({
|
|
91
|
-
to: op.to,
|
|
92
|
-
value: BigInt(op.value),
|
|
93
|
-
data: op.data,
|
|
94
|
-
})),
|
|
95
|
-
destOps: element.mandate.destinationOps.map((op) => ({
|
|
96
|
-
to: op.to,
|
|
97
|
-
value: BigInt(op.value),
|
|
98
|
-
data: op.data,
|
|
99
|
-
})),
|
|
100
|
-
q: (0, viem_1.keccak256)(element.mandate.qualifier?.encodedVal ?? '0x'),
|
|
101
|
-
},
|
|
102
|
-
})),
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
4
|
function convertBigIntFields(obj) {
|
|
107
5
|
if (obj === null || obj === undefined) {
|
|
108
6
|
return obj;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,28 +1,54 @@
|
|
|
1
1
|
import type { Account, Address, Chain, Hex } from 'viem';
|
|
2
2
|
import type { WebAuthnAccount } from 'viem/account-abstraction';
|
|
3
|
-
import {
|
|
4
|
-
type
|
|
3
|
+
import type { ValidatorConfig } from './accounts/utils';
|
|
4
|
+
import type { Module } from './modules/common';
|
|
5
|
+
import type { EnableSessionData } from './modules/validators/smart-sessions';
|
|
6
|
+
type AccountType = 'safe' | 'nexus' | 'kernel' | 'startale' | 'custom';
|
|
5
7
|
interface AccountProviderConfig {
|
|
6
8
|
type: AccountType;
|
|
9
|
+
custom?: CustomAccountProviderConfig;
|
|
10
|
+
}
|
|
11
|
+
interface CustomAccountProviderConfig {
|
|
12
|
+
getDeployArgs: () => {
|
|
13
|
+
factory: Address;
|
|
14
|
+
factoryData: Hex;
|
|
15
|
+
};
|
|
16
|
+
getInstallData: (module: Module) => Hex[];
|
|
17
|
+
getAddress: () => Address;
|
|
18
|
+
getPackedSignature: (signature: Hex, validator: ValidatorConfig, transformSignature: (signature: Hex) => Hex) => Promise<Hex>;
|
|
19
|
+
getSessionStubSignature: (session: Session, enableData: EnableSessionData | null) => Promise<Hex>;
|
|
20
|
+
signSessionUserOperation: (session: Session, enableData: EnableSessionData | null, hash: Hex) => Promise<Hex>;
|
|
21
|
+
getStubSignature: () => Promise<Hex>;
|
|
22
|
+
sign: (hash: Hex) => Promise<Hex>;
|
|
7
23
|
}
|
|
8
24
|
interface OwnableValidatorConfig {
|
|
9
|
-
type: 'ecdsa';
|
|
25
|
+
type: 'ecdsa' | 'ecdsa-v0';
|
|
10
26
|
accounts: Account[];
|
|
11
27
|
threshold?: number;
|
|
12
28
|
}
|
|
13
29
|
interface WebauthnValidatorConfig {
|
|
14
30
|
type: 'passkey';
|
|
15
|
-
|
|
31
|
+
accounts: WebAuthnAccount[];
|
|
32
|
+
threshold?: number;
|
|
33
|
+
}
|
|
34
|
+
interface MultiFactorValidatorConfig {
|
|
35
|
+
type: 'multi-factor';
|
|
36
|
+
validators: (OwnableValidatorConfig | WebauthnValidatorConfig)[];
|
|
37
|
+
threshold?: number;
|
|
38
|
+
}
|
|
39
|
+
interface ProviderConfig {
|
|
40
|
+
type: 'alchemy';
|
|
41
|
+
apiKey: string;
|
|
16
42
|
}
|
|
17
43
|
interface BundlerConfig {
|
|
18
|
-
type: 'pimlico';
|
|
44
|
+
type: 'pimlico' | 'biconomy';
|
|
19
45
|
apiKey: string;
|
|
20
46
|
}
|
|
21
47
|
interface PaymasterConfig {
|
|
22
|
-
type: 'pimlico';
|
|
48
|
+
type: 'pimlico' | 'biconomy';
|
|
23
49
|
apiKey: string;
|
|
24
50
|
}
|
|
25
|
-
type OwnerSet = OwnableValidatorConfig | WebauthnValidatorConfig;
|
|
51
|
+
type OwnerSet = OwnableValidatorConfig | WebauthnValidatorConfig | MultiFactorValidatorConfig;
|
|
26
52
|
interface SudoPolicy {
|
|
27
53
|
type: 'sudo';
|
|
28
54
|
}
|
|
@@ -78,39 +104,54 @@ interface Recovery {
|
|
|
78
104
|
interface RhinestoneAccountConfig {
|
|
79
105
|
account?: AccountProviderConfig;
|
|
80
106
|
owners: OwnerSet;
|
|
81
|
-
rhinestoneApiKey
|
|
82
|
-
deployerAccount?: Account;
|
|
107
|
+
rhinestoneApiKey?: string;
|
|
83
108
|
sessions?: Session[];
|
|
84
109
|
recovery?: Recovery;
|
|
85
110
|
eoa?: Account;
|
|
86
|
-
provider?:
|
|
87
|
-
type: 'alchemy';
|
|
88
|
-
apiKey: string;
|
|
89
|
-
};
|
|
111
|
+
provider?: ProviderConfig;
|
|
90
112
|
bundler?: BundlerConfig;
|
|
91
113
|
paymaster?: PaymasterConfig;
|
|
114
|
+
/**
|
|
115
|
+
* @internal
|
|
116
|
+
* For internal testing only - do not use
|
|
117
|
+
*/
|
|
118
|
+
useDev?: boolean;
|
|
119
|
+
}
|
|
120
|
+
type TokenSymbol = 'ETH' | 'WETH' | 'USDC' | 'USDT';
|
|
121
|
+
interface CallInput {
|
|
122
|
+
to: Address | TokenSymbol;
|
|
123
|
+
data?: Hex;
|
|
124
|
+
value?: bigint;
|
|
92
125
|
}
|
|
93
126
|
interface Call {
|
|
94
127
|
to: Address;
|
|
95
|
-
data
|
|
96
|
-
value
|
|
128
|
+
data: Hex;
|
|
129
|
+
value: bigint;
|
|
97
130
|
}
|
|
98
|
-
/**
|
|
99
|
-
* @deprecated Use the `Call` type instead.
|
|
100
|
-
*/
|
|
101
|
-
type Execution = Call;
|
|
102
131
|
interface TokenRequest {
|
|
103
|
-
address: Address;
|
|
132
|
+
address: Address | TokenSymbol;
|
|
104
133
|
amount: bigint;
|
|
105
134
|
}
|
|
106
135
|
type OwnerSignerSet = {
|
|
107
136
|
type: 'owner';
|
|
108
|
-
kind: 'ecdsa';
|
|
137
|
+
kind: 'ecdsa' | 'ecdsa-v0';
|
|
109
138
|
accounts: Account[];
|
|
110
139
|
} | {
|
|
111
140
|
type: 'owner';
|
|
112
141
|
kind: 'passkey';
|
|
113
|
-
|
|
142
|
+
accounts: WebAuthnAccount[];
|
|
143
|
+
} | {
|
|
144
|
+
type: 'owner';
|
|
145
|
+
kind: 'multi-factor';
|
|
146
|
+
validators: ({
|
|
147
|
+
type: 'ecdsa' | 'ecdsa-v0';
|
|
148
|
+
id: number | Hex;
|
|
149
|
+
accounts: Account[];
|
|
150
|
+
} | {
|
|
151
|
+
type: 'passkey';
|
|
152
|
+
id: number | Hex;
|
|
153
|
+
accounts: WebAuthnAccount[];
|
|
154
|
+
})[];
|
|
114
155
|
};
|
|
115
156
|
interface SessionSignerSet {
|
|
116
157
|
type: 'session';
|
|
@@ -123,18 +164,20 @@ interface GuardiansSignerSet {
|
|
|
123
164
|
}
|
|
124
165
|
type SignerSet = OwnerSignerSet | SessionSignerSet | GuardiansSignerSet;
|
|
125
166
|
interface BaseTransaction {
|
|
126
|
-
calls:
|
|
127
|
-
tokenRequests
|
|
167
|
+
calls: CallInput[];
|
|
168
|
+
tokenRequests?: TokenRequest[];
|
|
128
169
|
gasLimit?: bigint;
|
|
129
170
|
signers?: SignerSet;
|
|
171
|
+
sponsored?: boolean;
|
|
172
|
+
eip7702InitSignature?: Hex;
|
|
130
173
|
}
|
|
131
174
|
interface SameChainTransaction extends BaseTransaction {
|
|
132
175
|
chain: Chain;
|
|
133
176
|
}
|
|
134
177
|
interface CrossChainTransaction extends BaseTransaction {
|
|
135
|
-
|
|
178
|
+
sourceChains?: Chain[];
|
|
136
179
|
targetChain: Chain;
|
|
137
180
|
}
|
|
138
181
|
type Transaction = SameChainTransaction | CrossChainTransaction;
|
|
139
|
-
export type { AccountType, RhinestoneAccountConfig, AccountProviderConfig, BundlerConfig, PaymasterConfig, Transaction,
|
|
182
|
+
export type { AccountType, RhinestoneAccountConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, TokenSymbol, CallInput, Call, TokenRequest, OwnerSet, OwnableValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, Session, Recovery, Policy, UniversalActionPolicyParamCondition, };
|
|
140
183
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CA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IAC1B,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,EAAE,OAAO,EAAE,CAAA;CACrB;AAED,KAAK,SAAS,GAAG,cAAc,GAAG,gBAAgB,GAAG,kBAAkB,CAAA;AAEvE,UAAU,eAAe;IACvB,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,oBAAoB,CAAC,EAAE,GAAG,CAAA;CAC3B;AAED,UAAU,oBAAqB,SAAQ,eAAe;IACpD,KAAK,EAAE,KAAK,CAAA;CACb;AAED,UAAU,qBAAsB,SAAQ,eAAe;IACrD,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;IACtB,WAAW,EAAE,KAAK,CAAA;CACnB;AAED,KAAK,WAAW,GAAG,oBAAoB,GAAG,qBAAqB,CAAA;AAE/D,YAAY,EACV,WAAW,EACX,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,eAAe,EACf,WAAW,EACX,WAAW,EACX,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,EACN,mCAAmC,GACpC,CAAA"}
|
package/dist/test/consts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WebAuthnAccount } from 'viem/account-abstraction';
|
|
2
|
-
import { Account } from 'viem/accounts';
|
|
1
|
+
import { type WebAuthnAccount } from 'viem/account-abstraction';
|
|
2
|
+
import { type Account } from 'viem/accounts';
|
|
3
3
|
declare const accountA: Account;
|
|
4
4
|
declare const accountB: Account;
|
|
5
5
|
declare const accountC: Account;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../test/consts.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../test/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,OAAO,EAAuB,MAAM,eAAe,CAAA;AAEjE,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,cAAc,EAAE,eAMpB,CAAA;AAEF,QAAA,MAAM,YAAY,aAAa,CAAA;AAE/B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhinestone/sdk",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.21",
|
|
4
4
|
"description": "End-to-end chain abstraction and modularity toolkit",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Rhinestone",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@rhinestone/shared-configs": "1.4.1",
|
|
39
40
|
"axios": "^1.7.0",
|
|
40
41
|
"solady": "^0.1.21"
|
|
41
42
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../actions/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAA;AAGtC,iBAAS,aAAa,CAAC,OAAO,EAAE,iBAAiB;;;EAEhD;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.test.d.ts","sourceRoot":"","sources":["../../../actions/registry.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const vitest_1 = require("vitest");
|
|
4
|
-
const consts_1 = require("../../test/consts");
|
|
5
|
-
const consts_2 = require("../../test/consts");
|
|
6
|
-
const __1 = require("..");
|
|
7
|
-
const registry_1 = require("./registry");
|
|
8
|
-
(0, vitest_1.describe)('Actions', async () => {
|
|
9
|
-
const rhinestoneAccount = await (0, __1.createRhinestoneAccount)({
|
|
10
|
-
owners: {
|
|
11
|
-
type: 'ecdsa',
|
|
12
|
-
accounts: [consts_2.accountA],
|
|
13
|
-
},
|
|
14
|
-
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
15
|
-
});
|
|
16
|
-
(0, vitest_1.describe)('Trust Attester', () => {
|
|
17
|
-
(0, vitest_1.test)('should return the correct call', () => {
|
|
18
|
-
const call = (0, registry_1.trustAttester)(rhinestoneAccount);
|
|
19
|
-
(0, vitest_1.expect)(call).toStrictEqual({
|
|
20
|
-
data: '0xf05c04e1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000333034e9f539ce08819e12c1b8cb29084d0000000000000000000000006d0515e8e499468dce9583626f0ca15b887f9d03',
|
|
21
|
-
to: '0x000000000069e2a187aeffb852bf3ccdc95151b2',
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Address, PublicClient } from 'viem';
|
|
2
|
-
import { RhinestoneAccountConfig } from '../types';
|
|
3
|
-
declare function getAttesters(): {
|
|
4
|
-
list: Address[];
|
|
5
|
-
threshold: number;
|
|
6
|
-
};
|
|
7
|
-
declare function getTrustAttesterCall(config: RhinestoneAccountConfig): {
|
|
8
|
-
to: `0x${string}`;
|
|
9
|
-
data: `0x${string}`;
|
|
10
|
-
};
|
|
11
|
-
declare function getTrustedAttesters(client: PublicClient, account: Address): Promise<readonly Address[]>;
|
|
12
|
-
export { getTrustAttesterCall, getTrustedAttesters, getAttesters };
|
|
13
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../modules/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsB,YAAY,EAAE,MAAM,MAAM,CAAA;AAEhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAQlD,iBAAS,YAAY,IAAI;IACvB,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAKA;AAED,iBAAS,oBAAoB,CAAC,MAAM,EAAE,uBAAuB;;;EA0B5D;AAED,iBAAe,mBAAmB,CAChC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAyB7B;AAED,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,YAAY,EAAE,CAAA"}
|