@layerzerolabs/lz-solana-sdk-v2 2.3.33 → 2.3.35-aptos.0
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 +20 -0
- package/dist/index.cjs +57 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +57 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @layerzerolabs/lz-solana-sdk-v2
|
|
2
2
|
|
|
3
|
+
## 2.3.35-aptos.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7744b25: Add Aptos v1 support in testify, all tests passed.
|
|
8
|
+
- Updated dependencies [7744b25]
|
|
9
|
+
- @layerzerolabs/lz-corekit-solana@2.3.35-aptos.0
|
|
10
|
+
- @layerzerolabs/lz-definitions@2.3.35-aptos.0
|
|
11
|
+
- @layerzerolabs/lz-v2-utilities@2.3.35-aptos.0
|
|
12
|
+
|
|
13
|
+
## 2.3.34
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 5a99681: Fix an issue in Solana
|
|
18
|
+
- Updated dependencies [5a99681]
|
|
19
|
+
- @layerzerolabs/lz-corekit-solana@2.3.34
|
|
20
|
+
- @layerzerolabs/lz-definitions@2.3.34
|
|
21
|
+
- @layerzerolabs/lz-v2-utilities@2.3.34
|
|
22
|
+
|
|
3
23
|
## 2.3.33
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -15160,7 +15160,7 @@ async function txWithAddressLookupTable(connection, payer, instructions, recentB
|
|
|
15160
15160
|
}).compileToV0Message()
|
|
15161
15161
|
);
|
|
15162
15162
|
}
|
|
15163
|
-
const lookupTableAccount = await connection.getAddressLookupTable(tableAddr)
|
|
15163
|
+
const { value: lookupTableAccount } = await connection.getAddressLookupTable(tableAddr);
|
|
15164
15164
|
return new web35.VersionedTransaction(
|
|
15165
15165
|
new web35.TransactionMessage({
|
|
15166
15166
|
instructions,
|
|
@@ -19225,13 +19225,7 @@ var Uln = class {
|
|
|
19225
19225
|
const [receiveConfig] = this.deriver.receiveConfig(srcEid, receiver);
|
|
19226
19226
|
const [setting] = this.deriver.setting();
|
|
19227
19227
|
const [msgLib] = this.deriver.messageLib();
|
|
19228
|
-
|
|
19229
|
-
if (!receiveConfigState) {
|
|
19230
|
-
receiveConfigState = await this.getDefaultReceiveConfigState(connection, srcEid);
|
|
19231
|
-
}
|
|
19232
|
-
if (!receiveConfigState) {
|
|
19233
|
-
throw new Error("receive config not initialized");
|
|
19234
|
-
}
|
|
19228
|
+
const receiveConfigState = await this.getFinalReceiveConfigState(connection, receiver, srcEid);
|
|
19235
19229
|
const headerHash = packet.headerHash();
|
|
19236
19230
|
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), "hex"));
|
|
19237
19231
|
const confirmations = receiveConfigState.uln.requiredDvns.concat(receiveConfigState.uln.optionalDvns).map((p) => {
|
|
@@ -19369,6 +19363,61 @@ var Uln = class {
|
|
|
19369
19363
|
return null;
|
|
19370
19364
|
}
|
|
19371
19365
|
}
|
|
19366
|
+
async getFinalReceiveConfigState(connection, receiver, eid, commitmentOrConfig) {
|
|
19367
|
+
const NIL_CONFIRMATIONS = "18446744073709551615";
|
|
19368
|
+
const NIL_DVN_COUNT = "255";
|
|
19369
|
+
const rtn_config = {
|
|
19370
|
+
confirmations: 0,
|
|
19371
|
+
requiredDvnCount: 0,
|
|
19372
|
+
optionalDvnCount: 0,
|
|
19373
|
+
optionalDvnThreshold: 0,
|
|
19374
|
+
requiredDvns: [],
|
|
19375
|
+
optionalDvns: []
|
|
19376
|
+
};
|
|
19377
|
+
const [defaultConfig] = this.deriver.defaultReceiveConfig(eid);
|
|
19378
|
+
const [customConfig] = this.deriver.receiveConfig(eid, receiver);
|
|
19379
|
+
const [defaultConfigInfo, customConfigInfo] = await connection.getMultipleAccountsInfo(
|
|
19380
|
+
[defaultConfig, customConfig],
|
|
19381
|
+
commitmentOrConfig
|
|
19382
|
+
);
|
|
19383
|
+
if (defaultConfigInfo == null) {
|
|
19384
|
+
throw new Error(`please init default receive config first. ${defaultConfig.toBase58()}`);
|
|
19385
|
+
}
|
|
19386
|
+
const defaultConfigState = ReceiveConfig2.fromAccountInfo(defaultConfigInfo)[0];
|
|
19387
|
+
const customConfigState = customConfigInfo ? ReceiveConfig2.fromAccountInfo(customConfigInfo)[0] : null;
|
|
19388
|
+
if (customConfigState == null || customConfigState.uln.confirmations == 0) {
|
|
19389
|
+
rtn_config.confirmations = defaultConfigState.uln.confirmations;
|
|
19390
|
+
} else if (customConfigState.uln.confirmations.toString() !== NIL_CONFIRMATIONS) {
|
|
19391
|
+
rtn_config.confirmations = customConfigState.uln.confirmations;
|
|
19392
|
+
}
|
|
19393
|
+
if (customConfigState == null || customConfigState.uln.requiredDvnCount == 0) {
|
|
19394
|
+
if (defaultConfigState.uln.requiredDvnCount > 0) {
|
|
19395
|
+
rtn_config.requiredDvns = defaultConfigState.uln.requiredDvns;
|
|
19396
|
+
rtn_config.requiredDvnCount = defaultConfigState.uln.requiredDvnCount;
|
|
19397
|
+
}
|
|
19398
|
+
} else if (customConfigState.uln.requiredDvnCount.toString() !== NIL_DVN_COUNT) {
|
|
19399
|
+
rtn_config.requiredDvns = customConfigState.uln.requiredDvns;
|
|
19400
|
+
rtn_config.requiredDvnCount = customConfigState.uln.requiredDvnCount;
|
|
19401
|
+
}
|
|
19402
|
+
if (customConfigState == null || customConfigState.uln.optionalDvnCount == 0) {
|
|
19403
|
+
if (defaultConfigState.uln.optionalDvnCount > 0) {
|
|
19404
|
+
rtn_config.optionalDvns = defaultConfigState.uln.optionalDvns;
|
|
19405
|
+
rtn_config.optionalDvnCount = defaultConfigState.uln.optionalDvnCount;
|
|
19406
|
+
rtn_config.optionalDvnThreshold = defaultConfigState.uln.optionalDvnThreshold;
|
|
19407
|
+
}
|
|
19408
|
+
} else if (customConfigState.uln.optionalDvnCount.toString() !== NIL_DVN_COUNT) {
|
|
19409
|
+
rtn_config.optionalDvns = customConfigState.uln.optionalDvns;
|
|
19410
|
+
rtn_config.optionalDvnCount = customConfigState.uln.optionalDvnCount;
|
|
19411
|
+
rtn_config.optionalDvnThreshold = customConfigState.uln.optionalDvnThreshold;
|
|
19412
|
+
}
|
|
19413
|
+
if (rtn_config.requiredDvnCount === 0 && rtn_config.optionalDvnCount === 0) {
|
|
19414
|
+
throw new Error("no dvn");
|
|
19415
|
+
}
|
|
19416
|
+
return ReceiveConfig2.fromArgs({
|
|
19417
|
+
bump: defaultConfigState.bump,
|
|
19418
|
+
uln: rtn_config
|
|
19419
|
+
});
|
|
19420
|
+
}
|
|
19372
19421
|
};
|
|
19373
19422
|
|
|
19374
19423
|
// src/pricefeed.ts
|