@layerzerolabs/ton-sdk-tools 3.0.35 → 3.0.36

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @layerzerolabs/ton-sdk-tools
2
2
 
3
+ ## 3.0.36
4
+
5
+ ### Patch Changes
6
+
7
+ - 6ff94ed: Publish new TON packages at Dec 21
8
+
3
9
  ## 3.0.35
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -3240,6 +3240,20 @@ export const UlnConnectionVerificationStatusVerifying = BigInt(0)
3240
3240
  export const UlnConnectionVerificationStatusCommittable = BigInt(1)
3241
3241
  export const ChannelExecutionStatusExecutable = BigInt(2)
3242
3242
 
3243
+ export interface SendUlnConfig {
3244
+ workerQuoteGasLimit: bigint
3245
+ maxMessageBytes: bigint
3246
+ }
3247
+
3248
+ export interface ReceiveUlnConfig {
3249
+ minCommitPacketGas: bigint
3250
+ }
3251
+
3252
+ export interface UlnConfig {
3253
+ send: SendUlnConfig
3254
+ receive: ReceiveUlnConfig
3255
+ }
3256
+
3243
3257
  export interface SendDvnConfig {
3244
3258
  numReqDvns: bigint
3245
3259
  numOptDvns: bigint
@@ -3256,11 +3270,16 @@ export interface DvnConfigs {
3256
3270
  receive: ReceiveDvnConfig
3257
3271
  }
3258
3272
 
3259
- export interface DvnFixtureConfig {
3273
+ export interface DvnConfig {
3260
3274
  src: DvnConfigs
3261
3275
  dst: DvnConfigs
3262
3276
  }
3263
3277
 
3278
+ export interface CustomConfigs {
3279
+ ulnConfig?: UlnConfig
3280
+ dvnConfig?: DvnConfig
3281
+ }
3282
+
3264
3283
  export interface WorkerFixture {
3265
3284
  admins: SandboxContract<TreasuryContract>[]
3266
3285
  proxy: SandboxContract<TonContractWrapper>
@@ -3883,7 +3902,7 @@ export async function deployConfigAndRegisterDvn(
3883
3902
  allStorages: SandboxContract<TonContractWrapper>,
3884
3903
  fixture: OAppFixtureULN,
3885
3904
  eventHandler: LzEventHandler,
3886
- dvnFixtureConfig: DvnFixtureConfig
3905
+ dvnConfigs: DvnConfigs
3887
3906
  ): Promise<[DvnFixture[], DvnFixture[]]> {
3888
3907
  const dvnAdmins = [fixture.owner]
3889
3908
  const verifierSet = generateRandomVerifierSet(3)
@@ -3891,7 +3910,7 @@ export async function deployConfigAndRegisterDvn(
3891
3910
  const sendDvnFixtures: DvnFixture[] = []
3892
3911
  const receiveDvnFixtures: DvnFixture[] = []
3893
3912
 
3894
- for (let i = 0; i < dvnFixtureConfig.src.send.numReqDvns + dvnFixtureConfig.src.send.numOptDvns; i++) {
3913
+ for (let i = 0; i < dvnConfigs.send.numReqDvns + dvnConfigs.send.numOptDvns; i++) {
3895
3914
  const [dvn, dvnProxy, dvnMsgResults] = await openAndDeployDvnAndProxy(
3896
3915
  blockchain,
3897
3916
  allStorages,
@@ -3911,7 +3930,7 @@ export async function deployConfigAndRegisterDvn(
3911
3930
  }
3912
3931
 
3913
3932
  const randomNumber = Math.floor(Math.random() * 10) + 100
3914
- for (let i = 0; i < dvnFixtureConfig.src.receive.numReqDvns + dvnFixtureConfig.src.receive.numOptDvns; i++) {
3933
+ for (let i = 0; i < dvnConfigs.receive.numReqDvns + dvnConfigs.receive.numOptDvns; i++) {
3915
3934
  const [dvn, dvnProxy, dvnMsgResults] = await openAndDeployDvnAndProxy(
3916
3935
  blockchain,
3917
3936
  allStorages,
@@ -3939,9 +3958,10 @@ export async function deployConfigAndRegisterUln(
3939
3958
  allStorages: SandboxContract<TonContractWrapper>,
3940
3959
  srcFixture: OAppFixtureULN,
3941
3960
  dstFixture: OAppFixtureULN,
3961
+ ulnConfigs: UlnConfig,
3942
3962
  version: bigint,
3943
3963
  eventHandler: LzEventHandler,
3944
- dvnFixtureConfig: DvnFixtureConfig
3964
+ dvnConfigs: DvnConfigs
3945
3965
  ): Promise<SandboxContract<TonContractWrapper>> {
3946
3966
  // ===================================open and deploy uln manager =====================================
3947
3967
 
@@ -3960,7 +3980,7 @@ export async function deployConfigAndRegisterUln(
3960
3980
  allStorages,
3961
3981
  srcFixture,
3962
3982
  eventHandler,
3963
- dvnFixtureConfig
3983
+ dvnConfigs
3964
3984
  )
3965
3985
 
3966
3986
  // ===================================open and deploy executor=====================================
@@ -4196,11 +4216,11 @@ export async function deployConfigAndRegisterUln(
4196
4216
  // requireDefined(srcFixture.dvnFixtures)
4197
4217
  // const [reqDvns, optDvns, optThreshold] = getDvnArrayFromDvnFixtures(srcFixture.dvnFixtures, dvnConfig)
4198
4218
  requireDefined(srcFixture.sendDvnFixtures)
4199
- const [reqSendDvns, optSendDvns] = getDvnArrayFromDvnFixtures(srcFixture.sendDvnFixtures, dvnFixtureConfig.src.send)
4219
+ const [reqSendDvns, optSendDvns] = getDvnArrayFromDvnFixtures(srcFixture.sendDvnFixtures, dvnConfigs.send)
4200
4220
 
4201
4221
  const ulnSendConfig = await allStorages.getNewUlnSendConfig({
4202
- workerQuoteGasLimit: BigInt(100000000),
4203
- maxMessageBytes: BigInt(1000000000),
4222
+ workerQuoteGasLimit: ulnConfigs.send.workerQuoteGasLimit,
4223
+ maxMessageBytes: ulnConfigs.send.maxMessageBytes,
4204
4224
  executorNull: BigInt(0),
4205
4225
  executor: addressToBigInt(executorProxy.address),
4206
4226
  requiredDVNsNull: BigInt(0),
@@ -4247,12 +4267,12 @@ export async function deployConfigAndRegisterUln(
4247
4267
  requireDefined(srcFixture.receiveDvnFixtures)
4248
4268
  const [reqReceiveDvns, optReceiveDvns, optReceiveQuorum] = getDvnArrayFromDvnFixtures(
4249
4269
  srcFixture.receiveDvnFixtures,
4250
- dvnFixtureConfig.src.receive
4270
+ dvnConfigs.receive
4251
4271
  )
4252
4272
 
4253
4273
  const ulnReceiveConfig = await allStorages.getNewUlnReceiveConfig({
4254
4274
  minCommitPacketGasNull: BigInt(0),
4255
- minCommitPacketGas: BigInt(1),
4275
+ minCommitPacketGas: ulnConfigs.receive.minCommitPacketGas,
4256
4276
  confirmationsNull: BigInt(0),
4257
4277
  confirmations: BigInt(1),
4258
4278
  requiredDVNsNull: BigInt(0),
@@ -4305,7 +4325,8 @@ export async function wireFixtureWithUln(
4305
4325
  srcFixture: OAppFixtureULN,
4306
4326
  dstFixture: OAppFixtureULN,
4307
4327
  eventHandler: LzEventHandler,
4308
- dvnFixtureConfigCustom?: DvnFixtureConfig
4328
+ ulnConfigCustom?: UlnConfig,
4329
+ dvnConfigsCustom?: DvnConfigs
4309
4330
  ): Promise<void> {
4310
4331
  // ===================================wire channels=====================================
4311
4332
 
@@ -4313,28 +4334,25 @@ export async function wireFixtureWithUln(
4313
4334
 
4314
4335
  // ===================================default config =====================================
4315
4336
 
4316
- const defaultDvnFixtureConfig: DvnFixtureConfig = {
4317
- src: {
4318
- send: {
4319
- numReqDvns: 2n,
4320
- numOptDvns: 0n,
4321
- },
4322
- receive: {
4323
- numReqDvns: 2n,
4324
- numOptDvns: 0n,
4325
- optDvnQuorum: 0n,
4326
- },
4337
+ const ulnConfigDefault: UlnConfig = {
4338
+ send: {
4339
+ workerQuoteGasLimit: BigInt(100000000),
4340
+ maxMessageBytes: BigInt(100000000),
4327
4341
  },
4328
- dst: {
4329
- send: {
4330
- numReqDvns: 2n,
4331
- numOptDvns: 0n,
4332
- },
4333
- receive: {
4334
- numReqDvns: 2n,
4335
- numOptDvns: 0n,
4336
- optDvnQuorum: 0n,
4337
- },
4342
+ receive: {
4343
+ minCommitPacketGas: BigInt(1),
4344
+ },
4345
+ }
4346
+
4347
+ const dvnConfigsDefault: DvnConfigs = {
4348
+ send: {
4349
+ numReqDvns: 2n,
4350
+ numOptDvns: 0n,
4351
+ },
4352
+ receive: {
4353
+ numReqDvns: 2n,
4354
+ numOptDvns: 0n,
4355
+ optDvnQuorum: 0n,
4338
4356
  },
4339
4357
  }
4340
4358
 
@@ -4346,9 +4364,10 @@ export async function wireFixtureWithUln(
4346
4364
  allStorages,
4347
4365
  srcFixture,
4348
4366
  dstFixture,
4367
+ ulnConfigCustom ?? ulnConfigDefault,
4349
4368
  ULN_MANAGER_DEFAULT_VERSION,
4350
4369
  eventHandler,
4351
- defaultDvnFixtureConfig
4370
+ dvnConfigsDefault
4352
4371
  )
4353
4372
 
4354
4373
  // ===================================add msg lib to controller =====================================
@@ -4390,7 +4409,7 @@ export async function wireFixtureWithUln(
4390
4409
  // expect no failures
4391
4410
  expect(eventHandler.allFailures.txList).toHaveLength(0)
4392
4411
 
4393
- if (dvnFixtureConfigCustom) {
4412
+ if (dvnConfigsCustom) {
4394
4413
  // ===================================open and deploy dvn =====================================
4395
4414
 
4396
4415
  ;[srcFixture.sendDvnFixturesCustom, srcFixture.receiveDvnFixturesCustom] = await deployConfigAndRegisterDvn(
@@ -4398,7 +4417,7 @@ export async function wireFixtureWithUln(
4398
4417
  allStorages,
4399
4418
  srcFixture,
4400
4419
  eventHandler,
4401
- dvnFixtureConfigCustom
4420
+ dvnConfigsCustom
4402
4421
  )
4403
4422
 
4404
4423
  // ===================================addUlnWorker - dvn =======================================
@@ -4415,7 +4434,7 @@ export async function wireFixtureWithUln(
4415
4434
 
4416
4435
  const [reqSendDvns, optSendDvns] = getDvnArrayFromDvnFixtures(
4417
4436
  srcFixture.sendDvnFixturesCustom,
4418
- dvnFixtureConfigCustom.src.send
4437
+ dvnConfigsCustom.send
4419
4438
  )
4420
4439
 
4421
4440
  const ulnSendConfig = await allStorages.getNewUlnSendConfig({
@@ -4467,7 +4486,7 @@ export async function wireFixtureWithUln(
4467
4486
 
4468
4487
  const [reqReceiveDvns, optReceiveDvns, optReceiveQuorum] = getDvnArrayFromDvnFixtures(
4469
4488
  srcFixture.receiveDvnFixturesCustom,
4470
- dvnFixtureConfigCustom.src.receive
4489
+ dvnConfigsCustom.receive
4471
4490
  )
4472
4491
 
4473
4492
  const ulnReceiveConfig = await allStorages.getNewUlnReceiveConfig({
@@ -4525,7 +4544,7 @@ export async function wireFixturesTogetherWithUln(
4525
4544
  srcFixture: OAppFixtureULN,
4526
4545
  dstFixture: OAppFixtureULN,
4527
4546
  eventHandler: LzEventHandler,
4528
- dvnFixtureConfigCustom?: DvnFixtureConfig
4547
+ customConfigs?: CustomConfigs
4529
4548
  ): Promise<void> {
4530
4549
  await wireFixtureWithUln(
4531
4550
  blockchain,
@@ -4534,7 +4553,8 @@ export async function wireFixturesTogetherWithUln(
4534
4553
  srcFixture,
4535
4554
  dstFixture,
4536
4555
  eventHandler,
4537
- dvnFixtureConfigCustom
4556
+ customConfigs?.ulnConfig,
4557
+ customConfigs?.dvnConfig?.src
4538
4558
  )
4539
4559
  await wireFixtureWithUln(
4540
4560
  blockchain,
@@ -4543,7 +4563,8 @@ export async function wireFixturesTogetherWithUln(
4543
4563
  dstFixture,
4544
4564
  srcFixture,
4545
4565
  eventHandler,
4546
- dvnFixtureConfigCustom
4566
+ customConfigs?.ulnConfig,
4567
+ customConfigs?.dvnConfig?.dst
4547
4568
  )
4548
4569
  }
4549
4570