@rhinestone/sdk 2.2.0 → 2.2.2

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.
Files changed (37) hide show
  1. package/dist/src/actions/mfa.d.ts +0 -1
  2. package/dist/src/actions/mfa.d.ts.map +1 -1
  3. package/dist/src/actions/mfa.js +0 -1
  4. package/dist/src/actions/passkeys.d.ts +1 -2
  5. package/dist/src/actions/passkeys.d.ts.map +1 -1
  6. package/dist/src/actions/passkeys.js +1 -2
  7. package/dist/src/api/queries/portfolio.d.ts.map +1 -1
  8. package/dist/src/api/queries/portfolio.js +6 -15
  9. package/dist/src/api/sdk.d.ts +1 -1
  10. package/dist/src/api/sdk.js +1 -1
  11. package/dist/src/chains/caip2.d.ts +15 -0
  12. package/dist/src/chains/caip2.d.ts.map +1 -1
  13. package/dist/src/chains/caip2.js +34 -6
  14. package/dist/src/chains/catalog.js +2 -2
  15. package/dist/src/chains/non-evm.d.ts +4 -3
  16. package/dist/src/chains/non-evm.d.ts.map +1 -1
  17. package/dist/src/chains/non-evm.js +17 -4
  18. package/dist/src/clients/orchestrator/client.js +1 -1
  19. package/dist/src/clients/orchestrator/wire.gen.d.ts +46 -52
  20. package/dist/src/clients/orchestrator/wire.gen.d.ts.map +1 -1
  21. package/dist/src/config/account.d.ts +3 -3
  22. package/dist/src/index.d.ts +2 -2
  23. package/dist/src/index.d.ts.map +1 -1
  24. package/dist/src/index.js +2 -2
  25. package/dist/src/modules/validators/smart-sessions/fast-lz.d.ts +4 -0
  26. package/dist/src/modules/validators/smart-sessions/fast-lz.d.ts.map +1 -0
  27. package/dist/src/modules/validators/smart-sessions/fast-lz.js +148 -0
  28. package/dist/src/modules/validators/smart-sessions/signature.d.ts +5 -0
  29. package/dist/src/modules/validators/smart-sessions/signature.d.ts.map +1 -1
  30. package/dist/src/modules/validators/smart-sessions/signature.js +11 -4
  31. package/dist/src/modules/validators/webauthn.d.ts.map +1 -1
  32. package/dist/src/modules/validators/webauthn.js +41 -7
  33. package/dist/src/transactions/intents/prepare.d.ts.map +1 -1
  34. package/dist/src/transactions/intents/prepare.js +16 -3
  35. package/dist/src/transactions/intents/sessions.d.ts.map +1 -1
  36. package/dist/src/transactions/intents/sessions.js +12 -1
  37. package/package.json +1 -4
@@ -15,7 +15,6 @@ declare function enable(validators: (OwnableValidatorConfig | WebauthnValidatorC
15
15
  declare function changeThreshold(newThreshold: number): CalldataInput;
16
16
  /**
17
17
  * Disable multi-factor authentication
18
- * @param rhinestoneAccount Account to disable multi-factor authentication on
19
18
  * @returns Calls to disable multi-factor authentication
20
19
  */
21
20
  declare function disable(): LazyCallInput;
@@ -1 +1 @@
1
- {"version":3,"file":"mfa.d.ts","sourceRoot":"","sources":["../../../actions/mfa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,GAAG,EAAiB,MAAM,MAAM,CAAA;AAClE,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,mBAAmB,CAAA;AA6C1B;;;;;GAKG;AACH,iBAAS,MAAM,CACb,UAAU,EAAE,CAAC,sBAAsB,GAAG,uBAAuB,GAAG,IAAI,CAAC,EAAE,EACvE,SAAS,SAAI,GACZ,aAAa,CAOf;AAED;;;;GAIG;AACH,iBAAS,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAkB5D;AAED;;;;GAIG;AACH,iBAAS,OAAO,IAAI,aAAa,CAOhC;AAED;;;;;GAKG;AACH,iBAAS,eAAe,CACtB,EAAE,EAAE,GAAG,GAAG,MAAM,EAChB,SAAS,EAAE,sBAAsB,GAAG,uBAAuB,GAC1D,aAAa,CA+Bf;AAED;;;;;GAKG;AACH,iBAAS,kBAAkB,CACzB,EAAE,EAAE,GAAG,GAAG,MAAM,EAChB,SAAS,EAAE,sBAAsB,GAAG,uBAAuB,GAC1D,aAAa,CA2Bf;AAED,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAA"}
1
+ {"version":3,"file":"mfa.d.ts","sourceRoot":"","sources":["../../../actions/mfa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,GAAG,EAAiB,MAAM,MAAM,CAAA;AAClE,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,mBAAmB,CAAA;AA6C1B;;;;;GAKG;AACH,iBAAS,MAAM,CACb,UAAU,EAAE,CAAC,sBAAsB,GAAG,uBAAuB,GAAG,IAAI,CAAC,EAAE,EACvE,SAAS,SAAI,GACZ,aAAa,CAOf;AAED;;;;GAIG;AACH,iBAAS,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAkB5D;AAED;;;GAGG;AACH,iBAAS,OAAO,IAAI,aAAa,CAOhC;AAED;;;;;GAKG;AACH,iBAAS,eAAe,CACtB,EAAE,EAAE,GAAG,GAAG,MAAM,EAChB,SAAS,EAAE,sBAAsB,GAAG,uBAAuB,GAC1D,aAAa,CA+Bf;AAED;;;;;GAKG;AACH,iBAAS,kBAAkB,CACzB,EAAE,EAAE,GAAG,GAAG,MAAM,EAChB,SAAS,EAAE,sBAAsB,GAAG,uBAAuB,GAC1D,aAAa,CA2Bf;AAED,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAA"}
@@ -61,7 +61,6 @@ function changeThreshold(newThreshold) {
61
61
  }
62
62
  /**
63
63
  * Disable multi-factor authentication
64
- * @param rhinestoneAccount Account to disable multi-factor authentication on
65
64
  * @returns Calls to disable multi-factor authentication
66
65
  */
67
66
  function disable() {
@@ -2,8 +2,7 @@ import type { CalldataInput, LazyCallInput } from '../config/account.js';
2
2
  import { type WebauthnCredential } from '../modules/validators/webauthn.js';
3
3
  /**
4
4
  * Enable passkeys authentication
5
- * @param pubKey Public key for the passkey
6
- * @param authenticatorId Authenticator ID for the passkey
5
+ * @param credential WebAuthn credential to enable
7
6
  * @returns Calls to enable passkeys authentication
8
7
  */
9
8
  declare function enable(credential: WebauthnCredential): LazyCallInput;
@@ -1 +1 @@
1
- {"version":3,"file":"passkeys.d.ts","sourceRoot":"","sources":["../../../actions/passkeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,gCAAgC,CAAA;AAWvC;;;;;GAKG;AACH,iBAAS,MAAM,CAAC,UAAU,EAAE,kBAAkB,GAAG,aAAa,CAU7D;AAED;;;GAGG;AACH,iBAAS,OAAO,IAAI,aAAa,CAgBhC;AAED;;;;;;GAMG;AACH,iBAAS,QAAQ,CACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,uBAAuB,EAAE,OAAO,GAC/B,aAAa,CAOf;AAED;;;;;GAKG;AACH,iBAAS,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CAEpE;AAED;;;;GAIG;AACH,iBAAS,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAE5D;AAED,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"passkeys.d.ts","sourceRoot":"","sources":["../../../actions/passkeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,gCAAgC,CAAA;AAWvC;;;;GAIG;AACH,iBAAS,MAAM,CAAC,UAAU,EAAE,kBAAkB,GAAG,aAAa,CAU7D;AAED;;;GAGG;AACH,iBAAS,OAAO,IAAI,aAAa,CAgBhC;AAED;;;;;;GAMG;AACH,iBAAS,QAAQ,CACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,uBAAuB,EAAE,OAAO,GAC/B,aAAa,CAOf;AAED;;;;;GAKG;AACH,iBAAS,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CAEpE;AAED;;;;GAIG;AACH,iBAAS,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAE5D;AAED,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -3,8 +3,7 @@ import { resolveModuleInstallation, resolveModuleUninstallation, } from './runti
3
3
  import { addWebauthnCredential, changeWebauthnThreshold, removeWebauthnCredential, } from './webauthn.js';
4
4
  /**
5
5
  * Enable passkeys authentication
6
- * @param pubKey Public key for the passkey
7
- * @param authenticatorId Authenticator ID for the passkey
6
+ * @param credential WebAuthn credential to enable
8
7
  * @returns Calls to enable passkeys authentication
9
8
  */
10
9
  function enable(credential) {
@@ -1 +1 @@
1
- {"version":3,"file":"portfolio.d.ts","sourceRoot":"","sources":["../../../../api/queries/portfolio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAE7E,wBAAsB,YAAY,CAAC,KAAK,EAAE;IACxC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAA;IACpC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAAA;IACpD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;CAC7B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA6BjC"}
1
+ {"version":3,"file":"portfolio.d.ts","sourceRoot":"","sources":["../../../../api/queries/portfolio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAMhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAE7E,wBAAsB,YAAY,CAAC,KAAK,EAAE;IACxC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAA;IACpC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAAA;IACpD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;CAC7B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAwBjC"}
@@ -1,22 +1,13 @@
1
- import { toEvmChainReference } from '../../chains/caip2.js';
1
+ import { formatCaip2, isEvmCaip2, toEvmChainReference, } from '../../chains/caip2.js';
2
2
  export async function getPortfolio(input) {
3
- // Filter on the catalog's own `testnet` flag — authoritative for every chain
4
- // the orchestrator supports (incl. non-EVM and chains newer than the SDK's
5
- // viem). Filtering through viem would silently drop unknown chains, so their
6
- // balances would disappear until an SDK/viem bump.
3
+ // The catalog's `testnet` flag is authoritative even for chains newer than
4
+ // the SDK's viem version, while the portfolio endpoint accepts only EIP-155.
7
5
  const catalog = await input.client.getChainCatalog();
8
6
  const chainIds = catalog
9
7
  .getSupportedChainIds()
10
- .filter((chainId) => catalog.isTestnet(chainId) === input.onTestnets);
11
- const accountChainId = chainIds.find((chainId) => {
12
- try {
13
- toEvmChainReference(chainId);
14
- return true;
15
- }
16
- catch {
17
- return false;
18
- }
19
- });
8
+ .filter((chainId) => catalog.isTestnet(chainId) === input.onTestnets &&
9
+ isEvmCaip2(formatCaip2(chainId)));
10
+ const accountChainId = chainIds[0];
20
11
  if (accountChainId === undefined) {
21
12
  throw new Error('No EVM chain is available for portfolio account resolution');
22
13
  }
@@ -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 {@link toSession} and pass
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
@@ -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 {@link toSession} and pass
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;AA4BhE,wBAAgB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UAAU,MAAM,EAAE,CAErE;AAKD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD"}
@@ -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-settled (id 1337) so `isNonEvmChainId` is
8
- // `false` for it even though its wire id is the non-`eip155` `hypercore:mainnet`.
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 !== 1337) {
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). HyperCore
81
- // (1337) is EVM-settled, so this is `false` for it even though its wire id is
82
- // the non-`eip155` `hypercore:mainnet` namespace.
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 === 1337) {
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:mainnet';
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 hyperCoreMainnet: NonEvmChain;
23
+ declare const hyperCoreSpot: NonEvmChain;
24
+ declare const hyperCorePerp: NonEvmChain;
24
25
  export type { DestinationChain, NativeCurrency, NonEvmAddress, NonEvmChain };
25
- export { hyperCoreMainnet, solanaMainnet, tronMainnet };
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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
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
- export { hyperCoreMainnet, solanaMainnet, tronMainnet };
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.0';
6
+ const SDK_VERSION = '2.2.2';
7
7
  const API_VERSION = '2026-04.blanc';
8
8
  export function createOrchestratorClient(options) {
9
9
  const fetchPort = options.fetch ?? globalThis.fetch;