@layerzerolabs/lz-solana-sdk-v2 3.0.67 → 3.0.68-ton.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/dist/umi.cjs CHANGED
@@ -9927,7 +9927,7 @@ async function extractWorkerFeePaidEventByTxHash(connection, program, signature,
9927
9927
  if (!events) return null;
9928
9928
  return events;
9929
9929
  }
9930
- async function extractEventFromTransactionSignature(connection, _program, signature, serializer, commitment, unsafeParseErr = false) {
9930
+ async function extractEventFromTransactionSignature(rpc, _program, signature, serializer, commitment, unsafeParseErr = false) {
9931
9931
  let program;
9932
9932
  if (typeof _program === "string" && umi.isPublicKey(_program)) {
9933
9933
  program = umiWeb3jsAdapters.toWeb3JsPublicKey(_program);
@@ -9936,13 +9936,8 @@ async function extractEventFromTransactionSignature(connection, _program, signat
9936
9936
  }
9937
9937
  let tx;
9938
9938
  if (typeof signature === "string") {
9939
- if (connection instanceof web3__namespace.Connection) {
9940
- tx = await connection.getParsedTransaction(signature, commitment);
9941
- } else if ("connection" in connection && connection.connection instanceof web3__namespace.Connection) {
9942
- tx = await connection.connection.getParsedTransaction(signature, commitment);
9943
- } else {
9944
- throw new Error("Invalid connection");
9945
- }
9939
+ const connection = toWeb3Connection(rpc);
9940
+ tx = await connection.getParsedTransaction(signature, commitment);
9946
9941
  } else {
9947
9942
  tx = signature;
9948
9943
  }
@@ -10093,12 +10088,8 @@ async function simulateWeb3JsTransaction(_connection, _instructions, _programId,
10093
10088
  let connection;
10094
10089
  if (typeof _connection === "string") {
10095
10090
  connection = new web3__namespace.Connection(_connection, commitment);
10096
- } else if (_connection instanceof web3__namespace.Connection) {
10097
- connection = _connection;
10098
- } else if ("connection" in _connection && _connection.connection instanceof web3__namespace.Connection) {
10099
- ({ connection } = _connection);
10100
10091
  } else {
10101
- throw new Error("Invalid connection");
10092
+ connection = toWeb3Connection(_connection);
10102
10093
  }
10103
10094
  let instructions;
10104
10095
  if (_instructions.length === 0) {
@@ -10149,6 +10140,15 @@ async function simulateWeb3JsTransaction(_connection, _instructions, _programId,
10149
10140
  return serializer.deserialize(resp, 0)[0];
10150
10141
  }
10151
10142
  }
10143
+ function toWeb3Connection(rpc) {
10144
+ if (rpc instanceof web3__namespace.Connection) {
10145
+ return rpc;
10146
+ } else if ("connection" in rpc && rpc.connection instanceof web3__namespace.Connection) {
10147
+ return rpc.connection;
10148
+ } else {
10149
+ throw new Error("Invalid connection");
10150
+ }
10151
+ }
10152
10152
 
10153
10153
  // src/receive.ts
10154
10154
  async function lzReceive(rpc, payer, packet, callerParams = Uint8Array.from([0, 0]), commitment = "confirmed") {
@@ -14653,6 +14653,7 @@ exports.lzCompose = lzCompose;
14653
14653
  exports.lzReceive = lzReceive;
14654
14654
  exports.messageLibs = messageLibs;
14655
14655
  exports.simulateWeb3JsTransaction = simulateWeb3JsTransaction;
14656
+ exports.toWeb3Connection = toWeb3Connection;
14656
14657
  exports.txWithAddressLookupTable = txWithAddressLookupTable;
14657
14658
  exports.txWithNonce = txWithNonce;
14658
14659
  //# sourceMappingURL=umi.cjs.map