@across-protocol/contracts 6.0.0-beta.3 → 6.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,6 +34,63 @@ program and canonical IDL upgrade. Legacy `Program.at`/`fetchIdl` readers do not
34
34
  Artifact generation restores the canonical event-authority PDA seeds omitted by Anchor 1.1's IDL output,
35
35
  preserving typed account resolution and Codama async builders. This metadata does not change program bytes.
36
36
 
37
+ ## SVM JSON interfaces
38
+
39
+ The npm package exposes these stable JSON paths for downstream Anchor clients and Codama generation:
40
+
41
+ ```text
42
+ @across-protocol/contracts/svm/idl/svm_spoke.json
43
+ @across-protocol/contracts/svm/idl/multicall_handler.json
44
+ @across-protocol/contracts/svm/idl/sponsored_cctp_src_periphery.json
45
+ ```
46
+
47
+ `svm_spoke` is the V5 interface. `multicall_handler` and `sponsored_cctp_src_periphery` are legacy
48
+ compatibility interfaces for existing quote construction and event indexing; they are not used by V5 flows.
49
+
50
+ For example, load an IDL without loading the package's runtime clients:
51
+
52
+ ```js
53
+ const spokeIdl = require("@across-protocol/contracts/svm/idl/svm_spoke.json")
54
+ ```
55
+
56
+ Pin an exact contracts package version and commit your lockfile, together with compatible versions of your
57
+ client generator and runtime. IDLs are versioned with the npm package; `metadata.version` identifies the program's
58
+ declared version and is not the npm release version. Consumers can generate clients from the installed JSON without
59
+ a contracts checkout or Rust, Anchor CLI, or Foundry. Select the deployed program address for your environment;
60
+ installing a package does not deploy or upgrade programs.
61
+
62
+ The Spoke IDL includes the Rust-derived `V5AdapterInput`, `AcrossDepositJitParams`, and `V5FillJit` schemas
63
+ carried inside opaque instruction bytes. Event-authority PDA seeds are preserved for account resolution.
64
+ Circle owns the MessageTransmitterV2 and TokenMessengerMinterV2 schemas. They have no stable `/svm/idl/`
65
+ exports here; downstream generators should use reviewed, commit-pinned IDLs from
66
+ [Circle's repository](https://github.com/circlefin/solana-cctp-contracts/tree/master/examples/target/idl),
67
+ with the source revision recorded and compatibility checked against the intended deployment.
68
+ The reviewed Circle V2 snapshots in `idls/` remain available through the existing legacy IDL/client exports
69
+ during migration. SDK owns the downstream Circle client generation; this does not remove CCTP support.
70
+ Existing production generated clients, runtime helpers, legacy IDL deep imports, and EVM/shared exports remain available
71
+ during downstream migration. `MulticallHandlerCoder` is a handwritten compilation helper, not generated from
72
+ the program IDL; migrating it requires moving its logic downstream separately from IDL-based client generation.
73
+
74
+ Compatibility change from `6.0.0-beta.3`: the test program's root `TestIdl` and `TestAnchor` exports and
75
+ `dist/src/svm/assets/idl/test.json`, `dist/src/svm/assets/test.js` and `dist/src/svm/assets/test.d.ts` are removed.
76
+ Tests that need these interfaces must generate them from the matching source tag; they are not production APIs.
77
+
78
+ For maintainers, `yarn generate-svm-artifacts` always generates production interfaces, even with `IS_TEST=true`.
79
+ `yarn generate-svm-test-idls` writes test-feature and mock interfaces only under `target/`.
80
+ The explicit `/svm/idl/` entries in `package.json` allowlist the public Across IDLs. `yarn build-ts` exports those JSON
81
+ files to both the stable paths and the legacy `dist` paths, and retains Circle V2 JSON only in the legacy paths.
82
+ `npm pack` and `npm publish` run the same `prepack`
83
+ build, including EVM artifact export. Generate production artifacts first (and build EVM artifacts with
84
+ `yarn build-evm-foundry`). Run `yarn test-svm-idl-package` to inspect a real tarball and generate/compile clients
85
+ in an external fixture using only its IDLs. This check requires no validator or network access.
86
+
87
+ SVM binaries are a separate [GitHub Releases](https://github.com/across-protocol/contracts/releases) channel:
88
+ `svm-verified-test-binaries.tar.gz` contains test-feature binaries for downstream integration tests;
89
+ `svm-verified-production-binaries.tar.gz` contains production binaries. Both archives contain `target/deploy`.
90
+ Pin the release tag corresponding to the npm package version when pairing interfaces and binaries.
91
+ Test-only IDLs and mock interfaces are not npm exports; tests needing those interfaces must generate them
92
+ from the matching source tag. Test binaries must never be used for production deployment.
93
+
37
94
  ## Build
38
95
 
39
96
  ```shell
@@ -1,7 +1,5 @@
1
- declare const MessageTransmitterV2Idl: any;
2
- declare const MulticallHandlerIdl: any;
3
- declare const SponsoredCctpSrcPeripheryIdl: any;
4
- declare const SvmSpokeIdl: any;
5
- declare const TestIdl: any;
6
- declare const TokenMessengerMinterV2Idl: any;
7
- export { MessageTransmitterV2Idl, MulticallHandlerIdl, SponsoredCctpSrcPeripheryIdl, SvmSpokeIdl, TestIdl, TokenMessengerMinterV2Idl };
1
+ export declare const SvmSpokeIdl: any;
2
+ export declare const MulticallHandlerIdl: any;
3
+ export declare const SponsoredCctpSrcPeripheryIdl: any;
4
+ export declare const MessageTransmitterV2Idl: any;
5
+ export declare const TokenMessengerMinterV2Idl: any;
@@ -1,17 +1,9 @@
1
1
  "use strict";
2
2
  // This file has been autogenerated. Do not edit manually.
3
- // Generated by a script.
4
3
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.TokenMessengerMinterV2Idl = exports.TestIdl = exports.SvmSpokeIdl = exports.SponsoredCctpSrcPeripheryIdl = exports.MulticallHandlerIdl = exports.MessageTransmitterV2Idl = void 0;
6
- const MessageTransmitterV2Idl = require("./message_transmitter_v2.json");
7
- exports.MessageTransmitterV2Idl = MessageTransmitterV2Idl;
8
- const MulticallHandlerIdl = require("./multicall_handler.json");
9
- exports.MulticallHandlerIdl = MulticallHandlerIdl;
10
- const SponsoredCctpSrcPeripheryIdl = require("./sponsored_cctp_src_periphery.json");
11
- exports.SponsoredCctpSrcPeripheryIdl = SponsoredCctpSrcPeripheryIdl;
12
- const SvmSpokeIdl = require("./svm_spoke.json");
13
- exports.SvmSpokeIdl = SvmSpokeIdl;
14
- const TestIdl = require("./test.json");
15
- exports.TestIdl = TestIdl;
16
- const TokenMessengerMinterV2Idl = require("./token_messenger_minter_v2.json");
17
- exports.TokenMessengerMinterV2Idl = TokenMessengerMinterV2Idl;
4
+ exports.TokenMessengerMinterV2Idl = exports.MessageTransmitterV2Idl = exports.SponsoredCctpSrcPeripheryIdl = exports.MulticallHandlerIdl = exports.SvmSpokeIdl = void 0;
5
+ exports.SvmSpokeIdl = require("./svm_spoke.json");
6
+ exports.MulticallHandlerIdl = require("./multicall_handler.json");
7
+ exports.SponsoredCctpSrcPeripheryIdl = require("./sponsored_cctp_src_periphery.json");
8
+ exports.MessageTransmitterV2Idl = require("./message_transmitter_v2.json");
9
+ exports.TokenMessengerMinterV2Idl = require("./token_messenger_minter_v2.json");
@@ -1,7 +1,6 @@
1
1
  export * from "./idl";
2
- export { MessageTransmitterV2 as MessageTransmitterV2Anchor } from "./message_transmitter_v2";
2
+ export { SvmSpoke as SvmSpokeAnchor } from "./svm_spoke";
3
3
  export { MulticallHandler as MulticallHandlerAnchor } from "./multicall_handler";
4
4
  export { SponsoredCctpSrcPeriphery as SponsoredCctpSrcPeripheryAnchor } from "./sponsored_cctp_src_periphery";
5
- export { SvmSpoke as SvmSpokeAnchor } from "./svm_spoke";
6
- export { Test as TestAnchor } from "./test";
5
+ export { MessageTransmitterV2 as MessageTransmitterV2Anchor } from "./message_transmitter_v2";
7
6
  export { TokenMessengerMinterV2 as TokenMessengerMinterV2Anchor } from "./token_messenger_minter_v2";
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  // This file has been autogenerated. Do not edit manually.
3
- // Generated by a script.
4
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
4
  if (k2 === undefined) k2 = k;
6
5
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -58,8 +58,8 @@ export declare const encodeMessageHeaderV2: (header: MessageHeaderV2) => Buffer;
58
58
  */
59
59
  export declare const decodeTokenMessengerV2MessageBody: (data: Buffer) => TokenMessengerV2MessageBody;
60
60
  export declare const DecodedMessageBody: import("superstruct").Struct<{
61
- burnToken: string;
62
61
  amount: string;
62
+ burnToken: string;
63
63
  mintRecipient: string;
64
64
  messageSender: string;
65
65
  feeExecuted?: string | undefined;
@@ -77,18 +77,18 @@ export declare const DecodedMessageBody: import("superstruct").Struct<{
77
77
  hookData: import("superstruct").Struct<string | undefined, null>;
78
78
  }>;
79
79
  export declare const DecodedMessage: import("superstruct").Struct<{
80
- sourceDomain: string;
81
- nonce: string;
80
+ recipient: string;
82
81
  sender: string;
83
82
  messageBody: string;
83
+ sourceDomain: string;
84
+ nonce: string;
84
85
  destinationDomain: string;
85
- recipient: string;
86
86
  destinationCaller: string;
87
87
  finalityThresholdExecuted?: string | undefined;
88
88
  minFinalityThreshold?: string | undefined;
89
89
  decodedMessageBody?: {
90
- burnToken: string;
91
90
  amount: string;
91
+ burnToken: string;
92
92
  mintRecipient: string;
93
93
  messageSender: string;
94
94
  feeExecuted?: string | undefined;
@@ -111,8 +111,8 @@ export declare const DecodedMessage: import("superstruct").Struct<{
111
111
  }>;
112
112
  messageBody: import("superstruct").Struct<string, null>;
113
113
  decodedMessageBody: import("superstruct").Struct<{
114
- burnToken: string;
115
114
  amount: string;
115
+ burnToken: string;
116
116
  mintRecipient: string;
117
117
  messageSender: string;
118
118
  feeExecuted?: string | undefined;
@@ -131,24 +131,24 @@ export declare const DecodedMessage: import("superstruct").Struct<{
131
131
  }>;
132
132
  }>;
133
133
  export declare const AttestationMessage: import("superstruct").Struct<{
134
+ status: string;
134
135
  message: string;
135
136
  attestation: string;
136
- status: string;
137
137
  eventNonce: string;
138
138
  cctpVersion: number;
139
139
  decodedMessage?: {
140
- sourceDomain: string;
141
- nonce: string;
140
+ recipient: string;
142
141
  sender: string;
143
142
  messageBody: string;
143
+ sourceDomain: string;
144
+ nonce: string;
144
145
  destinationDomain: string;
145
- recipient: string;
146
146
  destinationCaller: string;
147
147
  finalityThresholdExecuted?: string | undefined;
148
148
  minFinalityThreshold?: string | undefined;
149
149
  decodedMessageBody?: {
150
- burnToken: string;
151
150
  amount: string;
151
+ burnToken: string;
152
152
  mintRecipient: string;
153
153
  messageSender: string;
154
154
  feeExecuted?: string | undefined;
@@ -163,18 +163,18 @@ export declare const AttestationMessage: import("superstruct").Struct<{
163
163
  eventNonce: import("superstruct").Struct<string, null>;
164
164
  attestation: import("superstruct").Struct<string, null>;
165
165
  decodedMessage: import("superstruct").Struct<{
166
- sourceDomain: string;
167
- nonce: string;
166
+ recipient: string;
168
167
  sender: string;
169
168
  messageBody: string;
169
+ sourceDomain: string;
170
+ nonce: string;
170
171
  destinationDomain: string;
171
- recipient: string;
172
172
  destinationCaller: string;
173
173
  finalityThresholdExecuted?: string | undefined;
174
174
  minFinalityThreshold?: string | undefined;
175
175
  decodedMessageBody?: {
176
- burnToken: string;
177
176
  amount: string;
177
+ burnToken: string;
178
178
  mintRecipient: string;
179
179
  messageSender: string;
180
180
  feeExecuted?: string | undefined;
@@ -197,8 +197,8 @@ export declare const AttestationMessage: import("superstruct").Struct<{
197
197
  }>;
198
198
  messageBody: import("superstruct").Struct<string, null>;
199
199
  decodedMessageBody: import("superstruct").Struct<{
200
- burnToken: string;
201
200
  amount: string;
201
+ burnToken: string;
202
202
  mintRecipient: string;
203
203
  messageSender: string;
204
204
  feeExecuted?: string | undefined;
@@ -228,24 +228,24 @@ export declare const AttestationMessage: import("superstruct").Struct<{
228
228
  }>;
229
229
  export declare const AttestationResponse: import("superstruct").Struct<{
230
230
  messages: {
231
+ status: string;
231
232
  message: string;
232
233
  attestation: string;
233
- status: string;
234
234
  eventNonce: string;
235
235
  cctpVersion: number;
236
236
  decodedMessage?: {
237
- sourceDomain: string;
238
- nonce: string;
237
+ recipient: string;
239
238
  sender: string;
240
239
  messageBody: string;
240
+ sourceDomain: string;
241
+ nonce: string;
241
242
  destinationDomain: string;
242
- recipient: string;
243
243
  destinationCaller: string;
244
244
  finalityThresholdExecuted?: string | undefined;
245
245
  minFinalityThreshold?: string | undefined;
246
246
  decodedMessageBody?: {
247
- burnToken: string;
248
247
  amount: string;
248
+ burnToken: string;
249
249
  mintRecipient: string;
250
250
  messageSender: string;
251
251
  feeExecuted?: string | undefined;
@@ -258,24 +258,24 @@ export declare const AttestationResponse: import("superstruct").Struct<{
258
258
  }[];
259
259
  }, {
260
260
  messages: import("superstruct").Struct<{
261
+ status: string;
261
262
  message: string;
262
263
  attestation: string;
263
- status: string;
264
264
  eventNonce: string;
265
265
  cctpVersion: number;
266
266
  decodedMessage?: {
267
- sourceDomain: string;
268
- nonce: string;
267
+ recipient: string;
269
268
  sender: string;
270
269
  messageBody: string;
270
+ sourceDomain: string;
271
+ nonce: string;
271
272
  destinationDomain: string;
272
- recipient: string;
273
273
  destinationCaller: string;
274
274
  finalityThresholdExecuted?: string | undefined;
275
275
  minFinalityThreshold?: string | undefined;
276
276
  decodedMessageBody?: {
277
- burnToken: string;
278
277
  amount: string;
278
+ burnToken: string;
279
279
  mintRecipient: string;
280
280
  messageSender: string;
281
281
  feeExecuted?: string | undefined;
@@ -286,24 +286,24 @@ export declare const AttestationResponse: import("superstruct").Struct<{
286
286
  } | null | undefined;
287
287
  delayReason?: string | null | undefined;
288
288
  }[], import("superstruct").Struct<{
289
+ status: string;
289
290
  message: string;
290
291
  attestation: string;
291
- status: string;
292
292
  eventNonce: string;
293
293
  cctpVersion: number;
294
294
  decodedMessage?: {
295
- sourceDomain: string;
296
- nonce: string;
295
+ recipient: string;
297
296
  sender: string;
298
297
  messageBody: string;
298
+ sourceDomain: string;
299
+ nonce: string;
299
300
  destinationDomain: string;
300
- recipient: string;
301
301
  destinationCaller: string;
302
302
  finalityThresholdExecuted?: string | undefined;
303
303
  minFinalityThreshold?: string | undefined;
304
304
  decodedMessageBody?: {
305
- burnToken: string;
306
305
  amount: string;
306
+ burnToken: string;
307
307
  mintRecipient: string;
308
308
  messageSender: string;
309
309
  feeExecuted?: string | undefined;
@@ -318,18 +318,18 @@ export declare const AttestationResponse: import("superstruct").Struct<{
318
318
  eventNonce: import("superstruct").Struct<string, null>;
319
319
  attestation: import("superstruct").Struct<string, null>;
320
320
  decodedMessage: import("superstruct").Struct<{
321
- sourceDomain: string;
322
- nonce: string;
321
+ recipient: string;
323
322
  sender: string;
324
323
  messageBody: string;
324
+ sourceDomain: string;
325
+ nonce: string;
325
326
  destinationDomain: string;
326
- recipient: string;
327
327
  destinationCaller: string;
328
328
  finalityThresholdExecuted?: string | undefined;
329
329
  minFinalityThreshold?: string | undefined;
330
330
  decodedMessageBody?: {
331
- burnToken: string;
332
331
  amount: string;
332
+ burnToken: string;
333
333
  mintRecipient: string;
334
334
  messageSender: string;
335
335
  feeExecuted?: string | undefined;
@@ -352,8 +352,8 @@ export declare const AttestationResponse: import("superstruct").Struct<{
352
352
  }>;
353
353
  messageBody: import("superstruct").Struct<string, null>;
354
354
  decodedMessageBody: import("superstruct").Struct<{
355
- burnToken: string;
356
355
  amount: string;
356
+ burnToken: string;
357
357
  mintRecipient: string;
358
358
  messageSender: string;
359
359
  feeExecuted?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@across-protocol/contracts",
3
- "version": "6.0.0-beta.3",
3
+ "version": "6.0.0-beta.4",
4
4
  "author": "UMA Team",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -12,7 +12,10 @@
12
12
  },
13
13
  "files": [
14
14
  "/contracts/**/*.sol",
15
- "/dist/**/*"
15
+ "/dist/**/*",
16
+ "/svm/idl/svm_spoke.json",
17
+ "/svm/idl/multicall_handler.json",
18
+ "/svm/idl/sponsored_cctp_src_periphery.json"
16
19
  ],
17
20
  "types": "dist/index.d.ts",
18
21
  "main": "dist/index.js",
@@ -30,19 +33,20 @@
30
33
  "format-contracts": "prettier --write \"contracts/**/*.sol\" \"script/**/*.sol\"",
31
34
  "check-format-contracts": "prettier --check \"contracts/**/*.sol\" \"script/**/*.sol\"",
32
35
  "lint-fix": "yarn prettier --write **/*.js **/*.ts ./programs/**/*.rs \"./contracts/**/*.sol\" && cargo +nightly fmt --all && cargo clippy",
33
- "clean-fast": "for dir in node_modules dist cache-foundry out zkout; do mv \"${dir}\" \"_${dir}\"; rm -rf \"_${dir}\" &; done",
34
- "clean": "rm -rf node_modules dist cache-foundry out zkout",
35
- "generate-svm-artifacts": "bash ./scripts/svm/buildHelpers/buildIdl.sh && sh ./scripts/svm/buildHelpers/generateSvmAssets.sh && yarn generate-svm-clients",
36
+ "clean-fast": "rm -rf svm/idl && for dir in node_modules dist cache-foundry out zkout; do mv \"${dir}\" \"_${dir}\"; rm -rf \"_${dir}\" & done",
37
+ "clean": "rm -rf node_modules dist cache-foundry out zkout svm/idl",
38
+ "generate-svm-artifacts": "bash ./scripts/svm/buildHelpers/buildIdl.sh && ts-node ./scripts/svm/buildHelpers/generateSvmAssets.ts && yarn generate-svm-clients",
36
39
  "generate-svm-test-idls": "bash ./scripts/svm/buildHelpers/buildTestIdls.sh",
37
40
  "generate-svm-clients": "yarn ts-node ./scripts/svm/buildHelpers/generateSvmClients.ts && yarn ts-node ./scripts/svm/buildHelpers/renameClientsImports.ts",
38
41
  "build-svm": "bash ./scripts/svm/buildHelpers/buildSvmLocalToolchain.sh",
39
42
  "build-svm-solana-verify": "bash ./scripts/svm/buildHelpers/buildSolanaVerify.sh",
40
- "build-ts": "rm -rf ./dist && tsc",
43
+ "build-ts": "rm -rf ./dist && tsc && yarn export-idl",
41
44
  "typecheck-tests": "tsc -p tsconfig.test.json",
42
45
  "test-svm-build-guard": "ts-mocha -p tsconfig.test.json -t 10000 test/svm/Scripts.SbfBuild.ts",
43
- "export-idl": "mkdir -p dist/src/svm/assets/idl && cp src/svm/assets/idl/*.json dist/src/svm/assets/idl/",
46
+ "test-svm-idl-package": "NODE_OPTIONS=--no-experimental-strip-types ts-mocha -p tsconfig.test.json -t 120000 test/svm-package/IdlPackage.ts",
47
+ "export-idl": "ts-node scripts/svm/buildHelpers/exportIdl.ts",
44
48
  "export-evm-artifacts": "sh scripts/exportEvmArtifacts.sh",
45
- "prepublishOnly": "yarn build-ts && yarn export-idl && yarn export-evm-artifacts",
49
+ "prepack": "yarn build-ts && yarn export-evm-artifacts",
46
50
  "build": "yarn build-evm-foundry && yarn build-svm && yarn generate-svm-artifacts && yarn build-ts",
47
51
  "build-verified": "yarn build-evm-foundry && yarn build-svm-solana-verify && yarn generate-svm-artifacts && yarn build-ts",
48
52
  "pin-foundry": "sh scripts/foundry-version.sh pin",
@@ -0,0 +1,31 @@
1
+ {
2
+ "address": "HaQe51FWtnmaEcuYEfPA7MRCXKrtqptat4oJdJ8zV5Be",
3
+ "metadata": {
4
+ "name": "multicall_handler",
5
+ "version": "0.1.0",
6
+ "spec": "0.1.0",
7
+ "description": "Created with Anchor"
8
+ },
9
+ "instructions": [
10
+ {
11
+ "name": "handle_v3_across_message",
12
+ "discriminator": [
13
+ 131,
14
+ 141,
15
+ 52,
16
+ 71,
17
+ 16,
18
+ 59,
19
+ 196,
20
+ 92
21
+ ],
22
+ "accounts": [],
23
+ "args": [
24
+ {
25
+ "name": "message",
26
+ "type": "bytes"
27
+ }
28
+ ]
29
+ }
30
+ ]
31
+ }