@wormhole-foundation/wormhole-connect 4.2.0-beta.0-development → 5.0.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.
Files changed (73) hide show
  1. package/dist/main.mjs +73 -73
  2. package/dist/src/telemetry/types.d.ts +2 -1
  3. package/dist/src/telemetry/types.d.ts.map +1 -1
  4. package/dist/src/utils/errors.d.ts +1 -0
  5. package/dist/src/utils/errors.d.ts.map +1 -1
  6. package/lib/{aptos-DcdKyekw.js → aptos-BnjZOhUE.js} +1 -1
  7. package/lib/{aptos-B1Gf2eCD.mjs → aptos-fTiHvXXE.mjs} +2 -2
  8. package/lib/{basic-DnhL0oWa.mjs → basic-BqusrmRE.mjs} +2 -2
  9. package/lib/{basic-C6VXQ7m-.js → basic-BrW22Cj9.js} +1 -1
  10. package/lib/{basic-CFbslwLM.mjs → basic-CK5Bsf0B.mjs} +2 -2
  11. package/lib/{basic-BS7Z1PMG.js → basic-ChOmeQQk.js} +1 -1
  12. package/lib/constants-C1w_RyOP.js +1 -0
  13. package/lib/{constants-CTJ_-E0d.mjs → constants-DcDpDarO.mjs} +5 -5
  14. package/lib/{core-DT6TBPQP.mjs → core-DQ-6Q1F1.mjs} +5 -5
  15. package/lib/{core-RRp0K__1.js → core-FA2gBc-s.js} +3 -3
  16. package/lib/{evm-DlOCiplA.mjs → evm-BJ4Lx-r9.mjs} +3 -3
  17. package/lib/{evm-BwCfQIyJ.js → evm-BTgO_HRP.js} +2 -2
  18. package/lib/{evm-BxF9XPn4.mjs → evm-C-vXMfGr.mjs} +3 -3
  19. package/lib/{evm-C3B8jHD7.js → evm-qxndAh3z.js} +1 -1
  20. package/lib/hosted.js +1 -1
  21. package/lib/hosted.mjs +1 -1
  22. package/lib/{hypercore-DbqOAqKF.js → hypercore-D7kZiwbe.js} +1 -1
  23. package/lib/{hypercore-H7pw_pN4.mjs → hypercore-DKqayfki.mjs} +9 -9
  24. package/lib/{index-mikg85u5.js → index-3Zg1AdoI.js} +1 -1
  25. package/lib/{index-BuEKhdrW.mjs → index-B1URQBlH.mjs} +1 -1
  26. package/lib/{index-pn6NZmOS.js → index-B7b8sctd.js} +1 -1
  27. package/lib/{index-CsLyPoC6.mjs → index-BVciucyT.mjs} +1 -1
  28. package/lib/{index-BNpkgexR.js → index-BfzaCmg7.js} +1 -1
  29. package/lib/{index-DVm_f5E1.js → index-C-F8_8dY.js} +1 -1
  30. package/lib/{index-BmP0jPVN.mjs → index-C6MalNd5.mjs} +9 -9
  31. package/lib/{index-BbE02hdW.js → index-Cb_8WAm1.js} +8 -8
  32. package/lib/{index-BnKf2rOm.mjs → index-CgqBQ88K.mjs} +178 -175
  33. package/lib/{index-BtU67kjy.mjs → index-CowAVUcg.mjs} +1 -1
  34. package/lib/{index-CGqJokTg.mjs → index-DcFL403C.mjs} +1 -1
  35. package/lib/{index-DAJZN12d.js → index-Oxm0y6-t.js} +1 -1
  36. package/lib/{index-t_koRpGi.js → index-XjDX4fWv.js} +1 -1
  37. package/lib/{index-NAUBlFLG.mjs → index-mNO1mk2F.mjs} +1 -1
  38. package/lib/{index.es-B3FwsRfN.js → index.es-B9kBDkCQ.js} +3 -3
  39. package/lib/{index.es-ClIr5Gv-.js → index.es-BZRO-bNH.js} +1 -1
  40. package/lib/{index.es-CYyuSfPG.mjs → index.es-CF3YY88z.mjs} +3 -3
  41. package/lib/{index.es-3KAM8l3G.mjs → index.es-CaAL5X4E.mjs} +2 -2
  42. package/lib/index.js +2 -2
  43. package/lib/index.mjs +16 -15
  44. package/lib/lifi.js +1 -1
  45. package/lib/lifi.mjs +2 -2
  46. package/lib/mayan.js +1 -1
  47. package/lib/mayan.mjs +2 -2
  48. package/lib/{secp256k1-BZFiBDHQ.mjs → secp256k1-1o6o1kFy.mjs} +1 -1
  49. package/lib/{secp256k1-D3i7kc2M.mjs → secp256k1-BjlnTj1_.mjs} +1 -1
  50. package/lib/{secp256k1-B2G0zB-5.js → secp256k1-CeYT4ndf.js} +1 -1
  51. package/lib/{secp256k1-Cteng3v9.mjs → secp256k1-Cw_BiEuN.mjs} +1 -1
  52. package/lib/{secp256k1-CxjctkO3.js → secp256k1-D5cKS6q_.js} +1 -1
  53. package/lib/{secp256k1-Bz-QjKBU.js → secp256k1-_QlJc7sK.js} +1 -1
  54. package/lib/{solana-BE2DAanS.js → solana-DvHFhri3.js} +4 -4
  55. package/lib/{solana-Df231Yni.mjs → solana-TgPr9kpk.mjs} +8 -8
  56. package/lib/{solanaEmbed.esm-B9WG-Afi.mjs → solanaEmbed.esm-Bh1-aAL4.mjs} +2 -2
  57. package/lib/{solanaEmbed.esm-BqcrHrhl.js → solanaEmbed.esm-C8TjRcIV.js} +1 -1
  58. package/lib/src/telemetry/types.d.ts +2 -1
  59. package/lib/src/telemetry/types.d.ts.map +1 -1
  60. package/lib/src/utils/errors.d.ts +1 -0
  61. package/lib/src/utils/errors.d.ts.map +1 -1
  62. package/lib/{sui-B9tYcgyb.mjs → sui-CoWRa3vr.mjs} +2 -2
  63. package/lib/{sui-BVwNcgQT.js → sui-DwFrGd2Y.js} +1 -1
  64. package/lib/{tokenHelpers-DITWDel1.js → tokenHelpers-CeTyb4rG.js} +1 -1
  65. package/lib/{tokenHelpers-C53sepsl.mjs → tokenHelpers-VYjmKUxj.mjs} +1 -1
  66. package/lib/{tokens-CO0YQ3R2.mjs → tokens-D6uJqrsR.mjs} +1 -1
  67. package/lib/{tokens-CiSHS7oi.js → tokens-mXZqt-qL.js} +1 -1
  68. package/lib/{w3m-modal-SlcSCSnx.mjs → w3m-modal-BEe8ji9_.mjs} +2 -2
  69. package/lib/{w3m-modal-5v-rsnN8.mjs → w3m-modal-D3eqrCT1.mjs} +2 -2
  70. package/lib/{w3m-modal-B0Lu-6W8.js → w3m-modal-Duc13ei7.js} +1 -1
  71. package/lib/{w3m-modal-B2xHxAWg.js → w3m-modal-f_sUVzPx.js} +1 -1
  72. package/package.json +1 -1
  73. package/lib/constants-BCFTvlgh.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const a=require("./unsignedTransaction-qRBv5Cnd.js"),m=require("./index-BbE02hdW.js"),C=require("./signer-gjSiV5v3.js"),N=require("./platform-DCcL7jHP.js");function E(e){return e.includes("rpcpool.com")?"triton":e.includes("helius-rpc.com")?"helius":e.includes("rpc.ankr.com")?"ankr":"unknown"}async function B(e,t,l,u){const n=u.transaction.transaction,d=i=>i.programId.toString()!=="ComputeBudget111111111111111111111111111111";if(a.isVersionedTransaction(n)){const i=(await Promise.all(n.message.addressTableLookups.map(c=>e.getAddressLookupTable(c.accountKey)))).map(c=>c.value).filter(c=>c!==null),r=a.TransactionMessage.decompile(n.message,{addressLookupTableAccounts:i});r.recentBlockhash=t,n.message.recentBlockhash=t,r.instructions=r.instructions.filter(d),n.message=r.compileToV0Message(i),r.instructions.push(...await L(e,n)),n.message=r.compileToV0Message(i),n.sign(u.transaction.signers??[])}else n.recentBlockhash=t,n.lastValidBlockHeight=l,n.instructions=n.instructions.filter(d),n.add(...await L(e,n)),u.transaction.signers&&n.partialSign(...u.transaction.signers);return n}async function L(e,t,l="confirmed"){let u=2e5,n=0;const d=a.ComputeBudgetProgram.setComputeUnitLimit({units:3e5});let i;if(a.isVersionedTransaction(t)){const s=(await Promise.all(t.message.addressTableLookups.map(g=>e.getAddressLookupTable(g.accountKey)))).map(g=>g.value).filter(g=>g!==null),o=a.TransactionMessage.decompile(t.message,{addressLookupTableAccounts:s});o.instructions=[...o.instructions,d],i=new a.VersionedTransaction(o.compileToV0Message(s)),i.signatures=[...t.signatures]}else{const s=new a.Transaction$1;s.recentBlockhash=t.recentBlockhash,s.feePayer=t.feePayer,s.instructions=[...t.instructions,d],s.signatures=[...t.signatures],i=s}e:for(;;){if(a.isVersionedTransaction(i)&&!i.message.recentBlockhash){const{blockhash:o}=await e.getLatestBlockhash(l);i.message.recentBlockhash=o}const s=await(a.isVersionedTransaction(i)?e.simulateTransaction(i,{commitment:l,replaceRecentBlockhash:!0}):e.simulateTransaction(i));if(s.value.err){if(I(s.value)){if(n<5){n++,await m.sleep(1e3);continue e}}else if(n<3){n++,await m.sleep(1e3);continue e}throw new Error(`Simulation failed: ${JSON.stringify(s.value.err)}
1
+ "use strict";const a=require("./unsignedTransaction-qRBv5Cnd.js"),m=require("./index-Cb_8WAm1.js"),C=require("./signer-gjSiV5v3.js"),N=require("./platform-DCcL7jHP.js");function E(e){return e.includes("rpcpool.com")?"triton":e.includes("helius-rpc.com")?"helius":e.includes("rpc.ankr.com")?"ankr":"unknown"}async function B(e,t,l,u){const n=u.transaction.transaction,d=i=>i.programId.toString()!=="ComputeBudget111111111111111111111111111111";if(a.isVersionedTransaction(n)){const i=(await Promise.all(n.message.addressTableLookups.map(c=>e.getAddressLookupTable(c.accountKey)))).map(c=>c.value).filter(c=>c!==null),r=a.TransactionMessage.decompile(n.message,{addressLookupTableAccounts:i});r.recentBlockhash=t,n.message.recentBlockhash=t,r.instructions=r.instructions.filter(d),n.message=r.compileToV0Message(i),r.instructions.push(...await L(e,n)),n.message=r.compileToV0Message(i),n.sign(u.transaction.signers??[])}else n.recentBlockhash=t,n.lastValidBlockHeight=l,n.instructions=n.instructions.filter(d),n.add(...await L(e,n)),u.transaction.signers&&n.partialSign(...u.transaction.signers);return n}async function L(e,t,l="confirmed"){let u=2e5,n=0;const d=a.ComputeBudgetProgram.setComputeUnitLimit({units:3e5});let i;if(a.isVersionedTransaction(t)){const s=(await Promise.all(t.message.addressTableLookups.map(g=>e.getAddressLookupTable(g.accountKey)))).map(g=>g.value).filter(g=>g!==null),o=a.TransactionMessage.decompile(t.message,{addressLookupTableAccounts:s});o.instructions=[...o.instructions,d],i=new a.VersionedTransaction(o.compileToV0Message(s)),i.signatures=[...t.signatures]}else{const s=new a.Transaction$1;s.recentBlockhash=t.recentBlockhash,s.feePayer=t.feePayer,s.instructions=[...t.instructions,d],s.signatures=[...t.signatures],i=s}e:for(;;){if(a.isVersionedTransaction(i)&&!i.message.recentBlockhash){const{blockhash:o}=await e.getLatestBlockhash(l);i.message.recentBlockhash=o}const s=await(a.isVersionedTransaction(i)?e.simulateTransaction(i,{commitment:l,replaceRecentBlockhash:!0}):e.simulateTransaction(i));if(s.value.err){if(I(s.value)){if(n<5){n++,await m.sleep(1e3);continue e}}else if(n<3){n++,await m.sleep(1e3);continue e}throw new Error(`Simulation failed: ${JSON.stringify(s.value.err)}
2
2
  Logs:
3
3
  ${(s.value.logs||[]).join(`
4
4
  `)}`)}else{s.value.unitsConsumed&&(u=s.value.unitsConsumed);break}}const r=Math.floor(u*1.2),c=[];c.push(a.ComputeBudgetProgram.setComputeUnitLimit({units:r}));const y=m.config.transactionSettings?.Solana?.priorityFee||{},{percentile:p=.9,percentileMultiple:f=1,min:S=1e5,max:h=1e8}=y,P=async s=>{if(s==="triton")try{return{fee:await C.determinePriorityFeeTritonOne(e,t,p,f,S,h),methodUsed:"triton"}}catch(o){console.warn("Failed to determine priority fee using Triton RPC:",o)}try{return{fee:await C.determinePriorityFee(e,t,p,f,S,h),methodUsed:"default"}}catch(o){return console.warn("Failed to determine priority fee using Triton RPC:",o),{fee:S,methodUsed:"minimum"}}},A=E(e.rpcEndpoint),{fee:T,methodUsed:k}=await P(A),w=T/1e6/a.LAMPORTS_PER_SOL*r;return console.table({"RPC Provider":A,"Method used":k,"Percentile used":p,"Multiple used":f,"Compute budget":r,"Priority fee":T,"Max fee in SOL":w}),c.push(a.ComputeBudgetProgram.setComputeUnitPrice({microLamports:T})),c}function I(e){const t={};if(e.err==="BlockhashNotFound"&&(t.BlockhashNotFound="Blockhash not found during simulation. Trying again."),e.logs)for(const l of e.logs)l.includes("SlippageToleranceExceeded")&&(t.SlippageToleranceExceeded="Slippage failure during simulation. Trying again."),l.includes("RequireGteViolated")&&(t.RequireGteViolated="Swap instruction failure during simulation. Trying again.");return m.isEmptyObject(t)?!1:(console.table(t),!0)}function _(e){return N.chainToPlatform.has(e)&&N.chainToPlatform.get(e)==="Solana"}const v="solana:signAndSendTransaction",M="solana:signIn",O="solana:signMessage",F="solana:signTransaction",V="standard:connect",x="standard:disconnect",b="standard:events",H="solana:mainnet",R="solana:devnet",U="solana:testnet",D="solana:localnet";exports.SOLANA_DEVNET_CHAIN=R;exports.SOLANA_LOCALNET_CHAIN=D;exports.SOLANA_MAINNET_CHAIN=H;exports.SOLANA_TESTNET_CHAIN=U;exports.SolanaSignAndSendTransaction=v;exports.SolanaSignIn=M;exports.SolanaSignMessage=O;exports.SolanaSignTransaction=F;exports.StandardConnect=V;exports.StandardDisconnect=x;exports.StandardEvents=b;exports.isSvmChain=_;exports.setPriorityFeeInstructions=B;
@@ -1,4 +1,4 @@
1
- import "./index-BmP0jPVN.mjs";
1
+ import "./index-C6MalNd5.mjs";
2
2
  import { EvmWormholeCore as q } from "./index-CrWTw0Se.mjs";
3
3
  import { l as D, aJ as C, V as T, aK as v, bd as I, m as S, aL as p, b as F, H as j, de as $, X as N, aM as U, ah as V, c as J, c1 as k, I as R, E as x, au as P, aN as W } from "./platform-CSpAb386.mjs";
4
4
  import { a as K } from "./solidity-D9gSgFcp.mjs";