@pushchain/core 6.0.19 → 6.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/package.json +1 -1
  3. package/src/lib/cache/cache.js +2 -0
  4. package/src/lib/constants/abi/index.d.ts +1 -0
  5. package/src/lib/constants/abi/index.js +8 -1
  6. package/src/lib/constants/abi/pc20.evm.d.ts +217 -0
  7. package/src/lib/constants/abi/pc20.evm.js +150 -0
  8. package/src/lib/constants/abi/prc20.evm.d.ts +172 -0
  9. package/src/lib/constants/abi/prc20.evm.js +97 -0
  10. package/src/lib/constants/abi/universalGatewayV0.json +1 -1
  11. package/src/lib/constants/chain.js +38 -8
  12. package/src/lib/constants/selectors.js +2 -2
  13. package/src/lib/constants/tokens.js +4 -3
  14. package/src/lib/formatters.js +16 -6
  15. package/src/lib/generated/uexecutor/v1/query.js +2 -4
  16. package/src/lib/generated/uexecutor/v1/types.d.ts +14 -0
  17. package/src/lib/generated/uexecutor/v1/types.js +90 -47
  18. package/src/lib/generated/uexecutor/v2/query.js +2 -4
  19. package/src/lib/generated/uexecutor/v2/types.d.ts +20 -0
  20. package/src/lib/generated/uexecutor/v2/types.js +49 -33
  21. package/src/lib/generated/v1/tx.js +30 -37
  22. package/src/lib/index.d.ts +4 -1
  23. package/src/lib/index.js +21 -3
  24. package/src/lib/internal/buffer.js +1 -2
  25. package/src/lib/orchestrator/cea-utils.js +73 -83
  26. package/src/lib/orchestrator/internals/account-manager.js +130 -139
  27. package/src/lib/orchestrator/internals/cascade.d.ts +0 -6
  28. package/src/lib/orchestrator/internals/cascade.js +1184 -1059
  29. package/src/lib/orchestrator/internals/confirmation.js +138 -148
  30. package/src/lib/orchestrator/internals/error-decoder.js +1 -1
  31. package/src/lib/orchestrator/internals/errors.js +12 -3
  32. package/src/lib/orchestrator/internals/execute-funds-only.d.ts +2 -2
  33. package/src/lib/orchestrator/internals/execute-funds-only.js +297 -259
  34. package/src/lib/orchestrator/internals/execute-funds-payload.d.ts +2 -2
  35. package/src/lib/orchestrator/internals/execute-funds-payload.js +220 -220
  36. package/src/lib/orchestrator/internals/execute-standard.d.ts +0 -8
  37. package/src/lib/orchestrator/internals/execute-standard.js +339 -342
  38. package/src/lib/orchestrator/internals/gas-calculator.js +497 -520
  39. package/src/lib/orchestrator/internals/gas-usd-sizer.js +101 -110
  40. package/src/lib/orchestrator/internals/gateway-client.js +102 -103
  41. package/src/lib/orchestrator/internals/helpers.js +30 -27
  42. package/src/lib/orchestrator/internals/inbound-tracker.js +234 -238
  43. package/src/lib/orchestrator/internals/outbound-sync.js +463 -452
  44. package/src/lib/orchestrator/internals/outbound-tracker.js +27 -34
  45. package/src/lib/orchestrator/internals/payload-builder.d.ts +2 -2
  46. package/src/lib/orchestrator/internals/payload-builder.js +119 -100
  47. package/src/lib/orchestrator/internals/pc-usd-oracle.js +121 -129
  48. package/src/lib/orchestrator/internals/pc20/address-codec.d.ts +31 -0
  49. package/src/lib/orchestrator/internals/pc20/address-codec.js +124 -0
  50. package/src/lib/orchestrator/internals/pc20/chain-namespace.d.ts +68 -0
  51. package/src/lib/orchestrator/internals/pc20/chain-namespace.js +136 -0
  52. package/src/lib/orchestrator/internals/pc20/errors.d.ts +160 -0
  53. package/src/lib/orchestrator/internals/pc20/errors.js +236 -0
  54. package/src/lib/orchestrator/internals/pc20/export.d.ts +172 -0
  55. package/src/lib/orchestrator/internals/pc20/export.js +412 -0
  56. package/src/lib/orchestrator/internals/pc20/gate.d.ts +67 -0
  57. package/src/lib/orchestrator/internals/pc20/gate.js +184 -0
  58. package/src/lib/orchestrator/internals/pc20/resolver.d.ts +187 -0
  59. package/src/lib/orchestrator/internals/pc20/resolver.js +658 -0
  60. package/src/lib/orchestrator/internals/pc20/svm.d.ts +189 -0
  61. package/src/lib/orchestrator/internals/pc20/svm.js +286 -0
  62. package/src/lib/orchestrator/internals/pc20/tracking.d.ts +46 -0
  63. package/src/lib/orchestrator/internals/pc20/tracking.js +109 -0
  64. package/src/lib/orchestrator/internals/preflight.js +1 -1
  65. package/src/lib/orchestrator/internals/progress-route-hooks.js +2 -2
  66. package/src/lib/orchestrator/internals/push-chain-tx.js +319 -331
  67. package/src/lib/orchestrator/internals/quote.js +90 -94
  68. package/src/lib/orchestrator/internals/rescue.js +76 -79
  69. package/src/lib/orchestrator/internals/response-builder.d.ts +28 -1
  70. package/src/lib/orchestrator/internals/response-builder.js +817 -701
  71. package/src/lib/orchestrator/internals/route-handlers.d.ts +7 -15
  72. package/src/lib/orchestrator/internals/route-handlers.js +1512 -1178
  73. package/src/lib/orchestrator/internals/signing.js +78 -83
  74. package/src/lib/orchestrator/internals/svm-bridge.d.ts +2 -2
  75. package/src/lib/orchestrator/internals/svm-bridge.js +161 -93
  76. package/src/lib/orchestrator/internals/svm-helpers.d.ts +15 -1
  77. package/src/lib/orchestrator/internals/svm-helpers.js +68 -24
  78. package/src/lib/orchestrator/internals/svm-rent.d.ts +19 -1
  79. package/src/lib/orchestrator/internals/svm-rent.js +163 -141
  80. package/src/lib/orchestrator/internals/tx-transformer.js +26 -23
  81. package/src/lib/orchestrator/internals/uea-manager.js +89 -86
  82. package/src/lib/orchestrator/max-pc-for-gas.js +5 -6
  83. package/src/lib/orchestrator/orchestrator.js +217 -200
  84. package/src/lib/orchestrator/orchestrator.types.d.ts +121 -1
  85. package/src/lib/orchestrator/orchestrator.types.js +19 -0
  86. package/src/lib/orchestrator/payload-builders.d.ts +2 -2
  87. package/src/lib/orchestrator/payload-builders.js +26 -24
  88. package/src/lib/orchestrator/route-detector.js +26 -9
  89. package/src/lib/orchestrator/svm-idl/ix-encoder.js +1 -2
  90. package/src/lib/orchestrator/svm-idl/normalize-address.js +2 -2
  91. package/src/lib/orchestrator/svm-idl/resolve.js +1 -2
  92. package/src/lib/price-fetch/price-fetch.js +67 -68
  93. package/src/lib/progress-hook/progress-hook.js +124 -72
  94. package/src/lib/push-chain/push-chain.js +171 -153
  95. package/src/lib/push-client/push-client.js +223 -237
  96. package/src/lib/universal/account/account.js +349 -365
  97. package/src/lib/universal/signer/signer.d.ts +2 -1
  98. package/src/lib/universal/signer/signer.js +315 -299
  99. package/src/lib/universal-tx-detector/auto-detect.js +55 -60
  100. package/src/lib/universal-tx-detector/cascade.js +160 -172
  101. package/src/lib/universal-tx-detector/child-inbounds.js +67 -75
  102. package/src/lib/universal-tx-detector/classify.js +2 -3
  103. package/src/lib/universal-tx-detector/detector-svm.js +139 -147
  104. package/src/lib/universal-tx-detector/detector.js +145 -157
  105. package/src/lib/universal-tx-detector/normalize.js +7 -7
  106. package/src/lib/utils/external-tx-hash.js +1 -2
  107. package/src/lib/utils.d.ts +44 -0
  108. package/src/lib/utils.js +762 -683
  109. package/src/lib/vm-client/evm-client.js +186 -202
  110. package/src/lib/vm-client/svm-client.d.ts +1 -1
  111. package/src/lib/vm-client/svm-client.js +220 -224
  112. package/src/lib/vm-client/vm-client.types.d.ts +14 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,57 @@
1
+ @pushchain/core@6.0.21 (2026-08-01)
2
+
3
+ - fix: pc20 bug fix
4
+ - fix: bug fixes
5
+ - fix: pc20 e2es and bug fixes
6
+ - feat: pc20 fixes
7
+ - fix: pc20 plan
8
+
9
+ ---
10
+
11
+ @pushchain/core@6.1.0 (unreleased)
12
+
13
+ - Added first-class PC20 support to the universal transaction API. PC20 tokens
14
+ are resolved from their chain and address through UniversalCore, without an
15
+ explicit token-standard flag.
16
+
17
+ - Added `PushChain.utils.tokens.getPC20Address()` for resolving either a
18
+ Push-native PC20 or an external wrapper and listing its confirmed deployments.
19
+ Spending paths also validate registry identity and reject wrong-chain,
20
+ ambiguous, stale, or unregistered token references before approval or
21
+ broadcast.
22
+
23
+ - Added PC20 execution across EVM and Solana for Route 1 (external wrapper burn
24
+ to Push), Route 2 (Push token export), and Route 3 (CEA-held wrapper return).
25
+ This includes first-export wrapper prediction, Solana ATA delivery and
26
+ fallback behavior, PC20 gas quoting, and typed PC20 errors. Route 4 remains
27
+ unsupported for PC20.
28
+
29
+ - Fixed funds-only PC20 returns and cascades producing a selector-only
30
+ `0x50433230` payload. The SDK now preserves PC20 routing metadata, builds a
31
+ complete universal forwarding payload on EVM and Solana, revalidates prepared
32
+ sends against the live registry, and fails closed when no safe payload can be
33
+ constructed.
34
+
35
+ - Fixed PC20 return tracking when a gateway transaction emits both a wrapper
36
+ burn event and a native gas-credit event. Tracking now follows the PC20 burn
37
+ leg by payload selector instead of relying on event position.
38
+
39
+ - Fixed prepaid native gas credit on PC20 burns by using the sender's executor
40
+ account as the gateway recipient instead of the zero address, preventing the
41
+ forwarded funds leg from attempting to credit `address(0)`.
42
+
43
+ - Realigned inbound protobuf fields with the chain, exposed PC20 inbound
44
+ metadata, and added SVM remaining-account support required by the Solana
45
+ gateway.
46
+
47
+ ---
48
+
49
+ @pushchain/core@6.0.20 (2026-07-10)
50
+
51
+ - fix: support custom EIP-7702 signers and dynamic multicall gas
52
+
53
+ ---
54
+
1
55
  @pushchain/core@6.0.19 (2026-07-01)
2
56
 
3
57
  - feat: use OZ ERC-7821 executor for 7702 batching
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushchain/core",
3
- "version": "6.0.19",
3
+ "version": "6.0.21",
4
4
  "homepage": "https://push.org",
5
5
  "keywords": [
6
6
  "pushchain",
@@ -11,6 +11,8 @@ class CacheKeys {
11
11
  }
12
12
  exports.CacheKeys = CacheKeys;
13
13
  class Cache {
14
+ cache;
15
+ maxSize;
14
16
  constructor(maxSize = 100) {
15
17
  this.cache = new Map();
16
18
  this.maxSize = maxSize;
@@ -12,5 +12,6 @@ export { CEA_FACTORY_EVM } from './ceaFactory.evm';
12
12
  export { UNIVERSAL_GATEWAY_PC } from './universalGatewayPC.evm';
13
13
  export { UNIVERSAL_CORE_EVM } from './prc20.evm';
14
14
  export { UEA_FACTORY_ABI } from './uea-factory';
15
+ export { IPC20_EVM, PC20_FACTORY_EVM, PC20_WRAPPER_EVM, EXTERNAL_GATEWAY_PC20_EVM, VAULT_PC20_FACTORY_EVM, } from './pc20.evm';
15
16
  export { WPC_EVM } from './wpc.evm';
16
17
  export { UNIV3_SWAP_ROUTER_EVM } from './uniswap-v3-router.evm';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UNIV3_SWAP_ROUTER_EVM = exports.WPC_EVM = exports.UEA_FACTORY_ABI = exports.UNIVERSAL_CORE_EVM = exports.UNIVERSAL_GATEWAY_PC = exports.CEA_FACTORY_EVM = exports.CEA_EVM = exports.SVM_GATEWAY_IDL = exports.ERC20_EVM = exports.UNIVERSAL_GATEWAY_V1_SEND = exports.UNIVERSAL_GATEWAY_V0 = exports.UEA_SVM = exports.UEA_EVM = exports.FACTORY_V1 = exports.FEE_LOCKER_SVM = exports.FEE_LOCKER_EVM = void 0;
3
+ exports.UNIV3_SWAP_ROUTER_EVM = exports.WPC_EVM = exports.VAULT_PC20_FACTORY_EVM = exports.EXTERNAL_GATEWAY_PC20_EVM = exports.PC20_WRAPPER_EVM = exports.PC20_FACTORY_EVM = exports.IPC20_EVM = exports.UEA_FACTORY_ABI = exports.UNIVERSAL_CORE_EVM = exports.UNIVERSAL_GATEWAY_PC = exports.CEA_FACTORY_EVM = exports.CEA_EVM = exports.SVM_GATEWAY_IDL = exports.ERC20_EVM = exports.UNIVERSAL_GATEWAY_V1_SEND = exports.UNIVERSAL_GATEWAY_V0 = exports.UEA_SVM = exports.UEA_EVM = exports.FACTORY_V1 = exports.FEE_LOCKER_SVM = exports.FEE_LOCKER_EVM = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  var feeLocker_evm_1 = require("./feeLocker.evm");
6
6
  Object.defineProperty(exports, "FEE_LOCKER_EVM", { enumerable: true, get: function () { return feeLocker_evm_1.FEE_LOCKER_EVM; } });
@@ -31,6 +31,13 @@ var prc20_evm_1 = require("./prc20.evm");
31
31
  Object.defineProperty(exports, "UNIVERSAL_CORE_EVM", { enumerable: true, get: function () { return prc20_evm_1.UNIVERSAL_CORE_EVM; } });
32
32
  var uea_factory_1 = require("./uea-factory");
33
33
  Object.defineProperty(exports, "UEA_FACTORY_ABI", { enumerable: true, get: function () { return uea_factory_1.UEA_FACTORY_ABI; } });
34
+ // PC20
35
+ var pc20_evm_1 = require("./pc20.evm");
36
+ Object.defineProperty(exports, "IPC20_EVM", { enumerable: true, get: function () { return pc20_evm_1.IPC20_EVM; } });
37
+ Object.defineProperty(exports, "PC20_FACTORY_EVM", { enumerable: true, get: function () { return pc20_evm_1.PC20_FACTORY_EVM; } });
38
+ Object.defineProperty(exports, "PC20_WRAPPER_EVM", { enumerable: true, get: function () { return pc20_evm_1.PC20_WRAPPER_EVM; } });
39
+ Object.defineProperty(exports, "EXTERNAL_GATEWAY_PC20_EVM", { enumerable: true, get: function () { return pc20_evm_1.EXTERNAL_GATEWAY_PC20_EVM; } });
40
+ Object.defineProperty(exports, "VAULT_PC20_FACTORY_EVM", { enumerable: true, get: function () { return pc20_evm_1.VAULT_PC20_FACTORY_EVM; } });
34
41
  // SDK 5.2 gas abstraction (Case C overflow bridging)
35
42
  var wpc_evm_1 = require("./wpc.evm");
36
43
  Object.defineProperty(exports, "WPC_EVM", { enumerable: true, get: function () { return wpc_evm_1.WPC_EVM; } });
@@ -0,0 +1,217 @@
1
+ /**
2
+ * PC20 ABIs — minimal read surfaces for registry resolution and validation.
3
+ *
4
+ * Sources:
5
+ * IPC20 push-chain-gateway-contracts/contracts/evm-gateway/src/interfaces/IPC20.sol
6
+ * PC20Factory push-chain-gateway-contracts/contracts/evm-gateway/src/PC20Factory.sol
7
+ * PC20Wrapper push-chain-gateway-contracts/contracts/evm-gateway/src/PC20Wrapper.sol
8
+ * UniversalGateway push-chain-gateway-contracts/contracts/evm-gateway/src/UniversalGateway.sol
9
+ *
10
+ * Read-only entries only. Writes go through the existing gateway ABIs — PC20
11
+ * changes the payload, not the entrypoint.
12
+ */
13
+ /** Push-native token eligible for export. Presence of `pc20Metadata` IS the PC20 test. */
14
+ export declare const IPC20_EVM: readonly [{
15
+ readonly type: "function";
16
+ readonly name: "pc20Metadata";
17
+ readonly inputs: readonly [];
18
+ readonly outputs: readonly [{
19
+ readonly name: "name";
20
+ readonly type: "string";
21
+ readonly internalType: "string";
22
+ }, {
23
+ readonly name: "symbol";
24
+ readonly type: "string";
25
+ readonly internalType: "string";
26
+ }, {
27
+ readonly name: "decimals";
28
+ readonly type: "uint8";
29
+ readonly internalType: "uint8";
30
+ }, {
31
+ readonly name: "originAddress";
32
+ readonly type: "address";
33
+ readonly internalType: "address";
34
+ }];
35
+ readonly stateMutability: "view";
36
+ }];
37
+ /**
38
+ * Destination-chain factory.
39
+ *
40
+ * `computeWrapperAddress` is deliberately called on-chain rather than
41
+ * reimplementing CREATE2 in the SDK: the factory derives the address from its
42
+ * own `type(PC20Wrapper).creationCode`, so calling the live registered factory
43
+ * cannot desynchronize from the deployed wrapper bytecode the way a mirrored
44
+ * init-code hash would.
45
+ */
46
+ export declare const PC20_FACTORY_EVM: readonly [{
47
+ readonly type: "function";
48
+ readonly name: "getWrapper";
49
+ readonly inputs: readonly [{
50
+ readonly name: "sourceAsset";
51
+ readonly type: "address";
52
+ readonly internalType: "address";
53
+ }];
54
+ readonly outputs: readonly [{
55
+ readonly name: "wrapper";
56
+ readonly type: "address";
57
+ readonly internalType: "address";
58
+ }];
59
+ readonly stateMutability: "view";
60
+ }, {
61
+ readonly type: "function";
62
+ readonly name: "wrapperToSource";
63
+ readonly inputs: readonly [{
64
+ readonly name: "";
65
+ readonly type: "address";
66
+ readonly internalType: "address";
67
+ }];
68
+ readonly outputs: readonly [{
69
+ readonly name: "";
70
+ readonly type: "address";
71
+ readonly internalType: "address";
72
+ }];
73
+ readonly stateMutability: "view";
74
+ }, {
75
+ readonly type: "function";
76
+ readonly name: "sourceToWrapper";
77
+ readonly inputs: readonly [{
78
+ readonly name: "";
79
+ readonly type: "address";
80
+ readonly internalType: "address";
81
+ }];
82
+ readonly outputs: readonly [{
83
+ readonly name: "";
84
+ readonly type: "address";
85
+ readonly internalType: "address";
86
+ }];
87
+ readonly stateMutability: "view";
88
+ }, {
89
+ readonly type: "function";
90
+ readonly name: "isPC20Wrapper";
91
+ readonly inputs: readonly [{
92
+ readonly name: "addr";
93
+ readonly type: "address";
94
+ readonly internalType: "address";
95
+ }];
96
+ readonly outputs: readonly [{
97
+ readonly name: "";
98
+ readonly type: "bool";
99
+ readonly internalType: "bool";
100
+ }];
101
+ readonly stateMutability: "view";
102
+ }, {
103
+ readonly type: "function";
104
+ readonly name: "computeWrapperAddress";
105
+ readonly inputs: readonly [{
106
+ readonly name: "sourceAsset";
107
+ readonly type: "address";
108
+ readonly internalType: "address";
109
+ }];
110
+ readonly outputs: readonly [{
111
+ readonly name: "predicted";
112
+ readonly type: "address";
113
+ readonly internalType: "address";
114
+ }];
115
+ readonly stateMutability: "view";
116
+ }, {
117
+ readonly type: "function";
118
+ readonly name: "MAX_NAME_LENGTH";
119
+ readonly inputs: readonly [];
120
+ readonly outputs: readonly [{
121
+ readonly name: "";
122
+ readonly type: "uint256";
123
+ readonly internalType: "uint256";
124
+ }];
125
+ readonly stateMutability: "view";
126
+ }, {
127
+ readonly type: "function";
128
+ readonly name: "MAX_SYMBOL_LENGTH";
129
+ readonly inputs: readonly [];
130
+ readonly outputs: readonly [{
131
+ readonly name: "";
132
+ readonly type: "uint256";
133
+ readonly internalType: "uint256";
134
+ }];
135
+ readonly stateMutability: "view";
136
+ }, {
137
+ readonly type: "error";
138
+ readonly name: "EmptyName";
139
+ readonly inputs: readonly [];
140
+ }, {
141
+ readonly type: "error";
142
+ readonly name: "NameTooLong";
143
+ readonly inputs: readonly [];
144
+ }, {
145
+ readonly type: "error";
146
+ readonly name: "EmptySymbol";
147
+ readonly inputs: readonly [];
148
+ }, {
149
+ readonly type: "error";
150
+ readonly name: "SymbolTooLong";
151
+ readonly inputs: readonly [];
152
+ }, {
153
+ readonly type: "error";
154
+ readonly name: "ZeroAddress";
155
+ readonly inputs: readonly [];
156
+ }];
157
+ /** Deployed wrapper on an external chain. `SOURCE_ASSET` is immutable. */
158
+ export declare const PC20_WRAPPER_EVM: readonly [{
159
+ readonly type: "function";
160
+ readonly name: "SOURCE_ASSET";
161
+ readonly inputs: readonly [];
162
+ readonly outputs: readonly [{
163
+ readonly name: "";
164
+ readonly type: "address";
165
+ readonly internalType: "address";
166
+ }];
167
+ readonly stateMutability: "view";
168
+ }, {
169
+ readonly type: "function";
170
+ readonly name: "factory";
171
+ readonly inputs: readonly [];
172
+ readonly outputs: readonly [{
173
+ readonly name: "";
174
+ readonly type: "address";
175
+ readonly internalType: "address";
176
+ }];
177
+ readonly stateMutability: "view";
178
+ }];
179
+ /**
180
+ * Destination Vault's configured factory.
181
+ *
182
+ * The Vault — not the gateway — is what calls `deployWrapper` at settlement
183
+ * (`Vault.sol:327`), so this is the authoritative answer to where a
184
+ * not-yet-deployed wrapper will land. Both pointers exist independently and are
185
+ * set separately; they happen to agree on all four testnets today, but only
186
+ * this one governs deployment.
187
+ */
188
+ export declare const VAULT_PC20_FACTORY_EVM: readonly [{
189
+ readonly type: "function";
190
+ readonly name: "pc20Factory";
191
+ readonly inputs: readonly [];
192
+ readonly outputs: readonly [{
193
+ readonly name: "";
194
+ readonly type: "address";
195
+ readonly internalType: "contract IPC20Factory";
196
+ }];
197
+ readonly stateMutability: "view";
198
+ }];
199
+ /**
200
+ * External gateway's configured factory.
201
+ *
202
+ * Compared against the reference factory (the destination Vault's
203
+ * `pc20Factory()`, or `UniversalCore.pc20FactoryByChain` if a future upgrade
204
+ * exposes it) — if they disagree the live gateway will not take the PC20 burn
205
+ * path for this token.
206
+ */
207
+ export declare const EXTERNAL_GATEWAY_PC20_EVM: readonly [{
208
+ readonly type: "function";
209
+ readonly name: "pc20Factory";
210
+ readonly inputs: readonly [];
211
+ readonly outputs: readonly [{
212
+ readonly name: "";
213
+ readonly type: "address";
214
+ readonly internalType: "contract IPC20Factory";
215
+ }];
216
+ readonly stateMutability: "view";
217
+ }];
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ /**
3
+ * PC20 ABIs — minimal read surfaces for registry resolution and validation.
4
+ *
5
+ * Sources:
6
+ * IPC20 push-chain-gateway-contracts/contracts/evm-gateway/src/interfaces/IPC20.sol
7
+ * PC20Factory push-chain-gateway-contracts/contracts/evm-gateway/src/PC20Factory.sol
8
+ * PC20Wrapper push-chain-gateway-contracts/contracts/evm-gateway/src/PC20Wrapper.sol
9
+ * UniversalGateway push-chain-gateway-contracts/contracts/evm-gateway/src/UniversalGateway.sol
10
+ *
11
+ * Read-only entries only. Writes go through the existing gateway ABIs — PC20
12
+ * changes the payload, not the entrypoint.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.EXTERNAL_GATEWAY_PC20_EVM = exports.VAULT_PC20_FACTORY_EVM = exports.PC20_WRAPPER_EVM = exports.PC20_FACTORY_EVM = exports.IPC20_EVM = void 0;
16
+ /** Push-native token eligible for export. Presence of `pc20Metadata` IS the PC20 test. */
17
+ exports.IPC20_EVM = [
18
+ {
19
+ type: 'function',
20
+ name: 'pc20Metadata',
21
+ inputs: [],
22
+ outputs: [
23
+ { name: 'name', type: 'string', internalType: 'string' },
24
+ { name: 'symbol', type: 'string', internalType: 'string' },
25
+ { name: 'decimals', type: 'uint8', internalType: 'uint8' },
26
+ { name: 'originAddress', type: 'address', internalType: 'address' },
27
+ ],
28
+ stateMutability: 'view',
29
+ },
30
+ ];
31
+ /**
32
+ * Destination-chain factory.
33
+ *
34
+ * `computeWrapperAddress` is deliberately called on-chain rather than
35
+ * reimplementing CREATE2 in the SDK: the factory derives the address from its
36
+ * own `type(PC20Wrapper).creationCode`, so calling the live registered factory
37
+ * cannot desynchronize from the deployed wrapper bytecode the way a mirrored
38
+ * init-code hash would.
39
+ */
40
+ exports.PC20_FACTORY_EVM = [
41
+ {
42
+ type: 'function',
43
+ name: 'getWrapper',
44
+ inputs: [{ name: 'sourceAsset', type: 'address', internalType: 'address' }],
45
+ outputs: [{ name: 'wrapper', type: 'address', internalType: 'address' }],
46
+ stateMutability: 'view',
47
+ },
48
+ {
49
+ type: 'function',
50
+ name: 'wrapperToSource',
51
+ inputs: [{ name: '', type: 'address', internalType: 'address' }],
52
+ outputs: [{ name: '', type: 'address', internalType: 'address' }],
53
+ stateMutability: 'view',
54
+ },
55
+ {
56
+ type: 'function',
57
+ name: 'sourceToWrapper',
58
+ inputs: [{ name: '', type: 'address', internalType: 'address' }],
59
+ outputs: [{ name: '', type: 'address', internalType: 'address' }],
60
+ stateMutability: 'view',
61
+ },
62
+ {
63
+ type: 'function',
64
+ name: 'isPC20Wrapper',
65
+ inputs: [{ name: 'addr', type: 'address', internalType: 'address' }],
66
+ outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
67
+ stateMutability: 'view',
68
+ },
69
+ {
70
+ type: 'function',
71
+ name: 'computeWrapperAddress',
72
+ inputs: [{ name: 'sourceAsset', type: 'address', internalType: 'address' }],
73
+ outputs: [{ name: 'predicted', type: 'address', internalType: 'address' }],
74
+ stateMutability: 'view',
75
+ },
76
+ // Name/symbol byte limits enforced at deployWrapper. Read so the SDK can fail
77
+ // fast on the Push side instead of reverting on the destination chain.
78
+ {
79
+ type: 'function',
80
+ name: 'MAX_NAME_LENGTH',
81
+ inputs: [],
82
+ outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
83
+ stateMutability: 'view',
84
+ },
85
+ {
86
+ type: 'function',
87
+ name: 'MAX_SYMBOL_LENGTH',
88
+ inputs: [],
89
+ outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
90
+ stateMutability: 'view',
91
+ },
92
+ { type: 'error', name: 'EmptyName', inputs: [] },
93
+ { type: 'error', name: 'NameTooLong', inputs: [] },
94
+ { type: 'error', name: 'EmptySymbol', inputs: [] },
95
+ { type: 'error', name: 'SymbolTooLong', inputs: [] },
96
+ { type: 'error', name: 'ZeroAddress', inputs: [] },
97
+ ];
98
+ /** Deployed wrapper on an external chain. `SOURCE_ASSET` is immutable. */
99
+ exports.PC20_WRAPPER_EVM = [
100
+ {
101
+ type: 'function',
102
+ name: 'SOURCE_ASSET',
103
+ inputs: [],
104
+ outputs: [{ name: '', type: 'address', internalType: 'address' }],
105
+ stateMutability: 'view',
106
+ },
107
+ {
108
+ type: 'function',
109
+ name: 'factory',
110
+ inputs: [],
111
+ outputs: [{ name: '', type: 'address', internalType: 'address' }],
112
+ stateMutability: 'view',
113
+ },
114
+ ];
115
+ /**
116
+ * Destination Vault's configured factory.
117
+ *
118
+ * The Vault — not the gateway — is what calls `deployWrapper` at settlement
119
+ * (`Vault.sol:327`), so this is the authoritative answer to where a
120
+ * not-yet-deployed wrapper will land. Both pointers exist independently and are
121
+ * set separately; they happen to agree on all four testnets today, but only
122
+ * this one governs deployment.
123
+ */
124
+ exports.VAULT_PC20_FACTORY_EVM = [
125
+ {
126
+ type: 'function',
127
+ name: 'pc20Factory',
128
+ inputs: [],
129
+ outputs: [{ name: '', type: 'address', internalType: 'contract IPC20Factory' }],
130
+ stateMutability: 'view',
131
+ },
132
+ ];
133
+ /**
134
+ * External gateway's configured factory.
135
+ *
136
+ * Compared against the reference factory (the destination Vault's
137
+ * `pc20Factory()`, or `UniversalCore.pc20FactoryByChain` if a future upgrade
138
+ * exposes it) — if they disagree the live gateway will not take the PC20 burn
139
+ * path for this token.
140
+ */
141
+ exports.EXTERNAL_GATEWAY_PC20_EVM = [
142
+ {
143
+ type: 'function',
144
+ name: 'pc20Factory',
145
+ inputs: [],
146
+ outputs: [{ name: '', type: 'address', internalType: 'contract IPC20Factory' }],
147
+ stateMutability: 'view',
148
+ },
149
+ ];
150
+ //# sourceMappingURL=pc20.evm.js.map
@@ -146,6 +146,178 @@ export declare const UNIVERSAL_CORE_EVM: readonly [{
146
146
  readonly internalType: "uint256";
147
147
  }];
148
148
  readonly stateMutability: "payable";
149
+ }, {
150
+ readonly type: "function";
151
+ readonly name: "getPC20ExportGasAndFees";
152
+ readonly inputs: readonly [{
153
+ readonly name: "destChainNamespace";
154
+ readonly type: "string";
155
+ readonly internalType: "string";
156
+ }, {
157
+ readonly name: "gasLimit";
158
+ readonly type: "uint256";
159
+ readonly internalType: "uint256";
160
+ }, {
161
+ readonly name: "pc20Token";
162
+ readonly type: "address";
163
+ readonly internalType: "address";
164
+ }];
165
+ readonly outputs: readonly [{
166
+ readonly name: "gasToken";
167
+ readonly type: "address";
168
+ readonly internalType: "address";
169
+ }, {
170
+ readonly name: "gasFee";
171
+ readonly type: "uint256";
172
+ readonly internalType: "uint256";
173
+ }, {
174
+ readonly name: "protocolFee";
175
+ readonly type: "uint256";
176
+ readonly internalType: "uint256";
177
+ }, {
178
+ readonly name: "gasPrice";
179
+ readonly type: "uint256";
180
+ readonly internalType: "uint256";
181
+ }, {
182
+ readonly name: "chainNamespace";
183
+ readonly type: "string";
184
+ readonly internalType: "string";
185
+ }, {
186
+ readonly name: "gasLimitUsed";
187
+ readonly type: "uint256";
188
+ readonly internalType: "uint256";
189
+ }, {
190
+ readonly name: "isFirstExport";
191
+ readonly type: "bool";
192
+ readonly internalType: "bool";
193
+ }];
194
+ readonly stateMutability: "view";
195
+ }, {
196
+ readonly type: "function";
197
+ readonly name: "pc20DeploymentGasOverhead";
198
+ readonly inputs: readonly [{
199
+ readonly name: "chainNamespace";
200
+ readonly type: "string";
201
+ readonly internalType: "string";
202
+ }];
203
+ readonly outputs: readonly [{
204
+ readonly name: "overhead";
205
+ readonly type: "uint256";
206
+ readonly internalType: "uint256";
207
+ }];
208
+ readonly stateMutability: "view";
209
+ }, {
210
+ readonly type: "function";
211
+ readonly name: "pc20Deployed";
212
+ readonly inputs: readonly [{
213
+ readonly name: "sourceAsset";
214
+ readonly type: "address";
215
+ readonly internalType: "address";
216
+ }, {
217
+ readonly name: "destChain";
218
+ readonly type: "string";
219
+ readonly internalType: "string";
220
+ }];
221
+ readonly outputs: readonly [{
222
+ readonly name: "";
223
+ readonly type: "bool";
224
+ readonly internalType: "bool";
225
+ }];
226
+ readonly stateMutability: "view";
227
+ }, {
228
+ readonly type: "function";
229
+ readonly name: "getPC20Wrapper";
230
+ readonly inputs: readonly [{
231
+ readonly name: "sourceAsset";
232
+ readonly type: "address";
233
+ readonly internalType: "address";
234
+ }, {
235
+ readonly name: "destChain";
236
+ readonly type: "string";
237
+ readonly internalType: "string";
238
+ }];
239
+ readonly outputs: readonly [{
240
+ readonly name: "wrapper";
241
+ readonly type: "bytes32";
242
+ readonly internalType: "bytes32";
243
+ }, {
244
+ readonly name: "deployed";
245
+ readonly type: "bool";
246
+ readonly internalType: "bool";
247
+ }];
248
+ readonly stateMutability: "view";
249
+ }, {
250
+ readonly type: "function";
251
+ readonly name: "getPC20Source";
252
+ readonly inputs: readonly [{
253
+ readonly name: "wrapper";
254
+ readonly type: "bytes32";
255
+ readonly internalType: "bytes32";
256
+ }, {
257
+ readonly name: "destChain";
258
+ readonly type: "string";
259
+ readonly internalType: "string";
260
+ }];
261
+ readonly outputs: readonly [{
262
+ readonly name: "sourceAsset";
263
+ readonly type: "address";
264
+ readonly internalType: "address";
265
+ }, {
266
+ readonly name: "known";
267
+ readonly type: "bool";
268
+ readonly internalType: "bool";
269
+ }];
270
+ readonly stateMutability: "view";
271
+ }, {
272
+ readonly type: "function";
273
+ readonly name: "pc20FactoryByChain";
274
+ readonly inputs: readonly [{
275
+ readonly name: "chainNamespace";
276
+ readonly type: "string";
277
+ readonly internalType: "string";
278
+ }];
279
+ readonly outputs: readonly [{
280
+ readonly name: "factory";
281
+ readonly type: "bytes32";
282
+ readonly internalType: "bytes32";
283
+ }];
284
+ readonly stateMutability: "view";
285
+ }, {
286
+ readonly type: "function";
287
+ readonly name: "pc20WrapperBySource";
288
+ readonly inputs: readonly [{
289
+ readonly name: "sourceAsset";
290
+ readonly type: "address";
291
+ readonly internalType: "address";
292
+ }, {
293
+ readonly name: "destChain";
294
+ readonly type: "string";
295
+ readonly internalType: "string";
296
+ }];
297
+ readonly outputs: readonly [{
298
+ readonly name: "wrapper";
299
+ readonly type: "bytes32";
300
+ readonly internalType: "bytes32";
301
+ }];
302
+ readonly stateMutability: "view";
303
+ }, {
304
+ readonly type: "function";
305
+ readonly name: "pc20SourceByWrapper";
306
+ readonly inputs: readonly [{
307
+ readonly name: "destChain";
308
+ readonly type: "string";
309
+ readonly internalType: "string";
310
+ }, {
311
+ readonly name: "wrapper";
312
+ readonly type: "bytes32";
313
+ readonly internalType: "bytes32";
314
+ }];
315
+ readonly outputs: readonly [{
316
+ readonly name: "sourceAsset";
317
+ readonly type: "address";
318
+ readonly internalType: "address";
319
+ }];
320
+ readonly stateMutability: "view";
149
321
  }, {
150
322
  readonly type: "error";
151
323
  readonly name: "GasLimitBelowBase";