@wormhole-foundation/wormhole-connect 1.1.10 → 1.3.0-beta.0-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.
Files changed (155) hide show
  1. package/dist/assets/aptos-DZ2rfUfg.js +3 -0
  2. package/dist/assets/{aptos-fvUGRJ4h.js → aptos-g3DaQf0b.js} +61 -61
  3. package/dist/assets/{ccip-BSaraGOI.js → ccip-CTWg50DB.js} +1 -1
  4. package/dist/assets/{chunk-U2PRGW4O-BklU2g_V.js → chunk-U2PRGW4O-_uqZ791P.js} +1 -1
  5. package/dist/assets/evm-CUAh52pb.js +2 -0
  6. package/dist/assets/{evm-27LNSCd5.js → evm-Dpe6bb4m.js} +4 -4
  7. package/dist/assets/index-B169l5cS.js +1 -0
  8. package/dist/assets/{index-BINzPDaS.js → index-B2zKde8M.js} +1 -1
  9. package/dist/assets/{index-BmcqXpQd.js → index-B85n1wgg.js} +1 -1
  10. package/dist/assets/{index-BOsp0gGs.js → index-BGPIDyz6.js} +1 -1
  11. package/dist/assets/index-BT5QH3hv.js +1 -0
  12. package/dist/assets/{index-DADsM90a.js → index-BbXYZkyr.js} +1 -1
  13. package/dist/assets/{index-C_VIzW7c.js → index-Bwgv1Ind.js} +1 -1
  14. package/dist/assets/{index-P4tasYP-.js → index-CFWDbus8.js} +1 -1
  15. package/dist/assets/{index-BKYhAEpg.js → index-CJV78alS.js} +1 -1
  16. package/dist/assets/{index-DAS-UCcB.js → index-Ck17eoCG.js} +1 -1
  17. package/dist/assets/index-CpdwiPRU.js +2 -0
  18. package/dist/assets/{index-C02sy3fv.js → index-DVtwRIfn.js} +1 -1
  19. package/dist/assets/{index-D3TIHxII.js → index-jE0RsYBN.js} +1 -1
  20. package/dist/assets/{index.es-GaVoXIXp.js → index.es-CEXOl433.js} +2 -2
  21. package/dist/assets/{signer-BzqNQC8X.js → signer-D8BxqoWW.js} +1 -1
  22. package/dist/assets/{solana-CFQqPT08.js → solana-Cu2aa7vE.js} +2 -2
  23. package/dist/assets/solana-Ddk7It-E.js +2 -0
  24. package/dist/assets/{sui-C76oYlao.js → sui-BXAKH3nv.js} +3 -3
  25. package/dist/assets/unsignedTransaction-DsxtoHjl.js +1 -0
  26. package/dist/main.js +63 -63
  27. package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
  28. package/dist/src/config/testnet/tokens.d.ts.map +1 -1
  29. package/dist/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
  30. package/dist/src/hooks/useWalletCompatibility.d.ts +14 -0
  31. package/dist/src/hooks/useWalletCompatibility.d.ts.map +1 -0
  32. package/dist/src/store/wallet.d.ts.map +1 -1
  33. package/dist/src/utils/address.d.ts +3 -0
  34. package/dist/src/utils/address.d.ts.map +1 -0
  35. package/dist/src/utils/index.d.ts +1 -1
  36. package/dist/src/utils/index.d.ts.map +1 -1
  37. package/dist/src/utils/transferValidation.d.ts +1 -0
  38. package/dist/src/utils/transferValidation.d.ts.map +1 -1
  39. package/dist/src/utils/wallet/ReadOnlyWallet.d.ts +28 -0
  40. package/dist/src/utils/wallet/ReadOnlyWallet.d.ts.map +1 -0
  41. package/dist/src/utils/wallet/aptos.d.ts.map +1 -1
  42. package/dist/src/utils/wallet/index.d.ts.map +1 -1
  43. package/dist/src/views/v2/Bridge/WalletConnector/Controller.d.ts.map +1 -1
  44. package/dist/src/views/v2/Bridge/WalletConnector/Sidebar.d.ts +1 -0
  45. package/dist/src/views/v2/Bridge/WalletConnector/Sidebar.d.ts.map +1 -1
  46. package/dist/src/views/v2/Bridge/WalletConnector/index.d.ts.map +1 -1
  47. package/dist/src/views/v2/Bridge/index.d.ts.map +1 -1
  48. package/lib/{aptos-BAqOCMlc.mjs → aptos-BADK10fB.mjs} +871 -870
  49. package/lib/{aptos-BKBD8aOt.mjs → aptos-CNLtQdwF.mjs} +59 -57
  50. package/lib/{aptos--lBFnUOc.js → aptos-DeODB5kZ.js} +4 -4
  51. package/lib/aptos-DhXgHrnl.js +2 -0
  52. package/lib/{base64-BbOJxpZK.js → base64-CEPDNsRw.js} +1 -1
  53. package/lib/{base64-pg98hy0n.mjs → base64-w49IrkvT.mjs} +1 -1
  54. package/lib/{ccip-BXRCXDA2.js → ccip-PRIyWWAN.js} +1 -1
  55. package/lib/{ccip-DVQrYbpb.mjs → ccip-VK5volw3.mjs} +1 -1
  56. package/lib/{chunk-U2PRGW4O-DQlmdhQZ.mjs → chunk-U2PRGW4O-Ch5UM-YX.mjs} +6 -3
  57. package/lib/{chunk-U2PRGW4O-Z6IR0JuP.js → chunk-U2PRGW4O-D9odrfIU.js} +5 -5
  58. package/lib/{events-CLqCMLJQ.js → events-Bu0pqh5u.js} +1 -1
  59. package/lib/{events-BkX3_Qb-.mjs → events-jOp8E97m.mjs} +1 -1
  60. package/lib/{evm-BggmzuUI.js → evm-3jPN9QHX.js} +1 -1
  61. package/lib/{evm-BQIEt73H.mjs → evm-B13HZSOG.mjs} +6 -6
  62. package/lib/{evm-Cn-GuiFa.mjs → evm-CZgBqG6_.mjs} +7 -7
  63. package/lib/{evm-FovMrTcs.js → evm-Y4sMK_A1.js} +4 -4
  64. package/lib/index-1qQOAFE2.mjs +102 -0
  65. package/lib/{index-DfYMJMp0.mjs → index-BAhBSTHO.mjs} +4343 -4061
  66. package/lib/{index-DA4kWTHQ.mjs → index-BDForJp0.mjs} +2 -2
  67. package/lib/index-BFbkaHZM.js +1 -0
  68. package/lib/{index-DEnnxbv4.mjs → index-BHdCskLu.mjs} +2 -2
  69. package/lib/{index-CGvvXGGl.js → index-BRf1dmcD.js} +1 -1
  70. package/lib/{index-BMTAtkvV.mjs → index-BVuV_rfV.mjs} +3 -3
  71. package/lib/{index-dG8QvzcV.js → index-BX2v7vz2.js} +1 -1
  72. package/lib/{index-CdAVlC1k.mjs → index-BZknHaxy.mjs} +70 -70
  73. package/lib/{index-BLy1Bcl6.js → index-Brzu_xNS.js} +1 -1
  74. package/lib/{index-mVuiGJzL.mjs → index-BuWkXqNE.mjs} +2 -2
  75. package/lib/{index-BpRH7hYY.js → index-C2Rk8dJm.js} +1 -1
  76. package/lib/{index-BCZobtID.mjs → index-CKnJa2J4.mjs} +1 -1
  77. package/lib/{index-BLGabWMd.mjs → index-CdUjuPf9.mjs} +5 -5
  78. package/lib/{index-BnnBAAJR.mjs → index-CkQ2SX_N.mjs} +48 -57
  79. package/lib/{index-D61cp36z.mjs → index-CpOpT2eM.mjs} +2 -2
  80. package/lib/{index-tRb3o7lw.mjs → index-CtVdS94F.mjs} +4 -4
  81. package/lib/{index-CtqBV0Mh.js → index-CzRLTmkg.js} +1 -1
  82. package/lib/{index-DNw0OK31.mjs → index-D4DQMA-o.mjs} +1 -1
  83. package/lib/{index-B3tC_M_3.js → index-D5ta6SAe.js} +79 -79
  84. package/lib/{index-DuULLCq3.js → index-D9KxVP2I.js} +1 -1
  85. package/lib/index-DBmgmviv.js +1 -0
  86. package/lib/{index-CXY2mOGN.js → index-DFS9XfYE.js} +1 -1
  87. package/lib/{index-5LwBcU2b.js → index-DL5itoYd.js} +1 -1
  88. package/lib/index-DOqilxLu.js +1 -0
  89. package/lib/{index-iS3ZW4TI.js → index-DT5QhFiG.js} +1 -1
  90. package/lib/{index-C-CUap2t.mjs → index-DcL6du1P.mjs} +2 -2
  91. package/lib/{index-gcOi6Zit.js → index-DfRhe8kL.js} +1 -1
  92. package/lib/{index-D32QK7ui.js → index-DjDJigyM.js} +1 -1
  93. package/lib/{index-D7cEsBPK.mjs → index-DkNDirHr.mjs} +2 -2
  94. package/lib/{index-XeZKZCsR.js → index-Dr6Wkn1g.js} +1 -1
  95. package/lib/{index-lrOSAygS.js → index-Dw4_1FXq.js} +1 -1
  96. package/lib/{index-DxpDkO_U.mjs → index-DzeE34W2.mjs} +1 -1
  97. package/lib/{index-BsP3I9rd.js → index-EVkJCI6W.js} +1 -1
  98. package/lib/{index-DLnED6iN.js → index-OdUgDqqR.js} +1 -1
  99. package/lib/{index-B2Ji2TVF.js → index-dYeh9TN5.js} +1 -1
  100. package/lib/{index-BnauFXr8.mjs → index-hnhyQbEN.mjs} +5 -5
  101. package/lib/{index-Cr6IHmC2.mjs → index-ieIOqnbv.mjs} +1 -1
  102. package/lib/{index-DwPudZsI.mjs → index-v8vynoP2.mjs} +2 -2
  103. package/lib/{index-tlYi7i4n.mjs → index-yIiSwVLU.mjs} +2 -2
  104. package/lib/{index.es-CcqEiwkU.js → index.es-D9Co2OZW.js} +2 -2
  105. package/lib/{index.es-DGHwpdZj.mjs → index.es-jvUS3_-Z.mjs} +5 -5
  106. package/lib/index.js +1 -1
  107. package/lib/index.mjs +1 -1
  108. package/lib/{signer-krqTFKEd.js → signer-BvZ7J3Rl.js} +1 -1
  109. package/lib/{signer-Cqlxyiog.mjs → signer-CsfCFMWy.mjs} +1 -1
  110. package/lib/solana-BD_xWaS3.js +1 -0
  111. package/lib/{solana-D6uxC8LZ.js → solana-BfiZpxkP.js} +2 -2
  112. package/lib/solana-ChpC_WNg.mjs +16 -0
  113. package/lib/{solana-VwhsvoCC.mjs → solana-Dh_0HpA8.mjs} +12 -5
  114. package/lib/{solanaEmbed.esm-CI-W1l8P.js → solanaEmbed.esm-B3b-A7RS.js} +44 -44
  115. package/lib/{solanaEmbed.esm-CIymlXVo.mjs → solanaEmbed.esm-BCE4UL9u.mjs} +4533 -4507
  116. package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
  117. package/lib/src/config/testnet/tokens.d.ts.map +1 -1
  118. package/lib/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
  119. package/lib/src/hooks/useWalletCompatibility.d.ts +14 -0
  120. package/lib/src/hooks/useWalletCompatibility.d.ts.map +1 -0
  121. package/lib/src/store/wallet.d.ts.map +1 -1
  122. package/lib/src/utils/address.d.ts +3 -0
  123. package/lib/src/utils/address.d.ts.map +1 -0
  124. package/lib/src/utils/index.d.ts +1 -1
  125. package/lib/src/utils/index.d.ts.map +1 -1
  126. package/lib/src/utils/transferValidation.d.ts +1 -0
  127. package/lib/src/utils/transferValidation.d.ts.map +1 -1
  128. package/lib/src/utils/wallet/ReadOnlyWallet.d.ts +28 -0
  129. package/lib/src/utils/wallet/ReadOnlyWallet.d.ts.map +1 -0
  130. package/lib/src/utils/wallet/aptos.d.ts.map +1 -1
  131. package/lib/src/utils/wallet/index.d.ts.map +1 -1
  132. package/lib/src/views/v2/Bridge/WalletConnector/Controller.d.ts.map +1 -1
  133. package/lib/src/views/v2/Bridge/WalletConnector/Sidebar.d.ts +1 -0
  134. package/lib/src/views/v2/Bridge/WalletConnector/Sidebar.d.ts.map +1 -1
  135. package/lib/src/views/v2/Bridge/WalletConnector/index.d.ts.map +1 -1
  136. package/lib/src/views/v2/Bridge/index.d.ts.map +1 -1
  137. package/lib/{sui-B_JzGAsZ.js → sui-BhOuuPtT.js} +1 -1
  138. package/lib/{sui-W6LXoAZi.mjs → sui-Cc0SlN9d.mjs} +1 -1
  139. package/lib/{sui-B24r0q88.mjs → sui-DmasAl1E.mjs} +5 -5
  140. package/lib/{sui-mdAKJ_1L.js → sui-RIp5yjOC.js} +2 -2
  141. package/lib/unsignedTransaction-BDOQhqcZ.mjs +16 -0
  142. package/lib/unsignedTransaction-C1YeEl4G.js +1 -0
  143. package/lib/{utf8-KAhF5YIf.mjs → utf8-V9eCtEDc.mjs} +1 -1
  144. package/lib/{utf8-BMcKQx0N.js → utf8-lSE3VJ2A.js} +1 -1
  145. package/package.json +17 -17
  146. package/dist/assets/aptos-De-iCK2S.js +0 -3
  147. package/dist/assets/evm-BBq1KqPa.js +0 -2
  148. package/dist/assets/index-Dze1LGXT.js +0 -2
  149. package/dist/assets/index-LPMvkG3A.js +0 -1
  150. package/dist/assets/solana-DTptRMWs.js +0 -2
  151. package/lib/aptos-BAu09v7j.js +0 -2
  152. package/lib/index-9W3bwgfp.js +0 -1
  153. package/lib/index-D0DFUHbc.js +0 -1
  154. package/lib/solana-CiM13Aj8.mjs +0 -16
  155. package/lib/solana-DeEKJzkQ.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wormhole-foundation/wormhole-connect",
3
- "version": "1.1.10",
3
+ "version": "1.3.0-beta.0-development",
4
4
  "repository": "github:wormhole-foundation/wormhole-connect",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.mjs",
@@ -36,8 +36,8 @@
36
36
  "@solana/spl-token": "^0.3.9",
37
37
  "@solana/wallet-adapter-wallets": "^0.19.25",
38
38
  "@solana/web3.js": "^1.95.8",
39
- "@wormhole-foundation/sdk": "1.4.0",
40
- "@wormhole-foundation/sdk-definitions": "1.4.0",
39
+ "@wormhole-foundation/sdk": "1.5.0-beta.0",
40
+ "@wormhole-foundation/sdk-definitions": "1.5.0-beta.0",
41
41
  "@wormhole-foundation/sdk-definitions-ntt": "^0.6.1",
42
42
  "@wormhole-foundation/sdk-evm-ntt": "^0.6.1",
43
43
  "@wormhole-foundation/sdk-icons": "^1.0.0",
@@ -163,28 +163,28 @@
163
163
  "axios": "1.4.0"
164
164
  },
165
165
  "@mayanfinance/wormhole-sdk-route": {
166
- "@wormhole-foundation/sdk-connect": "1.4.0",
167
- "@wormhole-foundation/sdk-evm": "1.4.0",
168
- "@wormhole-foundation/sdk-solana": "1.4.0"
166
+ "@wormhole-foundation/sdk-connect": "1.5.0-beta.0",
167
+ "@wormhole-foundation/sdk-evm": "1.5.0-beta.0",
168
+ "@wormhole-foundation/sdk-solana": "1.5.0-beta.0"
169
169
  },
170
170
  "@wormhole-foundation/sdk-definitions-ntt": {
171
- "@wormhole-foundation/sdk-base": "1.4.0",
172
- "@wormhole-foundation/sdk-definitions": "1.4.0"
171
+ "@wormhole-foundation/sdk-base": "1.5.0-beta.0",
172
+ "@wormhole-foundation/sdk-definitions": "1.5.0-beta.0"
173
173
  },
174
174
  "@wormhole-foundation/sdk-evm-ntt": {
175
- "@wormhole-foundation/sdk-base": "1.4.0",
176
- "@wormhole-foundation/sdk-definitions": "1.4.0",
177
- "@wormhole-foundation/sdk-evm": "1.4.0",
178
- "@wormhole-foundation/sdk-evm-core": "1.4.0"
175
+ "@wormhole-foundation/sdk-base": "1.5.0-beta.0",
176
+ "@wormhole-foundation/sdk-definitions": "1.5.0-beta.0",
177
+ "@wormhole-foundation/sdk-evm": "1.5.0-beta.0",
178
+ "@wormhole-foundation/sdk-evm-core": "1.5.0-beta.0"
179
179
  },
180
180
  "@wormhole-foundation/sdk-route-ntt": {
181
- "@wormhole-foundation/sdk-connect": "1.4.0"
181
+ "@wormhole-foundation/sdk-connect": "1.5.0-beta.0"
182
182
  },
183
183
  "@wormhole-foundation/sdk-solana-ntt": {
184
- "@wormhole-foundation/sdk-base": "1.4.0",
185
- "@wormhole-foundation/sdk-definitions": "1.4.0",
186
- "@wormhole-foundation/sdk-solana": "1.4.0",
187
- "@wormhole-foundation/sdk-solana-core": "1.4.0"
184
+ "@wormhole-foundation/sdk-base": "1.5.0-beta.0",
185
+ "@wormhole-foundation/sdk-definitions": "1.5.0-beta.0",
186
+ "@wormhole-foundation/sdk-solana": "1.5.0-beta.0",
187
+ "@wormhole-foundation/sdk-solana-core": "1.5.0-beta.0"
188
188
  },
189
189
  "@wormhole-foundation/wormhole-connect": {
190
190
  "aptos": "1.5.0"
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BINzPDaS.js","main.js","main.css","assets/chunk-U2PRGW4O-BklU2g_V.js","assets/base64-IWuz5NCL.js","assets/index-iG_7aUsO.js","assets/index-LPMvkG3A.js"])))=>i.map(i=>d[i]);
2
- var w=Object.defineProperty;var A=(e,t,a)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var h=(e,t,a)=>A(e,typeof t!="symbol"?t+"":t,a);import{ab as S,ac as b,ad as p,ae as y,af as C,ag as d,ah as T,ai as l,aj as v,ak as I,al as m,am as E,aa as N,_ as g,a0 as P}from"../main.js";import{e as f,o as k,x,M as O,z as B}from"./chunk-U2PRGW4O-BklU2g_V.js";class _ extends S{}const c=class c extends b{constructor(t,a){super(t,a??y(t,c._platform))}getRpc(t){if(t in this.config){const a=this.network==="Mainnet"?f.MAINNET:f.TESTNET,n=new k({fullnode:this.config[t].rpc,network:a});return new x(n)}throw new Error("No configuration available for chain: "+t)}getChain(t,a){if(t in this.config)return new _(t,this);throw new Error("No configuration available for chain: "+t)}static nativeTokenId(t,a){if(!this.isSupportedChain(a))throw new Error(`invalid chain: ${a}`);return C.tokenId(a,d)}static isNativeTokenId(t,a,n){return!this.isSupportedChain(a)||n.chain!==a?!1:this.nativeTokenId(t,a)==n}static isSupportedChain(t){return T(t)===c._platform}static async getDecimals(t,a,n){if(l(n)||n===d)return v(c._platform);const s=n.toString();return(await a.getAccountResource({accountAddress:s.split(I)[0],resourceType:`0x1::coin::CoinInfo<${s}>`})).decimals}static async getBalance(t,a,n,s){const r=l(s)?d:s.toString();try{const i=await a.getAccountCoinAmount({accountAddress:n,coinType:r});return BigInt(i)}catch(i){if(i.status===404)return null;throw i}}static async getBalances(t,a,n,s){return(await Promise.all(s.map(async i=>{const o=await this.getBalance(t,a,n,i);return{[l(i)?"native":new m(i).toString()]:o}}))).reduce((i,o)=>Object.assign(i,o),{})}static async sendWait(t,a,n){const s=[];for(const r of n){const i=await a.transaction.submit.simple(r.transaction),o=await a.waitForTransaction({transactionHash:i.hash});s.push(o.hash)}return s}static async getLatestBlock(t){const a=await t.getLedgerInfo();return Number(a.block_height)}static async getLatestFinalizedBlock(t){const a=await t.getLedgerInfo();return Number(a.block_height)}static chainFromChainId(t){const a=E(c._platform,BigInt(t));if(!a)throw new Error(`No matching chainId to determine network and chain: ${t}`);const[n,s]=a;return[n,s]}static async chainFromRpc(t){const a=await t.getLedgerInfo();return this.chainFromChainId(a.chain_id.toString())}};h(c,"_platform",p);let u=c;async function R(e,t){const[a,n]=await u.chainFromRpc(e),s=O.fromPrivateKey({privateKey:new B(N.decode(t))});return new $(n,s,e)}class ${constructor(t,a,n,s){h(this,"_chain");h(this,"_account");h(this,"_rpc");h(this,"_debug");this._chain=t,this._account=a,this._rpc=n,this._debug=s}chain(){return this._chain}address(){return this._account.accountAddress.toString()}async signAndSend(t){const a=[];for(const n of t){const{description:s,transaction:r}=n;this._debug&&console.log(`Signing: ${s} for ${this.address()}`);const i=await this._rpc.transaction.build.simple({sender:this._account.accountAddress,data:r}),{hash:o}=await this._simSignSend(i);a.push(o)}return a}async _simSignSend(t){return await this._rpc.transaction.simulate.simple({signerPublicKey:this._account.publicKey,transaction:t}).then(a=>a.forEach(n=>{if(!n.success)throw new Error(`Transaction failed: ${n.vm_status}
3
- ${JSON.stringify(n,null,2)}`)})),this._rpc.signAndSubmitTransaction({signer:this._account,transaction:t}).then(a=>this._rpc.waitForTransaction({transactionHash:a.hash}))}}const F={Address:m,Platform:u,getSigner:R,protocols:{WormholeCore:()=>g(()=>import("./index-BINzPDaS.js"),__vite__mapDeps([0,1,2,3,4,5])),TokenBridge:()=>g(()=>import("./index-LPMvkG3A.js"),__vite__mapDeps([6,1,2,3,4,5]))},getChain:(e,t,a)=>new _(t,new u(e,P(e,p,{[t]:a})))},M=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));export{u as A,M as a};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["main.js","main.css","assets/index-P4tasYP-.js","assets/index-C_VIzW7c.js","assets/index-BKYhAEpg.js"])))=>i.map(i=>d[i]);
2
- var R=Object.defineProperty;var x=s=>{throw TypeError(s)};var I=(s,t,e)=>t in s?R(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var l=(s,t,e)=>I(s,typeof t!="symbol"?t+"":t,e),D=(s,t,e)=>t.has(s)||x("Cannot "+e);var h=(s,t,e)=>(D(s,t,"read from private field"),e?e.call(s):t.get(s)),f=(s,t,e)=>t.has(s)?x("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),o=(s,t,e,i)=>(D(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e);var S=(s,t,e,i)=>({set _(r){o(s,t,r,e)},get _(){return h(s,t,i)}});import{S as V,d as B,U as $,X as _,Y as M,Z as W,_ as m,$ as b,a0 as U,a1 as X}from"../main.js";var a,c;const v=class v extends V{constructor(e){super(e.provider);l(this,"signer");f(this,a);f(this,c);B(this,{signer:e}),o(this,a,null),o(this,c,0)}async getAddress(){return this.signer.getAddress()}connect(e){return new v(this.signer.connect(e))}async getNonce(e){if(e==="pending"){h(this,a)==null&&o(this,a,super.getNonce("pending"));const i=h(this,c);return await h(this,a)+i}return super.getNonce(e)}increment(){S(this,c)._++}reset(){o(this,c,0),o(this,a,null)}async sendTransaction(e){const i=this.getNonce("pending");return this.increment(),e=await this.signer.populateTransaction(e),e.nonce=await i,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,i,r){return this.signer.signTypedData(e,i,r)}};a=new WeakMap,c=new WeakMap;let P=v;async function Y(s,t,e){const i=typeof t=="string"?new $(t,s):t,r=(e==null?void 0:e.chain)??(await _.chainFromRpc(s))[1],n=new P(i);if(n.provider===null)try{n.connect(s)}catch(g){console.error("Cannot connect to network for signer",g)}return new Z(r,await i.getAddress(),n,e)}class Z extends M{constructor(e,i,r,n){super(e,i,r);l(this,"opts");this.opts=n}chain(){return this._chain}address(){return this._address}async sign(e){var w,E,T,y,A,L,C;const i=this.chain(),r=[];let n=500000n,g=100000000000n,p=1500000000n,u=100000000n;if(((w=this.opts)==null?void 0:w.overrides)===void 0&&i!=="Celo"){const d=await this._signer.provider.getFeeData();g=d.gasPrice??g,p=d.maxFeePerGas??p,u=d.maxPriorityFeePerGas??u}((E=this.opts)==null?void 0:E.gasLimit)!==void 0&&(n=this.opts.gasLimit),((T=this.opts)==null?void 0:T.maxGasLimit)!==void 0&&(n=n>((y=this.opts)==null?void 0:y.maxGasLimit)?(A=this.opts)==null?void 0:A.maxGasLimit:n);const G=i==="Oasis"?{gasLimit:n,gasPrice:g,type:0}:{gasLimit:n,maxFeePerGas:p,maxPriorityFeePerGas:u};for(const d of e){const{transaction:O,description:F}=d;(L=this.opts)!=null&&L.debug&&console.log(`Signing: ${F} for ${this.address()}`);const N={...O,...G,from:this.address(),nonce:await this._signer.getNonce(),...(C=this.opts)==null?void 0:C.overrides};r.push(await this._signer.signTransaction(N))}return r}}const z={Address:W,Platform:_,getSigner:Y,protocols:{WormholeCore:()=>m(()=>import("../main.js").then(s=>s.cM),__vite__mapDeps([0,1])),TokenBridge:()=>m(()=>import("./index-P4tasYP-.js"),__vite__mapDeps([2,0,1])),PorticoBridge:()=>m(()=>import("./index-C_VIzW7c.js"),__vite__mapDeps([3,0,1,2])),CircleBridge:()=>m(()=>import("./index-BKYhAEpg.js"),__vite__mapDeps([4,0,1,2]))},getChain:(s,t,e)=>new b(t,new _(s,U(s,X,{[t]:e})))};export{z as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DADsM90a.js","assets/dijkstra-D_NXgYpA.js","main.js","main.css"])))=>i.map(i=>d[i]);
2
- import{_ as fe}from"../main.js";const me=Symbol(),ee=Object.getPrototypeOf,G=new WeakMap,ge=e=>e&&(G.has(e)?G.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),he=e=>ge(e)&&e[me]||null,te=(e,t=!0)=>{G.set(e,t)},z={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,REACT_APP_CONNECT_GIT_HASH:"47a7c1d6296e0cf071bcbeeaf480a131d1c1110d",REACT_APP_CONNECT_VERSION:"1.1.10",SSR:!1},q=e=>typeof e=="object"&&e!==null,A=new WeakMap,x=new WeakSet,be=(e=Object.is,t=(n,h)=>new Proxy(n,h),s=n=>q(n)&&!x.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),r=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,h,I=r)=>{const y=l.get(n);if((y==null?void 0:y[0])===h)return y[1];const v=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return te(v,!0),l.set(n,[h,v]),Reflect.ownKeys(n).forEach(U=>{if(Object.getOwnPropertyDescriptor(v,U))return;const L=Reflect.get(n,U),M={value:L,enumerable:!0,configurable:!0};if(x.has(L))te(L,!1);else if(L instanceof Promise)delete M.value,M.get=()=>I(L);else if(A.has(L)){const[b,H]=A.get(L);M.value=c(b,H(),I)}Object.defineProperty(v,U,M)}),Object.preventExtensions(v)},m=new WeakMap,f=[1,1],W=n=>{if(!q(n))throw new Error("object required");const h=m.get(n);if(h)return h;let I=f[0];const y=new Set,v=(i,a=++f[0])=>{I!==a&&(I=a,y.forEach(o=>o(i,a)))};let U=f[1];const L=(i=++f[1])=>(U!==i&&!y.size&&(U=i,b.forEach(([a])=>{const o=a[1](i);o>I&&(I=o)})),I),M=i=>(a,o)=>{const g=[...a];g[1]=[i,...g[1]],v(g,o)},b=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&b.has(i))throw new Error("prop listener already exists");if(y.size){const o=a[3](M(i));b.set(i,[a,o])}else b.set(i,[a])},Z=i=>{var a;const o=b.get(i);o&&(b.delete(i),(a=o[1])==null||a.call(o))},ue=i=>(y.add(i),y.size===1&&b.forEach(([o,g],D)=>{if((z?"production":void 0)!=="production"&&g)throw new Error("remove already exists");const T=o[3](M(D));b.set(D,[o,T])}),()=>{y.delete(i),y.size===0&&b.forEach(([o,g],D)=>{g&&(g(),b.set(D,[o]))})}),J=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(J,{deleteProperty(i,a){const o=Reflect.get(i,a);Z(a);const g=Reflect.deleteProperty(i,a);return g&&v(["delete",[a],o]),g},set(i,a,o,g){const D=Reflect.has(i,a),T=Reflect.get(i,a,g);if(D&&(e(T,o)||m.has(o)&&e(T,m.get(o))))return!0;Z(a),q(o)&&(o=he(o)||o);let V=o;if(o instanceof Promise)o.then(C=>{o.status="fulfilled",o.value=C,v(["resolve",[a],C])}).catch(C=>{o.status="rejected",o.reason=C,v(["reject",[a],C])});else{!A.has(o)&&s(o)&&(V=W(o));const C=!x.has(V)&&A.get(V);C&&H(a,C)}return Reflect.set(i,a,V,g),v(["set",[a],o,T]),!0}});m.set(n,$);const pe=[J,L,c,ue];return A.set($,pe),Reflect.ownKeys(n).forEach(i=>{const a=Object.getOwnPropertyDescriptor(n,i);"value"in a&&($[i]=n[i],delete a.value,delete a.writable),Object.defineProperty(J,i,a)}),$})=>[W,A,x,e,t,s,r,l,c,m,f],[ye]=be();function j(e={}){return ye(e)}function S(e,t,s){const r=A.get(e);(z?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let l;const c=[],m=r[3];let f=!1;const n=m(h=>{c.push(h),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,n()}}function ve(e,t){const s=A.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[r,l,c]=s;return c(r,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:d,subscribe(e){return S(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=j({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:u,subscribe(e){return S(u.events,()=>e(ve(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},E=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:E,subscribe(e){return S(E,()=>e(E))},setChains(e){E.chains=e},setWalletConnectUri(e){E.walletConnectUri=e},setIsCustomDesktop(e){E.isCustomDesktop=e},setIsCustomMobile(e){E.isCustomMobile=e},setIsDataLoaded(e){E.isDataLoaded=e},setIsUiLoaded(e){E.isUiLoaded=e},setIsAuth(e){E.isAuth=e}},B=j({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),N={state:B,subscribe(e){return S(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(B,e)}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Le.call(t,s)&&ne(e,s,t[s]);return e};const Q="https://explorer-api.walletconnect.com",X="wcm",Y="js-2.6.2";async function K(e,t){const s=We({sdkType:X,sdkVersion:Y},t),r=new URL(e,Q);return r.searchParams.append("projectId",N.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const _={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${Q}/w3m/v1/getWalletImage/${e}?projectId=${N.state.projectId}&sdkType=${X}&sdkVersion=${Y}`},getAssetImageUrl(e){return`${Q}/w3m/v1/getAssetImage/${e}?projectId=${N.state.projectId}&sdkType=${X}&sdkVersion=${Y}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Me=(e,t)=>{for(var s in t||(t={}))Ae.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))je.call(t,s)&&re(e,s,t[s]);return e};const ae=p.isMobile(),O=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Re={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=N.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await _.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),O.recomendedWallets=l}else{const{chains:s,isAuth:r}=w.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await _.getMobileListings(m):await _.getDesktopListings(m);O.recomendedWallets=Object.values(f)}return O.recomendedWallets},async getWallets(e){const t=Me({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=N.state,{recomendedWallets:l}=O;if(r==="ALL")return O.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=ae?await _.getMobileListings(t):await _.getDesktopListings(t),n=Object.values(f),h=m?"search":"wallets";return O[h]={listings:[...O[h].listings,...n],total:W,page:c??1},{listings:n,total:W}},getWalletImageUrl(e){return _.getWalletImageUrl(e)},getAssetImageUrl(e){return _.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},k=j({open:!1}),F={state:k,subscribe(e){return S(k,()=>e(k))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=w.state;if(p.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&r)k.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),k.open=!0,t())},200)}})},close(){k.open=!1}};var _e=Object.defineProperty,ie=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))Pe.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))Se.call(t,s)&&le(e,s,t[s]);return e};function De(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=j({themeMode:De()?"dark":"light"}),ce={state:R,subscribe(e){return S(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=Ue({},s))}},P=j({open:!1,message:"",variant:"success"}),$e={state:P,subscribe(e){return S(P,()=>e(P))},openToast(e,t){P.open=!0,P.message=e,P.variant=t},closeToast(){P.open=!1}};class ke{constructor(t){this.openModal=F.open,this.closeModal=F.close,this.subscribeModal=F.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),N.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await fe(()=>import("./index-DADsM90a.js"),__vite__mapDeps([0,1,2,3]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:ke},Symbol.toStringTag,{value:"Module"}));export{Ie as R,de as T,p as a,Ve as i,ce as n,$e as o,w as p,F as s,Re as t,N as y};
@@ -1 +0,0 @@
1
- var S=Object.defineProperty;var b=(i,e,t)=>e in i?S(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var a=(i,e,t)=>b(i,typeof e!="symbol"?e+"":e,t);import{cB as f,cC as v,cx as x,ak as p,cD as I,bw as w,bZ as E,bD as F,b_ as m,aa as o,O as k,al as c,ai as h,cE as U,c3 as T,i as $,c0 as C,ag as _,bE as u,cF as O,bJ as W}from"../main.js";import{A as N}from"./aptos-De-iCK2S.js";import"./chunk-U2PRGW4O-BklU2g_V.js";import"./base64-IWuz5NCL.js";import"./index-iG_7aUsO.js";class Q{constructor(e,t,s,n,r=!1){a(this,"transaction");a(this,"network");a(this,"chain");a(this,"description");a(this,"parallelizable");this.transaction=e,this.network=t,this.chain=s,this.description=n,this.parallelizable=r}}const R=[{name:"tokenBridgeAddress",...f},{name:"chain",...v()},{name:"domainSeparator",binary:"bytes",custom:x.encode(p),omit:!0},{name:"tokenId",...f},{name:"domainSeparator",binary:"bytes",custom:new Uint8Array([255]),omit:!0}],P=i=>I(R,i);class d{constructor(e,t,s,n){a(this,"network");a(this,"chain");a(this,"connection");a(this,"contracts");a(this,"chainId");a(this,"tokenBridgeAddress");this.network=e,this.chain=t,this.connection=s,this.contracts=n,this.chainId=w(t);const r=n.tokenBridge;if(!r)throw new Error(`TokenBridge contract Address for chain ${t} not found`);this.tokenBridgeAddress=r}static async fromRpc(e,t){const[s,n]=await N.chainFromRpc(e),r=t[n];if(r.network!==s)throw new Error("Network mismatch "+r.network+" !== "+s);return new d(s,n,e,r.contracts)}async isWrappedAsset(e){try{return await this.getOriginalAsset(e),!0}catch{return!1}}async getOriginalAsset(e){const t=e.toString().split(p),s=await this.connection.getAccountResource({accountAddress:t[0],resourceType:`${this.tokenBridgeAddress}::state::OriginInfo`});if(!s)throw E(e.toString());const n=F(parseInt(s.token_chain.number)),r=new m(s.token_address.external_address);return{chain:n,address:r}}async getTokenUniversalAddress(e){return new m(o.encode(k(e.toString()),!0))}async getTokenNativeAddress(e,t){const s=e===this.chain?await this.getTypeFromExternalAddress(t.toString()):await this.getAssetFullyQualifiedType({chain:e,address:t});if(!s)throw new Error("Invalid asset address.");return new c(s)}async hasWrappedAsset(e){try{return await this.getWrappedAsset(e),!0}catch{}return!1}async getWrappedAsset(e){if(h(e.address))throw new Error("native asset cannot be a wrapped asset");const t=await this.getAssetFullyQualifiedType(e);if(!t)throw new Error("Invalid asset address.");return await this.connection.getAccountResource({accountAddress:U(t),resourceType:`${this.tokenBridgeAddress}::state::OriginInfo`}),T(this.chain,t)}async isTransferCompleted(e){const s=(await this.connection.getAccountResource({accountAddress:this.tokenBridgeAddress,resourceType:`${this.tokenBridgeAddress}::state::State`})).consumed_vaas.elems.handle;try{return await this.connection.getTableItem({handle:s,data:{key_type:"vector<u8>",value_type:"u8",key:`0x${$.Buffer.from(C(e.hash)).toString("hex")}`}}),!0}catch{return!1}}async getWrappedNative(){return T(this.chain,_)}async*createAttestation(e,t){const s={chain:this.chain,address:new c(e)},n=await this.getAssetFullyQualifiedType(s);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::attest_token::attest_token_entry`,typeArguments:[n],functionArguments:[]},"Aptos.AttestToken")}async*submitAttestation(e,t){yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin_type`,typeArguments:[],functionArguments:[u(e)]},"Aptos.CreateWrappedCoinType");const s=await this.getAssetFullyQualifiedType(e.payload.token);if(!s)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin`,typeArguments:[s],functionArguments:[u(e)]},"Aptos.CreateWrappedCoin")}async*transfer(e,t,s,n,r){const B=0n,l=0n,A=h(s)?_:s.toString(),y=t.address.toUniversalAddress().toUint8Array(),g=w(t.chain);r?yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_with_payload_entry`,typeArguments:[A],functionArguments:[n,g,y,l,r]},"Aptos.TransferTokensWithPayload"):yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_entry`,typeArguments:[A],functionArguments:[n,g,y,B,l]},"Aptos.TransferTokens")}async*redeem(e,t,s=!0){const n=t.payload.token.chain===this.chain?await this.getTypeFromExternalAddress(t.payload.token.address.toString()):await this.getAssetFullyQualifiedType(t.payload.token);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::complete_transfer::submit_vaa_and_register_entry`,typeArguments:[n],functionArguments:[u(t)]},"Aptos.CompleteTransfer")}async getAssetFullyQualifiedType(e){return e.chain===this.chain?O(e.address.toString())?e.address.toString():null:`${d.getForeignAssetAddress(this.chain,this.tokenBridgeAddress,e)}::coin::T`}async getTypeFromExternalAddress(e){try{const t=await this.connection.getAccountResource({accountAddress:this.tokenBridgeAddress,resourceType:`${this.tokenBridgeAddress}::state::State`}),{handle:s}=t.native_infos,n=await this.connection.getTableItem({handle:s,data:{key_type:`${this.tokenBridgeAddress}::token_hash::TokenHash`,value_type:"0x1::type_info::TypeInfo",key:{hash:e}}});return n?[n.account_address,String.fromCharCode(...o.decode(n.module_name)),String.fromCharCode(...o.decode(n.struct_name))].join(p):null}catch{return null}}static getForeignAssetAddress(e,t,s){if(h(s.address))throw new Error("Invalid token address");const n=P({chain:s.chain,tokenBridgeAddress:new c(t).toUniversalAddress(),tokenId:s.address.toUniversalAddress()});return o.encode(k(n),!0)}createUnsignedTx(e,t,s=!1){return new Q(e,this.network,this.chain,t,s)}}W("Aptos","TokenBridge",d);export{d as AptosTokenBridge};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["main.js","main.css","assets/index-DAS-UCcB.js","assets/index-C02sy3fv.js"])))=>i.map(i=>d[i]);
2
- import{a2 as t,a3 as e,_ as o,a4 as _,a0 as n,a5 as s}from"../main.js";import{g as d}from"./signer-BzqNQC8X.js";const m={Address:t,Platform:e,getSigner:d,protocols:{WormholeCore:()=>o(()=>import("../main.js").then(a=>a.cN),__vite__mapDeps([0,1])),TokenBridge:()=>o(()=>import("./index-DAS-UCcB.js"),__vite__mapDeps([2,0,1])),CircleBridge:()=>o(()=>import("./index-C02sy3fv.js"),__vite__mapDeps([3,0,1]))},getChain:(a,r,i)=>new _(r,new e(a,n(a,s,{[r]:i})))};export{m as default};
@@ -1,2 +0,0 @@
1
- "use strict";var f=Object.defineProperty;var p=(r,t,n)=>t in r?f(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var u=(r,t,n)=>p(r,typeof t!="symbol"?t+"":t,n);const i=require("./index-B3tC_M_3.js"),l=require("./chunk-U2PRGW4O-Z6IR0JuP.js");class g extends i.ChainContext{}const h=class h extends i.PlatformContext{constructor(t,n){super(t,n??i.networkPlatformConfigs(t,h._platform))}getRpc(t){if(t in this.config){const n=this.network==="Mainnet"?l.e.MAINNET:l.e.TESTNET,e=new l.l({fullnode:this.config[t].rpc,network:n});return new l.t(e)}throw new Error("No configuration available for chain: "+t)}getChain(t,n){if(t in this.config)return new g(t,this);throw new Error("No configuration available for chain: "+t)}static nativeTokenId(t,n){if(!this.isSupportedChain(n))throw new Error(`invalid chain: ${n}`);return i.Wormhole.tokenId(n,i.APTOS_COIN)}static isNativeTokenId(t,n,e){return!this.isSupportedChain(n)||e.chain!==n?!1:this.nativeTokenId(t,n)==e}static isSupportedChain(t){return i.chainToPlatform(t)===h._platform}static async getDecimals(t,n,e){if(i.isNative(e)||e===i.APTOS_COIN)return i.nativeDecimals(h._platform);const s=e.toString();return(await n.getAccountResource({accountAddress:s.split(i.APTOS_SEPARATOR)[0],resourceType:`0x1::coin::CoinInfo<${s}>`})).decimals}static async getBalance(t,n,e,s){const o=i.isNative(s)?i.APTOS_COIN:s.toString();try{const a=await n.getAccountCoinAmount({accountAddress:e,coinType:o});return BigInt(a)}catch(a){if(a.status===404)return null;throw a}}static async getBalances(t,n,e,s){return(await Promise.all(s.map(async a=>{const c=await this.getBalance(t,n,e,a);return{[i.isNative(a)?"native":new i.AptosAddress(a).toString()]:c}}))).reduce((a,c)=>Object.assign(a,c),{})}static async sendWait(t,n,e){const s=[];for(const o of e){const a=await n.transaction.submit.simple(o.transaction),c=await n.waitForTransaction({transactionHash:a.hash});s.push(c.hash)}return s}static async getLatestBlock(t){const n=await t.getLedgerInfo();return Number(n.block_height)}static async getLatestFinalizedBlock(t){const n=await t.getLedgerInfo();return Number(n.block_height)}static chainFromChainId(t){const n=i.platformNativeChainIdToNetworkChain(h._platform,BigInt(t));if(!n)throw new Error(`No matching chainId to determine network and chain: ${t}`);const[e,s]=n;return[e,s]}static async chainFromRpc(t){const n=await t.getLedgerInfo();return this.chainFromChainId(n.chain_id.toString())}};u(h,"_platform",i._platform$2);let d=h;async function m(r,t){const[n,e]=await d.chainFromRpc(r),s=l.o.fromPrivateKey({privateKey:new l.z(i.hex.decode(t))});return new w(e,s,r)}class w{constructor(t,n,e,s){u(this,"_chain");u(this,"_account");u(this,"_rpc");u(this,"_debug");this._chain=t,this._account=n,this._rpc=e,this._debug=s}chain(){return this._chain}address(){return this._account.accountAddress.toString()}async signAndSend(t){const n=[];for(const e of t){const{description:s,transaction:o}=e;this._debug&&console.log(`Signing: ${s} for ${this.address()}`);const a=await this._rpc.transaction.build.simple({sender:this._account.accountAddress,data:o}),{hash:c}=await this._simSignSend(a);n.push(c)}return n}async _simSignSend(t){return await this._rpc.transaction.simulate.simple({signerPublicKey:this._account.publicKey,transaction:t}).then(n=>n.forEach(e=>{if(!e.success)throw new Error(`Transaction failed: ${e.vm_status}
2
- ${JSON.stringify(e,null,2)}`)})),this._rpc.signAndSubmitTransaction({signer:this._account,transaction:t}).then(n=>this._rpc.waitForTransaction({transactionHash:n.hash}))}}const _={Address:i.AptosAddress,Platform:d,getSigner:m,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-DuULLCq3.js")),TokenBridge:()=>Promise.resolve().then(()=>require("./index-9W3bwgfp.js"))},getChain:(r,t,n)=>new g(t,new d(r,i.applyChainsConfigConfigOverrides(r,i._platform$2,{[t]:n})))},A=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));exports.AptosPlatform=d;exports.aptos=A;
@@ -1 +0,0 @@
1
- "use strict";var p=Object.defineProperty;var y=(o,e,t)=>e in o?p(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>y(o,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-B3tC_M_3.js"),g=require("./aptos-BAu09v7j.js");class f{constructor(e,t,n,r,a=!1){i(this,"transaction");i(this,"network");i(this,"chain");i(this,"description");i(this,"parallelizable");this.transaction=e,this.network=t,this.chain=n,this.description=r,this.parallelizable=a}}const w=[{name:"tokenBridgeAddress",...s.universalAddressItem},{name:"chain",...s.chainItem()},{name:"domainSeparator",binary:"bytes",custom:s.bytes.encode(s.APTOS_SEPARATOR),omit:!0},{name:"tokenId",...s.universalAddressItem},{name:"domainSeparator",binary:"bytes",custom:new Uint8Array([255]),omit:!0}],T=o=>s.serialize$1(w,o);class d{constructor(e,t,n,r){i(this,"network");i(this,"chain");i(this,"connection");i(this,"contracts");i(this,"chainId");i(this,"tokenBridgeAddress");this.network=e,this.chain=t,this.connection=n,this.contracts=r,this.chainId=s.toChainId(t);const a=r.tokenBridge;if(!a)throw new Error(`TokenBridge contract Address for chain ${t} not found`);this.tokenBridgeAddress=a}static async fromRpc(e,t){const[n,r]=await g.AptosPlatform.chainFromRpc(e),a=t[r];if(a.network!==n)throw new Error("Network mismatch "+a.network+" !== "+n);return new d(n,r,e,a.contracts)}async isWrappedAsset(e){try{return await this.getOriginalAsset(e),!0}catch{return!1}}async getOriginalAsset(e){const t=e.toString().split(s.APTOS_SEPARATOR),n=await this.connection.getAccountResource({accountAddress:t[0],resourceType:`${this.tokenBridgeAddress}::state::OriginInfo`});if(!n)throw s.ErrNotWrapped(e.toString());const r=s.toChain(parseInt(n.token_chain.number)),a=new s.UniversalAddress(n.token_address.external_address);return{chain:r,address:a}}async getTokenUniversalAddress(e){return new s.UniversalAddress(s.hex.encode(s.sha3_256(e.toString()),!0))}async getTokenNativeAddress(e,t){const n=e===this.chain?await this.getTypeFromExternalAddress(t.toString()):await this.getAssetFullyQualifiedType({chain:e,address:t});if(!n)throw new Error("Invalid asset address.");return new s.AptosAddress(n)}async hasWrappedAsset(e){try{return await this.getWrappedAsset(e),!0}catch{}return!1}async getWrappedAsset(e){if(s.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const t=await this.getAssetFullyQualifiedType(e);if(!t)throw new Error("Invalid asset address.");return await this.connection.getAccountResource({accountAddress:s.coalesceModuleAddress(t),resourceType:`${this.tokenBridgeAddress}::state::OriginInfo`}),s.toNative(this.chain,t)}async isTransferCompleted(e){const n=(await this.connection.getAccountResource({accountAddress:this.tokenBridgeAddress,resourceType:`${this.tokenBridgeAddress}::state::State`})).consumed_vaas.elems.handle;try{return await this.connection.getTableItem({handle:n,data:{key_type:"vector<u8>",value_type:"u8",key:`0x${s.dist.Buffer.from(s.keccak_256(e.hash)).toString("hex")}`}}),!0}catch{return!1}}async getWrappedNative(){return s.toNative(this.chain,s.APTOS_COIN)}async*createAttestation(e,t){const n={chain:this.chain,address:new s.AptosAddress(e)},r=await this.getAssetFullyQualifiedType(n);if(!r)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::attest_token::attest_token_entry`,typeArguments:[r],functionArguments:[]},"Aptos.AttestToken")}async*submitAttestation(e,t){yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin_type`,typeArguments:[],functionArguments:[s.serialize(e)]},"Aptos.CreateWrappedCoinType");const n=await this.getAssetFullyQualifiedType(e.payload.token);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin`,typeArguments:[n],functionArguments:[s.serialize(e)]},"Aptos.CreateWrappedCoin")}async*transfer(e,t,n,r,a){const l=0n,c=0n,h=s.isNative(n)?s.APTOS_COIN:n.toString(),u=t.address.toUniversalAddress().toUint8Array(),A=s.toChainId(t.chain);a?yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_with_payload_entry`,typeArguments:[h],functionArguments:[r,A,u,c,a]},"Aptos.TransferTokensWithPayload"):yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_entry`,typeArguments:[h],functionArguments:[r,A,u,l,c]},"Aptos.TransferTokens")}async*redeem(e,t,n=!0){const r=t.payload.token.chain===this.chain?await this.getTypeFromExternalAddress(t.payload.token.address.toString()):await this.getAssetFullyQualifiedType(t.payload.token);if(!r)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::complete_transfer::submit_vaa_and_register_entry`,typeArguments:[r],functionArguments:[s.serialize(t)]},"Aptos.CompleteTransfer")}async getAssetFullyQualifiedType(e){return e.chain===this.chain?s.isValidAptosType(e.address.toString())?e.address.toString():null:`${d.getForeignAssetAddress(this.chain,this.tokenBridgeAddress,e)}::coin::T`}async getTypeFromExternalAddress(e){try{const t=await this.connection.getAccountResource({accountAddress:this.tokenBridgeAddress,resourceType:`${this.tokenBridgeAddress}::state::State`}),{handle:n}=t.native_infos,r=await this.connection.getTableItem({handle:n,data:{key_type:`${this.tokenBridgeAddress}::token_hash::TokenHash`,value_type:"0x1::type_info::TypeInfo",key:{hash:e}}});return r?[r.account_address,String.fromCharCode(...s.hex.decode(r.module_name)),String.fromCharCode(...s.hex.decode(r.struct_name))].join(s.APTOS_SEPARATOR):null}catch{return null}}static getForeignAssetAddress(e,t,n){if(s.isNative(n.address))throw new Error("Invalid token address");const r=T({chain:n.chain,tokenBridgeAddress:new s.AptosAddress(t).toUniversalAddress(),tokenId:n.address.toUniversalAddress()});return s.hex.encode(s.sha3_256(r),!0)}createUnsignedTx(e,t,n=!1){return new f(e,this.network,this.chain,t,n)}}s.registerProtocol("Aptos","TokenBridge",d);exports.AptosTokenBridge=d;
@@ -1 +0,0 @@
1
- "use strict";const me=Symbol(),se=Object.getPrototypeOf,G=new WeakMap,he=e=>e&&(G.has(e)?G.get(e):se(e)===Object.prototype||se(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,ne=(e,t=!0)=>{G.set(e,t)},H={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,REACT_APP_CONNECT_GIT_HASH:"47a7c1d6296e0cf071bcbeeaf480a131d1c1110d",REACT_APP_CONNECT_VERSION:"1.1.10",SSR:!1},F=e=>typeof e=="object"&&e!==null,A=new WeakMap,x=new WeakSet,be=(e=Object.is,t=(n,g)=>new Proxy(n,g),s=n=>F(n)&&!x.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),r=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,g,I=r)=>{const v=l.get(n);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return ne(w,!0),l.set(n,[g,w]),Reflect.ownKeys(n).forEach(_=>{if(Object.getOwnPropertyDescriptor(w,_))return;const L=Reflect.get(n,_),M={value:L,enumerable:!0,configurable:!0};if(x.has(L))ne(L,!1);else if(L instanceof Promise)delete M.value,M.get=()=>I(L);else if(A.has(L)){const[b,q]=A.get(L);M.value=c(b,q(),I)}Object.defineProperty(w,_,M)}),Object.preventExtensions(w)},m=new WeakMap,f=[1,1],W=n=>{if(!F(n))throw new Error("object required");const g=m.get(n);if(g)return g;let I=f[0];const v=new Set,w=(a,i=++f[0])=>{I!==i&&(I=i,v.forEach(o=>o(a,i)))};let _=f[1];const L=(a=++f[1])=>(_!==a&&!v.size&&(_=a,b.forEach(([i])=>{const o=i[1](a);o>I&&(I=o)})),I),M=a=>(i,o)=>{const h=[...i];h[1]=[a,...h[1]],w(h,o)},b=new Map,q=(a,i)=>{if((H?"production":void 0)!=="production"&&b.has(a))throw new Error("prop listener already exists");if(v.size){const o=i[3](M(a));b.set(a,[i,o])}else b.set(a,[i])},te=a=>{var i;const o=b.get(a);o&&(b.delete(a),(i=o[1])==null||i.call(o))},pe=a=>(v.add(a),v.size===1&&b.forEach(([o,h],k)=>{if((H?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const T=o[3](M(k));b.set(k,[o,T])}),()=>{v.delete(a),v.size===0&&b.forEach(([o,h],k)=>{h&&(h(),b.set(k,[o]))})}),J=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(J,{deleteProperty(a,i){const o=Reflect.get(a,i);te(i);const h=Reflect.deleteProperty(a,i);return h&&w(["delete",[i],o]),h},set(a,i,o,h){const k=Reflect.has(a,i),T=Reflect.get(a,i,h);if(k&&(e(T,o)||m.has(o)&&e(T,m.get(o))))return!0;te(i),F(o)&&(o=ge(o)||o);let V=o;if(o instanceof Promise)o.then(C=>{o.status="fulfilled",o.value=C,w(["resolve",[i],C])}).catch(C=>{o.status="rejected",o.reason=C,w(["reject",[i],C])});else{!A.has(o)&&s(o)&&(V=W(o));const C=!x.has(V)&&A.get(V);C&&q(i,C)}return Reflect.set(a,i,V,h),w(["set",[i],o,T]),!0}});m.set(n,$);const fe=[J,L,c,pe];return A.set($,fe),Reflect.ownKeys(n).forEach(a=>{const i=Object.getOwnPropertyDescriptor(n,a);"value"in i&&($[a]=n[a],delete i.value,delete i.writable),Object.defineProperty(J,a,i)}),$})=>[W,A,x,e,t,s,r,l,c,m,f],[ye]=be();function j(e={}){return ye(e)}function D(e,t,s){const r=A.get(e);(H?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let l;const c=[],m=r[3];let f=!1;const n=m(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,n()}}function ve(e,t){const s=A.get(e);(H?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[r,l,c]=s;return c(r,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ee={state:d,subscribe(e){return D(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},u={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return u.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return u.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(u.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!u.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(u.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(u.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(u.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(u.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=ee.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=j({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),ue={state:p,subscribe(e){return D(p.events,()=>e(ve(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},E=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),y={state:E,subscribe(e){return D(E,()=>e(E))},setChains(e){E.chains=e},setWalletConnectUri(e){E.walletConnectUri=e},setIsCustomDesktop(e){E.isCustomDesktop=e},setIsCustomMobile(e){E.isCustomMobile=e},setIsDataLoaded(e){E.isDataLoaded=e},setIsUiLoaded(e){E.isUiLoaded=e},setIsAuth(e){E.isAuth=e}},B=j({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),U={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;ue.initialize(),y.setChains(e.chains),y.setIsAuth(!!e.enableAuthMode),y.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),y.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),u.setModalVersionInStorage(),Object.assign(B,e)}};var Ie=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Oe.call(t,s)&&re(e,s,t[s]);return e};const Q="https://explorer-api.walletconnect.com",X="wcm",Y="js-2.6.2";async function K(e,t){const s=Le({sdkType:X,sdkVersion:Y},t),r=new URL(e,Q);return r.searchParams.append("projectId",U.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const P={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${Q}/w3m/v1/getWalletImage/${e}?projectId=${U.state.projectId}&sdkType=${X}&sdkVersion=${Y}`},getAssetImageUrl(e){return`${Q}/w3m/v1/getAssetImage/${e}?projectId=${U.state.projectId}&sdkType=${X}&sdkVersion=${Y}`}};var We=Object.defineProperty,ie=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,ae=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&ae(e,s,t[s]);if(ie)for(var s of ie(t))Ae.call(t,s)&&ae(e,s,t[s]);return e};const le=u.isMobile(),O=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Me={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=U.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(u.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await P.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),O.recomendedWallets=l}else{const{chains:s,isAuth:r}=y.state,l=s==null?void 0:s.join(","),c=u.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:u.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=le?await P.getMobileListings(m):await P.getDesktopListings(m);O.recomendedWallets=Object.values(f)}return O.recomendedWallets},async getWallets(e){const t=je({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=U.state,{recomendedWallets:l}=O;if(r==="ALL")return O.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):u.isArray(s)&&(t.excludedIds=s.join(",")),u.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),y.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=le?await P.getMobileListings(t):await P.getDesktopListings(t),n=Object.values(f),g=m?"search":"wallets";return O[g]={listings:[...O[g].listings,...n],total:W,page:c??1},{listings:n,total:W}},getWalletImageUrl(e){return P.getWalletImageUrl(e)},getAssetImageUrl(e){return P.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},N=j({open:!1}),z={state:N,subscribe(e){return D(N,()=>e(N))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=y.state;if(u.removeWalletConnectDeepLink(),y.setWalletConnectUri(e==null?void 0:e.uri),y.setChains(e==null?void 0:e.chains),ee.reset("ConnectWallet"),s&&r)N.open=!0,t();else{const l=setInterval(()=>{const c=y.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),N.open=!0,t())},200)}})},close(){N.open=!1}};var Pe=Object.defineProperty,ce=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,de=(e,t,s)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,De=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&de(e,s,t[s]);if(ce)for(var s of ce(t))Ue.call(t,s)&&de(e,s,t[s]);return e};function _e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=j({themeMode:_e()?"dark":"light"}),Z={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=De({},s))}},S=j({open:!1,message:"",variant:"success"}),ke={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Ne{constructor(t){this.openModal=z.open,this.closeModal=z.close,this.subscribeModal=z.subscribe,this.setTheme=Z.setThemeConfig,Z.setThemeConfig(t),U.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(()=>require("./index-BLy1Bcl6.js"));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),y.setIsUiLoaded(!0)}}}const Te=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Ne},Symbol.toStringTag,{value:"Module"}));exports.R=ue;exports.T=ee;exports.a=u;exports.index=Te;exports.ne=Z;exports.oe=ke;exports.p=y;exports.se=z;exports.te=Me;exports.y=U;
@@ -1,16 +0,0 @@
1
- import { S as n, e as r, f as i, c as s, g as t } from "./index-DfYMJMp0.mjs";
2
- import { g as l } from "./signer-Cqlxyiog.mjs";
3
- const d = {
4
- Address: n,
5
- Platform: r,
6
- getSigner: l,
7
- protocols: {
8
- WormholeCore: () => import("./index-DfYMJMp0.mjs").then((o) => o.cZ),
9
- TokenBridge: () => import("./index-DNw0OK31.mjs"),
10
- CircleBridge: () => import("./index-DxpDkO_U.mjs")
11
- },
12
- getChain: (o, a, e) => new i(a, new r(o, s(o, t, { [a]: e })))
13
- };
14
- export {
15
- d as default
16
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-B3tC_M_3.js"),i=require("./signer-krqTFKEd.js"),a={Address:e.SolanaAddress,Platform:e.SolanaPlatform,getSigner:i.getSolanaSignAndSendSigner,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-B3tC_M_3.js")).then(r=>r.index$2),TokenBridge:()=>Promise.resolve().then(()=>require("./index-BsP3I9rd.js")),CircleBridge:()=>Promise.resolve().then(()=>require("./index-CtqBV0Mh.js"))},getChain:(r,o,n)=>new e.SolanaChain(o,new e.SolanaPlatform(r,e.applyChainsConfigConfigOverrides(r,e._platform$1,{[o]:n})))};exports.default=a;