@rhinestone/sdk 2.2.1 → 2.2.5
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/adapters/kernel.d.ts.map +1 -1
- package/dist/src/accounts/adapters/kernel.js +3 -6
- package/dist/src/accounts/adapters/nexus.d.ts.map +1 -1
- package/dist/src/accounts/adapters/nexus.js +3 -6
- package/dist/src/accounts/adapters/safe.d.ts.map +1 -1
- package/dist/src/accounts/adapters/safe.js +7 -5
- package/dist/src/accounts/adapters/shared.d.ts +1 -0
- package/dist/src/accounts/adapters/shared.d.ts.map +1 -1
- package/dist/src/accounts/adapters/shared.js +7 -0
- package/dist/src/accounts/adapters/startale.d.ts.map +1 -1
- package/dist/src/accounts/adapters/startale.js +2 -5
- package/dist/src/accounts/construction.d.ts +1 -1
- package/dist/src/accounts/construction.d.ts.map +1 -1
- package/dist/src/accounts/construction.js +63 -15
- package/dist/src/accounts/deployment.d.ts +13 -1
- package/dist/src/accounts/deployment.d.ts.map +1 -1
- package/dist/src/accounts/deployment.js +11 -0
- package/dist/src/accounts/error.d.ts +8 -1
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +9 -1
- package/dist/src/accounts/passkey-install.d.ts +25 -0
- package/dist/src/accounts/passkey-install.d.ts.map +1 -0
- package/dist/src/accounts/passkey-install.js +105 -0
- package/dist/src/actions/mfa.d.ts +0 -1
- package/dist/src/actions/mfa.d.ts.map +1 -1
- package/dist/src/actions/mfa.js +0 -1
- package/dist/src/actions/passkeys.d.ts +1 -2
- package/dist/src/actions/passkeys.d.ts.map +1 -1
- package/dist/src/actions/passkeys.js +1 -2
- package/dist/src/api/direct-signing.d.ts.map +1 -1
- package/dist/src/api/direct-signing.js +100 -98
- package/dist/src/api/sdk.d.ts +1 -1
- package/dist/src/api/sdk.js +1 -1
- package/dist/src/chains/caip2.d.ts +15 -0
- package/dist/src/chains/caip2.d.ts.map +1 -1
- package/dist/src/chains/caip2.js +34 -6
- package/dist/src/chains/catalog.js +2 -2
- package/dist/src/chains/non-evm.d.ts +4 -3
- package/dist/src/chains/non-evm.d.ts.map +1 -1
- package/dist/src/chains/non-evm.js +17 -4
- package/dist/src/clients/orchestrator/client.js +1 -1
- package/dist/src/clients/orchestrator/mappers.d.ts +4 -3
- package/dist/src/clients/orchestrator/mappers.d.ts.map +1 -1
- package/dist/src/clients/orchestrator/mappers.js +21 -13
- package/dist/src/clients/orchestrator/serialization.d.ts +5 -0
- package/dist/src/clients/orchestrator/serialization.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/serialization.js +11 -0
- package/dist/src/clients/orchestrator/wire.d.ts +15 -0
- package/dist/src/clients/orchestrator/wire.d.ts.map +1 -1
- package/dist/src/clients/orchestrator/wire.gen.d.ts +556 -39
- package/dist/src/clients/orchestrator/wire.gen.d.ts.map +1 -1
- package/dist/src/config/account.d.ts +3 -3
- package/dist/src/errors/index.d.ts +2 -2
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +2 -2
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/modules/validators/ens.d.ts.map +1 -1
- package/dist/src/modules/validators/ens.js +2 -1
- package/dist/src/modules/validators/ordering.d.ts +3 -0
- package/dist/src/modules/validators/ordering.d.ts.map +1 -0
- package/dist/src/modules/validators/ordering.js +11 -0
- package/dist/src/modules/validators/resolve.d.ts +3 -2
- package/dist/src/modules/validators/resolve.d.ts.map +1 -1
- package/dist/src/modules/validators/resolve.js +8 -5
- package/dist/src/modules/validators/webauthn.d.ts +20 -1
- package/dist/src/modules/validators/webauthn.d.ts.map +1 -1
- package/dist/src/modules/validators/webauthn.js +58 -7
- package/dist/src/signing/message.d.ts +2 -0
- package/dist/src/signing/message.d.ts.map +1 -1
- package/dist/src/signing/message.js +1 -1
- package/dist/src/signing/protocols/erc7739.js +1 -8
- package/dist/src/signing/typed-data.d.ts.map +1 -1
- package/dist/src/signing/typed-data.js +5 -10
- package/dist/src/signing/types.d.ts +0 -4
- package/dist/src/signing/types.d.ts.map +1 -1
- package/dist/src/transactions/intents/prepare.d.ts.map +1 -1
- package/dist/src/transactions/intents/prepare.js +16 -3
- package/dist/src/transactions/intents/sessions.d.ts.map +1 -1
- package/dist/src/transactions/intents/sessions.js +12 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { encodePacked, hashMessage,
|
|
1
|
+
import { encodePacked, hashMessage, hashTypedData, pad, } from 'viem';
|
|
2
2
|
import { wrapKernelMessageHash } from '../accounts/adapters/kernel.js';
|
|
3
3
|
import { defineValidator } from '../modules/validators/definition.js';
|
|
4
4
|
import { getPermissionId } from '../modules/validators/smart-sessions/digest.js';
|
|
@@ -8,35 +8,34 @@ import { signAccountMessage } from '../signing/message.js';
|
|
|
8
8
|
import { createValidatorSigningTasks, signingTopology } from '../signing/plan.js';
|
|
9
9
|
import { resolveAccountTypedDataSigning, signAccountTypedData, } from '../signing/typed-data.js';
|
|
10
10
|
export async function signRuntimeMessage(input) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
if (input.session) {
|
|
12
|
+
return signSessionErc1271({
|
|
13
|
+
runtime: input.runtime,
|
|
14
|
+
signerInvoker: input.signerInvoker,
|
|
15
|
+
checkpoints: input.checkpoints,
|
|
16
|
+
chain: input.chain,
|
|
17
|
+
session: input.session,
|
|
18
|
+
contentHash: hashMessage(input.message),
|
|
19
|
+
nominalMessage: input.message,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
14
22
|
const context = createAccountSigningContext({
|
|
15
23
|
runtime: input.runtime,
|
|
16
24
|
purpose: 'erc1271',
|
|
17
25
|
signerInvoker: input.signerInvoker,
|
|
18
|
-
...(selection ? { selection } : {}),
|
|
26
|
+
...(input.selection ? { selection: input.selection } : {}),
|
|
19
27
|
});
|
|
20
|
-
const topology = signingTopology(context.validator, selection?.signerIds);
|
|
28
|
+
const topology = signingTopology(context.validator, input.selection?.signerIds);
|
|
21
29
|
const payload = hashMessage(input.message);
|
|
22
30
|
const accountHash = input.runtime.construction.account.kind === 'kernel'
|
|
23
31
|
? wrapKernelMessageHash(payload, context.account.address)
|
|
24
32
|
: payload;
|
|
25
|
-
const signingMaterial = input.
|
|
33
|
+
const signingMaterial = input.runtime.construction.account.kind === 'kernel'
|
|
26
34
|
? {
|
|
27
35
|
kind: 'message',
|
|
28
|
-
message: {
|
|
29
|
-
raw: hashMessage({
|
|
30
|
-
raw: encodePacked(['bytes32', 'bytes32'], [pad(context.account.address, { size: 32 }), accountHash]),
|
|
31
|
-
}),
|
|
32
|
-
},
|
|
36
|
+
message: { raw: accountHash },
|
|
33
37
|
}
|
|
34
|
-
:
|
|
35
|
-
? {
|
|
36
|
-
kind: 'message',
|
|
37
|
-
message: { raw: accountHash },
|
|
38
|
-
}
|
|
39
|
-
: undefined;
|
|
38
|
+
: undefined;
|
|
40
39
|
const route = getAccountSignatureRoute(input.runtime, context);
|
|
41
40
|
return signAccountMessage({
|
|
42
41
|
context,
|
|
@@ -52,43 +51,39 @@ export async function signRuntimeMessage(input) {
|
|
|
52
51
|
taskPrefix: 'message',
|
|
53
52
|
ecdsaInvocation: 'ecdsa-sign-message',
|
|
54
53
|
webauthnInvocation: 'webauthn-sign-hash',
|
|
55
|
-
...(selection
|
|
54
|
+
...(input.selection
|
|
55
|
+
? { selectedSignerIds: input.selection.signerIds }
|
|
56
|
+
: {}),
|
|
56
57
|
}),
|
|
57
|
-
route
|
|
58
|
-
? {
|
|
59
|
-
...route,
|
|
60
|
-
validatorCodec: {
|
|
61
|
-
kind: 'smart-session',
|
|
62
|
-
validator: {
|
|
63
|
-
kind: 'validator',
|
|
64
|
-
address: getSmartSessionEmissaryAddress(input.runtime.construction.sessions.environment),
|
|
65
|
-
},
|
|
66
|
-
mode: 'notarized',
|
|
67
|
-
permissionId: getPermissionId(input.session.session),
|
|
68
|
-
signerCodec: requireSessionOwnerCodec(getSigningValidatorCodec(context)),
|
|
69
|
-
},
|
|
70
|
-
accountEnvelope: smartSessionEnvelope(route.accountEnvelope, input.runtime.construction.sessions.environment),
|
|
71
|
-
}
|
|
72
|
-
: route,
|
|
58
|
+
route,
|
|
73
59
|
},
|
|
74
60
|
});
|
|
75
61
|
}
|
|
76
62
|
export async function signRuntimeTypedData(input) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
63
|
+
if (input.session) {
|
|
64
|
+
// Sessions sign an account-bound digest in direct (notarized) mode, the
|
|
65
|
+
// same shape signRuntimeMessage produces, so external ERC-1271 verifiers
|
|
66
|
+
// resolve the session validator directly.
|
|
67
|
+
const contentHash = hashTypedData(input.typedData);
|
|
68
|
+
return signSessionErc1271({
|
|
69
|
+
runtime: input.runtime,
|
|
70
|
+
signerInvoker: input.signerInvoker,
|
|
71
|
+
checkpoints: input.checkpoints,
|
|
72
|
+
chain: input.chain,
|
|
73
|
+
session: input.session,
|
|
74
|
+
contentHash,
|
|
75
|
+
nominalMessage: { raw: contentHash },
|
|
76
|
+
});
|
|
77
|
+
}
|
|
80
78
|
const context = createAccountSigningContext({
|
|
81
79
|
runtime: input.runtime,
|
|
82
80
|
purpose: 'erc1271',
|
|
83
81
|
signerInvoker: input.signerInvoker,
|
|
84
|
-
...(selection ? { selection } : {}),
|
|
82
|
+
...(input.selection ? { selection: input.selection } : {}),
|
|
85
83
|
});
|
|
86
|
-
const topology = signingTopology(context.validator, selection?.signerIds);
|
|
87
|
-
const typedData = input.session
|
|
88
|
-
? sessionTypedData(input.typedData, input.runtime, input.chain)
|
|
89
|
-
: input.typedData;
|
|
84
|
+
const topology = signingTopology(context.validator, input.selection?.signerIds);
|
|
90
85
|
const route = resolveAccountTypedDataSigning({
|
|
91
|
-
typedData,
|
|
86
|
+
typedData: input.typedData,
|
|
92
87
|
chain: input.chain,
|
|
93
88
|
context,
|
|
94
89
|
});
|
|
@@ -97,7 +92,7 @@ export async function signRuntimeTypedData(input) {
|
|
|
97
92
|
context,
|
|
98
93
|
checkpoints: input.checkpoints,
|
|
99
94
|
planInput: {
|
|
100
|
-
typedData,
|
|
95
|
+
typedData: input.typedData,
|
|
101
96
|
signingMaterial: route.material,
|
|
102
97
|
chain: input.chain,
|
|
103
98
|
...topology,
|
|
@@ -107,19 +102,68 @@ export async function signRuntimeTypedData(input) {
|
|
|
107
102
|
taskPrefix: 'typed-data',
|
|
108
103
|
ecdsaInvocation: route.ecdsaInvocation,
|
|
109
104
|
webauthnInvocation: route.webauthnInvocation,
|
|
110
|
-
...(selection
|
|
105
|
+
...(input.selection
|
|
106
|
+
? { selectedSignerIds: input.selection.signerIds }
|
|
107
|
+
: {}),
|
|
111
108
|
}),
|
|
112
|
-
route:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
route: accountRoute,
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// Shared ERC-1271 signing for a session: the session owner signs an
|
|
114
|
+
// account-bound digest (keccak of account ‖ contentHash) in the smart-session
|
|
115
|
+
// "notarized" (direct) mode. Used by both message and typed-data signing so
|
|
116
|
+
// they produce the identical on-chain-verifiable shape.
|
|
117
|
+
async function signSessionErc1271(input) {
|
|
118
|
+
const selection = sessionOwnerSelection(input.session);
|
|
119
|
+
const context = createAccountSigningContext({
|
|
120
|
+
runtime: input.runtime,
|
|
121
|
+
purpose: 'erc1271',
|
|
122
|
+
signerInvoker: input.signerInvoker,
|
|
123
|
+
selection,
|
|
124
|
+
});
|
|
125
|
+
const topology = signingTopology(context.validator, selection.signerIds);
|
|
126
|
+
const accountHash = input.runtime.construction.account.kind === 'kernel'
|
|
127
|
+
? wrapKernelMessageHash(input.contentHash, context.account.address)
|
|
128
|
+
: input.contentHash;
|
|
129
|
+
const route = getAccountSignatureRoute(input.runtime, context);
|
|
130
|
+
return signAccountMessage({
|
|
131
|
+
context,
|
|
132
|
+
checkpoints: input.checkpoints,
|
|
133
|
+
planInput: {
|
|
134
|
+
message: input.nominalMessage,
|
|
135
|
+
signingMaterial: {
|
|
136
|
+
kind: 'message',
|
|
137
|
+
message: {
|
|
138
|
+
raw: hashMessage({
|
|
139
|
+
raw: encodePacked(['bytes32', 'bytes32'], [pad(context.account.address, { size: 32 }), accountHash]),
|
|
140
|
+
}),
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
chain: input.chain,
|
|
144
|
+
...topology,
|
|
145
|
+
tasks: createValidatorSigningTasks({
|
|
146
|
+
validator: context.validator,
|
|
147
|
+
signerReferences: context.signerReferences,
|
|
148
|
+
taskPrefix: 'message',
|
|
149
|
+
ecdsaInvocation: 'ecdsa-sign-message',
|
|
150
|
+
webauthnInvocation: 'webauthn-sign-hash',
|
|
151
|
+
selectedSignerIds: selection.signerIds,
|
|
152
|
+
}),
|
|
153
|
+
route: {
|
|
154
|
+
...route,
|
|
155
|
+
validatorCodec: {
|
|
156
|
+
kind: 'smart-session',
|
|
157
|
+
validator: {
|
|
158
|
+
kind: 'validator',
|
|
159
|
+
address: getSmartSessionEmissaryAddress(input.runtime.construction.sessions.environment),
|
|
119
160
|
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
161
|
+
mode: 'notarized',
|
|
162
|
+
permissionId: getPermissionId(input.session.session),
|
|
163
|
+
signerCodec: requireSessionOwnerCodec(getSigningValidatorCodec(context)),
|
|
164
|
+
},
|
|
165
|
+
accountEnvelope: smartSessionEnvelope(route.accountEnvelope, input.runtime.construction.sessions.environment),
|
|
166
|
+
},
|
|
123
167
|
},
|
|
124
168
|
});
|
|
125
169
|
}
|
|
@@ -147,45 +191,3 @@ function smartSessionEnvelope(envelope, environment) {
|
|
|
147
191
|
? { ...envelope, validator, isRoot: false }
|
|
148
192
|
: { ...envelope, validator };
|
|
149
193
|
}
|
|
150
|
-
function sessionTypedData(typedData, runtime, chain) {
|
|
151
|
-
const verifier = sessionVerifierDomain(runtime, chain);
|
|
152
|
-
return {
|
|
153
|
-
domain: typedData.domain,
|
|
154
|
-
primaryType: 'TypedDataSign',
|
|
155
|
-
types: {
|
|
156
|
-
...typedData.types,
|
|
157
|
-
TypedDataSign: [
|
|
158
|
-
{ name: 'contents', type: typedData.primaryType },
|
|
159
|
-
{ name: 'name', type: 'string' },
|
|
160
|
-
{ name: 'version', type: 'string' },
|
|
161
|
-
{ name: 'chainId', type: 'uint256' },
|
|
162
|
-
{ name: 'verifyingContract', type: 'address' },
|
|
163
|
-
{ name: 'salt', type: 'bytes32' },
|
|
164
|
-
],
|
|
165
|
-
},
|
|
166
|
-
message: {
|
|
167
|
-
contents: typedData.message,
|
|
168
|
-
...verifier,
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
function sessionVerifierDomain(runtime, chain) {
|
|
173
|
-
const common = {
|
|
174
|
-
chainId: chain.id,
|
|
175
|
-
verifyingContract: runtime.identity.address,
|
|
176
|
-
salt: zeroHash,
|
|
177
|
-
};
|
|
178
|
-
switch (runtime.construction.account.kind) {
|
|
179
|
-
case 'safe':
|
|
180
|
-
return { ...common, name: 'rhinestone safe7579', version: 'v1.0.0' };
|
|
181
|
-
case 'nexus':
|
|
182
|
-
case 'hca':
|
|
183
|
-
return { ...common, name: 'Nexus', version: '1.2.0' };
|
|
184
|
-
case 'kernel':
|
|
185
|
-
return { ...common, name: 'Kernel', version: '0.3.3' };
|
|
186
|
-
case 'startale':
|
|
187
|
-
return { ...common, name: 'Startale', version: '1.0.0' };
|
|
188
|
-
case 'eoa':
|
|
189
|
-
throw new Error('EOA accounts do not have an EIP-712 domain');
|
|
190
|
-
}
|
|
191
|
-
}
|
package/dist/src/api/sdk.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ declare class RhinestoneSDK {
|
|
|
69
69
|
* Create a smart session, resolving the chain's wrapped-native token from the
|
|
70
70
|
* orchestrator's chain catalog (`GET /chains`) so native-token wrapping is
|
|
71
71
|
* permitted automatically. Project-scoped — needs the API key but no account.
|
|
72
|
-
* For a fully offline build, use the standalone
|
|
72
|
+
* For a fully offline build, use the standalone `toSession` and pass
|
|
73
73
|
* `wrappedNativeToken` yourself.
|
|
74
74
|
* @param definition The session definition
|
|
75
75
|
* @returns The resolved session
|
package/dist/src/api/sdk.js
CHANGED
|
@@ -91,7 +91,7 @@ class RhinestoneSDK {
|
|
|
91
91
|
* Create a smart session, resolving the chain's wrapped-native token from the
|
|
92
92
|
* orchestrator's chain catalog (`GET /chains`) so native-token wrapping is
|
|
93
93
|
* permitted automatically. Project-scoped — needs the API key but no account.
|
|
94
|
-
* For a fully offline build, use the standalone
|
|
94
|
+
* For a fully offline build, use the standalone `toSession` and pass
|
|
95
95
|
* `wrappedNativeToken` yourself.
|
|
96
96
|
* @param definition The session definition
|
|
97
97
|
* @returns The resolved session
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import type { ChainReference, EvmChainReference } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* True when a chain id's wire form is in the `hypercore:` namespace.
|
|
4
|
+
*
|
|
5
|
+
* This is the one combination the `caip2.startsWith('eip155:')` test gets wrong:
|
|
6
|
+
* HyperCore is EVM-*addressed* (hex recipients, EIP-712 signing) while its wire
|
|
7
|
+
* id is not `eip155:`, so every place that decides "is this reference EVM" must
|
|
8
|
+
* ask this too. Two places did it as `chainId === 1337`, which silently became
|
|
9
|
+
* wrong the moment HyperCore gained a second id — derived from the table here so
|
|
10
|
+
* a third venue cannot reintroduce it.
|
|
11
|
+
*
|
|
12
|
+
* NOT the same as `isHyperCoreChainId` in `@rhinestone/shared-configs`, which
|
|
13
|
+
* answers "is this a delivery VENUE" and is deliberately false for the Core L1.
|
|
14
|
+
* This one is about address shape, so it is true for all three.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isHyperCoreWireId(chainId: number): boolean;
|
|
2
17
|
export declare function formatCaip2(chainId: number): string;
|
|
3
18
|
export declare function chainIdFromCaip2(value: string): number | undefined;
|
|
4
19
|
export declare function parseCaip2(value: string): ChainReference;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caip2.d.ts","sourceRoot":"","sources":["../../../chains/caip2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"caip2.d.ts","sourceRoot":"","sources":["../../../chains/caip2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AA0ChE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE1D;AAID,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKlE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAmBxD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAUtE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAOlE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,MAAM,EAAE,CAErE;AAKD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD"}
|
package/dist/src/chains/caip2.js
CHANGED
|
@@ -4,12 +4,22 @@
|
|
|
4
4
|
// v2: this small table is bundled here rather than read from
|
|
5
5
|
// `@rhinestone/shared-configs`. EVM is the common case and needs no table, so a
|
|
6
6
|
// new EVM chain needs no SDK change; a new non-EVM chain is rare and adds one
|
|
7
|
-
// entry below. HyperCore is EVM
|
|
8
|
-
// `false` for
|
|
7
|
+
// entry below. Every HyperCore id is EVM-*settled*, so `isNonEvmChainId` is
|
|
8
|
+
// `false` for all of them even though their wire ids are the non-`eip155`
|
|
9
|
+
// `hypercore:` namespace.
|
|
10
|
+
//
|
|
11
|
+
// This table is TRANSLATION, not policy: it answers "what number is this wire
|
|
12
|
+
// id", and adding an entry does not make that chain a legal destination. Which
|
|
13
|
+
// HyperCore ids you may TARGET is `HyperCoreCaip2ChainId` and the exported
|
|
14
|
+
// descriptors — only the two venues. `hypercore:mainnet` is here because it is a
|
|
15
|
+
// real chain (the Core L1, where deposits originate) that can appear in a
|
|
16
|
+
// response we have to parse; it is not an addressable target (RHI-5510).
|
|
9
17
|
//
|
|
10
18
|
// Spec: https://chainagnostic.org/CAIPs/caip-2
|
|
11
19
|
const NON_EVM_CHAINS = [
|
|
12
20
|
{ id: 1337, caip2: 'hypercore:mainnet', nonEvm: false },
|
|
21
|
+
{ id: 1337001, caip2: 'hypercore:spot', nonEvm: false },
|
|
22
|
+
{ id: 1337002, caip2: 'hypercore:perp', nonEvm: false },
|
|
13
23
|
{ id: 728126428, caip2: 'tron:mainnet', nonEvm: true },
|
|
14
24
|
{
|
|
15
25
|
id: 792703809,
|
|
@@ -17,6 +27,24 @@ const NON_EVM_CHAINS = [
|
|
|
17
27
|
nonEvm: true,
|
|
18
28
|
},
|
|
19
29
|
];
|
|
30
|
+
const HYPERCORE_WIRE_IDS = new Set(NON_EVM_CHAINS.filter((chain) => chain.caip2.startsWith('hypercore:')).map((chain) => chain.id));
|
|
31
|
+
/**
|
|
32
|
+
* True when a chain id's wire form is in the `hypercore:` namespace.
|
|
33
|
+
*
|
|
34
|
+
* This is the one combination the `caip2.startsWith('eip155:')` test gets wrong:
|
|
35
|
+
* HyperCore is EVM-*addressed* (hex recipients, EIP-712 signing) while its wire
|
|
36
|
+
* id is not `eip155:`, so every place that decides "is this reference EVM" must
|
|
37
|
+
* ask this too. Two places did it as `chainId === 1337`, which silently became
|
|
38
|
+
* wrong the moment HyperCore gained a second id — derived from the table here so
|
|
39
|
+
* a third venue cannot reintroduce it.
|
|
40
|
+
*
|
|
41
|
+
* NOT the same as `isHyperCoreChainId` in `@rhinestone/shared-configs`, which
|
|
42
|
+
* answers "is this a delivery VENUE" and is deliberately false for the Core L1.
|
|
43
|
+
* This one is about address shape, so it is true for all three.
|
|
44
|
+
*/
|
|
45
|
+
export function isHyperCoreWireId(chainId) {
|
|
46
|
+
return HYPERCORE_WIRE_IDS.has(chainId);
|
|
47
|
+
}
|
|
20
48
|
const evmPattern = /^eip155:(0|[1-9]\d*)$/;
|
|
21
49
|
export function formatCaip2(chainId) {
|
|
22
50
|
if (!Number.isSafeInteger(chainId) || chainId < 0) {
|
|
@@ -53,7 +81,7 @@ export function parseCaip2(value) {
|
|
|
53
81
|
}
|
|
54
82
|
export function toEvmChainReference(chainId) {
|
|
55
83
|
const caip2 = formatCaip2(chainId);
|
|
56
|
-
if (!caip2.startsWith('eip155:') && chainId
|
|
84
|
+
if (!caip2.startsWith('eip155:') && !isHyperCoreWireId(chainId)) {
|
|
57
85
|
throw new Error(`Chain ${chainId} is not EVM-compatible`);
|
|
58
86
|
}
|
|
59
87
|
return {
|
|
@@ -77,9 +105,9 @@ export function isCaip2(value) {
|
|
|
77
105
|
export function isEvmCaip2(value) {
|
|
78
106
|
return evmPattern.test(value);
|
|
79
107
|
}
|
|
80
|
-
// True when a numeric chain id is genuinely non-EVM (Solana / Tron).
|
|
81
|
-
//
|
|
82
|
-
// the non-`eip155` `hypercore
|
|
108
|
+
// True when a numeric chain id is genuinely non-EVM (Solana / Tron). Every
|
|
109
|
+
// HyperCore id is EVM-settled, so this is `false` for all of them even though
|
|
110
|
+
// their wire ids are in the non-`eip155` `hypercore:` namespace.
|
|
83
111
|
export function isNonEvmChainId(chainId) {
|
|
84
112
|
return NON_EVM_CHAINS.some((chain) => chain.id === chainId && chain.nonEvm);
|
|
85
113
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineChain } from 'viem';
|
|
2
2
|
import * as viemChains from 'viem/chains';
|
|
3
|
-
import { formatCaip2 } from './caip2.js';
|
|
3
|
+
import { formatCaip2, isHyperCoreWireId } from './caip2.js';
|
|
4
4
|
// Chain objects (rpc / nativeCurrency / formatters, needed for signing and
|
|
5
5
|
// `createPublicClient`) come from viem — not from bundled chain config. The
|
|
6
6
|
// supported *set* is gated by the orchestrator; this resolves any known viem
|
|
@@ -24,7 +24,7 @@ export function getChainById(chainId) {
|
|
|
24
24
|
}
|
|
25
25
|
export function getChainReference(chainId) {
|
|
26
26
|
const caip2 = formatCaip2(chainId);
|
|
27
|
-
if (caip2.startsWith('eip155:') || chainId
|
|
27
|
+
if (caip2.startsWith('eip155:') || isHyperCoreWireId(chainId)) {
|
|
28
28
|
return {
|
|
29
29
|
kind: 'evm',
|
|
30
30
|
id: chainId,
|
|
@@ -2,7 +2,7 @@ import type { Chain } from 'viem';
|
|
|
2
2
|
type EvmCaip2ChainId = `eip155:${number}`;
|
|
3
3
|
type SolanaCaip2ChainId = `solana:${string}`;
|
|
4
4
|
type TronCaip2ChainId = `tron:${string}`;
|
|
5
|
-
type HyperCoreCaip2ChainId = 'hypercore:
|
|
5
|
+
type HyperCoreCaip2ChainId = 'hypercore:spot' | 'hypercore:perp';
|
|
6
6
|
type Caip2ChainId = EvmCaip2ChainId | SolanaCaip2ChainId | TronCaip2ChainId | HyperCoreCaip2ChainId;
|
|
7
7
|
interface NativeCurrency {
|
|
8
8
|
readonly name: string;
|
|
@@ -20,7 +20,8 @@ interface NonEvmChain {
|
|
|
20
20
|
type DestinationChain = Chain | NonEvmChain;
|
|
21
21
|
declare const solanaMainnet: NonEvmChain;
|
|
22
22
|
declare const tronMainnet: NonEvmChain;
|
|
23
|
-
declare const
|
|
23
|
+
declare const hyperCoreSpot: NonEvmChain;
|
|
24
|
+
declare const hyperCorePerp: NonEvmChain;
|
|
24
25
|
export type { DestinationChain, NativeCurrency, NonEvmAddress, NonEvmChain };
|
|
25
|
-
export {
|
|
26
|
+
export { hyperCorePerp, hyperCoreSpot, solanaMainnet, tronMainnet };
|
|
26
27
|
//# sourceMappingURL=non-evm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"non-evm.d.ts","sourceRoot":"","sources":["../../../chains/non-evm.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAEjC,KAAK,eAAe,GAAG,UAAU,MAAM,EAAE,CAAA;AACzC,KAAK,kBAAkB,GAAG,UAAU,MAAM,EAAE,CAAA;AAC5C,KAAK,gBAAgB,GAAG,QAAQ,MAAM,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"non-evm.d.ts","sourceRoot":"","sources":["../../../chains/non-evm.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAEjC,KAAK,eAAe,GAAG,UAAU,MAAM,EAAE,CAAA;AACzC,KAAK,kBAAkB,GAAG,UAAU,MAAM,EAAE,CAAA;AAC5C,KAAK,gBAAgB,GAAG,QAAQ,MAAM,EAAE,CAAA;AAGxC,KAAK,qBAAqB,GAAG,gBAAgB,GAAG,gBAAgB,CAAA;AAChE,KAAK,YAAY,GACb,eAAe,GACf,kBAAkB,GAClB,gBAAgB,GAChB,qBAAqB,CAAA;AAEzB,UAAU,cAAc;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAMD,KAAK,aAAa,GAAG,MAAM,CAAA;AAE3B,UAAU,WAAW;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;IAI5B,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,WAAW,CAAA;IAC1C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,KAAK,gBAAgB,GAAG,KAAK,GAAG,WAAW,CAAA;AAE3C,QAAA,MAAM,aAAa,EAAE,WAKpB,CAAA;AAED,QAAA,MAAM,WAAW,EAAE,WAKlB,CAAA;AASD,QAAA,MAAM,aAAa,EAAE,WAKpB,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,WAKpB,CAAA;AAED,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -21,10 +21,23 @@ const tronMainnet = {
|
|
|
21
21
|
kind: 'tvm',
|
|
22
22
|
nativeCurrency: { name: 'Tron', symbol: 'TRX', decimals: 6 },
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
// A HyperCore deposit credits one of two accounts that are not
|
|
25
|
+
// interchangeable: the recipient's spot wallet, or the default perp dex's
|
|
26
|
+
// margin account. `CoreDepositWallet.depositFor` selects between them, and the
|
|
27
|
+
// wrong choice is invisible — the intent completes, the fill succeeds, and only
|
|
28
|
+
// the recipient's Core state shows where the funds went. So the venue is the
|
|
29
|
+
// destination you address, not an optional field that four separate
|
|
30
|
+
// field-by-field rebuilds could each silently drop (RHI-5510).
|
|
31
|
+
const hyperCoreSpot = {
|
|
32
|
+
name: 'HyperCore Spot',
|
|
33
|
+
caip2: 'hypercore:spot',
|
|
27
34
|
kind: 'hypercore',
|
|
28
35
|
nativeCurrency: { name: 'Hyperliquid', symbol: 'HYPE', decimals: 18 },
|
|
29
36
|
};
|
|
30
|
-
|
|
37
|
+
const hyperCorePerp = {
|
|
38
|
+
name: 'HyperCore Perp',
|
|
39
|
+
caip2: 'hypercore:perp',
|
|
40
|
+
kind: 'hypercore',
|
|
41
|
+
nativeCurrency: { name: 'Hyperliquid', symbol: 'HYPE', decimals: 18 },
|
|
42
|
+
};
|
|
43
|
+
export { hyperCorePerp, hyperCoreSpot, solanaMainnet, tronMainnet };
|
|
@@ -3,7 +3,7 @@ import { createOrchestratorAuth } from './auth.js';
|
|
|
3
3
|
import { ChainCatalog, parseChains } from './chain-catalog.js';
|
|
4
4
|
import { fetchOrchestratorJson } from './fetch.js';
|
|
5
5
|
import { mapIntentRequestToWire, mapIntentStatusFromWire, mapPortfolioFromWire, mapQuoteResponseFromWire, mapSignedIntentToWire, mapSplitRequestToWire, mapSplitResultFromWire, } from './mappers.js';
|
|
6
|
-
const SDK_VERSION = '2.2.
|
|
6
|
+
const SDK_VERSION = '2.2.5';
|
|
7
7
|
const API_VERSION = '2026-04.blanc';
|
|
8
8
|
export function createOrchestratorClient(options) {
|
|
9
9
|
const fetchPort = options.fetch ?? globalThis.fetch;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { OrchestratorIntentRequest, OrchestratorIntentStatus, OrchestratorPortfolio, OrchestratorQuoteResponse, OrchestratorSignedIntent, OrchestratorSplitRequest, OrchestratorSplitResult } from './types.js';
|
|
2
|
-
|
|
2
|
+
import type { WireIntentRequestInternal, WireQuoteRequest, WireSplitRequest } from './wire.js';
|
|
3
|
+
export declare function mapIntentRequestToWire(input: OrchestratorIntentRequest): WireQuoteRequest;
|
|
3
4
|
export declare function mapQuoteResponseFromWire(value: unknown): OrchestratorQuoteResponse;
|
|
4
|
-
export declare function mapSignedIntentToWire(input: OrchestratorSignedIntent):
|
|
5
|
+
export declare function mapSignedIntentToWire(input: OrchestratorSignedIntent): WireIntentRequestInternal;
|
|
5
6
|
export declare function mapIntentStatusFromWire(intentId: string, value: unknown): OrchestratorIntentStatus;
|
|
6
7
|
export declare function mapPortfolioFromWire(value: unknown): OrchestratorPortfolio;
|
|
7
|
-
export declare function mapSplitRequestToWire(input: OrchestratorSplitRequest):
|
|
8
|
+
export declare function mapSplitRequestToWire(input: OrchestratorSplitRequest): WireSplitRequest;
|
|
8
9
|
export declare function mapSplitResultFromWire(value: unknown): OrchestratorSplitResult;
|
|
9
10
|
//# sourceMappingURL=mappers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../../clients/orchestrator/mappers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../../clients/orchestrator/mappers.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EAErB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAEV,yBAAyB,EAIzB,gBAAgB,EAEhB,gBAAgB,EAEjB,MAAM,QAAQ,CAAA;AAEf,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,yBAAyB,GAC/B,gBAAgB,CA2BlB;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,GACb,yBAAyB,CAM3B;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,wBAAwB,GAC9B,yBAAyB,CA0B3B;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,GACb,wBAAwB,CAwB1B;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,CAuB1E;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,wBAAwB,GAC9B,gBAAgB,CAMlB;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,uBAAuB,CAgBzB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { chainIdFromReference, formatCaip2, parseCaip2, } from '../../chains/caip2.js';
|
|
1
|
+
import { chainIdFromReference, formatCaip2, isHyperCoreWireId, isNonEvmChainId, parseCaip2, } from '../../chains/caip2.js';
|
|
2
|
+
import { serializeBigInts } from './serialization.js';
|
|
2
3
|
export function mapIntentRequestToWire(input) {
|
|
3
4
|
return serializeBigInts({
|
|
4
5
|
account: input.account,
|
|
@@ -9,6 +10,8 @@ export function mapIntentRequestToWire(input) {
|
|
|
9
10
|
accountAccessList: mapAccessList(input.accountAccessList),
|
|
10
11
|
options: {
|
|
11
12
|
...input.options,
|
|
13
|
+
settlementLayers: mapSettlementLayers(input.options.settlementLayers),
|
|
14
|
+
signatureMode: input.options.signatureMode,
|
|
12
15
|
...(input.options.auxiliaryFunds
|
|
13
16
|
? {
|
|
14
17
|
auxiliaryFunds: mapChainRecord(input.options.auxiliaryFunds),
|
|
@@ -86,7 +89,7 @@ export function mapSplitRequestToWire(input) {
|
|
|
86
89
|
return serializeBigInts({
|
|
87
90
|
chainId: formatCaip2(input.chainId),
|
|
88
91
|
tokens: input.tokens,
|
|
89
|
-
settlementLayers: input.settlementLayers,
|
|
92
|
+
settlementLayers: mapSettlementLayers(input.settlementLayers),
|
|
90
93
|
});
|
|
91
94
|
}
|
|
92
95
|
export function mapSplitResultFromWire(value) {
|
|
@@ -149,7 +152,7 @@ function mapBridgeFillFromWire(value) {
|
|
|
149
152
|
}
|
|
150
153
|
function mapAuthorizationToWire(authorization) {
|
|
151
154
|
return {
|
|
152
|
-
chainId:
|
|
155
|
+
chainId: mapAuthorizationChainIdToWire(authorization.chainId),
|
|
153
156
|
address: authorization.address,
|
|
154
157
|
nonce: authorization.nonce,
|
|
155
158
|
yParity: authorization.yParity ?? 0,
|
|
@@ -157,6 +160,17 @@ function mapAuthorizationToWire(authorization) {
|
|
|
157
160
|
s: authorization.s,
|
|
158
161
|
};
|
|
159
162
|
}
|
|
163
|
+
function mapAuthorizationChainIdToWire(chainId) {
|
|
164
|
+
if (chainId === 0)
|
|
165
|
+
return 0;
|
|
166
|
+
if (!Number.isSafeInteger(chainId) ||
|
|
167
|
+
chainId < 0 ||
|
|
168
|
+
isHyperCoreWireId(chainId) ||
|
|
169
|
+
isNonEvmChainId(chainId)) {
|
|
170
|
+
throw new Error(`Invalid EIP-7702 authorization chain ID: ${chainId}`);
|
|
171
|
+
}
|
|
172
|
+
return `eip155:${chainId}`;
|
|
173
|
+
}
|
|
160
174
|
function mapAccessList(input) {
|
|
161
175
|
if (!input)
|
|
162
176
|
return undefined;
|
|
@@ -171,6 +185,10 @@ function mapAccessList(input) {
|
|
|
171
185
|
: {}),
|
|
172
186
|
};
|
|
173
187
|
}
|
|
188
|
+
function mapSettlementLayers(input) {
|
|
189
|
+
// Keep the legacy public string arrays while checking the rest of the wire shape.
|
|
190
|
+
return input;
|
|
191
|
+
}
|
|
174
192
|
function mapChainRecord(input) {
|
|
175
193
|
return Object.fromEntries(Object.entries(input).map(([chainId, value]) => [
|
|
176
194
|
formatCaip2(Number(chainId)),
|
|
@@ -186,13 +204,3 @@ function parseChainValue(value) {
|
|
|
186
204
|
return Number(value);
|
|
187
205
|
return chainIdFromReference(parseCaip2(value));
|
|
188
206
|
}
|
|
189
|
-
function serializeBigInts(value) {
|
|
190
|
-
if (typeof value === 'bigint')
|
|
191
|
-
return value.toString();
|
|
192
|
-
if (Array.isArray(value))
|
|
193
|
-
return value.map(serializeBigInts);
|
|
194
|
-
if (value && typeof value === 'object') {
|
|
195
|
-
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, serializeBigInts(item)]));
|
|
196
|
-
}
|
|
197
|
-
return value;
|
|
198
|
-
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type Serialized<T> = T extends bigint ? string : T extends readonly (infer Item)[] ? Serialized<Item>[] : T extends string | number | boolean | null | undefined ? T : T extends object ? {
|
|
2
|
+
[Key in keyof T]: Serialized<T[Key]>;
|
|
3
|
+
} : T;
|
|
4
|
+
export declare function serializeBigInts<T>(value: T): Serialized<T>;
|
|
5
|
+
//# sourceMappingURL=serialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../../clients/orchestrator/serialization.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACxC,MAAM,GACN,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GAC/B,UAAU,CAAC,IAAI,CAAC,EAAE,GAClB,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GACpD,CAAC,GACD,CAAC,SAAS,MAAM,GACd;KAAG,GAAG,IAAI,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,GACxC,CAAC,CAAA;AAEX,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAW3D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function serializeBigInts(value) {
|
|
2
|
+
if (typeof value === 'bigint')
|
|
3
|
+
return value.toString();
|
|
4
|
+
if (Array.isArray(value)) {
|
|
5
|
+
return value.map(serializeBigInts);
|
|
6
|
+
}
|
|
7
|
+
if (value && typeof value === 'object') {
|
|
8
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, serializeBigInts(item)]));
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import type { operations } from './wire.gen.js';
|
|
2
|
+
type JsonRequest<Operation extends keyof operations> = operations[Operation] extends {
|
|
3
|
+
requestBody: {
|
|
4
|
+
content: {
|
|
5
|
+
'application/json': infer Body;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
} ? Body : never;
|
|
2
9
|
type JsonResponse<Operation extends keyof operations> = NonNullable<operations[Operation]['responses'] extends {
|
|
3
10
|
200: infer Ok;
|
|
4
11
|
} ? Ok extends {
|
|
@@ -9,6 +16,14 @@ type JsonResponse<Operation extends keyof operations> = NonNullable<operations[O
|
|
|
9
16
|
type Folded<Body> = Body & {
|
|
10
17
|
readonly traceId?: string;
|
|
11
18
|
};
|
|
19
|
+
export type WireQuoteRequest = JsonRequest<'createQuote'>;
|
|
20
|
+
export type WireIntentRequest = JsonRequest<'createIntent'>;
|
|
21
|
+
export type WireIntentRequestInternal = WireIntentRequest & {
|
|
22
|
+
readonly options?: {
|
|
23
|
+
readonly dryRun?: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type WireSplitRequest = JsonRequest<'getSplit'>;
|
|
12
27
|
export type WireQuoteResponse = Folded<JsonResponse<'createQuote'>>;
|
|
13
28
|
export type WireQuote = WireQuoteResponse['routes'][number];
|
|
14
29
|
export type WirePortfolioResponse = Folded<JsonResponse<'getPortfolio'>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../../../clients/orchestrator/wire.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,KAAK,YAAY,CAAC,SAAS,SAAS,MAAM,UAAU,IAAI,WAAW,CACjE,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,SAAS;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,GACxD,EAAE,SAAS;IAAE,OAAO,EAAE;QAAE,kBAAkB,EAAE,MAAM,IAAI,CAAA;KAAE,CAAA;CAAE,GACxD,IAAI,GACJ,KAAK,GACP,KAAK,CACV,CAAA;AAID,KAAK,MAAM,CAAC,IAAI,IAAI,IAAI,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAExD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAA;AACnE,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAC3D,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAA;AACxE,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAA;AACxE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAA;AAGhE,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../../../clients/orchestrator/wire.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,KAAK,WAAW,CAAC,SAAS,SAAS,MAAM,UAAU,IACjD,UAAU,CAAC,SAAS,CAAC,SAAS;IAC5B,WAAW,EAAE;QAAE,OAAO,EAAE;YAAE,kBAAkB,EAAE,MAAM,IAAI,CAAA;SAAE,CAAA;KAAE,CAAA;CAC7D,GACG,IAAI,GACJ,KAAK,CAAA;AAEX,KAAK,YAAY,CAAC,SAAS,SAAS,MAAM,UAAU,IAAI,WAAW,CACjE,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,SAAS;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,GACxD,EAAE,SAAS;IAAE,OAAO,EAAE;QAAE,kBAAkB,EAAE,MAAM,IAAI,CAAA;KAAE,CAAA;CAAE,GACxD,IAAI,GACJ,KAAK,GACP,KAAK,CACV,CAAA;AAID,KAAK,MAAM,CAAC,IAAI,IAAI,IAAI,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAExD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,aAAa,CAAC,CAAA;AACzD,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAE3D,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,GAAG;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CACjD,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,UAAU,CAAC,CAAA;AACtD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAA;AACnE,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAC3D,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAA;AACxE,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAA;AACxE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAA;AAGhE,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA"}
|