@pushchain/core 6.0.23 → 6.0.25

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 (94) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/package.json +1 -1
  3. package/src/lib/constants/abi/index.d.ts +1 -0
  4. package/src/lib/constants/abi/index.js +4 -1
  5. package/src/lib/constants/abi/prc20.evm.d.ts +32 -0
  6. package/src/lib/constants/abi/prc20.evm.js +20 -0
  7. package/src/lib/constants/abi/uea-factory.d.ts +31 -0
  8. package/src/lib/constants/abi/uea-factory.js +19 -0
  9. package/src/lib/constants/abi/universalCallback.evm.d.ts +561 -0
  10. package/src/lib/constants/abi/universalCallback.evm.js +247 -0
  11. package/src/lib/constants/abi/universalGatewayV0.json +1 -1
  12. package/src/lib/constants/abi/universalReadRegistry.evm.d.ts +247 -0
  13. package/src/lib/constants/abi/universalReadRegistry.evm.js +38 -0
  14. package/src/lib/constants/chain.d.ts +12 -0
  15. package/src/lib/constants/chain.js +23 -1
  16. package/src/lib/constants/enums.d.ts +7 -0
  17. package/src/lib/constants/enums.js +11 -0
  18. package/src/lib/constants/index.d.ts +52 -0
  19. package/src/lib/constants/index.js +37 -8
  20. package/src/lib/constants/read-state.d.ts +53 -0
  21. package/src/lib/constants/read-state.js +59 -0
  22. package/src/lib/generated/ucallback/v1/index.d.ts +2 -0
  23. package/src/lib/generated/ucallback/v1/index.js +6 -0
  24. package/src/lib/generated/ucallback/v1/query.d.ts +47 -0
  25. package/src/lib/generated/ucallback/v1/query.js +131 -0
  26. package/src/lib/generated/ucallback/v1/types.d.ts +99 -0
  27. package/src/lib/generated/ucallback/v1/types.js +366 -0
  28. package/src/lib/generated/uexecutor/v1/query.d.ts +29 -0
  29. package/src/lib/generated/uexecutor/v1/query.js +98 -1
  30. package/src/lib/index.d.ts +9 -0
  31. package/src/lib/index.js +37 -1
  32. package/src/lib/orchestrator/internals/cascade.js +5 -2
  33. package/src/lib/orchestrator/internals/errors.d.ts +6 -0
  34. package/src/lib/orchestrator/internals/errors.js +13 -1
  35. package/src/lib/orchestrator/internals/index.d.ts +1 -0
  36. package/src/lib/orchestrator/internals/index.js +6 -1
  37. package/src/lib/orchestrator/internals/push-chain-tx.js +81 -61
  38. package/src/lib/orchestrator/internals/read-state.d.ts +24 -0
  39. package/src/lib/orchestrator/internals/read-state.js +47 -0
  40. package/src/lib/orchestrator/internals/route-handlers.js +6 -1
  41. package/src/lib/orchestrator/internals/svm-helpers.js +24 -0
  42. package/src/lib/orchestrator/orchestrator.d.ts +26 -0
  43. package/src/lib/orchestrator/orchestrator.js +22 -0
  44. package/src/lib/orchestrator/orchestrator.types.d.ts +2 -0
  45. package/src/lib/orchestrator/route-detector.js +4 -0
  46. package/src/lib/progress-hook/progress-hook.js +271 -0
  47. package/src/lib/progress-hook/progress-hook.types.d.ts +32 -0
  48. package/src/lib/progress-hook/progress-hook.types.js +34 -0
  49. package/src/lib/push-chain/push-chain.d.ts +70 -0
  50. package/src/lib/push-chain/push-chain.js +27 -0
  51. package/src/lib/push-client/push-client.d.ts +35 -2
  52. package/src/lib/push-client/push-client.js +117 -4
  53. package/src/lib/read-state/budget.d.ts +16 -0
  54. package/src/lib/read-state/budget.js +32 -0
  55. package/src/lib/read-state/destination.d.ts +12 -0
  56. package/src/lib/read-state/destination.js +51 -0
  57. package/src/lib/read-state/envelopes/evm.d.ts +24 -0
  58. package/src/lib/read-state/envelopes/evm.js +148 -0
  59. package/src/lib/read-state/envelopes/index.d.ts +12 -0
  60. package/src/lib/read-state/envelopes/index.js +45 -0
  61. package/src/lib/read-state/envelopes/svm.d.ts +32 -0
  62. package/src/lib/read-state/envelopes/svm.js +107 -0
  63. package/src/lib/read-state/envelopes/web2.d.ts +29 -0
  64. package/src/lib/read-state/envelopes/web2.js +149 -0
  65. package/src/lib/read-state/errors.d.ts +70 -0
  66. package/src/lib/read-state/errors.js +116 -0
  67. package/src/lib/read-state/index.d.ts +13 -0
  68. package/src/lib/read-state/index.js +38 -0
  69. package/src/lib/read-state/preflight.d.ts +21 -0
  70. package/src/lib/read-state/preflight.js +70 -0
  71. package/src/lib/read-state/read-events.d.ts +27 -0
  72. package/src/lib/read-state/read-events.js +135 -0
  73. package/src/lib/read-state/read-executor.d.ts +18 -0
  74. package/src/lib/read-state/read-executor.js +212 -0
  75. package/src/lib/read-state/read-params.d.ts +205 -0
  76. package/src/lib/read-state/read-params.js +120 -0
  77. package/src/lib/read-state/read-state.types.d.ts +417 -0
  78. package/src/lib/read-state/read-state.types.js +50 -0
  79. package/src/lib/read-state/read-tracker.d.ts +50 -0
  80. package/src/lib/read-state/read-tracker.js +415 -0
  81. package/src/lib/read-state/registry.d.ts +21 -0
  82. package/src/lib/read-state/registry.js +54 -0
  83. package/src/lib/read-state/result-decoder.d.ts +16 -0
  84. package/src/lib/read-state/result-decoder.js +73 -0
  85. package/src/lib/read-state/spec-builder.d.ts +47 -0
  86. package/src/lib/read-state/spec-builder.js +251 -0
  87. package/src/lib/read-state/validate.d.ts +22 -0
  88. package/src/lib/read-state/validate.js +80 -0
  89. package/src/lib/universal-tx-detector/child-inbounds.d.ts +3 -1
  90. package/src/lib/universal-tx-detector/child-inbounds.js +4 -5
  91. package/src/lib/universal-tx-detector/detector-svm.js +29 -20
  92. package/src/lib/universal-tx-detector/svm-events.d.ts +17 -5
  93. package/src/lib/universal-tx-detector/svm-events.js +81 -6
  94. package/src/lib/vm-client/evm-client.js +27 -10
@@ -0,0 +1,247 @@
1
+ /** UniversalReadRegistry ABI supplied with the Donut proxy deployment. */
2
+ export declare const UNIVERSAL_READ_REGISTRY_EVM: readonly [{
3
+ readonly type: "function";
4
+ readonly name: "read";
5
+ readonly stateMutability: "payable";
6
+ readonly inputs: readonly [{
7
+ readonly name: "spec";
8
+ readonly type: "tuple";
9
+ readonly components: readonly [{
10
+ readonly name: "account";
11
+ readonly type: "tuple";
12
+ readonly internalType: "struct UniversalAccountId";
13
+ readonly components: readonly [{
14
+ readonly name: "chainNamespace";
15
+ readonly type: "string";
16
+ readonly internalType: "string";
17
+ }, {
18
+ readonly name: "chainId";
19
+ readonly type: "string";
20
+ readonly internalType: "string";
21
+ }, {
22
+ readonly name: "owner";
23
+ readonly type: "bytes";
24
+ readonly internalType: "bytes";
25
+ }];
26
+ }, {
27
+ readonly name: "query";
28
+ readonly type: "bytes";
29
+ readonly internalType: "bytes";
30
+ }, {
31
+ readonly name: "minConfirmations";
32
+ readonly type: "uint16";
33
+ readonly internalType: "uint16";
34
+ }, {
35
+ readonly name: "blockNumber";
36
+ readonly type: "uint64";
37
+ readonly internalType: "uint64";
38
+ }, {
39
+ readonly name: "expiryPushChainHeight";
40
+ readonly type: "uint64";
41
+ readonly internalType: "uint64";
42
+ }, {
43
+ readonly name: "maxFee";
44
+ readonly type: "uint256";
45
+ readonly internalType: "uint256";
46
+ }, {
47
+ readonly name: "revertRecipient";
48
+ readonly type: "address";
49
+ readonly internalType: "address";
50
+ }];
51
+ }, {
52
+ readonly name: "queryKey";
53
+ readonly type: "bytes32";
54
+ }, {
55
+ readonly name: "callbackGasLimit";
56
+ readonly type: "uint64";
57
+ }];
58
+ readonly outputs: readonly [{
59
+ readonly name: "requestId";
60
+ readonly type: "uint256";
61
+ }];
62
+ }, {
63
+ readonly type: "constructor";
64
+ readonly stateMutability: "nonpayable";
65
+ readonly inputs: readonly [{
66
+ readonly type: "address";
67
+ readonly name: "universalCallback_";
68
+ }];
69
+ }, {
70
+ readonly name: "initialize";
71
+ readonly type: "function";
72
+ readonly stateMutability: "nonpayable";
73
+ readonly inputs: readonly [];
74
+ readonly outputs: readonly [];
75
+ }, {
76
+ readonly name: "getLocalContext";
77
+ readonly type: "function";
78
+ readonly stateMutability: "view";
79
+ readonly inputs: readonly [{
80
+ readonly type: "uint256";
81
+ readonly name: "requestId";
82
+ }];
83
+ readonly outputs: readonly [{
84
+ readonly type: "bytes";
85
+ }];
86
+ }, {
87
+ readonly name: "hasResult";
88
+ readonly type: "function";
89
+ readonly stateMutability: "view";
90
+ readonly inputs: readonly [{
91
+ readonly type: "uint256";
92
+ readonly name: "requestId";
93
+ }];
94
+ readonly outputs: readonly [{
95
+ readonly type: "bool";
96
+ }];
97
+ }, {
98
+ readonly name: "onUniversalData";
99
+ readonly type: "function";
100
+ readonly stateMutability: "nonpayable";
101
+ readonly inputs: readonly [{
102
+ readonly type: "uint256";
103
+ readonly name: "requestId";
104
+ }, {
105
+ readonly type: "bytes";
106
+ readonly name: "resultData";
107
+ }];
108
+ readonly outputs: readonly [];
109
+ }, {
110
+ readonly name: "queryKeyOf";
111
+ readonly type: "function";
112
+ readonly stateMutability: "view";
113
+ readonly inputs: readonly [{
114
+ readonly type: "uint256";
115
+ }];
116
+ readonly outputs: readonly [{
117
+ readonly type: "bytes32";
118
+ }];
119
+ }, {
120
+ readonly name: "readerOf";
121
+ readonly type: "function";
122
+ readonly stateMutability: "view";
123
+ readonly inputs: readonly [{
124
+ readonly type: "uint256";
125
+ }];
126
+ readonly outputs: readonly [{
127
+ readonly type: "address";
128
+ }];
129
+ }, {
130
+ readonly name: "requestOrderOf";
131
+ readonly type: "function";
132
+ readonly stateMutability: "view";
133
+ readonly inputs: readonly [{
134
+ readonly type: "uint256";
135
+ }];
136
+ readonly outputs: readonly [{
137
+ readonly type: "uint256";
138
+ }];
139
+ }, {
140
+ readonly name: "universalCallback";
141
+ readonly type: "function";
142
+ readonly stateMutability: "view";
143
+ readonly inputs: readonly [];
144
+ readonly outputs: readonly [{
145
+ readonly type: "address";
146
+ }];
147
+ }, {
148
+ readonly name: "resultByRequestId";
149
+ readonly type: "function";
150
+ readonly stateMutability: "view";
151
+ readonly inputs: readonly [{
152
+ readonly type: "uint256";
153
+ readonly name: "requestId";
154
+ }];
155
+ readonly outputs: readonly [{
156
+ readonly type: "tuple";
157
+ readonly components: readonly [{
158
+ readonly type: "uint256";
159
+ readonly name: "requestId";
160
+ }, {
161
+ readonly type: "bytes";
162
+ readonly name: "resultData";
163
+ }, {
164
+ readonly type: "uint64";
165
+ readonly name: "updatedAtBlock";
166
+ }];
167
+ }];
168
+ }, {
169
+ readonly name: "latestResult";
170
+ readonly type: "function";
171
+ readonly stateMutability: "view";
172
+ readonly inputs: readonly [{
173
+ readonly type: "address";
174
+ readonly name: "reader";
175
+ }, {
176
+ readonly type: "bytes32";
177
+ readonly name: "queryKey";
178
+ }];
179
+ readonly outputs: readonly [{
180
+ readonly type: "tuple";
181
+ readonly components: readonly [{
182
+ readonly type: "uint256";
183
+ readonly name: "requestId";
184
+ }, {
185
+ readonly type: "bytes";
186
+ readonly name: "resultData";
187
+ }, {
188
+ readonly type: "uint64";
189
+ readonly name: "updatedAtBlock";
190
+ }];
191
+ }];
192
+ }, {
193
+ readonly name: "Initialized";
194
+ readonly type: "event";
195
+ readonly inputs: readonly [{
196
+ readonly type: "uint64";
197
+ readonly name: "version";
198
+ }];
199
+ }, {
200
+ readonly name: "RegistryReadRequested";
201
+ readonly type: "event";
202
+ readonly inputs: readonly [{
203
+ readonly type: "uint256";
204
+ readonly name: "requestId";
205
+ readonly indexed: true;
206
+ }, {
207
+ readonly type: "address";
208
+ readonly name: "reader";
209
+ readonly indexed: true;
210
+ }, {
211
+ readonly type: "bytes32";
212
+ readonly name: "queryKey";
213
+ readonly indexed: true;
214
+ }];
215
+ }, {
216
+ readonly name: "RegistryReadStored";
217
+ readonly type: "event";
218
+ readonly inputs: readonly [{
219
+ readonly type: "uint256";
220
+ readonly name: "requestId";
221
+ readonly indexed: true;
222
+ }, {
223
+ readonly type: "address";
224
+ readonly name: "reader";
225
+ readonly indexed: true;
226
+ }, {
227
+ readonly type: "bytes32";
228
+ readonly name: "queryKey";
229
+ readonly indexed: true;
230
+ }];
231
+ }, {
232
+ readonly name: "InvalidInitialization";
233
+ readonly type: "error";
234
+ readonly inputs: readonly [];
235
+ }, {
236
+ readonly name: "NotInitializing";
237
+ readonly type: "error";
238
+ readonly inputs: readonly [];
239
+ }, {
240
+ readonly name: "UnauthorizedCaller";
241
+ readonly type: "error";
242
+ readonly inputs: readonly [];
243
+ }, {
244
+ readonly name: "ZeroAddressInit";
245
+ readonly type: "error";
246
+ readonly inputs: readonly [];
247
+ }];
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNIVERSAL_READ_REGISTRY_EVM = void 0;
4
+ const viem_1 = require("viem");
5
+ const universalCallback_evm_1 = require("./universalCallback.evm");
6
+ /** UniversalReadRegistry ABI supplied with the Donut proxy deployment. */
7
+ exports.UNIVERSAL_READ_REGISTRY_EVM = [
8
+ {
9
+ type: 'function', name: 'read', stateMutability: 'payable',
10
+ inputs: [
11
+ { name: 'spec', type: 'tuple', components: universalCallback_evm_1.READ_SPEC_COMPONENTS },
12
+ { name: 'queryKey', type: 'bytes32' },
13
+ { name: 'callbackGasLimit', type: 'uint64' },
14
+ ],
15
+ outputs: [{ name: 'requestId', type: 'uint256' }],
16
+ },
17
+ ...(0, viem_1.parseAbi)([
18
+ 'constructor(address universalCallback_)',
19
+ 'function initialize()',
20
+ 'function getLocalContext(uint256 requestId) view returns (bytes)',
21
+ 'function hasResult(uint256 requestId) view returns (bool)',
22
+ 'function onUniversalData(uint256 requestId, bytes resultData)',
23
+ 'function queryKeyOf(uint256) view returns (bytes32)',
24
+ 'function readerOf(uint256) view returns (address)',
25
+ 'function requestOrderOf(uint256) view returns (uint256)',
26
+ 'function universalCallback() view returns (address)',
27
+ 'function resultByRequestId(uint256 requestId) view returns ((uint256 requestId, bytes resultData, uint64 updatedAtBlock))',
28
+ 'function latestResult(address reader, bytes32 queryKey) view returns ((uint256 requestId, bytes resultData, uint64 updatedAtBlock))',
29
+ 'event Initialized(uint64 version)',
30
+ 'event RegistryReadRequested(uint256 indexed requestId, address indexed reader, bytes32 indexed queryKey)',
31
+ 'event RegistryReadStored(uint256 indexed requestId, address indexed reader, bytes32 indexed queryKey)',
32
+ 'error InvalidInitialization()',
33
+ 'error NotInitializing()',
34
+ 'error UnauthorizedCaller()',
35
+ 'error ZeroAddressInit()',
36
+ ]),
37
+ ];
38
+ //# sourceMappingURL=universalReadRegistry.evm.js.map
@@ -15,6 +15,18 @@ export declare const UEA_PROXY: Record<PUSH_NETWORK, `0x${string}`>;
15
15
  * Used to read UEA_VERSION (minRequiredVersion) and UEA_MIGRATION_CONTRACT.
16
16
  */
17
17
  export declare const UEA_FACTORY: Record<PUSH_NETWORK, `0x${string}`>;
18
+ /**
19
+ * UniversalCore — genesis predeploy, identical on every network. The read path
20
+ * uses it for the destination-height ceiling (`chainHeightByChainNamespace`,
21
+ * CAIP-2 keyed) and the read protocol fee (`readBaseFeeByChainNamespace`).
22
+ */
23
+ export declare const UNIVERSAL_CORE_ADDRESSES: Record<PUSH_NETWORK, `0x${string}`>;
24
+ /**
25
+ * UniversalCallback — the read-request contract, genesis predeploy at 0x…C2.
26
+ * Apps call `requestExternalReadSelf` on it; the SDK reads `estimateFee`,
27
+ * `statusOf` and parses its events. Same address on every network.
28
+ */
29
+ export declare const UNIVERSAL_CALLBACK_ADDRESSES: Record<PUSH_NETWORK, `0x${string}`>;
18
30
  /**
19
31
  * UEAMigration contract address on Push Chain.
20
32
  * Used in MsgMigrateUEA to specify which migration contract to delegatecall.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CHAIN_EXPLORERS = exports.CEA_FACTORY_ADDRESSES = exports.VAULT_ADDRESSES = exports.SVM_PYTH_PRICE_FEED = exports.UNIVERSAL_GATEWAY_ADDRESSES = exports.PUSH_VIEM_CHAINS = exports.PUSH_CHAIN_INFO = exports.CHAIN_INFO = exports.PUSH_BATCH_EXECUTOR_ADDRESS = exports.SYNTHETIC_PUSH_ERC20 = exports.UEA_MIGRATION = exports.UEA_FACTORY = exports.UEA_PROXY = exports.VM_NAMESPACE = void 0;
3
+ exports.CHAIN_EXPLORERS = exports.CEA_FACTORY_ADDRESSES = exports.VAULT_ADDRESSES = exports.SVM_PYTH_PRICE_FEED = exports.UNIVERSAL_GATEWAY_ADDRESSES = exports.PUSH_VIEM_CHAINS = exports.PUSH_CHAIN_INFO = exports.CHAIN_INFO = exports.PUSH_BATCH_EXECUTOR_ADDRESS = exports.SYNTHETIC_PUSH_ERC20 = exports.UEA_MIGRATION = exports.UNIVERSAL_CALLBACK_ADDRESSES = exports.UNIVERSAL_CORE_ADDRESSES = exports.UEA_FACTORY = exports.UEA_PROXY = exports.VM_NAMESPACE = void 0;
4
4
  exports.getBatchExecutorAddress = getBatchExecutorAddress;
5
5
  exports.getPushViemChain = getPushViemChain;
6
6
  exports.getExplorerTxUrl = getExplorerTxUrl;
@@ -36,6 +36,28 @@ exports.UEA_FACTORY = {
36
36
  [enums_1.PUSH_NETWORK.TESTNET]: '0x00000000000000000000000000000000000000eA',
37
37
  [enums_1.PUSH_NETWORK.LOCALNET]: '0x00000000000000000000000000000000000000eA',
38
38
  };
39
+ /**
40
+ * UniversalCore — genesis predeploy, identical on every network. The read path
41
+ * uses it for the destination-height ceiling (`chainHeightByChainNamespace`,
42
+ * CAIP-2 keyed) and the read protocol fee (`readBaseFeeByChainNamespace`).
43
+ */
44
+ exports.UNIVERSAL_CORE_ADDRESSES = {
45
+ [enums_1.PUSH_NETWORK.MAINNET]: '0x00000000000000000000000000000000000000C0',
46
+ [enums_1.PUSH_NETWORK.TESTNET_DONUT]: '0x00000000000000000000000000000000000000C0',
47
+ [enums_1.PUSH_NETWORK.TESTNET]: '0x00000000000000000000000000000000000000C0',
48
+ [enums_1.PUSH_NETWORK.LOCALNET]: '0x00000000000000000000000000000000000000C0',
49
+ };
50
+ /**
51
+ * UniversalCallback — the read-request contract, genesis predeploy at 0x…C2.
52
+ * Apps call `requestExternalReadSelf` on it; the SDK reads `estimateFee`,
53
+ * `statusOf` and parses its events. Same address on every network.
54
+ */
55
+ exports.UNIVERSAL_CALLBACK_ADDRESSES = {
56
+ [enums_1.PUSH_NETWORK.MAINNET]: '0x00000000000000000000000000000000000000c2',
57
+ [enums_1.PUSH_NETWORK.TESTNET_DONUT]: '0x00000000000000000000000000000000000000c2',
58
+ [enums_1.PUSH_NETWORK.TESTNET]: '0x00000000000000000000000000000000000000c2',
59
+ [enums_1.PUSH_NETWORK.LOCALNET]: '0x00000000000000000000000000000000000000c2',
60
+ };
39
61
  /**
40
62
  * UEAMigration contract address on Push Chain.
41
63
  * Used in MsgMigrateUEA to specify which migration contract to delegatecall.
@@ -26,6 +26,13 @@ export declare enum CHAIN {
26
26
  SOLANA_TESTNET = "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",
27
27
  SOLANA_DEVNET = "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
28
28
  }
29
+ /**
30
+ * Read-only destination exposed with the OG `CHAIN.WEB2` spelling without
31
+ * widening the blockchain enum type accepted by transaction APIs.
32
+ */
33
+ export declare namespace CHAIN {
34
+ const WEB2: "web2:https";
35
+ }
29
36
  /**
30
37
  * Represents the virtual machine or execution environment for a chain.
31
38
  */
@@ -34,6 +34,17 @@ var CHAIN;
34
34
  CHAIN["SOLANA_TESTNET"] = "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z";
35
35
  CHAIN["SOLANA_DEVNET"] = "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
36
36
  })(CHAIN || (exports.CHAIN = CHAIN = {}));
37
+ /**
38
+ * Read-only destination exposed with the OG `CHAIN.WEB2` spelling without
39
+ * widening the blockchain enum type accepted by transaction APIs.
40
+ */
41
+ // eslint-disable-next-line @typescript-eslint/no-namespace -- declaration merging keeps Web2 out of the transaction enum union
42
+ (function (CHAIN) {
43
+ CHAIN.WEB2 = 'web2:https';
44
+ })(CHAIN || (exports.CHAIN = CHAIN = {}));
45
+ // Namespace properties are normally enumerable after TypeScript emits them.
46
+ // Keep blockchain enumeration (`Object.values(CHAIN)`) blockchain-only.
47
+ Object.defineProperty(CHAIN, 'WEB2', { value: CHAIN.WEB2, enumerable: false });
37
48
  /**
38
49
  * Represents the virtual machine or execution environment for a chain.
39
50
  */
@@ -1,5 +1,31 @@
1
1
  import { CHAIN, LIBRARY, PUSH_NETWORK } from './enums';
2
2
  import { TypedDataDomain, TypedData } from '../universal/signer/signer.types';
3
+ import { UNIVERSAL_READ_STATUS, READ_STATUS, READ_ERROR_CODE } from '../read-state/read-state.types';
4
+ /** `PushChain.CONSTANTS.READ` — cross-chain read state. Values verified against the deployed UniversalCallback. */
5
+ export declare const READ_CONSTANTS: {
6
+ /** Read-only Web2 destination. Equivalent to `CHAIN.WEB2`. */
7
+ readonly WEB2: "web2:https";
8
+ readonly NAMESPACE: {
9
+ readonly EVM: "eip155";
10
+ readonly SVM: "solana";
11
+ readonly WEB2: "web2";
12
+ };
13
+ readonly MAX_CALLBACK_GAS_LIMIT: 1000000n;
14
+ readonly MIN_CONFIRMATIONS_FLOOR: 1;
15
+ readonly DEFAULT_EXPIRY_BLOCKS: 300n;
16
+ readonly CALLBACK_BUDGET_BUFFER: 3;
17
+ readonly REGISTRY_CALLBACK_GAS: 500000n;
18
+ readonly UNIVERSAL_READ_REGISTRY_ADDRESS: {
19
+ readonly TESTNET_DONUT: "0x91b09DAd1774bAfDE679F9ebB5F9046AE2b928C8";
20
+ };
21
+ readonly WEB2_MAX_EXTRACT_ENTRIES: 16;
22
+ readonly WEB2_DEFAULT_TIMEOUT_MS: 5000;
23
+ readonly UNIVERSAL_CORE_ADDRESSES: Record<PUSH_NETWORK, `0x${string}`>;
24
+ readonly UNIVERSAL_CALLBACK_ADDRESSES: Record<PUSH_NETWORK, `0x${string}`>;
25
+ readonly STATUS: typeof UNIVERSAL_READ_STATUS;
26
+ readonly RESULT_STATUS: typeof READ_STATUS;
27
+ readonly ERROR_CODE: typeof READ_ERROR_CODE;
28
+ };
3
29
  export type { MoveableToken, PayableToken, PushChainMoveableToken, ChainSuffixAccessor, UsdcChainSuffixAccessor, PushChainMoveableTokenAccessor, MoveableTokenConstantsMap, PayableTokenConstantsMap, } from './tokens';
4
30
  export declare const CONSTANTS: {
5
31
  PUSH_NETWORK: typeof PUSH_NETWORK;
@@ -11,7 +37,33 @@ export declare const CONSTANTS: {
11
37
  PAYABLE: {
12
38
  TOKEN: import("./tokens").PayableTokenConstantsMap;
13
39
  };
40
+ READ: {
41
+ /** Read-only Web2 destination. Equivalent to `CHAIN.WEB2`. */
42
+ readonly WEB2: "web2:https";
43
+ readonly NAMESPACE: {
44
+ readonly EVM: "eip155";
45
+ readonly SVM: "solana";
46
+ readonly WEB2: "web2";
47
+ };
48
+ readonly MAX_CALLBACK_GAS_LIMIT: 1000000n;
49
+ readonly MIN_CONFIRMATIONS_FLOOR: 1;
50
+ readonly DEFAULT_EXPIRY_BLOCKS: 300n;
51
+ readonly CALLBACK_BUDGET_BUFFER: 3;
52
+ readonly REGISTRY_CALLBACK_GAS: 500000n;
53
+ readonly UNIVERSAL_READ_REGISTRY_ADDRESS: {
54
+ readonly TESTNET_DONUT: "0x91b09DAd1774bAfDE679F9ebB5F9046AE2b928C8";
55
+ };
56
+ readonly WEB2_MAX_EXTRACT_ENTRIES: 16;
57
+ readonly WEB2_DEFAULT_TIMEOUT_MS: 5000;
58
+ readonly UNIVERSAL_CORE_ADDRESSES: Record<PUSH_NETWORK, `0x${string}`>;
59
+ readonly UNIVERSAL_CALLBACK_ADDRESSES: Record<PUSH_NETWORK, `0x${string}`>;
60
+ readonly STATUS: typeof UNIVERSAL_READ_STATUS;
61
+ readonly RESULT_STATUS: typeof READ_STATUS;
62
+ readonly ERROR_CODE: typeof READ_ERROR_CODE;
63
+ };
14
64
  };
15
65
  export type { TypedDataDomain, TypedData };
16
66
  export { CHAIN_EXPLORERS, CEA_FACTORY_ADDRESSES, UNIVERSAL_GATEWAY_ADDRESSES, VAULT_ADDRESSES, getExplorerTxUrl, getExplorerAddressUrl, } from './chain';
17
67
  export { MULTICALL_SELECTOR, UEA_MULTICALL_SELECTOR, MIGRATION_SELECTOR, TX_TYPE, ZERO_ADDRESS, DEFAULT_OUTBOUND_GAS_LIMIT, DEFAULT_CEA_TO_PUSH_GAS_LIMIT, } from './selectors';
68
+ export { UNIVERSAL_CORE_ADDRESSES, UNIVERSAL_CALLBACK_ADDRESSES } from './chain';
69
+ export * from './read-state';
@@ -1,8 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_CEA_TO_PUSH_GAS_LIMIT = exports.DEFAULT_OUTBOUND_GAS_LIMIT = exports.ZERO_ADDRESS = exports.TX_TYPE = exports.MIGRATION_SELECTOR = exports.UEA_MULTICALL_SELECTOR = exports.MULTICALL_SELECTOR = exports.getExplorerAddressUrl = exports.getExplorerTxUrl = exports.VAULT_ADDRESSES = exports.UNIVERSAL_GATEWAY_ADDRESSES = exports.CEA_FACTORY_ADDRESSES = exports.CHAIN_EXPLORERS = exports.CONSTANTS = void 0;
3
+ exports.UNIVERSAL_CALLBACK_ADDRESSES = exports.UNIVERSAL_CORE_ADDRESSES = exports.DEFAULT_CEA_TO_PUSH_GAS_LIMIT = exports.DEFAULT_OUTBOUND_GAS_LIMIT = exports.ZERO_ADDRESS = exports.TX_TYPE = exports.MIGRATION_SELECTOR = exports.UEA_MULTICALL_SELECTOR = exports.MULTICALL_SELECTOR = exports.getExplorerAddressUrl = exports.getExplorerTxUrl = exports.VAULT_ADDRESSES = exports.UNIVERSAL_GATEWAY_ADDRESSES = exports.CEA_FACTORY_ADDRESSES = exports.CHAIN_EXPLORERS = exports.CONSTANTS = exports.READ_CONSTANTS = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const enums_1 = require("./enums");
5
6
  const tokens_1 = require("./tokens");
7
+ const chain_1 = require("./chain");
8
+ const read_state_1 = require("./read-state");
9
+ const read_state_types_1 = require("../read-state/read-state.types");
10
+ /** `PushChain.CONSTANTS.READ` — cross-chain read state. Values verified against the deployed UniversalCallback. */
11
+ exports.READ_CONSTANTS = {
12
+ /** Read-only Web2 destination. Equivalent to `CHAIN.WEB2`. */
13
+ WEB2: enums_1.CHAIN.WEB2,
14
+ NAMESPACE: read_state_1.READ_NAMESPACE,
15
+ MAX_CALLBACK_GAS_LIMIT: read_state_1.MAX_CALLBACK_GAS_LIMIT,
16
+ MIN_CONFIRMATIONS_FLOOR: read_state_1.MIN_CONFIRMATIONS_FLOOR,
17
+ DEFAULT_EXPIRY_BLOCKS: read_state_1.DEFAULT_EXPIRY_BLOCKS,
18
+ CALLBACK_BUDGET_BUFFER: read_state_1.CALLBACK_BUDGET_BUFFER,
19
+ REGISTRY_CALLBACK_GAS: read_state_1.REGISTRY_CALLBACK_GAS,
20
+ UNIVERSAL_READ_REGISTRY_ADDRESS: read_state_1.UNIVERSAL_READ_REGISTRY_ADDRESS,
21
+ WEB2_MAX_EXTRACT_ENTRIES: read_state_1.WEB2_MAX_EXTRACT_ENTRIES,
22
+ WEB2_DEFAULT_TIMEOUT_MS: read_state_1.WEB2_DEFAULT_TIMEOUT_MS,
23
+ UNIVERSAL_CORE_ADDRESSES: chain_1.UNIVERSAL_CORE_ADDRESSES,
24
+ UNIVERSAL_CALLBACK_ADDRESSES: chain_1.UNIVERSAL_CALLBACK_ADDRESSES,
25
+ STATUS: read_state_types_1.UNIVERSAL_READ_STATUS,
26
+ RESULT_STATUS: read_state_types_1.READ_STATUS,
27
+ ERROR_CODE: read_state_types_1.READ_ERROR_CODE,
28
+ };
6
29
  // NOTE - Only include enums & constants which need to be exported to end user.
7
30
  exports.CONSTANTS = {
8
31
  PUSH_NETWORK: enums_1.PUSH_NETWORK,
@@ -10,15 +33,16 @@ exports.CONSTANTS = {
10
33
  LIBRARY: enums_1.LIBRARY,
11
34
  MOVEABLE: { TOKEN: tokens_1.MOVEABLE_TOKEN_CONSTANTS },
12
35
  PAYABLE: { TOKEN: tokens_1.PAYABLE_TOKEN_CONSTANTS },
36
+ READ: exports.READ_CONSTANTS,
13
37
  };
14
38
  // Multi-chain configuration exports
15
- var chain_1 = require("./chain");
16
- Object.defineProperty(exports, "CHAIN_EXPLORERS", { enumerable: true, get: function () { return chain_1.CHAIN_EXPLORERS; } });
17
- Object.defineProperty(exports, "CEA_FACTORY_ADDRESSES", { enumerable: true, get: function () { return chain_1.CEA_FACTORY_ADDRESSES; } });
18
- Object.defineProperty(exports, "UNIVERSAL_GATEWAY_ADDRESSES", { enumerable: true, get: function () { return chain_1.UNIVERSAL_GATEWAY_ADDRESSES; } });
19
- Object.defineProperty(exports, "VAULT_ADDRESSES", { enumerable: true, get: function () { return chain_1.VAULT_ADDRESSES; } });
20
- Object.defineProperty(exports, "getExplorerTxUrl", { enumerable: true, get: function () { return chain_1.getExplorerTxUrl; } });
21
- Object.defineProperty(exports, "getExplorerAddressUrl", { enumerable: true, get: function () { return chain_1.getExplorerAddressUrl; } });
39
+ var chain_2 = require("./chain");
40
+ Object.defineProperty(exports, "CHAIN_EXPLORERS", { enumerable: true, get: function () { return chain_2.CHAIN_EXPLORERS; } });
41
+ Object.defineProperty(exports, "CEA_FACTORY_ADDRESSES", { enumerable: true, get: function () { return chain_2.CEA_FACTORY_ADDRESSES; } });
42
+ Object.defineProperty(exports, "UNIVERSAL_GATEWAY_ADDRESSES", { enumerable: true, get: function () { return chain_2.UNIVERSAL_GATEWAY_ADDRESSES; } });
43
+ Object.defineProperty(exports, "VAULT_ADDRESSES", { enumerable: true, get: function () { return chain_2.VAULT_ADDRESSES; } });
44
+ Object.defineProperty(exports, "getExplorerTxUrl", { enumerable: true, get: function () { return chain_2.getExplorerTxUrl; } });
45
+ Object.defineProperty(exports, "getExplorerAddressUrl", { enumerable: true, get: function () { return chain_2.getExplorerAddressUrl; } });
22
46
  // Selectors and constants for multi-chain transactions
23
47
  var selectors_1 = require("./selectors");
24
48
  Object.defineProperty(exports, "MULTICALL_SELECTOR", { enumerable: true, get: function () { return selectors_1.MULTICALL_SELECTOR; } });
@@ -28,4 +52,9 @@ Object.defineProperty(exports, "TX_TYPE", { enumerable: true, get: function () {
28
52
  Object.defineProperty(exports, "ZERO_ADDRESS", { enumerable: true, get: function () { return selectors_1.ZERO_ADDRESS; } });
29
53
  Object.defineProperty(exports, "DEFAULT_OUTBOUND_GAS_LIMIT", { enumerable: true, get: function () { return selectors_1.DEFAULT_OUTBOUND_GAS_LIMIT; } });
30
54
  Object.defineProperty(exports, "DEFAULT_CEA_TO_PUSH_GAS_LIMIT", { enumerable: true, get: function () { return selectors_1.DEFAULT_CEA_TO_PUSH_GAS_LIMIT; } });
55
+ // Read state (cross-chain reads)
56
+ var chain_3 = require("./chain");
57
+ Object.defineProperty(exports, "UNIVERSAL_CORE_ADDRESSES", { enumerable: true, get: function () { return chain_3.UNIVERSAL_CORE_ADDRESSES; } });
58
+ Object.defineProperty(exports, "UNIVERSAL_CALLBACK_ADDRESSES", { enumerable: true, get: function () { return chain_3.UNIVERSAL_CALLBACK_ADDRESSES; } });
59
+ tslib_1.__exportStar(require("./read-state"), exports);
31
60
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Read-state (cross-chain read) constants.
3
+ *
4
+ * Contract-derived values are pinned to the deployed `UniversalCallback`
5
+ * (push-chain-core-contracts@feat-read-state, f8d1a0c) and verified by
6
+ * `read-state/__tests__/abi-selectors.spec.ts`.
7
+ */
8
+ /** Hard upper bound on the gas an app callback may declare — `ReadTypes.sol:50`. */
9
+ export declare const MAX_CALLBACK_GAS_LIMIT = 1000000n;
10
+ /** Registry default; large results may need an explicit override up to the maximum. */
11
+ export declare const REGISTRY_CALLBACK_GAS = 500000n;
12
+ /** Verified proxy on Donut. Other networks intentionally have no default receiver. */
13
+ export declare const UNIVERSAL_READ_REGISTRY_ADDRESS: {
14
+ readonly TESTNET_DONUT: "0x91b09DAd1774bAfDE679F9ebB5F9046AE2b928C8";
15
+ };
16
+ /** Contract rejects anything below this — `ReadTypes.sol:43`. */
17
+ export declare const MIN_CONFIRMATIONS_FLOOR = 1;
18
+ /** Default lifetime of a request in Push blocks (~1.3 s each on Donut). */
19
+ export declare const DEFAULT_EXPIRY_BLOCKS = 300n;
20
+ /**
21
+ * Multiple of `callbackGasLimit × pushGasPrice` escrowed as the callback budget.
22
+ * The node refuses to fulfil a read whose budget cannot cover its callback, so
23
+ * this errs high; the unspent remainder is refunded to `refundTo`.
24
+ */
25
+ export declare const CALLBACK_BUDGET_BUFFER = 3;
26
+ /** `universalClient/externalchains/web2/read_envelope.go` — maxExtractEntries. */
27
+ export declare const WEB2_MAX_EXTRACT_ENTRIES = 16;
28
+ export declare const WEB2_DEFAULT_TIMEOUT_MS = 5000;
29
+ /** Validators clamp anything above this. */
30
+ export declare const WEB2_MAX_TIMEOUT_MS = 15000;
31
+ /**
32
+ * Web2 is not a blockchain and is not a `CHAIN` enum member. Reads target it via
33
+ * an explicit destination; the node routes on namespace `web2`, id `https`.
34
+ */
35
+ export declare const WEB2_DESTINATION: {
36
+ readonly chainNamespace: "web2";
37
+ readonly chainId: "https";
38
+ };
39
+ /** CAIP-2 namespaces the read path understands, keyed by how the node routes them. */
40
+ export declare const READ_NAMESPACE: {
41
+ readonly EVM: "eip155";
42
+ readonly SVM: "solana";
43
+ readonly WEB2: "web2";
44
+ };
45
+ export type ReadNamespace = (typeof READ_NAMESPACE)[keyof typeof READ_NAMESPACE];
46
+ /** Donut block time, measured over 100 blocks on 2026-09-09 (134 s / 100). Used to size the default wait. */
47
+ export declare const PUSH_BLOCK_TIME_MS = 1340;
48
+ export declare const READ_TRACK_POLL_INTERVAL_MS = 2000;
49
+ export declare const READ_TRACK_MIN_POLL_INTERVAL_MS = 500;
50
+ /** Default `wait()` timeout is `expiryBlocks × PUSH_BLOCK_TIME_MS`, capped here. */
51
+ export declare const READ_TRACK_MAX_TIMEOUT_MS = 180000;
52
+ /** How long `trackRead` keeps looking for a record the node has not ingested yet. */
53
+ export declare const READ_TRACK_LOOKUP_TIMEOUT_MS = 30000;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /**
3
+ * Read-state (cross-chain read) constants.
4
+ *
5
+ * Contract-derived values are pinned to the deployed `UniversalCallback`
6
+ * (push-chain-core-contracts@feat-read-state, f8d1a0c) and verified by
7
+ * `read-state/__tests__/abi-selectors.spec.ts`.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.READ_TRACK_LOOKUP_TIMEOUT_MS = exports.READ_TRACK_MAX_TIMEOUT_MS = exports.READ_TRACK_MIN_POLL_INTERVAL_MS = exports.READ_TRACK_POLL_INTERVAL_MS = exports.PUSH_BLOCK_TIME_MS = exports.READ_NAMESPACE = exports.WEB2_DESTINATION = exports.WEB2_MAX_TIMEOUT_MS = exports.WEB2_DEFAULT_TIMEOUT_MS = exports.WEB2_MAX_EXTRACT_ENTRIES = exports.CALLBACK_BUDGET_BUFFER = exports.DEFAULT_EXPIRY_BLOCKS = exports.MIN_CONFIRMATIONS_FLOOR = exports.UNIVERSAL_READ_REGISTRY_ADDRESS = exports.REGISTRY_CALLBACK_GAS = exports.MAX_CALLBACK_GAS_LIMIT = void 0;
11
+ /** Hard upper bound on the gas an app callback may declare — `ReadTypes.sol:50`. */
12
+ exports.MAX_CALLBACK_GAS_LIMIT = 1000000n;
13
+ /** Registry default; large results may need an explicit override up to the maximum. */
14
+ exports.REGISTRY_CALLBACK_GAS = 500000n;
15
+ /** Verified proxy on Donut. Other networks intentionally have no default receiver. */
16
+ exports.UNIVERSAL_READ_REGISTRY_ADDRESS = {
17
+ TESTNET_DONUT: '0x91b09DAd1774bAfDE679F9ebB5F9046AE2b928C8',
18
+ };
19
+ /** Contract rejects anything below this — `ReadTypes.sol:43`. */
20
+ exports.MIN_CONFIRMATIONS_FLOOR = 1;
21
+ /** Default lifetime of a request in Push blocks (~1.3 s each on Donut). */
22
+ exports.DEFAULT_EXPIRY_BLOCKS = 300n;
23
+ /**
24
+ * Multiple of `callbackGasLimit × pushGasPrice` escrowed as the callback budget.
25
+ * The node refuses to fulfil a read whose budget cannot cover its callback, so
26
+ * this errs high; the unspent remainder is refunded to `refundTo`.
27
+ */
28
+ exports.CALLBACK_BUDGET_BUFFER = 3;
29
+ /** `universalClient/externalchains/web2/read_envelope.go` — maxExtractEntries. */
30
+ exports.WEB2_MAX_EXTRACT_ENTRIES = 16;
31
+ exports.WEB2_DEFAULT_TIMEOUT_MS = 5_000;
32
+ /** Validators clamp anything above this. */
33
+ exports.WEB2_MAX_TIMEOUT_MS = 15_000;
34
+ /**
35
+ * Web2 is not a blockchain and is not a `CHAIN` enum member. Reads target it via
36
+ * an explicit destination; the node routes on namespace `web2`, id `https`.
37
+ */
38
+ exports.WEB2_DESTINATION = {
39
+ chainNamespace: 'web2',
40
+ chainId: 'https',
41
+ };
42
+ /** CAIP-2 namespaces the read path understands, keyed by how the node routes them. */
43
+ exports.READ_NAMESPACE = {
44
+ EVM: 'eip155',
45
+ SVM: 'solana',
46
+ WEB2: 'web2',
47
+ };
48
+ // ---------------------------------------------------------------------------
49
+ // Tracking (trackRead / wait)
50
+ // ---------------------------------------------------------------------------
51
+ /** Donut block time, measured over 100 blocks on 2026-09-09 (134 s / 100). Used to size the default wait. */
52
+ exports.PUSH_BLOCK_TIME_MS = 1_340;
53
+ exports.READ_TRACK_POLL_INTERVAL_MS = 2_000;
54
+ exports.READ_TRACK_MIN_POLL_INTERVAL_MS = 500;
55
+ /** Default `wait()` timeout is `expiryBlocks × PUSH_BLOCK_TIME_MS`, capped here. */
56
+ exports.READ_TRACK_MAX_TIMEOUT_MS = 180_000;
57
+ /** How long `trackRead` keeps looking for a record the node has not ingested yet. */
58
+ exports.READ_TRACK_LOOKUP_TIMEOUT_MS = 30_000;
59
+ //# sourceMappingURL=read-state.js.map
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './query';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./types"), exports);
5
+ tslib_1.__exportStar(require("./query"), exports);
6
+ //# sourceMappingURL=index.js.map