@wormhole-foundation/wormhole-connect 1.0.0-beta.3-development → 1.0.0-beta.5-development
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/assets/{ccip-YN27M9dL.js → ccip-B-OK94pJ.js} +1 -1
- package/dist/assets/{evm-wKiUiV3-.js → evm-CPj7oFVL.js} +4 -4
- package/dist/assets/{index-B9_Snb-C.js → index-BWMdho2w.js} +2 -2
- package/dist/assets/{index-8fbGA94c.js → index-DGFWhjyA.js} +1 -1
- package/dist/assets/{index-BBy_QGBB.js → index-Ddso83Ti.js} +1 -1
- package/dist/assets/{index.es-BY7lrdO_.js → index.es-VchQxXD4.js} +2 -2
- package/dist/main.js +115 -62
- package/dist/src/components/v2/Button.d.ts +1 -1
- package/dist/src/components/v2/Button.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +17 -3
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistory.d.ts +1 -1
- package/dist/src/hooks/useTransactionHistory.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
- package/dist/src/icons/TxReadyForClaim.d.ts +2 -2
- package/dist/src/icons/TxReadyForClaim.d.ts.map +1 -1
- package/dist/src/utils/inProgressTxCache.d.ts +5 -0
- package/dist/src/utils/inProgressTxCache.d.ts.map +1 -0
- package/dist/src/utils/polling.d.ts +5 -0
- package/dist/src/utils/polling.d.ts.map +1 -0
- package/dist/src/utils/sdkv2.d.ts +3 -2
- package/dist/src/utils/sdkv2.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/ReviewTransaction/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/index.d.ts.map +1 -1
- package/dist/src/views/v2/Redeem/index.d.ts.map +1 -1
- package/dist/src/views/v2/TxHistory/Widget/Item.d.ts +8 -0
- package/dist/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -0
- package/dist/src/views/v2/TxHistory/Widget/index.d.ts +4 -0
- package/dist/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -0
- package/dist/src/views/v2/TxHistory/index.d.ts.map +1 -1
- package/lib/{algorand-DIrI8hux.js → algorand-DFJZIdnH.js} +1 -1
- package/lib/{algorand-BZLSulqp.mjs → algorand-qEY4HHOc.mjs} +3 -3
- package/lib/{aptos-ClFQX748.mjs → aptos-BCuZuiBG.mjs} +1 -1
- package/lib/{aptos-B61S9Mku.js → aptos-BHw0JlTE.js} +1 -1
- package/lib/{aptos-poOCeL-e.js → aptos-D-S8DXGs.js} +2 -2
- package/lib/{aptos-BXyptrTk.mjs → aptos-DoqExVYR.mjs} +3 -3
- package/lib/{ccip-CROSeCCn.js → ccip-CXJ3nCk_.js} +1 -1
- package/lib/{ccip-BcLqF-ov.mjs → ccip-_0LmpQds.mjs} +1 -1
- package/lib/{cosmos-B7IowZE9.mjs → cosmos-0un-E2-0.mjs} +6 -6
- package/lib/{cosmos-D-fRtzTz.js → cosmos-DCgWSBll.js} +1 -1
- package/lib/{cosmwasm-BU28GqyN.js → cosmwasm-BsEhYnuw.js} +2 -2
- package/lib/{cosmwasm-i8-2LBd4.mjs → cosmwasm-DvwgrLe6.mjs} +7 -7
- package/lib/{events-BIfEV615.mjs → events-BL2eUG60.mjs} +1 -1
- package/lib/{events-CG085uVS.js → events-wpqGOay9.js} +1 -1
- package/lib/{evm-z72BQwjo.js → evm-B46tP5Ah.js} +1 -1
- package/lib/{evm-DSo1klm4.js → evm-BOrFw20j.js} +4 -4
- package/lib/{evm-BG4p6wWc.mjs → evm-CkxKsuQ-.mjs} +7 -7
- package/lib/{evm-DqVh4NBz.mjs → evm-kynWl8-i.mjs} +5 -5
- package/lib/{index-Coqx-ZYc.js → index-6gwCyfQU.js} +1 -1
- package/lib/{index-B-bMfv9J.mjs → index-BHOu1oLq.mjs} +3 -3
- package/lib/{index-9Ifk_2V6.js → index-BNWJG0G4.js} +1 -1
- package/lib/{index-Xxsx46yX.mjs → index-BOppeFAI.mjs} +1 -1
- package/lib/{index-l3VuXtv4.mjs → index-BTBmklHJ.mjs} +2 -2
- package/lib/{index-CQ_e_FtW.js → index-BVz1aMw3.js} +1 -1
- package/lib/{index--kQS0wX-.js → index-BWNh4wvK.js} +1 -1
- package/lib/{index-x3yNXPc-.js → index-BwCIDEBK.js} +1 -1
- package/lib/{index-DkmEXbbA.js → index-C4ri6eMC.js} +1 -1
- package/lib/{index-CytdQ1id.js → index-C7amSMG9.js} +1 -1
- package/lib/{index-CdnXAZl6.js → index-CAkX47d8.js} +1 -1
- package/lib/{index-ByG9EJHX.js → index-CDGktAjP.js} +137 -84
- package/lib/{index-CkrE6mmF.js → index-CFVm1KSi.js} +1 -1
- package/lib/{index-Cfu2mlWW.mjs → index-CLH7U4rp.mjs} +2 -2
- package/lib/{index-BhfoV5RZ.js → index-CNIDBiCc.js} +1 -1
- package/lib/{index-xrevpHY6.js → index-CPgdgK8L.js} +1 -1
- package/lib/{index-DjSK9SdK.mjs → index-CTwzW64I.mjs} +2 -2
- package/lib/{index-Cf-xLfst.js → index-CUInBQd6.js} +1 -1
- package/lib/{index-CGmv-GLf.js → index-CaFGZvKm.js} +1 -1
- package/lib/{index-DTLOaiZ5.mjs → index-Cb47usqO.mjs} +2 -2
- package/lib/{index-BDhzG0Bz.mjs → index-CjwA7HmM.mjs} +5313 -4809
- package/lib/{index--orPBbEs.mjs → index-CkPaHAgJ.mjs} +3 -3
- package/lib/{index-C1XMdJFH.js → index-ClLbfY74.js} +1 -1
- package/lib/{index-CJJaUncM.js → index-ClRkhvNK.js} +1 -1
- package/lib/{index-DGI2tbSC.mjs → index-Cm3iq-IJ.mjs} +1 -1
- package/lib/{index-DEfagu36.js → index-CtJdy4GW.js} +1 -1
- package/lib/{index-BUcxdUpo.mjs → index-D0W1ZmqN.mjs} +2 -2
- package/lib/{index-Bn9MsO0e.mjs → index-D5SPCl8N.mjs} +2 -2
- package/lib/{index-C8UyzBg3.mjs → index-D6Sqxs9J.mjs} +4 -4
- package/lib/{index-BM3TrHYu.mjs → index-DC65dQZI.mjs} +7 -7
- package/lib/{index-2u6Q9y32.js → index-DICIR39L.js} +1 -1
- package/lib/{index-C8tIBuyM.mjs → index-DIddLRbN.mjs} +1 -1
- package/lib/{index-C1t8_dYP.mjs → index-DSSXLwpv.mjs} +1 -1
- package/lib/{index-eY_q88kc.js → index-DVKptZW_.js} +1 -1
- package/lib/{index-CLiemfL3.js → index-DcbhKZoU.js} +1 -1
- package/lib/{index-B51snNHX.mjs → index-DojwGTf0.mjs} +1 -1
- package/lib/{index-3CEBQmCn.mjs → index-DrQrqu4U.mjs} +2 -2
- package/lib/{index-C262JAz4.mjs → index-DvQkOUhD.mjs} +4 -4
- package/lib/{index-C1fq1xT0.mjs → index-Dw4gUoPq.mjs} +2 -2
- package/lib/{index-DTtBAHqC.mjs → index-IypSUdxl.mjs} +2 -2
- package/lib/{index-GyFHGs5Z.js → index-QfqpopxL.js} +1 -1
- package/lib/{index-C2ZrCXVv.mjs → index-SiA6wvOM.mjs} +2 -2
- package/lib/{index-D1GFc9u_.js → index-dZuWNqUJ.js} +1 -1
- package/lib/{index-DTj0BYI6.mjs → index-fzN-meRd.mjs} +1 -1
- package/lib/{index-CYfEuKEC.js → index-hWgZ0Dfs.js} +1 -1
- package/lib/{index-BrFyHtHO.js → index-tKKMDrTV.js} +1 -1
- package/lib/{index-B3uNul6-.mjs → index-tKooq_Tx.mjs} +3 -3
- package/lib/{index-C3Ztf7te.mjs → index-yd8RiLQo.mjs} +4 -4
- package/lib/{index.es-CTYy3A6V.js → index.es-BfpZO8dT.js} +2 -2
- package/lib/{index.es-zlUSra_a.mjs → index.es-P5wvRtJq.mjs} +5 -5
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-BL6m46dv.mjs → libsodium-wrappers-BB6-Iffd.mjs} +1 -1
- package/lib/{libsodium-wrappers-_Sv3nUjE.js → libsodium-wrappers-BvMpC4vD.js} +1 -1
- package/lib/{pako.esm-Bf33_673.mjs → pako.esm-C7QrkxRd.mjs} +3 -3
- package/lib/{pako.esm-CEjOh_1P.js → pako.esm-DlDLS2rv.js} +1 -1
- package/lib/{pbkdf2-C3vdgkb4.mjs → pbkdf2-DMV4l9Li.mjs} +1 -1
- package/lib/{pbkdf2-BJ3CFykt.js → pbkdf2-Di1EjoiV.js} +1 -1
- package/lib/{sei-BXWrZef6.mjs → sei-CnR3Aw9g.mjs} +4 -4
- package/lib/{sei-LGYYUG8M.js → sei-RTyi_UJs.js} +1 -1
- package/lib/{signer-DaJj3hCp.mjs → signer-BAztlcE7.mjs} +1 -1
- package/lib/{signer-BQ4T60Nz.js → signer-CbhSUdvo.js} +1 -1
- package/lib/solana-Bkh_veaR.mjs +16 -0
- package/lib/solana-CKipdoh2.js +1 -0
- package/lib/{solana-Cl4jwD2F.mjs → solana-CP3uz3z9.mjs} +4 -4
- package/lib/{solana-AQlZomQ6.js → solana-Cglhypga.js} +1 -1
- package/lib/{solanaEmbed.esm-B_5axZif.js → solanaEmbed.esm-8VvaQIYa.js} +1 -1
- package/lib/{solanaEmbed.esm-DEMxZG02.mjs → solanaEmbed.esm-DfSXcnar.mjs} +4 -4
- package/lib/src/components/v2/Button.d.ts +1 -1
- package/lib/src/components/v2/Button.d.ts.map +1 -1
- package/lib/src/config/types.d.ts +17 -3
- package/lib/src/config/types.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistory.d.ts +1 -1
- package/lib/src/hooks/useTransactionHistory.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
- package/lib/src/icons/TxReadyForClaim.d.ts +2 -2
- package/lib/src/icons/TxReadyForClaim.d.ts.map +1 -1
- package/lib/src/utils/inProgressTxCache.d.ts +5 -0
- package/lib/src/utils/inProgressTxCache.d.ts.map +1 -0
- package/lib/src/utils/polling.d.ts +5 -0
- package/lib/src/utils/polling.d.ts.map +1 -0
- package/lib/src/utils/sdkv2.d.ts +3 -2
- package/lib/src/utils/sdkv2.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/ReviewTransaction/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/index.d.ts.map +1 -1
- package/lib/src/views/v2/Redeem/index.d.ts.map +1 -1
- package/lib/src/views/v2/TxHistory/Widget/Item.d.ts +8 -0
- package/lib/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -0
- package/lib/src/views/v2/TxHistory/Widget/index.d.ts +4 -0
- package/lib/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -0
- package/lib/src/views/v2/TxHistory/index.d.ts.map +1 -1
- package/lib/{sui-IAt2YxVB.js → sui-BLA0P5P1.js} +2 -2
- package/lib/{sui-tX-807Bw.js → sui-BMLSVXBy.js} +1 -1
- package/lib/{sui-DfdFzATl.mjs → sui-C73zQuHR.mjs} +1 -1
- package/lib/{sui-BpKCqOiX.mjs → sui-WPdV6u03.mjs} +4 -4
- package/lib/{unsignedTransaction-B1rzGa0o.mjs → unsignedTransaction-BWLDqwPd.mjs} +2 -2
- package/lib/{unsignedTransaction-BzNQ2WFS.js → unsignedTransaction-Cl0WbHFW.js} +1 -1
- package/lib/{utils-DZZcQv7V.js → utils-CA5brb9u.js} +1 -1
- package/lib/{utils-Xa6ErDQY.mjs → utils-Cd5O9nI7.mjs} +2 -2
- package/package.json +1 -1
- package/lib/solana-6EZacoKb.js +0 -1
- package/lib/solana-CbB3tRah.mjs +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var U=Object.defineProperty;var b=(m,n,e)=>n in m?U(m,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[n]=e;var c=(m,n,e)=>b(m,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";var U=Object.defineProperty;var b=(m,n,e)=>n in m?U(m,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[n]=e;var c=(m,n,e)=>b(m,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CDGktAjP.js");require("./index-C7amSMG9.js");const N=new t.Interface(["function start((bytes32,address,address,address,address,address,uint256,uint256,uint256,uint256)) returns (address,uint16,uint64)","function receiveMessageAndSwap(bytes)"]),W=new t.Interface(["function quoteExactInputSingle((address,address,uint256,uint24,uint160)) public view returns (uint256,uint160,uint32,uint256)"]),T=100,B="https://gfx.relayers.xlabs.xyz/api/v1/swap/quote",_="https://thermae.fly.dev/api/order/create";class R{static async createOrder(n,e,r,o,s,a,i,h){var d,p;try{const{minAmountStart:l,minAmountFinish:w}=i.swapAmounts,g=t.canonicalAddress(r),[u,f]=t.resolveWrappedToken(n,e,o),[A,E]=t.resolveWrappedToken(n,r.chain,a),v=t.canonicalAddress(f),k=t.canonicalAddress(E),C=t.portico.get(n,e).portico,S=t.portico.get(n,r.chain).portico,I=t.networkChainToNativeChainId.get(n,e),F=t.networkChainToNativeChainId.get(n,r.chain),x={startingChainId:Number(I),startingToken:v.toLowerCase(),destinationChainId:Number(F),destinationToken:k.toLowerCase(),destinationAddress:g,porticoAddress:C,destinationPorticoAddress:S,startingTokenAmount:s.toString(),minAmountStart:l.toString(),minAmountEnd:w.toString(),bridgeNonce:h,relayerFee:i.relayerFee.toString(),feeTierStart:T,feeTierEnd:T,shouldWrapNative:u,shouldUnwrapNative:A},P=await t.axios.post(_,x);return this.validateCreateOrderResponse(P.data,x),P.data}catch(l){if(t.axios.isAxiosError(l)){const w=`${(d=l.response)==null?void 0:d.statusText}: ${(p=l.response)==null?void 0:p.data.message}`;throw new Error(`Could not create order: ${w},`)}throw l}}static async quoteRelayer(n,e,r){var h;if(t.isNative(e)||t.isNative(r))throw new Error("how did you get here tho?");const o=t.hex.encode(e.toUniversalAddress().toUint8Array(),!1),s=t.hex.encode(r.toUniversalAddress().toUint8Array(),!1),i={targetChain:t.toChainId(n),sourceToken:o,targetToken:s};try{const d=await t.axios.post(B,i);return BigInt(d.data.fee)}catch(d){throw t.axios.isAxiosError(d)?new Error(`Error getting relayer fee: ${(h=d.response)==null?void 0:h.statusText}`):d}}}c(R,"validateCreateOrderResponse",(n,e)=>{if(!t.isEqualCaseInsensitive(e.porticoAddress||"",n.transactionTarget))throw new Error("portico address mismatch");const r=N.decodeFunctionData("start",n.transactionData);if(r.length!==1||r[0].length!==10)throw new Error("decoded length mismatch");const o=t.hex.decode(r[0][0]);if(o.length!==32)throw new Error("flag set length mismatch");const{recipientChain:s,feeTierStart:a,feeTierFinish:i,flags:h}=t.PorticoBridge.deserializeFlagSet(o),{shouldWrapNative:d,shouldUnwrapNative:p}=h,[l,w]=t.platformNativeChainIdToNetworkChain("Evm",BigInt(e.destinationChainId));if(s!==t.toChainId(w))throw new Error("recipient chain mismatch");if(a!==e.feeTierStart)throw new Error("fee tier start mismatch");if(i!==e.feeTierEnd)throw new Error("fee tier end mismatch");if(!!d!==e.shouldWrapNative)throw new Error("should wrap native mismatch");if(!!p!==e.shouldUnwrapNative)throw new Error("should unwrap native mismatch");const g=r[0][1];if(!t.isEqualCaseInsensitive(g,e.startingToken))throw new Error("start token address mismatch");const u=r[0][3];if(!t.isEqualCaseInsensitive(u,e.destinationToken))throw new Error("final token address mismatch");const f=r[0][4];if(!t.isEqualCaseInsensitive(f,e.destinationAddress))throw new Error("recipient address mismatch");const A=r[0][5];if(!t.isEqualCaseInsensitive(A,e.destinationPorticoAddress||""))throw new Error("destination portico address mismatch");if(r[0][6].toString()!==e.startingTokenAmount)throw new Error("amount mismatch");if(r[0][7].toString()!==e.minAmountStart)throw new Error("min amount start mismatch");if(r[0][8].toString()!==e.minAmountEnd)throw new Error("min amount finish mismatch");if(r[0][9].toString()!==e.relayerFee)throw new Error("relayer fee mismatch")});class y{constructor(n,e,r,o){c(this,"network");c(this,"chain");c(this,"provider");c(this,"contracts");c(this,"chainId");c(this,"porticoAddress");c(this,"uniswapAddress");c(this,"porticoContract");c(this,"uniswapContract");c(this,"core");if(this.network=n,this.chain=e,this.provider=r,this.contracts=o,!o.portico)throw new Error("Unsupported chain, no contract addresses for: "+e);this.core=new t.EvmWormholeCore(n,e,r,o);const{portico:s,uniswapQuoterV2:a}=o.portico;this.porticoAddress=s,this.uniswapAddress=a,this.chainId=t.networkChainToNativeChainId.get(n,e),this.porticoContract=new t.Contract(this.porticoAddress,N.fragments,this.provider),this.uniswapContract=new t.Contract(this.uniswapAddress,W.fragments,this.provider)}static async fromRpc(n,e){const[r,o]=await t.EvmPlatform.chainFromRpc(n),s=e[o];if(s.network!==r)throw new Error(`Network mismatch: ${s.network} != ${r}`);return new y(r,o,n,s.contracts)}async*transfer(n,e,r,o,s,a){const{minAmountStart:i,minAmountFinish:h}=a.swapAmounts;if(i===0n)throw new Error("Invalid min swap amount");if(h===0n)throw new Error("Invalid min swap amount");const d=new t.EvmAddress(n).toString(),[p,l]=t.resolveWrappedToken(this.network,this.chain,r),[w,g]=t.resolveWrappedToken(this.network,e.chain,s),u=t.canonicalAddress(l),f=t.canonicalAddress(this.getTransferrableToken(u)),A=t.canonicalAddress(e),E=t.canonicalAddress(g),v=t.portico.get(this.network,e.chain).portico,k=new Date().valueOf()%2**4,C=t.PorticoBridge.serializeFlagSet({flags:{shouldWrapNative:p,shouldUnwrapNative:w},recipientChain:t.toChainId(e.chain),bridgeNonce:k,feeTierStart:T,feeTierFinish:T,padding:new Uint8Array(19)}),S=N.encodeFunctionData("start",[[C,u.toLowerCase(),f,E.toLowerCase(),A,v,o.toString(),i.toString(),h.toString(),a.relayerFee.toString()]]);p||(yield*this.approve(u,d,o,this.porticoAddress));const I=await this.core.getMessageFee(),F={to:this.porticoAddress,data:S,value:I+(p?o:0n)};yield this.createUnsignedTransaction(t.addFrom(F,d),"PorticoBridge.Transfer")}async*redeem(n,e){const r=await this.porticoContract.getFunction("receiveMessageAndSwap").populateTransaction(t.serialize(e)),o=new t.EvmAddress(n).toString();yield this.createUnsignedTransaction(t.addFrom(r,o),"PorticoBridge.Redeem")}async quoteSwap(n,e,r){const[,o]=t.resolveWrappedToken(this.network,this.chain,n),[,s]=t.resolveWrappedToken(this.network,this.chain,e),a=t.canonicalAddress(o),i=t.canonicalAddress(s);return t.isEqualCaseInsensitive(a,i)?r:(await this.uniswapContract.getFunction("quoteExactInputSingle").staticCall([a,i,r,T,0]))[0]}async quoteRelay(n,e){return await R.quoteRelayer(this.chain,n,e)}getTransferrableToken(n){var o;if(this.chain==="Ethereum")return t.Wormhole.tokenId("Ethereum",n);const e=t.getTokenByAddress(this.network,this.chain,n);if(!e)throw new Error("Unsupported source token: "+n);const r=(o=t.getTokensBySymbol(this.network,this.chain,e.symbol))==null?void 0:o.find(s=>s.original==="Ethereum");if(!r)throw new Error(`Unsupported symbol for chain ${e.symbol}: ${this.chain} `);return t.Wormhole.tokenId(r.chain,r.address)}async*approve(n,e,r,o){const s=t.EvmPlatform.getTokenImplementation(this.provider,n);if(await s.allowance(e,o)<r){const i=await s.approve.populateTransaction(o,r);yield this.createUnsignedTransaction(t.addFrom(i,e),"PorticoBridge.Approve")}}createUnsignedTransaction(n,e){return new t.EvmUnsignedTransaction(t.addChainId(n,this.chainId),this.network,this.chain,e,!1)}}t.registerProtocol(t._platform,"PorticoBridge",y);exports.EvmPorticoBridge=y;
|