@rhinestone/sdk 1.0.0-alpha.11 → 1.0.0-alpha.13

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 (59) hide show
  1. package/dist/src/accounts/index.d.ts +8 -6
  2. package/dist/src/accounts/index.d.ts.map +1 -1
  3. package/dist/src/accounts/index.js +69 -134
  4. package/dist/src/accounts/index.test.js +2 -2
  5. package/dist/src/accounts/kernel.d.ts +3 -2
  6. package/dist/src/accounts/kernel.d.ts.map +1 -1
  7. package/dist/src/accounts/kernel.js +3 -5
  8. package/dist/src/accounts/kernel.test.js +5 -10
  9. package/dist/src/accounts/nexus.d.ts +2 -2
  10. package/dist/src/accounts/nexus.d.ts.map +1 -1
  11. package/dist/src/accounts/nexus.js +5 -6
  12. package/dist/src/accounts/nexus.test.js +11 -12
  13. package/dist/src/accounts/safe.d.ts +2 -2
  14. package/dist/src/accounts/safe.d.ts.map +1 -1
  15. package/dist/src/accounts/safe.js +3 -5
  16. package/dist/src/accounts/safe.test.js +4 -5
  17. package/dist/src/accounts/signing/common.d.ts +23 -0
  18. package/dist/src/accounts/signing/common.d.ts.map +1 -0
  19. package/dist/src/accounts/signing/common.js +113 -0
  20. package/dist/src/accounts/signing/message.d.ts +5 -0
  21. package/dist/src/accounts/signing/message.d.ts.map +1 -0
  22. package/dist/src/accounts/signing/message.js +51 -0
  23. package/dist/src/accounts/signing/typedData.d.ts +5 -0
  24. package/dist/src/accounts/signing/typedData.d.ts.map +1 -0
  25. package/dist/src/accounts/signing/typedData.js +39 -0
  26. package/dist/src/accounts/startale.d.ts +2 -2
  27. package/dist/src/accounts/startale.d.ts.map +1 -1
  28. package/dist/src/accounts/startale.js +3 -3
  29. package/dist/src/accounts/startale.test.js +4 -5
  30. package/dist/src/actions/index.d.ts +84 -0
  31. package/dist/src/actions/index.d.ts.map +1 -1
  32. package/dist/src/actions/index.js +92 -0
  33. package/dist/src/actions/index.test.js +15 -15
  34. package/dist/src/actions/smart-session.d.ts +6 -0
  35. package/dist/src/actions/smart-session.d.ts.map +1 -1
  36. package/dist/src/actions/smart-session.js +6 -0
  37. package/dist/src/execution/compact.d.ts +128 -1
  38. package/dist/src/execution/compact.d.ts.map +1 -1
  39. package/dist/src/execution/compact.js +91 -0
  40. package/dist/src/execution/index.d.ts.map +1 -1
  41. package/dist/src/execution/index.js +2 -3
  42. package/dist/src/execution/utils.d.ts +6 -5
  43. package/dist/src/execution/utils.d.ts.map +1 -1
  44. package/dist/src/execution/utils.js +35 -6
  45. package/dist/src/index.d.ts +6 -5
  46. package/dist/src/index.d.ts.map +1 -1
  47. package/dist/src/index.js +77 -11
  48. package/dist/src/modules/index.test.js +1 -1
  49. package/dist/src/modules/validators/core.js +1 -1
  50. package/dist/src/modules/validators/core.test.js +3 -3
  51. package/dist/src/modules/validators/smart-sessions.js +3 -3
  52. package/dist/src/modules/validators/smart-sessions.test.js +4 -4
  53. package/dist/src/orchestrator/index.d.ts +1 -2
  54. package/dist/src/orchestrator/index.d.ts.map +1 -1
  55. package/dist/src/orchestrator/index.js +1 -3
  56. package/dist/src/orchestrator/utils.d.ts +1 -3
  57. package/dist/src/orchestrator/utils.d.ts.map +1 -1
  58. package/dist/src/orchestrator/utils.js +0 -102
  59. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTokenAddressSupported = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.getTokenSymbol = exports.getWethAddress = exports.getIntentOpHash = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.INTENT_STATUS_UNKNOWN = exports.INTENT_STATUS_PRECONFIRMED = exports.INTENT_STATUS_FAILED = exports.INTENT_STATUS_FILLED = exports.INTENT_STATUS_COMPLETED = exports.INTENT_STATUS_PARTIALLY_COMPLETED = exports.INTENT_STATUS_EXPIRED = exports.INTENT_STATUS_PENDING = void 0;
3
+ exports.isTokenAddressSupported = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.getTokenSymbol = exports.getWethAddress = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.INTENT_STATUS_UNKNOWN = exports.INTENT_STATUS_PRECONFIRMED = exports.INTENT_STATUS_FAILED = exports.INTENT_STATUS_FILLED = exports.INTENT_STATUS_COMPLETED = exports.INTENT_STATUS_PARTIALLY_COMPLETED = exports.INTENT_STATUS_EXPIRED = exports.INTENT_STATUS_PENDING = void 0;
4
4
  exports.getOrchestrator = getOrchestrator;
5
5
  const client_1 = require("./client");
6
6
  Object.defineProperty(exports, "Orchestrator", { enumerable: true, get: function () { return client_1.Orchestrator; } });
@@ -35,8 +35,6 @@ Object.defineProperty(exports, "INTENT_STATUS_PARTIALLY_COMPLETED", { enumerable
35
35
  Object.defineProperty(exports, "INTENT_STATUS_PENDING", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PENDING; } });
36
36
  Object.defineProperty(exports, "INTENT_STATUS_PRECONFIRMED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PRECONFIRMED; } });
37
37
  Object.defineProperty(exports, "INTENT_STATUS_UNKNOWN", { enumerable: true, get: function () { return types_1.INTENT_STATUS_UNKNOWN; } });
38
- const utils_1 = require("./utils");
39
- Object.defineProperty(exports, "getIntentOpHash", { enumerable: true, get: function () { return utils_1.getIntentOpHash; } });
40
38
  function getOrchestrator(apiKey, orchestratorUrl) {
41
39
  return new client_1.Orchestrator(orchestratorUrl ?? consts_1.PROD_ORCHESTRATOR_URL, apiKey);
42
40
  }
@@ -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 { getIntentOpHash, convertBigIntFields };
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":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,SAAS,CAAA;AAWzD,iBAAS,eAAe,CAAC,QAAQ,EAAE,QAAQ,iBA4F1C;AAED,iBAAS,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAwB1C;AAED,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAA"}
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 '0x1636b30481Db91Bbc5818e65d3962838BdCd5569';
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: '0xAbd3388A633758D0Bae01Efb885EF1e87BD519a6',
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/sdk",
3
- "version": "1.0.0-alpha.11",
3
+ "version": "1.0.0-alpha.13",
4
4
  "description": "End-to-end chain abstraction and modularity toolkit",
5
5
  "author": {
6
6
  "name": "Rhinestone",