@human.tech/waap-sdk 2.4.0 → 2.4.2-staging-416db8

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 (83) hide show
  1. package/.agent/SKILL.md +28 -13
  2. package/CHANGELOG.md +84 -0
  3. package/README.md +16 -2
  4. package/dist/SolanaProvider-BKWKXTWh.mjs +1 -0
  5. package/dist/SolanaProvider-Uv3q1b0H.js +1 -0
  6. package/dist/UIMessageManager-4xqSTTBS.d.mts +11 -0
  7. package/dist/UIMessageManager-4xqSTTBS.d.ts +11 -0
  8. package/dist/UIMessageManager-CPw6PggC.js +1 -0
  9. package/dist/UIMessageManager-D3VN9vM8.mjs +1 -0
  10. package/dist/{WaaPError-BuwfZjBk.d.mts → WaaPError-C2TOEGPx.d.mts} +1 -1
  11. package/dist/{WaaPError-BuwfZjBk.d.ts → WaaPError-C2TOEGPx.d.ts} +1 -1
  12. package/dist/{WalletConnect-Dn40Omgo.js → WalletConnect-B21f4Vvh.js} +1 -1
  13. package/dist/{WalletConnect-UfxGn2M_.mjs → WalletConnect-DXiTxC-F.mjs} +1 -1
  14. package/dist/{WalletModalController-Qh9LNwW5.d.ts → WalletModalController-16mHsFv2.d.ts} +1 -1
  15. package/dist/{WalletModalController-wIHBGOVd.d.mts → WalletModalController-DxiBiqDf.d.mts} +1 -1
  16. package/dist/bridge.d.mts +3 -3
  17. package/dist/bridge.d.ts +3 -3
  18. package/dist/bridge.js +1 -1
  19. package/dist/bridge.mjs +1 -1
  20. package/dist/evm-BbSgL_Hv.mjs +2 -0
  21. package/dist/evm-_ReyhrCP.js +2 -0
  22. package/dist/evm.d.mts +3 -3
  23. package/dist/evm.d.ts +3 -3
  24. package/dist/evm.js +1 -1
  25. package/dist/evm.mjs +1 -1
  26. package/dist/{index-XdQjHMzI.d.mts → index-BOExImk3.d.mts} +29 -11
  27. package/dist/{index-DNyKwJcJ.d.ts → index-BkKBZpqc.d.ts} +29 -11
  28. package/dist/index.d.mts +12 -10
  29. package/dist/index.d.ts +12 -10
  30. package/dist/index.js +3 -3
  31. package/dist/index.mjs +3 -3
  32. package/dist/init-BljRyI7Q.mjs +1 -0
  33. package/dist/init-C-52fEJS.d.ts +84 -0
  34. package/dist/init-C3zCj5Lc.d.mts +84 -0
  35. package/dist/init-IB0dPXBp.js +1 -0
  36. package/dist/react.d.mts +1 -1
  37. package/dist/react.d.ts +1 -1
  38. package/dist/{register-CMv6n7ak.d.ts → register-BKCJXsHB.d.mts} +9 -6
  39. package/dist/{register-DfUAOQke.d.mts → register-C1hFwh4A.d.ts} +4 -3
  40. package/dist/register-CLsRV5W0.mjs +1 -0
  41. package/dist/register-CpvrhMCx.js +1 -0
  42. package/dist/register-DN1lfMSy.mjs +1 -0
  43. package/dist/register-DpEJlZIw.js +1 -0
  44. package/dist/{register-BhybMFR2.d.mts → register-GiWQpcBY.d.ts} +9 -6
  45. package/dist/{register-MK9ivXiJ.d.ts → register-mq9fTaSt.d.mts} +4 -3
  46. package/dist/solana.d.mts +6 -6
  47. package/dist/solana.d.ts +6 -6
  48. package/dist/solana.js +1 -1
  49. package/dist/solana.mjs +1 -1
  50. package/dist/stellar.d.mts +6 -0
  51. package/dist/stellar.d.ts +6 -0
  52. package/dist/stellar.js +1 -0
  53. package/dist/stellar.mjs +1 -0
  54. package/dist/sui.d.mts +5 -5
  55. package/dist/sui.d.ts +5 -5
  56. package/dist/sui.js +1 -1
  57. package/dist/sui.mjs +1 -1
  58. package/dist/types-Bai14yLc.d.mts +95 -0
  59. package/dist/{types-8CCmbLuY.d.ts → types-Bj5dDE-C.d.ts} +10 -3
  60. package/dist/{types-Bfz205sD.d.mts → types-C7JDjWnt.d.mts} +10 -3
  61. package/dist/{types-x7TOncUp.d.mts → types-Cc6tc4ut.d.mts} +5 -0
  62. package/dist/{types-x7TOncUp.d.ts → types-Cc6tc4ut.d.ts} +5 -0
  63. package/dist/types-DqdVfkaW.d.ts +95 -0
  64. package/dist/ui-D4wp1W_E.js +1 -0
  65. package/dist/ui-DSsOjby7.mjs +1 -0
  66. package/dist/{useWaapAuth-CMhYoBKA.d.mts → useWaapAuth-Be1YJk-7.d.mts} +2 -2
  67. package/dist/{useWaapAuth-CeJuu2wk.d.ts → useWaapAuth-DSFDwJtt.d.ts} +2 -2
  68. package/dist/walletconnect.js +1 -1
  69. package/dist/walletconnect.mjs +1 -1
  70. package/docs/solana-wallet-adapter.md +157 -0
  71. package/package.json +9 -2
  72. package/dist/SolanaProvider-CxJX9Dzo.js +0 -1
  73. package/dist/SolanaProvider-CygEwKg1.mjs +0 -1
  74. package/dist/evm-64xq-c4L.js +0 -2
  75. package/dist/evm-ChOfSh-X.mjs +0 -2
  76. package/dist/initializerContext-DB5E2A6s.d.mts +0 -20
  77. package/dist/initializerContext-Z7JeZRsm.d.ts +0 -20
  78. package/dist/register-BAygaKgr.mjs +0 -1
  79. package/dist/register-CdSpQr2m.js +0 -1
  80. package/dist/register-CoFt8w20.mjs +0 -1
  81. package/dist/register-DEFLr1aE.js +0 -1
  82. package/dist/ui-Bd49qoIs.js +0 -1
  83. package/dist/ui-CI7vln8d.mjs +0 -1
package/dist/bridge.mjs CHANGED
@@ -1 +1 @@
1
- import{E as e,O as t,_ as n,b as r,d as i,n as a,y as o}from"./evm-ChOfSh-X.mjs";import{t as s}from"./asyncSigning-CzqBbYDP.mjs";import{t as c}from"./SolanaProvider-CygEwKg1.mjs";const l=[t.eth_requestAccounts,t.eth_accounts,t.eth_sendTransaction,t.eth_signTransaction,t.eth_getBalance,t.personal_sign,t.eth_signTypedData_v4,t.eth_chainId,t.net_version,t.wallet_switchEthereumChain,t.wallet_addEthereumChain,t.eth_estimateGas,t.eth_blockNumber,t.eth_getCode,t.eth_call,t.eth_getTransactionReceipt,t.eth_getTransactionByHash],u=new Set(l),d=e=>typeof e==`string`&&u.has(e),f=1,p=[`session.login`,`session.logout`,`session.status`,`evm.connect`,`evm.request`,`solana.connect`,`solana.disconnect`,`solana.accounts`,`solana.signMessage`,`solana.signTransaction`,`solana.signAndSendTransaction`,`sdk.preload`,`sdk.destroy`],m=e=>typeof e==`string`&&p.includes(e),h=(e,t,n=`protocolError`)=>({ok:!1,id:e,error:{code:n,message:t}}),g=e=>typeof e==`object`&&!!e&&!Array.isArray(e),_=e=>g(e)&&typeof e.id==`string`&&e.id.length>0?e.id:null,v=e=>{let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return h(null,`Message is not valid JSON`)}if(!g(t))return h(null,`Message must be a JSON object`);let n=_(t);return t.version===1?t.kind===`request`?n?m(t.method)?{ok:!0,request:{version:1,kind:`request`,id:n,method:t.method,params:t.params}}:{ok:!1,id:n,error:{code:`unsupportedMethod`,message:`Unsupported bridge method: ${String(t.method)}`,method:typeof t.method==`string`?t.method:void 0}}:h(null,`Request id must be a non-empty string`):h(n,`Unsupported message kind: ${String(t.kind)}`):h(n,`Unsupported protocol version: ${String(t.version)}`)},y=(e,t)=>({version:1,kind:`response`,id:e,result:t}),b=(e,t)=>({version:1,kind:`response`,id:e,error:t}),x=(e,t)=>({version:1,kind:`event`,event:e,data:t}),S=e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t),C={cancelled:`cancelled`,timeout:`timeout`,user_rejected:`userRejected`,policy_rejected:`policyRejected`,insufficient_balance:`insufficientBalance`,not_authenticated:`notAuthenticated`,not_connected:`notConnected`,unsupported_input:`unsupportedInput`,wallet_error:`walletError`,maintenance:`maintenance`,unknown:`unknown`},w=[`connect`,`disconnect`,`accountsChanged`,`chainChanged`,...Object.values(s)],T=e=>{if(typeof e!=`object`||!e)return;let t=e.code;return typeof t==`number`?t:void 0},E=(t,n)=>{let r=e(t),i=T(r.cause??t);return{code:C[r.code]??`unknown`,message:r.message,...i===void 0?{}:{eip1193Code:i},...n?{method:n}:{}}},D=e=>{let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)},O=(e,t)=>{if(typeof e!=`string`)throw{bridgeError:{code:`unsupportedInput`,message:`${t} must be a base64 string`}};let n=atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;e+=1)r[e]=n.charCodeAt(e);return r},k=e=>({address:e.address,publicKey:D(e.publicKey),chains:[...e.chains]}),A=[`solana:mainnet`,`solana:devnet`,`solana:testnet`,`solana:localnet`],j=e=>{if(e!=null){if(typeof e==`string`&&A.includes(e))return e;throw{bridgeError:{code:`unsupportedInput`,message:`Not a supported Solana chain: ${String(e)}`}}}},M=e=>{let{post:n,createProvider:r,createSolanaProvider:i,token:a}=e,o=null,s=!1,c=new Set,l=[],u=e=>{try{n(e)}catch{}},f=e=>a?{...e,token:a}:e,p=e=>{let t;try{t=S(f(e))}catch(n){let r=n instanceof Error?n.message:String(n);t=S(f(e.kind===`response`?b(e.id,{code:`serializationFailed`,message:`Result could not be serialized for the host: ${r}`}):x(`bridgeSerializationError`,{event:e.event,message:r})))}u(t)},m=e=>{for(let t of w){let n=(...e)=>p(x(t,e.length<=1?e[0]:e));e.on(t,n),l.push([t,n])}},h=e=>{let t=e.uiMessageManager;typeof t?.on==`function`&&(t.on(`show_modal`,()=>p(x(`walletVisibilityChanged`,{visible:!0}))),t.on(`hide_modal`,()=>p(x(`walletVisibilityChanged`,{visible:!1}))))},g=null,_=null,C=e=>{let n=e.walletMessageManager;if(n){if(typeof n.pingIframe!=`function`||typeof n.postSilkRequest!=`function`){p(x(`bridgeProtocolError`,{code:`walletError`,message:`Cannot announce mobile: the wallet message manager is missing pingIframe or postSilkRequest`}));return}_=n.pingIframe().then(()=>n.postSilkRequest?.({method:t.set_is_mobile,params:[!0],interactionRequired:!1})).then(()=>void 0).catch(e=>{p(x(`bridgeProtocolError`,{code:`walletError`,message:`Could not tell the wallet it is on mobile: ${String(e)}`}))})}},T=e=>{let t=e.walletMessageManager;typeof t?.addListener==`function`&&t.addListener({onAuthComplete:async e=>{let t=g;if(t){if(g=null,e===`success`){try{await F().request({method:`eth_requestAccounts`})}catch(e){p(x(`bridgeProtocolError`,{code:`walletError`,message:`Login completed but accounts could not be read: ${String(e)}`}))}M(`waap`)}t(e===`success`?`waap`:null)}}})},A=null,M=e=>{A?.setLoginMethod(e)},N=()=>{if(!i)throw{bridgeError:{code:`unsupportedMethod`,message:`This bridge was built without a Solana facade`}};if(!A){let e=F();A=i(),M(e.getLoginMethod())}return A},P=e=>{let t=N().accounts;if(t.length===0)throw{bridgeError:{code:`notConnected`,message:`Connect the Solana facade before signing`}};if(typeof e!=`string`||e.length===0)return t[0];let n=t.find(t=>t.address===e);if(!n)throw{bridgeError:{code:`unsupportedInput`,message:`Not a connected Solana account: ${e}`}};return n},F=()=>(o||(o=r(),m(o),h(o),T(o),C(o)),o),I=async e=>{let t=typeof e.params==`object`&&e.params!==null?e.params:{};switch(e.method){case`sdk.preload`:return await F().preload(),null;case`sdk.destroy`:return R(e.id),null;case`session.login`:{F(),await _;let e=F(),n=e.loginWithNativeHandoff;if(typeof n!=`function`)throw{bridgeError:{code:`walletError`,message:`This provider cannot report a native auth hand-off; social login would silently do nothing`,method:`session.login`}};let r=await n.call(e,{force:t.force===!0});if(typeof r==`object`&&r&&r.isComplete===!1&&typeof r.authUrl==`string`)return p(x(`nativeAuthRequested`,{authUrl:r.authUrl})),await new Promise((e,t)=>{g?.(null);let n=setTimeout(()=>{g=null,t({bridgeError:{code:`timeout`,message:`The social login was not completed. The browser may have been dismissed before it finished.`,method:`session.login`}})},18e4);g=t=>{clearTimeout(n),e(t)}});let i=typeof r==`object`&&r?r.loginMethod??null:r;return M(i),i}case`session.logout`:return await F().logout(),M(null),null;case`session.status`:return F().session.getAccountStatus();case`evm.connect`:return F().request({method:`eth_requestAccounts`});case`solana.connect`:return{accounts:(await N().connect(t.silent===!0?{silent:!0}:void 0)).accounts.map(k)};case`solana.disconnect`:return await N().disconnect(),null;case`solana.accounts`:return{accounts:N().accounts.map(k)};case`solana.signMessage`:{let e=P(t.address),n=await N().signMessage({message:O(t.message,`message`),account:e});return{signedMessage:D(n.signedMessage),signature:D(n.signature)}}case`solana.signTransaction`:{let e=P(t.address),n=j(t.chain),r=await N().signTransaction({transaction:O(t.transaction,`transaction`),account:e,...n===void 0?{}:{chain:n}});return{signedTransaction:D(r.signedTransaction),signature:D(r.signature)}}case`solana.signAndSendTransaction`:{let e=P(t.address),n=j(t.chain);return{signature:(await N().signAndSendTransaction({transaction:O(t.transaction,`transaction`),account:e,...n===void 0?{}:{chain:n}})).signature}}case`evm.request`:if(!d(t.method))throw{bridgeError:{code:`unsupportedMethod`,message:`Method is not available to native callers: ${String(t.method)}`,method:typeof t.method==`string`?t.method:void 0}};return F().request({method:t.method,params:t.params})}},L=(e,t)=>{c.delete(e)&&p(t)},R=e=>{g?.(null),g=null;for(let t of[...c])t!==e&&L(t,b(t,{code:`bridgeUnavailable`,message:`Bridge was destroyed while this request was in flight`}));if(o){for(let[e,t]of l)o.removeListener(e,t);l.length=0;let e=o.destroy;typeof e==`function`&&e.call(o),o=null}A&&=(A.destroy(),null),s=!0};return{handleMessage:e=>{let t=v(e);if(!t.ok){t.id?p(b(t.id,t.error)):p(x(`bridgeProtocolError`,t.error));return}let{request:n}=t;if(s){p(b(n.id,{code:`bridgeUnavailable`,message:`Bridge has been destroyed`}));return}if(c.has(n.id)){p(x(`bridgeProtocolError`,{code:`protocolError`,message:`Request id is already in flight: ${n.id}`,id:n.id,method:n.method}));return}c.add(n.id),(async()=>{try{L(n.id,y(n.id,await I(n)))}catch(e){let t=e?.bridgeError;L(n.id,b(n.id,t??E(e,n.method)))}})()},dispose:()=>R()}},N=(e=`WaaPBridge`,t=window)=>{let n=t[e];if(typeof n?.postMessage==`function`)return e=>n.postMessage(e);let r=t.webkit?.messageHandlers?.[e];return typeof r?.postMessage==`function`?e=>r.postMessage(e):typeof t.ReactNativeWebView?.postMessage==`function`?e=>t.ReactNativeWebView.postMessage(e):null},P=(e={})=>{e.sdkPlatform&&n(e.sdkPlatform,e.sdkVersion??`unknown`);let t=e.post??N(e.channel);if(!t)throw Error(`[WaaP bridge] No native host channel found. The WebView must install one before loading the bridge page.`);let i={...e.init??{},deferIframe:!1},s=()=>(r(i),o(`tap`).contentWindow),l=null,u=M({post:t,token:e.token,createProvider:()=>a(i,`tap`,!0,[`evm`,`solana`],!1),createSolanaProvider:()=>(l??=new c(s(),i,s,{...i,chains:[`solana`]}),l.setAccountMode?.(`tap`),l)});return window.__waapBridgeReceive=e=>u.handleMessage(e),u};export{l as BRIDGE_EVM_METHODS,f as BRIDGE_PROTOCOL_VERSION,M as createMobileBridge,i as getWaaPIframeDiagnostics,v as parseHostMessage,N as resolveNativeHostPost,P as startMobileBridge};
1
+ import{S as e,g as t,h as n,p as r,s as i,w as a}from"./UIMessageManager-D3VN9vM8.mjs";import{t as o}from"./asyncSigning-CzqBbYDP.mjs";import{t as s}from"./SolanaProvider-BKWKXTWh.mjs";import{n as c}from"./evm-BbSgL_Hv.mjs";const l=[a.eth_requestAccounts,a.eth_accounts,a.eth_sendTransaction,a.eth_signTransaction,a.eth_getBalance,a.personal_sign,a.eth_signTypedData_v4,a.eth_chainId,a.net_version,a.wallet_switchEthereumChain,a.wallet_addEthereumChain,a.eth_estimateGas,a.eth_blockNumber,a.eth_getCode,a.eth_call,a.eth_getTransactionReceipt,a.eth_getTransactionByHash],u=new Set(l),d=e=>typeof e==`string`&&u.has(e),f=1,p=[`session.login`,`session.logout`,`session.status`,`evm.connect`,`evm.request`,`solana.connect`,`solana.disconnect`,`solana.accounts`,`solana.signMessage`,`solana.signTransaction`,`solana.signAndSendTransaction`,`sdk.preload`,`sdk.destroy`],m=e=>typeof e==`string`&&p.includes(e),h=(e,t,n=`protocolError`)=>({ok:!1,id:e,error:{code:n,message:t}}),g=e=>typeof e==`object`&&!!e&&!Array.isArray(e),_=e=>g(e)&&typeof e.id==`string`&&e.id.length>0?e.id:null,v=e=>{let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return h(null,`Message is not valid JSON`)}if(!g(t))return h(null,`Message must be a JSON object`);let n=_(t);return t.version===1?t.kind===`request`?n?m(t.method)?{ok:!0,request:{version:1,kind:`request`,id:n,method:t.method,params:t.params}}:{ok:!1,id:n,error:{code:`unsupportedMethod`,message:`Unsupported bridge method: ${String(t.method)}`,method:typeof t.method==`string`?t.method:void 0}}:h(null,`Request id must be a non-empty string`):h(n,`Unsupported message kind: ${String(t.kind)}`):h(n,`Unsupported protocol version: ${String(t.version)}`)},y=(e,t)=>({version:1,kind:`response`,id:e,result:t}),b=(e,t)=>({version:1,kind:`response`,id:e,error:t}),x=(e,t)=>({version:1,kind:`event`,event:e,data:t}),S=e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t),C={cancelled:`cancelled`,timeout:`timeout`,user_rejected:`userRejected`,policy_rejected:`policyRejected`,insufficient_balance:`insufficientBalance`,not_authenticated:`notAuthenticated`,not_connected:`notConnected`,unsupported_input:`unsupportedInput`,wallet_error:`walletError`,maintenance:`maintenance`,unknown:`unknown`},w=[`connect`,`disconnect`,`accountsChanged`,`chainChanged`,...Object.values(o)],T=e=>{if(typeof e!=`object`||!e)return;let t=e.code;return typeof t==`number`?t:void 0},E=(t,n)=>{let r=e(t),i=T(r.cause??t);return{code:C[r.code]??`unknown`,message:r.message,...i===void 0?{}:{eip1193Code:i},...n?{method:n}:{}}},D=e=>{let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)},O=(e,t)=>{if(typeof e!=`string`)throw{bridgeError:{code:`unsupportedInput`,message:`${t} must be a base64 string`}};let n=atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;e+=1)r[e]=n.charCodeAt(e);return r},k=e=>({address:e.address,publicKey:D(e.publicKey),chains:[...e.chains]}),A=[`solana:mainnet`,`solana:devnet`,`solana:testnet`,`solana:localnet`],j=e=>{if(e!=null){if(typeof e==`string`&&A.includes(e))return e;throw{bridgeError:{code:`unsupportedInput`,message:`Not a supported Solana chain: ${String(e)}`}}}},M=e=>{let{post:t,createProvider:n,createSolanaProvider:r,token:i}=e,o=null,s=!1,c=new Set,l=[],u=e=>{try{t(e)}catch{}},f=e=>i?{...e,token:i}:e,p=e=>{let t;try{t=S(f(e))}catch(n){let r=n instanceof Error?n.message:String(n);t=S(f(e.kind===`response`?b(e.id,{code:`serializationFailed`,message:`Result could not be serialized for the host: ${r}`}):x(`bridgeSerializationError`,{event:e.event,message:r})))}u(t)},m=e=>{for(let t of w){let n=(...e)=>p(x(t,e.length<=1?e[0]:e));e.on(t,n),l.push([t,n])}},h=e=>{let t=e.uiMessageManager;typeof t?.on==`function`&&(t.on(`show_modal`,()=>p(x(`walletVisibilityChanged`,{visible:!0}))),t.on(`hide_modal`,()=>p(x(`walletVisibilityChanged`,{visible:!1}))))},g=null,_=null,C=null,T=e=>{let t=e.walletMessageManager;if(!t)return;if(typeof t.pingIframe!=`function`||typeof t.postSilkRequest!=`function`){p(x(`bridgeProtocolError`,{code:`walletError`,message:`Cannot announce mobile: the wallet message manager is missing pingIframe or postSilkRequest`})),_=Promise.resolve(!1);return}let n=t.pingIframe.bind(t),r=t.postSilkRequest.bind(t);C=()=>n().then(()=>r({method:a.set_is_mobile,params:[!0],interactionRequired:!1})).then(()=>!0).catch(e=>(p(x(`bridgeProtocolError`,{code:`walletError`,message:`Could not tell the wallet it is on mobile: ${String(e)}`})),!1)),_=C()},A=e=>{let t=e.walletMessageManager;typeof t?.addListener==`function`&&t.addListener({onAuthComplete:async e=>{let t=g;if(t){if(g=null,e===`success`){try{await I().request({method:`eth_requestAccounts`})}catch(e){p(x(`bridgeProtocolError`,{code:`walletError`,message:`Login completed but accounts could not be read: ${String(e)}`}))}N(`waap`)}t(e===`success`?`waap`:null)}}})},M=null,N=e=>{M?.setLoginMethod(e)},P=()=>{if(!r)throw{bridgeError:{code:`unsupportedMethod`,message:`This bridge was built without a Solana facade`}};if(!M){let e=I();M=r(),N(e.getLoginMethod())}return M},F=e=>{let t=P().accounts;if(t.length===0)throw{bridgeError:{code:`notConnected`,message:`Connect the Solana facade before signing`}};if(typeof e!=`string`||e.length===0)return t[0];let n=t.find(t=>t.address===e);if(!n)throw{bridgeError:{code:`unsupportedInput`,message:`Not a connected Solana account: ${e}`}};return n},I=()=>(o||(o=n(),m(o),h(o),A(o),T(o)),o),L=async e=>{let t=typeof e.params==`object`&&e.params!==null?e.params:{};switch(e.method){case`sdk.preload`:return await I().preload(),null;case`sdk.destroy`:return z(e.id),null;case`session.login`:{if(I(),await _===!1&&C&&(_=C()),await _===!1)throw{bridgeError:{code:`bridgeUnavailable`,message:`The wallet did not confirm it is running on a phone, so social login cannot open. Try again once the wallet has loaded.`,method:`session.login`}};let e=I(),n=e.loginWithNativeHandoff;if(typeof n!=`function`)throw{bridgeError:{code:`walletError`,message:`This provider cannot report a native auth hand-off; social login would silently do nothing`,method:`session.login`}};let r=await n.call(e,{force:t.force===!0});if(typeof r==`object`&&r&&r.isComplete===!1&&typeof r.authUrl==`string`)return p(x(`nativeAuthRequested`,{authUrl:r.authUrl})),await new Promise((e,t)=>{g?.(null);let n=setTimeout(()=>{g=null,t({bridgeError:{code:`timeout`,message:`The social login was not completed. The browser may have been dismissed before it finished.`,method:`session.login`}})},18e4);g=t=>{clearTimeout(n),e(t)}});let i=typeof r==`object`&&r?r.loginMethod??null:r;return N(i),i}case`session.logout`:return await I().logout(),N(null),null;case`session.status`:return I().session.getAccountStatus();case`evm.connect`:return I().request({method:`eth_requestAccounts`});case`solana.connect`:return{accounts:(await P().connect(t.silent===!0?{silent:!0}:void 0)).accounts.map(k)};case`solana.disconnect`:return await P().disconnect(),null;case`solana.accounts`:return{accounts:P().accounts.map(k)};case`solana.signMessage`:{let e=F(t.address),n=await P().signMessage({message:O(t.message,`message`),account:e});return{signedMessage:D(n.signedMessage),signature:D(n.signature)}}case`solana.signTransaction`:{let e=F(t.address),n=j(t.chain),r=await P().signTransaction({transaction:O(t.transaction,`transaction`),account:e,...n===void 0?{}:{chain:n}});return{signedTransaction:D(r.signedTransaction),signature:D(r.signature)}}case`solana.signAndSendTransaction`:{let e=F(t.address),n=j(t.chain);return{signature:(await P().signAndSendTransaction({transaction:O(t.transaction,`transaction`),account:e,...n===void 0?{}:{chain:n}})).signature}}case`evm.request`:if(!d(t.method))throw{bridgeError:{code:`unsupportedMethod`,message:`Method is not available to native callers: ${String(t.method)}`,method:typeof t.method==`string`?t.method:void 0}};return I().request({method:t.method,params:t.params})}},R=(e,t)=>{c.delete(e)&&p(t)},z=e=>{g?.(null),g=null;for(let t of[...c])t!==e&&R(t,b(t,{code:`bridgeUnavailable`,message:`Bridge was destroyed while this request was in flight`}));if(o){for(let[e,t]of l)o.removeListener(e,t);l.length=0;let e=o.destroy;typeof e==`function`&&e.call(o),o=null}M&&=(M.destroy(),null),s=!0};return{handleMessage:e=>{let t=v(e);if(!t.ok){t.id?p(b(t.id,t.error)):p(x(`bridgeProtocolError`,t.error));return}let{request:n}=t;if(s){p(b(n.id,{code:`bridgeUnavailable`,message:`Bridge has been destroyed`}));return}if(c.has(n.id)){p(x(`bridgeProtocolError`,{code:`protocolError`,message:`Request id is already in flight: ${n.id}`,id:n.id,method:n.method}));return}c.add(n.id),(async()=>{try{R(n.id,y(n.id,await L(n)))}catch(e){let t=e?.bridgeError;R(n.id,b(n.id,t??E(e,n.method)))}})()},dispose:()=>z()}},N=(e=`WaaPBridge`,t=window)=>{let n=t[e];if(typeof n?.postMessage==`function`)return e=>n.postMessage(e);let r=t.webkit?.messageHandlers?.[e];return typeof r?.postMessage==`function`?e=>r.postMessage(e):typeof t.ReactNativeWebView?.postMessage==`function`?e=>t.ReactNativeWebView.postMessage(e):null},P=(e={})=>{e.sdkPlatform&&r(e.sdkPlatform,e.sdkVersion??`unknown`);let i=e.post??N(e.channel);if(!i)throw Error(`[WaaP bridge] No native host channel found. The WebView must install one before loading the bridge page.`);let a={...e.init??{},deferIframe:!1},o=()=>(t(a),n(`tap`).contentWindow),l=null,u=M({post:i,token:e.token,createProvider:()=>c(a,`tap`,!0,[`evm`,`solana`],!1),createSolanaProvider:()=>(l??=new s(o(),a,o,{...a,chains:[`solana`]},!1),l.setAccountMode?.(`tap`),l)});return window.__waapBridgeReceive=e=>u.handleMessage(e),u};export{l as BRIDGE_EVM_METHODS,f as BRIDGE_PROTOCOL_VERSION,M as createMobileBridge,i as getWaaPIframeDiagnostics,v as parseHostMessage,N as resolveNativeHostPost,P as startMobileBridge};
@@ -0,0 +1,2 @@
1
+ import{C as e,_ as t,a as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,r as d,t as f,v as p,w as m,x as h}from"./UIMessageManager-D3VN9vM8.mjs";import{t as g}from"./WalletConnect-DXiTxC-F.mjs";import{EventEmitter as _}from"events";import{getAddress as v}from"ethers";const y=e=>typeof e==`object`&&!!e&&e.isComplete===!1&&typeof e.authUrl==`string`;function b(e){return!(!e?.isMetaMask||e.isApexWallet||e.isAvalanche||e.isBitKeep||e.isBlockWallet||e.isMathWallet||e.isOkxWallet||e.isOKExWallet||e.isOneInchIOSWallet||e.isOneInchAndroidWallet||e.isOpera||e.isPortal||e.isRabby||e.isDefiant||e.isTokenPocket||e.isTokenary||e.isZerion)}function x(e){try{if(!e||!Array.isArray(e))return!1;let t=JSON.parse(typeof e[1]==`string`?e[1]:JSON.stringify(e[1]));return t.primaryType===`SafeTx`&&t.domain?.verifyingContract!==void 0&&t.message&&`to`in t.message&&`value`in t.message&&`safeTxGas`in t.message&&`baseGas`in t.message&&`gasPrice`in t.message&&`nonce`in t.message}catch{return!1}}const S={styles:{darkMode:!1}},C=[`waap`,`human`,`injected`,`walletconnect`],w=[e.eth_sendTransaction,e.eth_signTransaction,e.eth_signTypedData_v4,e.personal_sign];function T(e){if(e==null)return null;if(typeof e==`string`){if(C.includes(e))return e;throw Error(`[EthereumProvider] Unexpected login method: "${e}". Expected one of: ${C.join(`, `)}`)}if(typeof e==`object`&&`loginMethod`in e&&typeof e.loginMethod==`string`){let t=e.loginMethod;if(console.warn(`[EthereumProvider] Received object login response. Normalizing "${t}" to string. This is unexpected for the web SDK.`),C.includes(t))return t;throw Error(`[EthereumProvider] Unknown loginMethod in object: "${t}". Expected one of: ${C.join(`, `)}`)}throw Error(`[EthereumProvider] Unexpected login response: ${JSON.stringify(e)} (type: ${typeof e})`)}var E=class extends _{setExposeOnWindow(e){this.exposeOnWindow=e}constructor(e,t,n,r,a,o=!1,s=!1,c,l=[`evm`]){super(),this.lastKnownConversion=`pending`,this.isSilk=!0,this.isWaaP=!0,this.connected=!1,this.exposeOnWindow=!0,this.currentAccount=null,this.accountMode=`tap`,this.walletConnectProvider=null,this.asyncTxs=!1,this.legacyAsyncSigning=!1,this.internalEventEmitter=new _,this.iframeMounted=!0,this.initializerPromise=null,this.sessionProbe=null,this.initializedIframeWindow=null,this.waapRestoreRetryAt=0,this.asyncTxs=o,this.legacyAsyncSigning=s,this.ensureIframe=c,this.iframeMounted=!c,this.referralCode=t,this.project=r,this.customConfig=n,this.initializerChains=l,this.uiMessageManager=new f,this.walletMessageManager=new i(e,a),this.config={...S,...n||{}},this.persistedMethods={login:this.login.bind(this),logout:this.logout.bind(this),getLoginMethod:this.getLoginMethod.bind(this),walletMessageManager:this.walletMessageManager,internalEventEmitter:this.internalEventEmitter,uiMessageManager:this.uiMessageManager,portal:this.portal.bind(this),requestEmail:this.requestEmail.bind(this),requestSBT:this.requestSBT.bind(this),requestPermissionToken:this.requestPermissionToken.bind(this),getLinkedAddresses:this.getLinkedAddresses.bind(this),linkAddress:this.linkAddress.bind(this),unlinkAddress:this.unlinkAddress.bind(this),orcid:this.orcid.bind(this),enable:this.enable.bind(this),isConnected:this.isConnected.bind(this),toggleDarkMode:this.toggleDarkMode.bind(this),destroy:this.destroy.bind(this),silkRequest:this.request.bind(this),waaPRequest:this.request.bind(this)},this.walletMessageManager.addListener({onReceiveConnectNotif:()=>{this.connected=!0,this.emit(`connect`)},handleResponse:e=>this.internalEventEmitter.emit(e.id,e),handleRequest:e=>{e.method===m.show_modal?this.uiMessageManager.emit(`show_modal`):e.method===m.hide_modal&&this.uiMessageManager.emit(`hide_modal`)},onAccountChanged:e=>{this.currentAccount!==e&&(this.currentAccount=e,this.emit(`accountsChanged`,e?[e]:[]))},onAsyncTxNotification:e=>{this.emit(e.type,e.payload)},onSquidLifecycleNotification:e=>{this.emit(e.type,e.payload)}})}async initializeWalletConnect(){try{this.walletConnectProvider=await g.getInstance()}catch(e){console.error(`Failed to initialize WalletConnect provider:`,e),this.walletConnectProvider=null}}async initializeIframeContext(){let e=this.walletMessageManager.getIframeWindow();if(!e)throw Error(`WaaP iframe is not mounted`);if(this.initializedIframeWindow===e&&this.initializerPromise)return this.initializerPromise;this.initializedIframeWindow=e,this.initializerPromise=u(e,async()=>{await this.walletMessageManager.pingIframe(),await c({method:m.set_signing_mode,params:[a(this.accountMode,{referralCode:this.referralCode,project:this.project,config:this.customConfig,chains:this.initializerChains})]},!1,this.walletMessageManager,this.internalEventEmitter)});try{await this.initializerPromise}catch(e){throw this.initializerPromise=null,this.initializedIframeWindow=null,e}}async reassertIframeAccountMode(){this.ensureIframeMounted(),await this.walletMessageManager.pingIframe(),await c({method:m.set_signing_mode,params:[a(this.accountMode,{referralCode:this.referralCode,project:this.project,config:this.customConfig,chains:this.initializerChains})]},!1,this.walletMessageManager,this.internalEventEmitter)}ensureIframeMounted(){if(this.iframeMounted||!this.ensureIframe)return;let e=this.ensureIframe();e&&(this.iframeMounted=!0,this.walletMessageManager.setIframeWindow(e))}async ensureInitialized(){this.ensureIframeMounted(),await this.initializeIframeContext()}async preload(){await this.ensureInitialized()}async enable(){return this.request({method:`eth_requestAccounts`})}isConnected(){return this.connected}getAccountStatus(){let e=this.getLoginMethod();return{authenticated:e!==null,loginMethod:e,activeMode:e?this.accountMode:null,mode:this.accountMode,conversion:e?this.lastKnownConversion:`not_required`,tap:null,squid:null,accounts:this.currentAccount?{evm:this.currentAccount}:{}}}get session(){return{login:e=>this.login(e),logout:async()=>{await this.logout()},getLoginMethod:()=>this.getLoginMethod(),getAccountStatus:()=>this.getCanonicalAccountStatus()}}async getCanonicalAccountStatus(){await this.ensureInitialized();let e=await c({method:m.waap_getAccountStatus,params:[]},!1,this.walletMessageManager,this.internalEventEmitter);return e?.conversion&&(this.lastKnownConversion=e.conversion),e}setAccountMode(e){this.accountMode=e,this.initializerPromise=null,this.initializedIframeWindow=null}async request(t){if(!Object.keys(e).includes(t.method))return Promise.reject({error:`Not implemented (${t.method})`});let r=await this.attemptAutoConnect(t.method);if(r!==null)return r;if(w.includes(t.method)&&!(this.getLoginMethod()!==null||await this.restorePersistedWaaPSession()!==null))return Promise.reject(new h(`not_authenticated`,`Not authenticated: call login() before signing.`,{operation:{chain:`evm`,method:t.method}}));if(x(t.params)&&t.method!==e.eth_signTypedData_v4)return Promise.reject({error:`Safe transactions must be signed using eth_signTypedData_v4`});await this.ensureInitialized();let i=(t.method===e.eth_sendTransaction||t.method===e.eth_signTransaction||t.method===e.eth_signTypedData_v4||t.method===e.personal_sign)&&this.asyncTxs||t.async,a=i||t.withPT||t.timeoutMs!==void 0||t.signal?this.legacyAsyncSigning?{asyncSigning:i||void 0,withPT:t.withPT,timeoutMs:t.timeoutMs,signal:t.signal}:{async:i,withPT:t.withPT,timeoutMs:t.timeoutMs,signal:t.signal}:void 0,o=await c(t,n(t.method),this.walletMessageManager,this.internalEventEmitter,a);if((t.method===e.wallet_switchEthereumChain||t.method===e.wallet_addEthereumChain)&&o===null){this.emit(`chainChanged`,t.params?.[0]?.chainId);try{let e=await this.request({method:`eth_accounts`});e&&e.length>0&&(this.currentAccount=e[0],this.emit(`accountsChanged`,e),this.emit(`connect`,{chainId:t.params?.[0]?.chainId}))}catch(e){console.warn(`[EthereumProvider] Failed to get accounts after chain switch:`,e),this.currentAccount&&(this.emit(`accountsChanged`,[this.currentAccount]),this.emit(`connect`,{chainId:t.params?.[0]?.chainId}))}}return t.method===e.eth_requestAccounts&&Array.isArray(o)&&typeof o[0]==`string`&&(this.currentAccount=o[0],this.connected=!0,typeof window<`u`&&typeof localStorage<`u`&&localStorage.setItem(`${window.location.origin}-connected`,`waap`),this.emit(`accountsChanged`,o),this.emit(`connect`)),o}async login(e){let t=await this.loginWithNativeHandoff(e);if(y(t))throw Error(`[WaaP SDK] The wallet returned a native auth hand-off. Use loginWithNativeHandoff() from a native host.`);return t}async loginWithNativeHandoff(e){if(this.waapRestoreRetryAt=0,typeof window>`u`||typeof document>`u`)return null;let t=e&&!(`request`in e)?e:void 0,n=t?t.customProvider:e;if(await this.ensureInitialized(),!t?.force&&await this.restorePersistedWaaPSession())return this.getLoginMethod()??`waap`;let r=n||window.ethereum,i=r&&b(r)?`MetaMask`:`Browser Wallet`,a=await c({method:m.login,params:[i]},!0,this.walletMessageManager,this.internalEventEmitter);if(y(a))return a;let o=T(a);if(o===null)return null;switch(o){case`waap`:case`human`:localStorage.setItem(`${window.location.origin}-connected`,`waap`),this.setupWaaP();break;case`injected`:r&&(localStorage.setItem(`${window.location.origin}-connected`,`injected`),this.setupInjectedWallet(r));break;case`walletconnect`:{localStorage.setItem(`${window.location.origin}-connected`,`walletconnect`),this.walletConnectProvider||await this.initializeWalletConnect(),g.isConnected()||(await this.walletConnectProvider.open({view:`Connect`}),await g.listenToAccountChangeEvent());let e=g.getWalletProvider();this.setupWalletConnect(e);break}}return o}async logout(){await this.ensureInitialized(),this.cleanupInvalidLoginState(),this.waapRestoreRetryAt=0,this.lastKnownConversion=`pending`,this.currentAccount=null,this.connected=!1,this.emit(`accountsChanged`,[]),this.emit(`disconnect`);try{this.walletConnectProvider&&await this.walletConnectProvider.disconnect()}catch(e){console.error(`Error disconnecting from WalletConnect:`,e)}return c({method:m.logout},!1,this.walletMessageManager,this.internalEventEmitter)}destroy(){if(this.walletMessageManager.dispose(),this.internalEventEmitter.removeAllListeners(),this.uiMessageManager.removeAllListeners(),this.removeAllListeners(),this.connected=!1,this.walletConnectProvider&&=(this.walletConnectProvider.disconnect().catch(()=>void 0),null),typeof window<`u`){let e=window;(e.silk===this||e.silk?.walletMessageManager===this.walletMessageManager)&&delete e.silk,(e.waap===this||e.waap?.walletMessageManager===this.walletMessageManager)&&delete e.waap}t()}cleanupInvalidLoginState(){try{localStorage.removeItem(`${window.location.origin}-connected`)}catch(e){console.warn(`Could not clean up login state:`,e)}}setupWaaP(){if(!this.exposeOnWindow)return;let e={...this.persistedMethods,isWaaP:!0,on:this.on.bind(this),removeListener:this.removeListener.bind(this),request:this.request.bind(this)};window.silk=e,window.waap=e}setupInjectedWallet(e){if(!this.exposeOnWindow)return;let t={...this.persistedMethods,...e,isSilk:!0,connected:e.connected??!1,on:e.on?.bind(e)??(()=>{}),removeListener:e.removeListener?.bind(e)??(()=>{}),request:e.request.bind(e)};window.silk=t,window.waap=t}setupWalletConnect(e){if(!this.exposeOnWindow)return;let t={...this.persistedMethods,...e,isSilk:!0,connected:!0,on:e.on?.bind(e)??(()=>{}),removeListener:e.removeListener?.bind(e)??(()=>{}),request:e.request.bind(e)};window.silk=t,window.waap=t}setupAutoConnectInjected(e){if(!this.exposeOnWindow)return;let t={...this.persistedMethods,...e,isSilk:!1,connected:e.isConnected?.()??!1,on:e.on?.bind(e)??(()=>{}),removeListener:e.removeListener?.bind(e)??(()=>{}),request:e.request.bind(e)};window.silk=t,window.waap=t}setupAutoConnectWalletConnect(e){if(!this.exposeOnWindow)return;let t={...this.persistedMethods,...e,isSilk:!1,connected:!0,on:e.on?.bind(e)??(()=>{}),removeListener:e.removeListener?.bind(e)??(()=>{}),request:e.request.bind(e)};window.silk=t,window.waap=t}async attemptAutoConnect(e){if(e!==`eth_requestAccounts`&&e!==`eth_accounts`)return null;let t=this.getLoginMethod();if(t===`waap`||t===`human`||t===null&&e===`eth_accounts`&&Date.now()>=this.waapRestoreRetryAt){let e=await this.restorePersistedWaaPSession();if(e)return e;t===null&&(this.waapRestoreRetryAt=Date.now()+5e3)}if(t===`injected`&&window.ethereum)try{return this.setupAutoConnectInjected(window.ethereum),window.ethereum.request({method:`eth_requestAccounts`})}catch(e){return console.warn(`Injected wallet auto-connect failed:`,e),this.cleanupInvalidLoginState(),null}else if(t===`walletconnect`)try{if(this.walletConnectProvider||=await g.getInstance(),await g.waitForReadyAndCheckConnection()){let e=g.getWalletProvider();return this.setupAutoConnectWalletConnect(e),e.request({method:`eth_requestAccounts`})}else return this.cleanupInvalidLoginState(),null}catch(e){return console.warn(`WalletConnect auto-connect failed:`,e),this.cleanupInvalidLoginState(),null}return null}restorePersistedWaaPSession(){return this.sessionProbe??=this.probeWaaPSession().finally(()=>{this.sessionProbe=null}),this.sessionProbe}async probeWaaPSession(){try{if(await this.ensureInitialized(),!(await this.getCanonicalAccountStatus()).authenticated)return this.cleanupInvalidLoginState(),null;let e=await c({method:m.auto_conn,params:[window.location.origin]},!1,this.walletMessageManager,this.internalEventEmitter);if(Array.isArray(e)&&e.length>0)return this.currentAccount=e[0],this.connected=!0,localStorage.setItem(`${window.location.origin}-connected`,`waap`),this.setupWaaP(),e}catch(e){console.warn(`WaaP session probe failed:`,e)}return this.cleanupInvalidLoginState(),null}getLoginMethod(){if(typeof window>`u`||typeof localStorage>`u`)return null;try{let e=localStorage.getItem(`${window.location.origin}-connected`);if(!e)return null;if(![`waap`,`human`,`injected`,`walletconnect`].includes(e))return this.cleanupInvalidLoginState(),null;switch(e){case`injected`:return window.ethereum?`injected`:(this.cleanupInvalidLoginState(),null);case`walletconnect`:try{return g.isConnected()?`walletconnect`:(this.cleanupInvalidLoginState(),null)}catch{return this.cleanupInvalidLoginState(),null}case`waap`:return`waap`;case`human`:return`human`;default:return this.cleanupInvalidLoginState(),null}}catch(e){return console.warn(`Error checking login method:`,e),this.cleanupInvalidLoginState(),null}}async toggleDarkMode(){this.config.styles.darkMode=!this.config.styles.darkMode,await this.ensureInitialized();try{await c({method:m.set_custom_config,params:[this.config]},!1,this.walletMessageManager,this.internalEventEmitter)}catch(e){console.error(`Error setting custom config in Silk iframe:`,e)}}async safe(){await this.ensureInitialized(),await c({method:m.safe},!0,this.walletMessageManager,this.internalEventEmitter)}async orcid(){await this.ensureInitialized(),await c({method:m.orcid},!0,this.walletMessageManager,this.internalEventEmitter)}async portal(e,t,n){await this.ensureInitialized();let r;switch(t){case`get`:r=e===`gastank`?m.gastank_get_settings:m.customization_get;break;case`update`:r=e===`gastank`?m.gastank_update_settings:m.customization_update;break;case`topup`:r=m.gastank_topup;break;case`init`:r=m.project_init;break}let i=t!==`get`&&e!==`customization`;return c({method:r,params:[n,window.location.origin]},i,this.walletMessageManager,this.internalEventEmitter)}async requestEmail(){return await this.ensureInitialized(),c({method:m.silk_requestEmail},!0,this.walletMessageManager,this.internalEventEmitter)}async requestPermissionToken(e){await this.ensureInitialized();let t={...e,walletMode:this.accountMode};return c({method:m.waap_requestPermissionToken,params:[t]},!0,this.walletMessageManager,this.internalEventEmitter)}async getPermissionTokenStatus(e){return await this.ensureInitialized(),await c({method:m.waap_getPermissionTokenStatus,params:[e]},!1,this.walletMessageManager,this.internalEventEmitter)}async clearPermissionToken(e){return await this.ensureInitialized(),await c({method:m.waap_clearPermissionToken,params:[e]},!1,this.walletMessageManager,this.internalEventEmitter)}async requestSBT(e){return await this.ensureInitialized(),c({method:m.silk_requestSbt,params:[e]},!0,this.walletMessageManager,this.internalEventEmitter)}async getLinkedAddresses(){return await this.walletMessageManager.pingIframe(),(await c({method:m.waap_getLinkedAddresses,params:[]},!1,this.walletMessageManager,this.internalEventEmitter,D)).addresses}async linkAddress(e){if(typeof window>`u`)throw Error(`linkAddress requires a browser environment`);this.walletConnectProvider||await this.initializeWalletConnect(),g.isConnected()||(await this.walletConnectProvider.open({view:`Connect`}),await g.listenToAccountChangeEvent());let t=g.getWalletProvider();if(!t)throw Error(`No wallet provider available after connection`);let n=(await t.request({method:`eth_accounts`}))[0];if(!n||n.toLowerCase()!==e.toLowerCase())throw Error(`Connected wallet account ${n??`(none)`} does not match requested address ${e}`);await this.walletMessageManager.pingIframe();let r=await c({method:m.waap_getLinkAddressNonce,params:[]},!1,this.walletMessageManager,this.internalEventEmitter,D),i=O({domain:window.location.host,address:e,uri:window.location.origin,nonce:r.nonce,issuedAt:new Date().toISOString()}),a=await t.request({method:`personal_sign`,params:[i,e]});return(await c({method:m.waap_linkAddress,params:[{message:i,signature:a}]},!1,this.walletMessageManager,this.internalEventEmitter,D)).addresses}async unlinkAddress(e){return await this.walletMessageManager.pingIframe(),(await c({method:m.waap_unlinkAddress,params:[{address:e}]},!1,this.walletMessageManager,this.internalEventEmitter,D)).addresses}};const D={timeoutMs:10*6e4};function O(e){let t=v(e.address);return`${`${e.domain} wants you to sign in with your Ethereum account:\n${t}`}\n\nLink this wallet to your Human Wallet account.\n\n${[`URI: ${e.uri}`,`Version: 1`,`Chain ID: 1`,`Nonce: ${e.nonce}`,`Issued At: ${e.issuedAt}`].join(`
2
+ `)}`}const k=(e,t,n=!0,i=[`evm`],a=!0)=>{let{referralCode:c,config:u,project:f,asyncTxs:m,asyncSigning:h,deferIframe:_}=e,v=p(e),y=!!h&&!m;e.walletConnectProjectId&&g.setProjectId(e.walletConnectProjectId),h&&!m&&console.warn("[WaaP SDK] `asyncSigning` is deprecated. Use `asyncTxs` instead.");let b=typeof window>`u`||typeof document>`u`,x=()=>typeof window>`u`||typeof document>`u`?null:(o(e),s(t).contentWindow),S=_===!1&&!b,C=_===void 0&&!b,w=S?x():null;if(S&&!w)throw Error(`WaaP iframe does not exist on page`);let T=new E(w,c,u||{},f||{},v,m||h||!1,y,S?void 0:x,i);if(T.setAccountMode(t),T.setExposeOnWindow(a),!b&&n&&S&&T.initializeIframeContext().catch(()=>void 0),T.uiMessageManager.on(`show_modal`,()=>{l()}),T.uiMessageManager.on(`hide_modal`,()=>{r()}),!b&&a&&(window.silk=T,window.waap=T),n&&C){let e=d(T),t=T.destroy.bind(T);T.destroy=()=>{e(),t()}}return T},A=(e={})=>k(e,`tap`);export{S as i,k as n,E as r,A as t};
@@ -0,0 +1,2 @@
1
+ const e=require("./UIMessageManager-CPw6PggC.js"),t=require("./WalletConnect-B21f4Vvh.js");let n=require("events"),r=require("ethers");const i=e=>typeof e==`object`&&!!e&&e.isComplete===!1&&typeof e.authUrl==`string`;function a(e){return!(!e?.isMetaMask||e.isApexWallet||e.isAvalanche||e.isBitKeep||e.isBlockWallet||e.isMathWallet||e.isOkxWallet||e.isOKExWallet||e.isOneInchIOSWallet||e.isOneInchAndroidWallet||e.isOpera||e.isPortal||e.isRabby||e.isDefiant||e.isTokenPocket||e.isTokenary||e.isZerion)}function o(e){try{if(!e||!Array.isArray(e))return!1;let t=JSON.parse(typeof e[1]==`string`?e[1]:JSON.stringify(e[1]));return t.primaryType===`SafeTx`&&t.domain?.verifyingContract!==void 0&&t.message&&`to`in t.message&&`value`in t.message&&`safeTxGas`in t.message&&`baseGas`in t.message&&`gasPrice`in t.message&&`nonce`in t.message}catch{return!1}}const s={styles:{darkMode:!1}},c=[`waap`,`human`,`injected`,`walletconnect`],l=[e.C.eth_sendTransaction,e.C.eth_signTransaction,e.C.eth_signTypedData_v4,e.C.personal_sign];function u(e){if(e==null)return null;if(typeof e==`string`){if(c.includes(e))return e;throw Error(`[EthereumProvider] Unexpected login method: "${e}". Expected one of: ${c.join(`, `)}`)}if(typeof e==`object`&&`loginMethod`in e&&typeof e.loginMethod==`string`){let t=e.loginMethod;if(console.warn(`[EthereumProvider] Received object login response. Normalizing "${t}" to string. This is unexpected for the web SDK.`),c.includes(t))return t;throw Error(`[EthereumProvider] Unknown loginMethod in object: "${t}". Expected one of: ${c.join(`, `)}`)}throw Error(`[EthereumProvider] Unexpected login response: ${JSON.stringify(e)} (type: ${typeof e})`)}var d=class extends n.EventEmitter{setExposeOnWindow(e){this.exposeOnWindow=e}constructor(t,r,i,a,o,c=!1,l=!1,u,d=[`evm`]){super(),this.lastKnownConversion=`pending`,this.isSilk=!0,this.isWaaP=!0,this.connected=!1,this.exposeOnWindow=!0,this.currentAccount=null,this.accountMode=`tap`,this.walletConnectProvider=null,this.asyncTxs=!1,this.legacyAsyncSigning=!1,this.internalEventEmitter=new n.EventEmitter,this.iframeMounted=!0,this.initializerPromise=null,this.sessionProbe=null,this.initializedIframeWindow=null,this.waapRestoreRetryAt=0,this.asyncTxs=c,this.legacyAsyncSigning=l,this.ensureIframe=u,this.iframeMounted=!u,this.referralCode=r,this.project=a,this.customConfig=i,this.initializerChains=d,this.uiMessageManager=new e.t,this.walletMessageManager=new e.d(t,o),this.config={...s,...i||{}},this.persistedMethods={login:this.login.bind(this),logout:this.logout.bind(this),getLoginMethod:this.getLoginMethod.bind(this),walletMessageManager:this.walletMessageManager,internalEventEmitter:this.internalEventEmitter,uiMessageManager:this.uiMessageManager,portal:this.portal.bind(this),requestEmail:this.requestEmail.bind(this),requestSBT:this.requestSBT.bind(this),requestPermissionToken:this.requestPermissionToken.bind(this),getLinkedAddresses:this.getLinkedAddresses.bind(this),linkAddress:this.linkAddress.bind(this),unlinkAddress:this.unlinkAddress.bind(this),orcid:this.orcid.bind(this),enable:this.enable.bind(this),isConnected:this.isConnected.bind(this),toggleDarkMode:this.toggleDarkMode.bind(this),destroy:this.destroy.bind(this),silkRequest:this.request.bind(this),waaPRequest:this.request.bind(this)},this.walletMessageManager.addListener({onReceiveConnectNotif:()=>{this.connected=!0,this.emit(`connect`)},handleResponse:e=>this.internalEventEmitter.emit(e.id,e),handleRequest:t=>{t.method===e.w.show_modal?this.uiMessageManager.emit(`show_modal`):t.method===e.w.hide_modal&&this.uiMessageManager.emit(`hide_modal`)},onAccountChanged:e=>{this.currentAccount!==e&&(this.currentAccount=e,this.emit(`accountsChanged`,e?[e]:[]))},onAsyncTxNotification:e=>{this.emit(e.type,e.payload)},onSquidLifecycleNotification:e=>{this.emit(e.type,e.payload)}})}async initializeWalletConnect(){try{this.walletConnectProvider=await t.t.getInstance()}catch(e){console.error(`Failed to initialize WalletConnect provider:`,e),this.walletConnectProvider=null}}async initializeIframeContext(){let t=this.walletMessageManager.getIframeWindow();if(!t)throw Error(`WaaP iframe is not mounted`);if(this.initializedIframeWindow===t&&this.initializerPromise)return this.initializerPromise;this.initializedIframeWindow=t,this.initializerPromise=e.m(t,async()=>{await this.walletMessageManager.pingIframe(),await e.i({method:e.w.set_signing_mode,params:[e.f(this.accountMode,{referralCode:this.referralCode,project:this.project,config:this.customConfig,chains:this.initializerChains})]},!1,this.walletMessageManager,this.internalEventEmitter)});try{await this.initializerPromise}catch(e){throw this.initializerPromise=null,this.initializedIframeWindow=null,e}}async reassertIframeAccountMode(){this.ensureIframeMounted(),await this.walletMessageManager.pingIframe(),await e.i({method:e.w.set_signing_mode,params:[e.f(this.accountMode,{referralCode:this.referralCode,project:this.project,config:this.customConfig,chains:this.initializerChains})]},!1,this.walletMessageManager,this.internalEventEmitter)}ensureIframeMounted(){if(this.iframeMounted||!this.ensureIframe)return;let e=this.ensureIframe();e&&(this.iframeMounted=!0,this.walletMessageManager.setIframeWindow(e))}async ensureInitialized(){this.ensureIframeMounted(),await this.initializeIframeContext()}async preload(){await this.ensureInitialized()}async enable(){return this.request({method:`eth_requestAccounts`})}isConnected(){return this.connected}getAccountStatus(){let e=this.getLoginMethod();return{authenticated:e!==null,loginMethod:e,activeMode:e?this.accountMode:null,mode:this.accountMode,conversion:e?this.lastKnownConversion:`not_required`,tap:null,squid:null,accounts:this.currentAccount?{evm:this.currentAccount}:{}}}get session(){return{login:e=>this.login(e),logout:async()=>{await this.logout()},getLoginMethod:()=>this.getLoginMethod(),getAccountStatus:()=>this.getCanonicalAccountStatus()}}async getCanonicalAccountStatus(){await this.ensureInitialized();let t=await e.i({method:e.w.waap_getAccountStatus,params:[]},!1,this.walletMessageManager,this.internalEventEmitter);return t?.conversion&&(this.lastKnownConversion=t.conversion),t}setAccountMode(e){this.accountMode=e,this.initializerPromise=null,this.initializedIframeWindow=null}async request(t){if(!Object.keys(e.C).includes(t.method))return Promise.reject({error:`Not implemented (${t.method})`});let n=await this.attemptAutoConnect(t.method);if(n!==null)return n;if(l.includes(t.method)&&!(this.getLoginMethod()!==null||await this.restorePersistedWaaPSession()!==null))return Promise.reject(new e.x(`not_authenticated`,`Not authenticated: call login() before signing.`,{operation:{chain:`evm`,method:t.method}}));if(o(t.params)&&t.method!==e.C.eth_signTypedData_v4)return Promise.reject({error:`Safe transactions must be signed using eth_signTypedData_v4`});await this.ensureInitialized();let r=(t.method===e.C.eth_sendTransaction||t.method===e.C.eth_signTransaction||t.method===e.C.eth_signTypedData_v4||t.method===e.C.personal_sign)&&this.asyncTxs||t.async,i=r||t.withPT||t.timeoutMs!==void 0||t.signal?this.legacyAsyncSigning?{asyncSigning:r||void 0,withPT:t.withPT,timeoutMs:t.timeoutMs,signal:t.signal}:{async:r,withPT:t.withPT,timeoutMs:t.timeoutMs,signal:t.signal}:void 0,a=await e.i(t,e.a(t.method),this.walletMessageManager,this.internalEventEmitter,i);if((t.method===e.C.wallet_switchEthereumChain||t.method===e.C.wallet_addEthereumChain)&&a===null){this.emit(`chainChanged`,t.params?.[0]?.chainId);try{let e=await this.request({method:`eth_accounts`});e&&e.length>0&&(this.currentAccount=e[0],this.emit(`accountsChanged`,e),this.emit(`connect`,{chainId:t.params?.[0]?.chainId}))}catch(e){console.warn(`[EthereumProvider] Failed to get accounts after chain switch:`,e),this.currentAccount&&(this.emit(`accountsChanged`,[this.currentAccount]),this.emit(`connect`,{chainId:t.params?.[0]?.chainId}))}}return t.method===e.C.eth_requestAccounts&&Array.isArray(a)&&typeof a[0]==`string`&&(this.currentAccount=a[0],this.connected=!0,typeof window<`u`&&typeof localStorage<`u`&&localStorage.setItem(`${window.location.origin}-connected`,`waap`),this.emit(`accountsChanged`,a),this.emit(`connect`)),a}async login(e){let t=await this.loginWithNativeHandoff(e);if(i(t))throw Error(`[WaaP SDK] The wallet returned a native auth hand-off. Use loginWithNativeHandoff() from a native host.`);return t}async loginWithNativeHandoff(n){if(this.waapRestoreRetryAt=0,typeof window>`u`||typeof document>`u`)return null;let r=n&&!(`request`in n)?n:void 0,o=r?r.customProvider:n;if(await this.ensureInitialized(),!r?.force&&await this.restorePersistedWaaPSession())return this.getLoginMethod()??`waap`;let s=o||window.ethereum,c=s&&a(s)?`MetaMask`:`Browser Wallet`,l=await e.i({method:e.w.login,params:[c]},!0,this.walletMessageManager,this.internalEventEmitter);if(i(l))return l;let d=u(l);if(d===null)return null;switch(d){case`waap`:case`human`:localStorage.setItem(`${window.location.origin}-connected`,`waap`),this.setupWaaP();break;case`injected`:s&&(localStorage.setItem(`${window.location.origin}-connected`,`injected`),this.setupInjectedWallet(s));break;case`walletconnect`:{localStorage.setItem(`${window.location.origin}-connected`,`walletconnect`),this.walletConnectProvider||await this.initializeWalletConnect(),t.t.isConnected()||(await this.walletConnectProvider.open({view:`Connect`}),await t.t.listenToAccountChangeEvent());let e=t.t.getWalletProvider();this.setupWalletConnect(e);break}}return d}async logout(){await this.ensureInitialized(),this.cleanupInvalidLoginState(),this.waapRestoreRetryAt=0,this.lastKnownConversion=`pending`,this.currentAccount=null,this.connected=!1,this.emit(`accountsChanged`,[]),this.emit(`disconnect`);try{this.walletConnectProvider&&await this.walletConnectProvider.disconnect()}catch(e){console.error(`Error disconnecting from WalletConnect:`,e)}return e.i({method:e.w.logout},!1,this.walletMessageManager,this.internalEventEmitter)}destroy(){if(this.walletMessageManager.dispose(),this.internalEventEmitter.removeAllListeners(),this.uiMessageManager.removeAllListeners(),this.removeAllListeners(),this.connected=!1,this.walletConnectProvider&&=(this.walletConnectProvider.disconnect().catch(()=>void 0),null),typeof window<`u`){let e=window;(e.silk===this||e.silk?.walletMessageManager===this.walletMessageManager)&&delete e.silk,(e.waap===this||e.waap?.walletMessageManager===this.walletMessageManager)&&delete e.waap}e._()}cleanupInvalidLoginState(){try{localStorage.removeItem(`${window.location.origin}-connected`)}catch(e){console.warn(`Could not clean up login state:`,e)}}setupWaaP(){if(!this.exposeOnWindow)return;let e={...this.persistedMethods,isWaaP:!0,on:this.on.bind(this),removeListener:this.removeListener.bind(this),request:this.request.bind(this)};window.silk=e,window.waap=e}setupInjectedWallet(e){if(!this.exposeOnWindow)return;let t={...this.persistedMethods,...e,isSilk:!0,connected:e.connected??!1,on:e.on?.bind(e)??(()=>{}),removeListener:e.removeListener?.bind(e)??(()=>{}),request:e.request.bind(e)};window.silk=t,window.waap=t}setupWalletConnect(e){if(!this.exposeOnWindow)return;let t={...this.persistedMethods,...e,isSilk:!0,connected:!0,on:e.on?.bind(e)??(()=>{}),removeListener:e.removeListener?.bind(e)??(()=>{}),request:e.request.bind(e)};window.silk=t,window.waap=t}setupAutoConnectInjected(e){if(!this.exposeOnWindow)return;let t={...this.persistedMethods,...e,isSilk:!1,connected:e.isConnected?.()??!1,on:e.on?.bind(e)??(()=>{}),removeListener:e.removeListener?.bind(e)??(()=>{}),request:e.request.bind(e)};window.silk=t,window.waap=t}setupAutoConnectWalletConnect(e){if(!this.exposeOnWindow)return;let t={...this.persistedMethods,...e,isSilk:!1,connected:!0,on:e.on?.bind(e)??(()=>{}),removeListener:e.removeListener?.bind(e)??(()=>{}),request:e.request.bind(e)};window.silk=t,window.waap=t}async attemptAutoConnect(e){if(e!==`eth_requestAccounts`&&e!==`eth_accounts`)return null;let n=this.getLoginMethod();if(n===`waap`||n===`human`||n===null&&e===`eth_accounts`&&Date.now()>=this.waapRestoreRetryAt){let e=await this.restorePersistedWaaPSession();if(e)return e;n===null&&(this.waapRestoreRetryAt=Date.now()+5e3)}if(n===`injected`&&window.ethereum)try{return this.setupAutoConnectInjected(window.ethereum),window.ethereum.request({method:`eth_requestAccounts`})}catch(e){return console.warn(`Injected wallet auto-connect failed:`,e),this.cleanupInvalidLoginState(),null}else if(n===`walletconnect`)try{if(this.walletConnectProvider||=await t.t.getInstance(),await t.t.waitForReadyAndCheckConnection()){let e=t.t.getWalletProvider();return this.setupAutoConnectWalletConnect(e),e.request({method:`eth_requestAccounts`})}else return this.cleanupInvalidLoginState(),null}catch(e){return console.warn(`WalletConnect auto-connect failed:`,e),this.cleanupInvalidLoginState(),null}return null}restorePersistedWaaPSession(){return this.sessionProbe??=this.probeWaaPSession().finally(()=>{this.sessionProbe=null}),this.sessionProbe}async probeWaaPSession(){try{if(await this.ensureInitialized(),!(await this.getCanonicalAccountStatus()).authenticated)return this.cleanupInvalidLoginState(),null;let t=await e.i({method:e.w.auto_conn,params:[window.location.origin]},!1,this.walletMessageManager,this.internalEventEmitter);if(Array.isArray(t)&&t.length>0)return this.currentAccount=t[0],this.connected=!0,localStorage.setItem(`${window.location.origin}-connected`,`waap`),this.setupWaaP(),t}catch(e){console.warn(`WaaP session probe failed:`,e)}return this.cleanupInvalidLoginState(),null}getLoginMethod(){if(typeof window>`u`||typeof localStorage>`u`)return null;try{let e=localStorage.getItem(`${window.location.origin}-connected`);if(!e)return null;if(![`waap`,`human`,`injected`,`walletconnect`].includes(e))return this.cleanupInvalidLoginState(),null;switch(e){case`injected`:return window.ethereum?`injected`:(this.cleanupInvalidLoginState(),null);case`walletconnect`:try{return t.t.isConnected()?`walletconnect`:(this.cleanupInvalidLoginState(),null)}catch{return this.cleanupInvalidLoginState(),null}case`waap`:return`waap`;case`human`:return`human`;default:return this.cleanupInvalidLoginState(),null}}catch(e){return console.warn(`Error checking login method:`,e),this.cleanupInvalidLoginState(),null}}async toggleDarkMode(){this.config.styles.darkMode=!this.config.styles.darkMode,await this.ensureInitialized();try{await e.i({method:e.w.set_custom_config,params:[this.config]},!1,this.walletMessageManager,this.internalEventEmitter)}catch(e){console.error(`Error setting custom config in Silk iframe:`,e)}}async safe(){await this.ensureInitialized(),await e.i({method:e.w.safe},!0,this.walletMessageManager,this.internalEventEmitter)}async orcid(){await this.ensureInitialized(),await e.i({method:e.w.orcid},!0,this.walletMessageManager,this.internalEventEmitter)}async portal(t,n,r){await this.ensureInitialized();let i;switch(n){case`get`:i=t===`gastank`?e.w.gastank_get_settings:e.w.customization_get;break;case`update`:i=t===`gastank`?e.w.gastank_update_settings:e.w.customization_update;break;case`topup`:i=e.w.gastank_topup;break;case`init`:i=e.w.project_init;break}let a=n!==`get`&&t!==`customization`;return e.i({method:i,params:[r,window.location.origin]},a,this.walletMessageManager,this.internalEventEmitter)}async requestEmail(){return await this.ensureInitialized(),e.i({method:e.w.silk_requestEmail},!0,this.walletMessageManager,this.internalEventEmitter)}async requestPermissionToken(t){await this.ensureInitialized();let n={...t,walletMode:this.accountMode};return e.i({method:e.w.waap_requestPermissionToken,params:[n]},!0,this.walletMessageManager,this.internalEventEmitter)}async getPermissionTokenStatus(t){return await this.ensureInitialized(),await e.i({method:e.w.waap_getPermissionTokenStatus,params:[t]},!1,this.walletMessageManager,this.internalEventEmitter)}async clearPermissionToken(t){return await this.ensureInitialized(),await e.i({method:e.w.waap_clearPermissionToken,params:[t]},!1,this.walletMessageManager,this.internalEventEmitter)}async requestSBT(t){return await this.ensureInitialized(),e.i({method:e.w.silk_requestSbt,params:[t]},!0,this.walletMessageManager,this.internalEventEmitter)}async getLinkedAddresses(){return await this.walletMessageManager.pingIframe(),(await e.i({method:e.w.waap_getLinkedAddresses,params:[]},!1,this.walletMessageManager,this.internalEventEmitter,f)).addresses}async linkAddress(n){if(typeof window>`u`)throw Error(`linkAddress requires a browser environment`);this.walletConnectProvider||await this.initializeWalletConnect(),t.t.isConnected()||(await this.walletConnectProvider.open({view:`Connect`}),await t.t.listenToAccountChangeEvent());let r=t.t.getWalletProvider();if(!r)throw Error(`No wallet provider available after connection`);let i=(await r.request({method:`eth_accounts`}))[0];if(!i||i.toLowerCase()!==n.toLowerCase())throw Error(`Connected wallet account ${i??`(none)`} does not match requested address ${n}`);await this.walletMessageManager.pingIframe();let a=await e.i({method:e.w.waap_getLinkAddressNonce,params:[]},!1,this.walletMessageManager,this.internalEventEmitter,f),o=p({domain:window.location.host,address:n,uri:window.location.origin,nonce:a.nonce,issuedAt:new Date().toISOString()}),s=await r.request({method:`personal_sign`,params:[o,n]});return(await e.i({method:e.w.waap_linkAddress,params:[{message:o,signature:s}]},!1,this.walletMessageManager,this.internalEventEmitter,f)).addresses}async unlinkAddress(t){return await this.walletMessageManager.pingIframe(),(await e.i({method:e.w.waap_unlinkAddress,params:[{address:t}]},!1,this.walletMessageManager,this.internalEventEmitter,f)).addresses}};const f={timeoutMs:10*6e4};function p(e){let t=(0,r.getAddress)(e.address);return`${`${e.domain} wants you to sign in with your Ethereum account:\n${t}`}\n\nLink this wallet to your Human Wallet account.\n\n${[`URI: ${e.uri}`,`Version: 1`,`Chain ID: 1`,`Nonce: ${e.nonce}`,`Issued At: ${e.issuedAt}`].join(`
2
+ `)}`}const m=(n,r,i=!0,a=[`evm`],o=!0)=>{let{referralCode:s,config:c,project:l,asyncTxs:u,asyncSigning:f,deferIframe:p}=n,m=e.v(n),h=!!f&&!u;n.walletConnectProjectId&&t.t.setProjectId(n.walletConnectProjectId),f&&!u&&console.warn("[WaaP SDK] `asyncSigning` is deprecated. Use `asyncTxs` instead.");let g=typeof window>`u`||typeof document>`u`,_=()=>typeof window>`u`||typeof document>`u`?null:(e.g(n),e.h(r).contentWindow),v=p===!1&&!g,y=p===void 0&&!g,b=v?_():null;if(v&&!b)throw Error(`WaaP iframe does not exist on page`);let x=new d(b,s,c||{},l||{},m,u||f||!1,h,v?void 0:_,a);if(x.setAccountMode(r),x.setExposeOnWindow(o),!g&&i&&v&&x.initializeIframeContext().catch(()=>void 0),x.uiMessageManager.on(`show_modal`,()=>{e.l()}),x.uiMessageManager.on(`hide_modal`,()=>{e.c()}),!g&&o&&(window.silk=x,window.waap=x),i&&y){let t=e.r(x),n=x.destroy.bind(x);x.destroy=()=>{t(),n()}}return x},h=(e={})=>m(e,`tap`);Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
package/dist/evm.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { I as WaaPSessionProtection, _ as resolveWalletOrigin, a as PermissionTokenClearResult, d as WaaPAccountMode, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, h as WaaPEnvironment, l as SilkEthereumProviderInterface, n as InitSilkOptions, o as PermissionTokenQuery, p as WaaPLoginOptions, s as PermissionTokenStatus, u as SilkProvider, v as validateWalletOrigin } from "./types-x7TOncUp.mjs";
2
- import { a as subscribeWaaPIframeLifecycle, i as getWaaPIframeDiagnostics, n as WaaPIframeLifecycleEvent, r as WaaPIframeLifecyclePhase, t as WaaPIframeDiagnostics } from "./WalletModalController-wIHBGOVd.mjs";
3
- import { a as CancelWaaPPreload, c as preloadWaaPOnIdle, i as normalizeWaaPError, n as WaaPErrorCode, o as WaaPIdlePreloadOptions, r as WaaPOperationMetadata, s as WaaPPreloadTarget, t as WaaPError } from "./WaaPError-BuwfZjBk.mjs";
1
+ import { I as WaaPSessionProtection, _ as resolveWalletOrigin, a as PermissionTokenClearResult, d as WaaPAccountMode, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, h as WaaPEnvironment, l as SilkEthereumProviderInterface, n as InitSilkOptions, o as PermissionTokenQuery, p as WaaPLoginOptions, s as PermissionTokenStatus, u as SilkProvider, v as validateWalletOrigin } from "./types-Cc6tc4ut.mjs";
2
+ import { a as subscribeWaaPIframeLifecycle, i as getWaaPIframeDiagnostics, n as WaaPIframeLifecycleEvent, r as WaaPIframeLifecyclePhase, t as WaaPIframeDiagnostics } from "./WalletModalController-DxiBiqDf.mjs";
3
+ import { a as CancelWaaPPreload, c as preloadWaaPOnIdle, i as normalizeWaaPError, n as WaaPErrorCode, o as WaaPIdlePreloadOptions, r as WaaPOperationMetadata, s as WaaPPreloadTarget, t as WaaPError } from "./WaaPError-C2TOEGPx.mjs";
4
4
  //#region src/ui/evm.d.ts
5
5
  /** Initialize the TAP t1 EVM EIP-1193 provider. */
6
6
  declare const initWaaP: (params?: InitSilkOptions) => SilkEthereumProviderInterface;
package/dist/evm.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { I as WaaPSessionProtection, _ as resolveWalletOrigin, a as PermissionTokenClearResult, d as WaaPAccountMode, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, h as WaaPEnvironment, l as SilkEthereumProviderInterface, n as InitSilkOptions, o as PermissionTokenQuery, p as WaaPLoginOptions, s as PermissionTokenStatus, u as SilkProvider, v as validateWalletOrigin } from "./types-x7TOncUp.js";
2
- import { a as subscribeWaaPIframeLifecycle, i as getWaaPIframeDiagnostics, n as WaaPIframeLifecycleEvent, r as WaaPIframeLifecyclePhase, t as WaaPIframeDiagnostics } from "./WalletModalController-Qh9LNwW5.js";
3
- import { a as CancelWaaPPreload, c as preloadWaaPOnIdle, i as normalizeWaaPError, n as WaaPErrorCode, o as WaaPIdlePreloadOptions, r as WaaPOperationMetadata, s as WaaPPreloadTarget, t as WaaPError } from "./WaaPError-BuwfZjBk.js";
1
+ import { I as WaaPSessionProtection, _ as resolveWalletOrigin, a as PermissionTokenClearResult, d as WaaPAccountMode, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, h as WaaPEnvironment, l as SilkEthereumProviderInterface, n as InitSilkOptions, o as PermissionTokenQuery, p as WaaPLoginOptions, s as PermissionTokenStatus, u as SilkProvider, v as validateWalletOrigin } from "./types-Cc6tc4ut.js";
2
+ import { a as subscribeWaaPIframeLifecycle, i as getWaaPIframeDiagnostics, n as WaaPIframeLifecycleEvent, r as WaaPIframeLifecyclePhase, t as WaaPIframeDiagnostics } from "./WalletModalController-16mHsFv2.js";
3
+ import { a as CancelWaaPPreload, c as preloadWaaPOnIdle, i as normalizeWaaPError, n as WaaPErrorCode, o as WaaPIdlePreloadOptions, r as WaaPOperationMetadata, s as WaaPPreloadTarget, t as WaaPError } from "./WaaPError-C2TOEGPx.js";
4
4
  //#region src/ui/evm.d.ts
5
5
  /** Initialize the TAP t1 EVM EIP-1193 provider. */
6
6
  declare const initWaaP: (params?: InitSilkOptions) => SilkEthereumProviderInterface;
package/dist/evm.js CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./evm-64xq-c4L.js");exports.WaaPError=e.T,exports.getWaaPIframeDiagnostics=e.d,exports.initWaaP=e.t,exports.normalizeWaaPError=e.E,exports.preloadWaaPOnIdle=e.s,exports.resolveWalletOrigin=e.S,exports.subscribeWaaPIframeLifecycle=e.m,exports.validateWalletOrigin=e.C;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./UIMessageManager-CPw6PggC.js"),t=require("./evm-_ReyhrCP.js");exports.WaaPError=e.x,exports.getWaaPIframeDiagnostics=e.s,exports.initWaaP=t.t,exports.normalizeWaaPError=e.S,exports.preloadWaaPOnIdle=e.r,exports.resolveWalletOrigin=e.v,exports.subscribeWaaPIframeLifecycle=e.u,exports.validateWalletOrigin=e.y;
package/dist/evm.mjs CHANGED
@@ -1 +1 @@
1
- import{C as e,E as t,S as n,T as r,d as i,m as a,s as o,t as s}from"./evm-ChOfSh-X.mjs";export{r as WaaPError,i as getWaaPIframeDiagnostics,s as initWaaP,t as normalizeWaaPError,o as preloadWaaPOnIdle,n as resolveWalletOrigin,a as subscribeWaaPIframeLifecycle,e as validateWalletOrigin};
1
+ import{S as e,r as t,s as n,u as r,v as i,x as a,y as o}from"./UIMessageManager-D3VN9vM8.mjs";import{t as s}from"./evm-BbSgL_Hv.mjs";export{a as WaaPError,n as getWaaPIframeDiagnostics,s as initWaaP,e as normalizeWaaPError,t as preloadWaaPOnIdle,i as resolveWalletOrigin,r as subscribeWaaPIframeLifecycle,o as validateWalletOrigin};
@@ -1,5 +1,6 @@
1
- import { E as RequestPermissionTokenResult, T as RequestPermissionTokenParams, a as PermissionTokenClearResult, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, l as SilkEthereumProviderInterface, m as WaaPSessionExtension, n as InitSilkOptions, o as PermissionTokenQuery, r as LoginResponse, s as PermissionTokenStatus, w as ProjectConfig, x as CustomConfig, y as AuthenticationMethod } from "./types-x7TOncUp.mjs";
2
- import { t as InitWaaPSolanaOptions, y as WaaPSolanaProviderInterface } from "./types-Bfz205sD.mjs";
1
+ import { E as RequestPermissionTokenResult, T as RequestPermissionTokenParams, a as PermissionTokenClearResult, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, l as SilkEthereumProviderInterface, m as WaaPSessionExtension, n as InitSilkOptions, o as PermissionTokenQuery, r as LoginResponse, s as PermissionTokenStatus, w as ProjectConfig, x as CustomConfig, y as AuthenticationMethod } from "./types-Cc6tc4ut.mjs";
2
+ import { t as InitWaaPSolanaOptions, y as WaaPSolanaProviderInterface } from "./types-C7JDjWnt.mjs";
3
+ import { s as WaaPStellarProviderInterface, t as InitWaaPStellarOptions } from "./types-Bai14yLc.mjs";
3
4
  //#region src/lib/sui/types.d.ts
4
5
  /**
5
6
  * Sui chain identifiers.
@@ -345,7 +346,7 @@ interface InitWaaPSuiOptions extends WaaPWalletTargetOptions {
345
346
  //#endregion
346
347
  //#region src/ui/index.d.ts
347
348
  /** Chain selected by a direct WaaP initializer. */
348
- type WaaPChain = 'evm' | 'sui' | 'solana';
349
+ type WaaPChain = 'evm' | 'sui' | 'solana' | 'stellar';
349
350
  /**
350
351
  * Options for the direct WaaP initializers.
351
352
  *
@@ -372,23 +373,31 @@ type LegacyInitWaaPSuiOptions = Omit<InitWaaPOptions, 'chain' | 'config'> & {
372
373
  chain: 'sui';
373
374
  config?: InitWaaPSuiOptions['config'];
374
375
  };
375
- type LegacyInitWaaPSolanaOptions = InitWaaPOptions & {
376
+ type LegacyInitWaaPSolanaOptions = InitWaaPOptions & Pick<InitWaaPSolanaOptions, 'defaultChain'> & {
376
377
  chain: 'solana';
377
378
  };
379
+ type LegacyInitWaaPStellarOptions = Omit<InitWaaPOptions, 'chain'> & {
380
+ chain: 'stellar';
381
+ /** Defaults to pubnet; testnet is opt-in. */
382
+ network?: InitWaaPStellarOptions['network'];
383
+ };
378
384
  /**
379
385
  * Initialize the TAP wallet.
380
386
  *
381
387
  * Existing `initWaaP(options)` calls retain their EVM provider behavior. Use
382
388
  * `chain: 'sui'` or `chain: 'solana'` to select a direct Wallet Standard
383
- * facade. Use `initWaaPMulti({ chains })` for a shared multichain wallet.
389
+ * facade, or `chain: 'stellar'` for the SEP-43 module interface — Stellar has
390
+ * no Wallet Standard registration because SEP-43 is not one. Use
391
+ * `initWaaPMulti({ chains })` for a shared multichain wallet.
384
392
  */
385
393
  declare function initWaaP(options?: LegacyInitWaaPEvmOptions): SilkEthereumProviderInterface;
386
394
  declare function initWaaP(options: LegacyInitWaaPSuiOptions): WaaPSuiWalletInterface;
387
395
  declare function initWaaP(options: LegacyInitWaaPSolanaOptions): WaaPSolanaProviderInterface;
396
+ declare function initWaaP(options: LegacyInitWaaPStellarOptions): WaaPStellarProviderInterface;
388
397
  /** Accepts a runtime-selected chain when callers cannot preserve a literal. */
389
398
  declare function initWaaP(options: InitWaaPOptions & {
390
399
  chain?: WaaPChain;
391
- }): SilkEthereumProviderInterface | WaaPSuiWalletInterface | WaaPSolanaProviderInterface;
400
+ }): SilkEthereumProviderInterface | WaaPSuiWalletInterface | WaaPSolanaProviderInterface | WaaPStellarProviderInterface;
392
401
  /**
393
402
  * Options for the multichain `initWaaPSquid` entry point.
394
403
  *
@@ -436,9 +445,18 @@ interface WaaPSquidStatus {
436
445
  * surface, while `initWaaP({ chain: 'sui' })` remains the best choice for a
437
446
  * single-chain integration.
438
447
  */
448
+ /**
449
+ * Chains the multichain initializer can share one iframe between.
450
+ *
451
+ * Stellar is deliberately absent. It has no Squid account — the shared dWallet
452
+ * has no funded Stellar account to send from — so a facade here would be one
453
+ * the multichain surface cannot actually complete an operation on. Reach it
454
+ * with `initWaaP({ chain: 'stellar' })`, which is TAP-only by construction.
455
+ */
456
+ type WaaPMultiChain = WaaPSquidChain;
439
457
  interface InitWaaPMultiOptions extends InitWaaPOptions {
440
458
  /** Chain facades to expose from one shared wallet iframe. */
441
- chains: readonly WaaPChain[];
459
+ chains: readonly WaaPMultiChain[];
442
460
  }
443
461
  /** @deprecated Use `InitWaaPMultiOptions`. */
444
462
  type InitWaaPTapOptions = InitWaaPMultiOptions;
@@ -479,7 +497,7 @@ interface WaaPTapSession extends WaaPSessionExtension {
479
497
  * the session consumed by EVM, Sui, and Solana. TAP does not have a separate
480
498
  * provisioning step; connect and sign through the requested native facade.
481
499
  */
482
- type WaaPTap<Chains extends readonly WaaPChain[] = typeof ALL_TAP_CHAINS> = {
500
+ type WaaPTap<Chains extends readonly WaaPMultiChain[] = typeof ALL_TAP_CHAINS> = {
483
501
  /** Combined public-safe local status for the shared TAP initializer. */
484
502
  getAccountStatus: () => WaaPAccountStatus;
485
503
  /** Shared canonical authentication, status, and lifecycle event surface. */
@@ -585,7 +603,7 @@ declare function initWaaPSquid<const Chains extends readonly [WaaPSquidChain, ..
585
603
  * const { accounts } = await waap.sui.connect()
586
604
  * ```
587
605
  */
588
- declare function initWaaPMulti<const Chains extends readonly WaaPChain[]>(options: InitWaaPMultiOptions & {
606
+ declare function initWaaPMulti<const Chains extends readonly WaaPMultiChain[]>(options: InitWaaPMultiOptions & {
589
607
  chains: Chains;
590
608
  }): WaaPTap<Chains>;
591
609
  /**
@@ -602,9 +620,9 @@ declare function initWaaPSui(options?: InitWaaPSuiOptions): WaaPSuiWalletInterfa
602
620
  */
603
621
  declare function initWaaPSolana(options?: InitWaaPSolanaOptions): WaaPSolanaProviderInterface;
604
622
  /** @deprecated Use `initWaaPMulti({ chains })` instead. */
605
- declare function initWaaPTap<const Chains extends readonly WaaPChain[]>(options: InitWaaPTapOptions & {
623
+ declare function initWaaPTap<const Chains extends readonly WaaPMultiChain[]>(options: InitWaaPTapOptions & {
606
624
  chains: Chains;
607
625
  }): WaaPTap<Chains>;
608
626
  declare function initWaaPTap(options?: Partial<InitWaaPTapOptions>): WaaPTap;
609
627
  //#endregion
610
- export { SuiSignPersonalMessageOutput as A, SuiConnectInput as C, SuiSignAndExecuteTransactionInput as D, SuiSignAndExecuteTransactionBlockOutput as E, SuiTransactionInput as F, SuiWalletEventListener as I, WaaPSuiWalletFeatures as L, SuiSignTransactionBlockOutput as M, SuiSignTransactionInput as N, SuiSignAndExecuteTransactionOutput as O, SuiSignTransactionOutput as P, WaaPSuiWalletInterface as R, SuiChain as S, SuiSignAndExecuteTransactionBlockInput as T, initWaaPSquid as _, WaaPChain as a, InitWaaPSuiOptions as b, WaaPSquidLifecycle as c, WaaPSquidStatusState as d, WaaPTap as f, initWaaPSolana as g, initWaaPMulti as h, InitWaaPTapOptions as i, SuiSignTransactionBlockInput as j, SuiSignPersonalMessageInput as k, WaaPSquidSession as l, initWaaP as m, InitWaaPOptions as n, WaaPSquid as o, WaaPTapSession as p, InitWaaPSquidOptions as r, WaaPSquidChain as s, InitWaaPMultiOptions as t, WaaPSquidStatus as u, initWaaPSui as v, SuiConnectOutput as w, SuiAccount as x, initWaaPTap as y, WalletIcon as z };
628
+ export { SuiSignPersonalMessageInput as A, WalletIcon as B, SuiChain as C, SuiSignAndExecuteTransactionBlockOutput as D, SuiSignAndExecuteTransactionBlockInput as E, SuiSignTransactionOutput as F, SuiTransactionInput as I, SuiWalletEventListener as L, SuiSignTransactionBlockInput as M, SuiSignTransactionBlockOutput as N, SuiSignAndExecuteTransactionInput as O, SuiSignTransactionInput as P, WaaPSuiWalletFeatures as R, SuiAccount as S, SuiConnectOutput as T, initWaaPSolana as _, WaaPChain as a, initWaaPTap as b, WaaPSquidChain as c, WaaPSquidStatus as d, WaaPSquidStatusState as f, initWaaPMulti as g, initWaaP as h, InitWaaPTapOptions as i, SuiSignPersonalMessageOutput as j, SuiSignAndExecuteTransactionOutput as k, WaaPSquidLifecycle as l, WaaPTapSession as m, InitWaaPOptions as n, WaaPMultiChain as o, WaaPTap as p, InitWaaPSquidOptions as r, WaaPSquid as s, InitWaaPMultiOptions as t, WaaPSquidSession as u, initWaaPSquid as v, SuiConnectInput as w, InitWaaPSuiOptions as x, initWaaPSui as y, WaaPSuiWalletInterface as z };
@@ -1,5 +1,6 @@
1
- import { E as RequestPermissionTokenResult, T as RequestPermissionTokenParams, a as PermissionTokenClearResult, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, l as SilkEthereumProviderInterface, m as WaaPSessionExtension, n as InitSilkOptions, o as PermissionTokenQuery, r as LoginResponse, s as PermissionTokenStatus, w as ProjectConfig, x as CustomConfig, y as AuthenticationMethod } from "./types-x7TOncUp.js";
2
- import { t as InitWaaPSolanaOptions, y as WaaPSolanaProviderInterface } from "./types-8CCmbLuY.js";
1
+ import { E as RequestPermissionTokenResult, T as RequestPermissionTokenParams, a as PermissionTokenClearResult, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, l as SilkEthereumProviderInterface, m as WaaPSessionExtension, n as InitSilkOptions, o as PermissionTokenQuery, r as LoginResponse, s as PermissionTokenStatus, w as ProjectConfig, x as CustomConfig, y as AuthenticationMethod } from "./types-Cc6tc4ut.js";
2
+ import { t as InitWaaPSolanaOptions, y as WaaPSolanaProviderInterface } from "./types-Bj5dDE-C.js";
3
+ import { s as WaaPStellarProviderInterface, t as InitWaaPStellarOptions } from "./types-DqdVfkaW.js";
3
4
  //#region src/lib/sui/types.d.ts
4
5
  /**
5
6
  * Sui chain identifiers.
@@ -345,7 +346,7 @@ interface InitWaaPSuiOptions extends WaaPWalletTargetOptions {
345
346
  //#endregion
346
347
  //#region src/ui/index.d.ts
347
348
  /** Chain selected by a direct WaaP initializer. */
348
- type WaaPChain = 'evm' | 'sui' | 'solana';
349
+ type WaaPChain = 'evm' | 'sui' | 'solana' | 'stellar';
349
350
  /**
350
351
  * Options for the direct WaaP initializers.
351
352
  *
@@ -372,23 +373,31 @@ type LegacyInitWaaPSuiOptions = Omit<InitWaaPOptions, 'chain' | 'config'> & {
372
373
  chain: 'sui';
373
374
  config?: InitWaaPSuiOptions['config'];
374
375
  };
375
- type LegacyInitWaaPSolanaOptions = InitWaaPOptions & {
376
+ type LegacyInitWaaPSolanaOptions = InitWaaPOptions & Pick<InitWaaPSolanaOptions, 'defaultChain'> & {
376
377
  chain: 'solana';
377
378
  };
379
+ type LegacyInitWaaPStellarOptions = Omit<InitWaaPOptions, 'chain'> & {
380
+ chain: 'stellar';
381
+ /** Defaults to pubnet; testnet is opt-in. */
382
+ network?: InitWaaPStellarOptions['network'];
383
+ };
378
384
  /**
379
385
  * Initialize the TAP wallet.
380
386
  *
381
387
  * Existing `initWaaP(options)` calls retain their EVM provider behavior. Use
382
388
  * `chain: 'sui'` or `chain: 'solana'` to select a direct Wallet Standard
383
- * facade. Use `initWaaPMulti({ chains })` for a shared multichain wallet.
389
+ * facade, or `chain: 'stellar'` for the SEP-43 module interface — Stellar has
390
+ * no Wallet Standard registration because SEP-43 is not one. Use
391
+ * `initWaaPMulti({ chains })` for a shared multichain wallet.
384
392
  */
385
393
  declare function initWaaP(options?: LegacyInitWaaPEvmOptions): SilkEthereumProviderInterface;
386
394
  declare function initWaaP(options: LegacyInitWaaPSuiOptions): WaaPSuiWalletInterface;
387
395
  declare function initWaaP(options: LegacyInitWaaPSolanaOptions): WaaPSolanaProviderInterface;
396
+ declare function initWaaP(options: LegacyInitWaaPStellarOptions): WaaPStellarProviderInterface;
388
397
  /** Accepts a runtime-selected chain when callers cannot preserve a literal. */
389
398
  declare function initWaaP(options: InitWaaPOptions & {
390
399
  chain?: WaaPChain;
391
- }): SilkEthereumProviderInterface | WaaPSuiWalletInterface | WaaPSolanaProviderInterface;
400
+ }): SilkEthereumProviderInterface | WaaPSuiWalletInterface | WaaPSolanaProviderInterface | WaaPStellarProviderInterface;
392
401
  /**
393
402
  * Options for the multichain `initWaaPSquid` entry point.
394
403
  *
@@ -436,9 +445,18 @@ interface WaaPSquidStatus {
436
445
  * surface, while `initWaaP({ chain: 'sui' })` remains the best choice for a
437
446
  * single-chain integration.
438
447
  */
448
+ /**
449
+ * Chains the multichain initializer can share one iframe between.
450
+ *
451
+ * Stellar is deliberately absent. It has no Squid account — the shared dWallet
452
+ * has no funded Stellar account to send from — so a facade here would be one
453
+ * the multichain surface cannot actually complete an operation on. Reach it
454
+ * with `initWaaP({ chain: 'stellar' })`, which is TAP-only by construction.
455
+ */
456
+ type WaaPMultiChain = WaaPSquidChain;
439
457
  interface InitWaaPMultiOptions extends InitWaaPOptions {
440
458
  /** Chain facades to expose from one shared wallet iframe. */
441
- chains: readonly WaaPChain[];
459
+ chains: readonly WaaPMultiChain[];
442
460
  }
443
461
  /** @deprecated Use `InitWaaPMultiOptions`. */
444
462
  type InitWaaPTapOptions = InitWaaPMultiOptions;
@@ -479,7 +497,7 @@ interface WaaPTapSession extends WaaPSessionExtension {
479
497
  * the session consumed by EVM, Sui, and Solana. TAP does not have a separate
480
498
  * provisioning step; connect and sign through the requested native facade.
481
499
  */
482
- type WaaPTap<Chains extends readonly WaaPChain[] = typeof ALL_TAP_CHAINS> = {
500
+ type WaaPTap<Chains extends readonly WaaPMultiChain[] = typeof ALL_TAP_CHAINS> = {
483
501
  /** Combined public-safe local status for the shared TAP initializer. */
484
502
  getAccountStatus: () => WaaPAccountStatus;
485
503
  /** Shared canonical authentication, status, and lifecycle event surface. */
@@ -585,7 +603,7 @@ declare function initWaaPSquid<const Chains extends readonly [WaaPSquidChain, ..
585
603
  * const { accounts } = await waap.sui.connect()
586
604
  * ```
587
605
  */
588
- declare function initWaaPMulti<const Chains extends readonly WaaPChain[]>(options: InitWaaPMultiOptions & {
606
+ declare function initWaaPMulti<const Chains extends readonly WaaPMultiChain[]>(options: InitWaaPMultiOptions & {
589
607
  chains: Chains;
590
608
  }): WaaPTap<Chains>;
591
609
  /**
@@ -602,9 +620,9 @@ declare function initWaaPSui(options?: InitWaaPSuiOptions): WaaPSuiWalletInterfa
602
620
  */
603
621
  declare function initWaaPSolana(options?: InitWaaPSolanaOptions): WaaPSolanaProviderInterface;
604
622
  /** @deprecated Use `initWaaPMulti({ chains })` instead. */
605
- declare function initWaaPTap<const Chains extends readonly WaaPChain[]>(options: InitWaaPTapOptions & {
623
+ declare function initWaaPTap<const Chains extends readonly WaaPMultiChain[]>(options: InitWaaPTapOptions & {
606
624
  chains: Chains;
607
625
  }): WaaPTap<Chains>;
608
626
  declare function initWaaPTap(options?: Partial<InitWaaPTapOptions>): WaaPTap;
609
627
  //#endregion
610
- export { SuiSignPersonalMessageOutput as A, SuiConnectInput as C, SuiSignAndExecuteTransactionInput as D, SuiSignAndExecuteTransactionBlockOutput as E, SuiTransactionInput as F, SuiWalletEventListener as I, WaaPSuiWalletFeatures as L, SuiSignTransactionBlockOutput as M, SuiSignTransactionInput as N, SuiSignAndExecuteTransactionOutput as O, SuiSignTransactionOutput as P, WaaPSuiWalletInterface as R, SuiChain as S, SuiSignAndExecuteTransactionBlockInput as T, initWaaPSquid as _, WaaPChain as a, InitWaaPSuiOptions as b, WaaPSquidLifecycle as c, WaaPSquidStatusState as d, WaaPTap as f, initWaaPSolana as g, initWaaPMulti as h, InitWaaPTapOptions as i, SuiSignTransactionBlockInput as j, SuiSignPersonalMessageInput as k, WaaPSquidSession as l, initWaaP as m, InitWaaPOptions as n, WaaPSquid as o, WaaPTapSession as p, InitWaaPSquidOptions as r, WaaPSquidChain as s, InitWaaPMultiOptions as t, WaaPSquidStatus as u, initWaaPSui as v, SuiConnectOutput as w, SuiAccount as x, initWaaPTap as y, WalletIcon as z };
628
+ export { SuiSignPersonalMessageInput as A, WalletIcon as B, SuiChain as C, SuiSignAndExecuteTransactionBlockOutput as D, SuiSignAndExecuteTransactionBlockInput as E, SuiSignTransactionOutput as F, SuiTransactionInput as I, SuiWalletEventListener as L, SuiSignTransactionBlockInput as M, SuiSignTransactionBlockOutput as N, SuiSignAndExecuteTransactionInput as O, SuiSignTransactionInput as P, WaaPSuiWalletFeatures as R, SuiAccount as S, SuiConnectOutput as T, initWaaPSolana as _, WaaPChain as a, initWaaPTap as b, WaaPSquidChain as c, WaaPSquidStatus as d, WaaPSquidStatusState as f, initWaaPMulti as g, initWaaP as h, InitWaaPTapOptions as i, SuiSignPersonalMessageOutput as j, SuiSignAndExecuteTransactionOutput as k, WaaPSquidLifecycle as l, WaaPTapSession as m, InitWaaPOptions as n, WaaPMultiChain as o, WaaPTap as p, InitWaaPSquidOptions as r, WaaPSquid as s, InitWaaPMultiOptions as t, WaaPSquidSession as u, initWaaPSquid as v, SuiConnectInput as w, InitWaaPSuiOptions as x, initWaaPSui as y, WaaPSuiWalletInterface as z };
package/dist/index.d.mts CHANGED
@@ -1,13 +1,15 @@
1
- import { A as SocialProvider, C as LinkedAddressesResult, E as RequestPermissionTokenResult, I as WaaPSessionProtection, M as JSON_RPC_METHOD, N as SILK_METHOD, S as LinkAddressNonceResult, T as RequestPermissionTokenParams, _ as resolveWalletOrigin, a as PermissionTokenClearResult, b as CredentialType, c as RequestArguments, d as WaaPAccountMode, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, h as WaaPEnvironment, i as NativeAuthHandoff, j as StylesConfig, l as SilkEthereumProviderInterface, m as WaaPSessionExtension, n as InitSilkOptions, o as PermissionTokenQuery, p as WaaPLoginOptions, r as LoginResponse, s as PermissionTokenStatus, t as EthereumProviderInterface, u as SilkProvider, v as validateWalletOrigin, w as ProjectConfig, x as CustomConfig, y as AuthenticationMethod } from "./types-x7TOncUp.mjs";
2
- import { _ as WAAP_EVENTS, a as useWaapTransaction, c as AsyncEventType, d as AsyncSignPendingEvent, f as AsyncTxConfirmedEvent, g as SilkOptions, h as AsyncTxResponse, i as UseWaapTransactionReturn, l as AsyncSignCompleteEvent, m as AsyncTxPendingEvent, n as TxState, o as Async2faRequiredEvent, p as AsyncTxFailedEvent, r as UseWaapTransactionOptions, s as AsyncEvent, t as useWaapAuth, u as AsyncSignFailedEvent } from "./useWaapAuth-CMhYoBKA.mjs";
3
- import { a as subscribeWaaPIframeLifecycle, i as getWaaPIframeDiagnostics, n as WaaPIframeLifecycleEvent, o as PostSilkRequestArgs, r as WaaPIframeLifecyclePhase, s as WalletMessageManager, t as WaaPIframeDiagnostics } from "./WalletModalController-wIHBGOVd.mjs";
4
- import { _ as SolanaStandardSignTransactionOutput, a as SolanaConnectOutput, b as WaaPSolanaWalletFeatures, c as SolanaSignMessageInput, d as SolanaSignTransactionOutput, f as SolanaStandardSignAndSendTransactionInput, g as SolanaStandardSignTransactionInput, h as SolanaStandardSignMessageOutput, i as SolanaConnectInput, l as SolanaSignMessageOutput, m as SolanaStandardSignMessageInput, n as SolanaAccount, o as SolanaSignAndSendTransactionInput, p as SolanaStandardSignAndSendTransactionOutput, r as SolanaChain, s as SolanaSignAndSendTransactionOutput, t as InitWaaPSolanaOptions, u as SolanaSignTransactionInput, y as WaaPSolanaProviderInterface } from "./types-Bfz205sD.mjs";
5
- import { a as CancelWaaPPreload, c as preloadWaaPOnIdle, i as normalizeWaaPError, n as WaaPErrorCode, o as WaaPIdlePreloadOptions, r as WaaPOperationMetadata, s as WaaPPreloadTarget, t as WaaPError } from "./WaaPError-BuwfZjBk.mjs";
6
- import { A as SuiSignPersonalMessageOutput, C as SuiConnectInput, D as SuiSignAndExecuteTransactionInput, F as SuiTransactionInput, L as WaaPSuiWalletFeatures, N as SuiSignTransactionInput, O as SuiSignAndExecuteTransactionOutput, P as SuiSignTransactionOutput, R as WaaPSuiWalletInterface, S as SuiChain, _ as initWaaPSquid, a as WaaPChain, b as InitWaaPSuiOptions, c as WaaPSquidLifecycle, d as WaaPSquidStatusState, f as WaaPTap, g as initWaaPSolana, h as initWaaPMulti, i as InitWaaPTapOptions, k as SuiSignPersonalMessageInput, l as WaaPSquidSession, m as initWaaP, n as InitWaaPOptions, o as WaaPSquid, p as WaaPTapSession, r as InitWaaPSquidOptions, s as WaaPSquidChain, t as InitWaaPMultiOptions, u as WaaPSquidStatus, v as initWaaPSui, w as SuiConnectOutput, x as SuiAccount, y as initWaaPTap } from "./index-XdQjHMzI.mjs";
1
+ import { A as SocialProvider, C as LinkedAddressesResult, E as RequestPermissionTokenResult, I as WaaPSessionProtection, M as JSON_RPC_METHOD, N as SILK_METHOD, S as LinkAddressNonceResult, T as RequestPermissionTokenParams, _ as resolveWalletOrigin, a as PermissionTokenClearResult, b as CredentialType, c as RequestArguments, d as WaaPAccountMode, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, h as WaaPEnvironment, i as NativeAuthHandoff, j as StylesConfig, l as SilkEthereumProviderInterface, m as WaaPSessionExtension, n as InitSilkOptions, o as PermissionTokenQuery, p as WaaPLoginOptions, r as LoginResponse, s as PermissionTokenStatus, t as EthereumProviderInterface, u as SilkProvider, v as validateWalletOrigin, w as ProjectConfig, x as CustomConfig, y as AuthenticationMethod } from "./types-Cc6tc4ut.mjs";
2
+ import { _ as WAAP_EVENTS, a as useWaapTransaction, c as AsyncEventType, d as AsyncSignPendingEvent, f as AsyncTxConfirmedEvent, g as SilkOptions, h as AsyncTxResponse, i as UseWaapTransactionReturn, l as AsyncSignCompleteEvent, m as AsyncTxPendingEvent, n as TxState, o as Async2faRequiredEvent, p as AsyncTxFailedEvent, r as UseWaapTransactionOptions, s as AsyncEvent, t as useWaapAuth, u as AsyncSignFailedEvent } from "./useWaapAuth-Be1YJk-7.mjs";
3
+ import { a as subscribeWaaPIframeLifecycle, i as getWaaPIframeDiagnostics, n as WaaPIframeLifecycleEvent, o as PostSilkRequestArgs, r as WaaPIframeLifecyclePhase, s as WalletMessageManager, t as WaaPIframeDiagnostics } from "./WalletModalController-DxiBiqDf.mjs";
4
+ import { _ as SolanaStandardSignTransactionOutput, a as SolanaConnectOutput, b as WaaPSolanaWalletFeatures, c as SolanaSignMessageInput, d as SolanaSignTransactionOutput, f as SolanaStandardSignAndSendTransactionInput, g as SolanaStandardSignTransactionInput, h as SolanaStandardSignMessageOutput, i as SolanaConnectInput, l as SolanaSignMessageOutput, m as SolanaStandardSignMessageInput, n as SolanaAccount, o as SolanaSignAndSendTransactionInput, p as SolanaStandardSignAndSendTransactionOutput, r as SolanaChain, s as SolanaSignAndSendTransactionOutput, t as InitWaaPSolanaOptions, u as SolanaSignTransactionInput, y as WaaPSolanaProviderInterface } from "./types-C7JDjWnt.mjs";
5
+ import { a as CancelWaaPPreload, c as preloadWaaPOnIdle, i as normalizeWaaPError, n as WaaPErrorCode, o as WaaPIdlePreloadOptions, r as WaaPOperationMetadata, s as WaaPPreloadTarget, t as WaaPError } from "./WaaPError-C2TOEGPx.mjs";
6
+ import { A as SuiSignPersonalMessageInput, C as SuiChain, F as SuiSignTransactionOutput, I as SuiTransactionInput, O as SuiSignAndExecuteTransactionInput, P as SuiSignTransactionInput, R as WaaPSuiWalletFeatures, S as SuiAccount, T as SuiConnectOutput, _ as initWaaPSolana, a as WaaPChain, b as initWaaPTap, c as WaaPSquidChain, d as WaaPSquidStatus, f as WaaPSquidStatusState, g as initWaaPMulti, h as initWaaP, i as InitWaaPTapOptions, j as SuiSignPersonalMessageOutput, k as SuiSignAndExecuteTransactionOutput, l as WaaPSquidLifecycle, m as WaaPTapSession, n as InitWaaPOptions, o as WaaPMultiChain, p as WaaPTap, r as InitWaaPSquidOptions, s as WaaPSquid, t as InitWaaPMultiOptions, u as WaaPSquidSession, v as initWaaPSquid, w as SuiConnectInput, x as InitWaaPSuiOptions, y as initWaaPSui, z as WaaPSuiWalletInterface } from "./index-BOExImk3.mjs";
7
+ import { a as StellarSignBlobOptions, i as StellarNetwork, n as Sep43Error, o as StellarSignTransactionOptions, r as Sep43Result, s as WaaPStellarProviderInterface, t as InitWaaPStellarOptions } from "./types-Bai14yLc.mjs";
7
8
  import { t as SilkWalletConnect } from "./WalletConnect-BTT6LtUu.mjs";
8
- import { n as UIMessageManager, r as UI_EVENT_NAMES } from "./initializerContext-DB5E2A6s.mjs";
9
- import { n as WaaPSuiWallet, t as registerWaaPSuiWallet } from "./register-DfUAOQke.mjs";
10
- import { n as WaaPSolanaProvider, t as registerWaaPSolanaWallet } from "./register-BhybMFR2.mjs";
9
+ import { n as UI_EVENT_NAMES, t as UIMessageManager } from "./UIMessageManager-4xqSTTBS.mjs";
10
+ import { n as WaaPSuiWallet, t as registerWaaPSuiWallet } from "./register-mq9fTaSt.mjs";
11
+ import { n as WaaPSolanaProvider, t as registerWaaPSolanaWallet } from "./register-BKCJXsHB.mjs";
12
+ import { n as WaaPStellarProvider, t as initWaaPStellar } from "./init-C3zCj5Lc.mjs";
11
13
  import { EventEmitter } from "events";
12
14
  //#region ../silk-interface-core/dist/esm/types/squidLifecycle.d.ts
13
15
  /**
@@ -340,4 +342,4 @@ interface AnchorIdlInstruction {
340
342
  */
341
343
  declare function permissionTokenSolanaAnchorInstruction(programId: string, instruction: AnchorIdlInstruction): string;
342
344
  //#endregion
343
- export { type AnchorIdlInstruction, type Async2faRequiredEvent, type AsyncEvent, type AsyncEventType, type AsyncSignCompleteEvent, type AsyncSignFailedEvent, type AsyncSignPendingEvent, type AsyncTxConfirmedEvent, type AsyncTxFailedEvent, type AsyncTxPendingEvent, type AsyncTxResponse, type AuthenticationMethod, type CancelWaaPPreload, type CredentialType, EthereumProvider, EthereumProviderExtension, type InitSilkOptions, type InitWaaPMultiOptions, type InitWaaPOptions, type InitWaaPSolanaOptions, type InitWaaPSquidOptions, type InitWaaPSuiOptions, type InitWaaPTapOptions, type LinkAddressNonceResult, type LinkedAddressesResult, type PermissionTokenClearResult, type PermissionTokenQuery, type PermissionTokenStatus, type PostSilkRequestArgs, type PostSilkRequestArgs as PostWaaPRequestArgs, type ProjectConfig, type RequestPermissionTokenParams, type RequestPermissionTokenResult, SILK_METHOD, SILK_METHOD as WAAP_METHOD, type SilkEthereumProviderInterface, type SilkEthereumProviderInterface as WaaPEthereumProviderInterface, type SilkOptions, type SilkProvider, type SilkProvider as WaaPProvider, SilkWalletConnect, SilkWalletConnect as WaaPWalletConnect, type SocialProvider, type SolanaAccount, type SolanaChain, type SolanaConnectInput, type SolanaConnectOutput, type SolanaSignAndSendTransactionInput, type SolanaSignAndSendTransactionOutput, type SolanaSignMessageInput, type SolanaSignMessageOutput, type SolanaSignTransactionInput, type SolanaSignTransactionOutput, type SolanaStandardSignAndSendTransactionInput, type SolanaStandardSignAndSendTransactionOutput, type SolanaStandardSignMessageInput, type SolanaStandardSignMessageOutput, type SolanaStandardSignTransactionInput, type SolanaStandardSignTransactionOutput, type SquidFailedEvent, type SquidLifecycleEventType, type SquidPendingEvent, type SquidReadyEvent, type StylesConfig, type SuiAccount, type SuiChain, type SuiConnectInput, type SuiConnectOutput, type SuiSignAndExecuteTransactionInput, type SuiSignAndExecuteTransactionOutput, type SuiSignPersonalMessageInput, type SuiSignPersonalMessageOutput, type SuiSignTransactionInput, type SuiSignTransactionOutput, type SuiTransactionInput, type TxState, UIMessageManager, UI_EVENT_NAMES, type UseWaapTransactionOptions, type UseWaapTransactionReturn, WAAP_EVENTS, WaapWalletElement as WaaP, type WaaPAccountMode, type WaaPAccountStatus, type WaaPChain, type WaaPEnvironment, WaaPError, type WaaPErrorCode, type WaaPIdlePreloadOptions, type WaaPIframeDiagnostics, type WaaPIframeLifecycleEvent, type WaaPIframeLifecyclePhase, type WaaPLoginOptions, type WaaPOperationMetadata, type WaaPPreloadTarget, type WaaPSessionProtection, WaaPSolanaProvider, type WaaPSolanaProviderInterface, type WaaPSolanaWalletFeatures, type WaaPSquid, type WaaPSquidChain, type WaaPSquidLifecycle, type WaaPSquidSession, type WaaPSquidStatus, type WaaPSquidStatusState, WaaPSuiWallet, type WaaPSuiWalletFeatures, type WaaPSuiWalletInterface, type WaaPTap, type WaaPTapSession, type WaaPWalletTargetOptions, WalletMessageManager, getWaaPIframeDiagnostics, handleWalletRequestAndResponse, initWaaP, initWaaPMulti, initWaaPSolana, initWaaPSquid, initWaaPSui, initWaaPTap, normalizeWaaPError, permissionTokenEvmContract, permissionTokenEvmFunction, permissionTokenRecipient, permissionTokenSolanaAnchorInstruction, permissionTokenSolanaDiscriminator, permissionTokenSolanaInstruction, permissionTokenSolanaProgram, permissionTokenSuiFunction, permissionTokenSuiPackage, preloadWaaPOnIdle, registerWaaPSolanaWallet, registerWaaPSuiWallet, resolveWalletOrigin, rpcMethodRequiresUI, subscribeWaaPIframeLifecycle, useWaapAuth, useWaapTransaction, validateWalletOrigin };
345
+ export { type AnchorIdlInstruction, type Async2faRequiredEvent, type AsyncEvent, type AsyncEventType, type AsyncSignCompleteEvent, type AsyncSignFailedEvent, type AsyncSignPendingEvent, type AsyncTxConfirmedEvent, type AsyncTxFailedEvent, type AsyncTxPendingEvent, type AsyncTxResponse, type AuthenticationMethod, type CancelWaaPPreload, type CredentialType, EthereumProvider, EthereumProviderExtension, type InitSilkOptions, type InitWaaPMultiOptions, type InitWaaPOptions, type InitWaaPSolanaOptions, type InitWaaPSquidOptions, type InitWaaPStellarOptions, type InitWaaPSuiOptions, type InitWaaPTapOptions, type LinkAddressNonceResult, type LinkedAddressesResult, type PermissionTokenClearResult, type PermissionTokenQuery, type PermissionTokenStatus, type PostSilkRequestArgs, type PostSilkRequestArgs as PostWaaPRequestArgs, type ProjectConfig, type RequestPermissionTokenParams, type RequestPermissionTokenResult, SILK_METHOD, SILK_METHOD as WAAP_METHOD, type Sep43Error, type Sep43Result, type SilkEthereumProviderInterface, type SilkEthereumProviderInterface as WaaPEthereumProviderInterface, type SilkOptions, type SilkProvider, type SilkProvider as WaaPProvider, SilkWalletConnect, SilkWalletConnect as WaaPWalletConnect, type SocialProvider, type SolanaAccount, type SolanaChain, type SolanaConnectInput, type SolanaConnectOutput, type SolanaSignAndSendTransactionInput, type SolanaSignAndSendTransactionOutput, type SolanaSignMessageInput, type SolanaSignMessageOutput, type SolanaSignTransactionInput, type SolanaSignTransactionOutput, type SolanaStandardSignAndSendTransactionInput, type SolanaStandardSignAndSendTransactionOutput, type SolanaStandardSignMessageInput, type SolanaStandardSignMessageOutput, type SolanaStandardSignTransactionInput, type SolanaStandardSignTransactionOutput, type SquidFailedEvent, type SquidLifecycleEventType, type SquidPendingEvent, type SquidReadyEvent, type StellarNetwork, type StellarSignBlobOptions, type StellarSignTransactionOptions, type StylesConfig, type SuiAccount, type SuiChain, type SuiConnectInput, type SuiConnectOutput, type SuiSignAndExecuteTransactionInput, type SuiSignAndExecuteTransactionOutput, type SuiSignPersonalMessageInput, type SuiSignPersonalMessageOutput, type SuiSignTransactionInput, type SuiSignTransactionOutput, type SuiTransactionInput, type TxState, UIMessageManager, UI_EVENT_NAMES, type UseWaapTransactionOptions, type UseWaapTransactionReturn, WAAP_EVENTS, WaapWalletElement as WaaP, type WaaPAccountMode, type WaaPAccountStatus, type WaaPChain, type WaaPEnvironment, WaaPError, type WaaPErrorCode, type WaaPIdlePreloadOptions, type WaaPIframeDiagnostics, type WaaPIframeLifecycleEvent, type WaaPIframeLifecyclePhase, type WaaPLoginOptions, type WaaPMultiChain, type WaaPOperationMetadata, type WaaPPreloadTarget, type WaaPSessionProtection, WaaPSolanaProvider, type WaaPSolanaProviderInterface, type WaaPSolanaWalletFeatures, type WaaPSquid, type WaaPSquidChain, type WaaPSquidLifecycle, type WaaPSquidSession, type WaaPSquidStatus, type WaaPSquidStatusState, WaaPStellarProvider, type WaaPStellarProviderInterface, WaaPSuiWallet, type WaaPSuiWalletFeatures, type WaaPSuiWalletInterface, type WaaPTap, type WaaPTapSession, type WaaPWalletTargetOptions, WalletMessageManager, getWaaPIframeDiagnostics, handleWalletRequestAndResponse, initWaaP, initWaaPMulti, initWaaPSolana, initWaaPSquid, initWaaPStellar, initWaaPSui, initWaaPTap, normalizeWaaPError, permissionTokenEvmContract, permissionTokenEvmFunction, permissionTokenRecipient, permissionTokenSolanaAnchorInstruction, permissionTokenSolanaDiscriminator, permissionTokenSolanaInstruction, permissionTokenSolanaProgram, permissionTokenSuiFunction, permissionTokenSuiPackage, preloadWaaPOnIdle, registerWaaPSolanaWallet, registerWaaPSuiWallet, resolveWalletOrigin, rpcMethodRequiresUI, subscribeWaaPIframeLifecycle, useWaapAuth, useWaapTransaction, validateWalletOrigin };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,15 @@
1
- import { A as SocialProvider, C as LinkedAddressesResult, E as RequestPermissionTokenResult, I as WaaPSessionProtection, M as JSON_RPC_METHOD, N as SILK_METHOD, S as LinkAddressNonceResult, T as RequestPermissionTokenParams, _ as resolveWalletOrigin, a as PermissionTokenClearResult, b as CredentialType, c as RequestArguments, d as WaaPAccountMode, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, h as WaaPEnvironment, i as NativeAuthHandoff, j as StylesConfig, l as SilkEthereumProviderInterface, m as WaaPSessionExtension, n as InitSilkOptions, o as PermissionTokenQuery, p as WaaPLoginOptions, r as LoginResponse, s as PermissionTokenStatus, t as EthereumProviderInterface, u as SilkProvider, v as validateWalletOrigin, w as ProjectConfig, x as CustomConfig, y as AuthenticationMethod } from "./types-x7TOncUp.js";
2
- import { _ as WAAP_EVENTS, a as useWaapTransaction, c as AsyncEventType, d as AsyncSignPendingEvent, f as AsyncTxConfirmedEvent, g as SilkOptions, h as AsyncTxResponse, i as UseWaapTransactionReturn, l as AsyncSignCompleteEvent, m as AsyncTxPendingEvent, n as TxState, o as Async2faRequiredEvent, p as AsyncTxFailedEvent, r as UseWaapTransactionOptions, s as AsyncEvent, t as useWaapAuth, u as AsyncSignFailedEvent } from "./useWaapAuth-CeJuu2wk.js";
3
- import { a as subscribeWaaPIframeLifecycle, i as getWaaPIframeDiagnostics, n as WaaPIframeLifecycleEvent, o as PostSilkRequestArgs, r as WaaPIframeLifecyclePhase, s as WalletMessageManager, t as WaaPIframeDiagnostics } from "./WalletModalController-Qh9LNwW5.js";
4
- import { _ as SolanaStandardSignTransactionOutput, a as SolanaConnectOutput, b as WaaPSolanaWalletFeatures, c as SolanaSignMessageInput, d as SolanaSignTransactionOutput, f as SolanaStandardSignAndSendTransactionInput, g as SolanaStandardSignTransactionInput, h as SolanaStandardSignMessageOutput, i as SolanaConnectInput, l as SolanaSignMessageOutput, m as SolanaStandardSignMessageInput, n as SolanaAccount, o as SolanaSignAndSendTransactionInput, p as SolanaStandardSignAndSendTransactionOutput, r as SolanaChain, s as SolanaSignAndSendTransactionOutput, t as InitWaaPSolanaOptions, u as SolanaSignTransactionInput, y as WaaPSolanaProviderInterface } from "./types-8CCmbLuY.js";
5
- import { a as CancelWaaPPreload, c as preloadWaaPOnIdle, i as normalizeWaaPError, n as WaaPErrorCode, o as WaaPIdlePreloadOptions, r as WaaPOperationMetadata, s as WaaPPreloadTarget, t as WaaPError } from "./WaaPError-BuwfZjBk.js";
6
- import { A as SuiSignPersonalMessageOutput, C as SuiConnectInput, D as SuiSignAndExecuteTransactionInput, F as SuiTransactionInput, L as WaaPSuiWalletFeatures, N as SuiSignTransactionInput, O as SuiSignAndExecuteTransactionOutput, P as SuiSignTransactionOutput, R as WaaPSuiWalletInterface, S as SuiChain, _ as initWaaPSquid, a as WaaPChain, b as InitWaaPSuiOptions, c as WaaPSquidLifecycle, d as WaaPSquidStatusState, f as WaaPTap, g as initWaaPSolana, h as initWaaPMulti, i as InitWaaPTapOptions, k as SuiSignPersonalMessageInput, l as WaaPSquidSession, m as initWaaP, n as InitWaaPOptions, o as WaaPSquid, p as WaaPTapSession, r as InitWaaPSquidOptions, s as WaaPSquidChain, t as InitWaaPMultiOptions, u as WaaPSquidStatus, v as initWaaPSui, w as SuiConnectOutput, x as SuiAccount, y as initWaaPTap } from "./index-DNyKwJcJ.js";
1
+ import { A as SocialProvider, C as LinkedAddressesResult, E as RequestPermissionTokenResult, I as WaaPSessionProtection, M as JSON_RPC_METHOD, N as SILK_METHOD, S as LinkAddressNonceResult, T as RequestPermissionTokenParams, _ as resolveWalletOrigin, a as PermissionTokenClearResult, b as CredentialType, c as RequestArguments, d as WaaPAccountMode, f as WaaPAccountStatus, g as WaaPWalletTargetOptions, h as WaaPEnvironment, i as NativeAuthHandoff, j as StylesConfig, l as SilkEthereumProviderInterface, m as WaaPSessionExtension, n as InitSilkOptions, o as PermissionTokenQuery, p as WaaPLoginOptions, r as LoginResponse, s as PermissionTokenStatus, t as EthereumProviderInterface, u as SilkProvider, v as validateWalletOrigin, w as ProjectConfig, x as CustomConfig, y as AuthenticationMethod } from "./types-Cc6tc4ut.js";
2
+ import { _ as WAAP_EVENTS, a as useWaapTransaction, c as AsyncEventType, d as AsyncSignPendingEvent, f as AsyncTxConfirmedEvent, g as SilkOptions, h as AsyncTxResponse, i as UseWaapTransactionReturn, l as AsyncSignCompleteEvent, m as AsyncTxPendingEvent, n as TxState, o as Async2faRequiredEvent, p as AsyncTxFailedEvent, r as UseWaapTransactionOptions, s as AsyncEvent, t as useWaapAuth, u as AsyncSignFailedEvent } from "./useWaapAuth-DSFDwJtt.js";
3
+ import { a as subscribeWaaPIframeLifecycle, i as getWaaPIframeDiagnostics, n as WaaPIframeLifecycleEvent, o as PostSilkRequestArgs, r as WaaPIframeLifecyclePhase, s as WalletMessageManager, t as WaaPIframeDiagnostics } from "./WalletModalController-16mHsFv2.js";
4
+ import { _ as SolanaStandardSignTransactionOutput, a as SolanaConnectOutput, b as WaaPSolanaWalletFeatures, c as SolanaSignMessageInput, d as SolanaSignTransactionOutput, f as SolanaStandardSignAndSendTransactionInput, g as SolanaStandardSignTransactionInput, h as SolanaStandardSignMessageOutput, i as SolanaConnectInput, l as SolanaSignMessageOutput, m as SolanaStandardSignMessageInput, n as SolanaAccount, o as SolanaSignAndSendTransactionInput, p as SolanaStandardSignAndSendTransactionOutput, r as SolanaChain, s as SolanaSignAndSendTransactionOutput, t as InitWaaPSolanaOptions, u as SolanaSignTransactionInput, y as WaaPSolanaProviderInterface } from "./types-Bj5dDE-C.js";
5
+ import { a as CancelWaaPPreload, c as preloadWaaPOnIdle, i as normalizeWaaPError, n as WaaPErrorCode, o as WaaPIdlePreloadOptions, r as WaaPOperationMetadata, s as WaaPPreloadTarget, t as WaaPError } from "./WaaPError-C2TOEGPx.js";
6
+ import { A as SuiSignPersonalMessageInput, C as SuiChain, F as SuiSignTransactionOutput, I as SuiTransactionInput, O as SuiSignAndExecuteTransactionInput, P as SuiSignTransactionInput, R as WaaPSuiWalletFeatures, S as SuiAccount, T as SuiConnectOutput, _ as initWaaPSolana, a as WaaPChain, b as initWaaPTap, c as WaaPSquidChain, d as WaaPSquidStatus, f as WaaPSquidStatusState, g as initWaaPMulti, h as initWaaP, i as InitWaaPTapOptions, j as SuiSignPersonalMessageOutput, k as SuiSignAndExecuteTransactionOutput, l as WaaPSquidLifecycle, m as WaaPTapSession, n as InitWaaPOptions, o as WaaPMultiChain, p as WaaPTap, r as InitWaaPSquidOptions, s as WaaPSquid, t as InitWaaPMultiOptions, u as WaaPSquidSession, v as initWaaPSquid, w as SuiConnectInput, x as InitWaaPSuiOptions, y as initWaaPSui, z as WaaPSuiWalletInterface } from "./index-BkKBZpqc.js";
7
+ import { a as StellarSignBlobOptions, i as StellarNetwork, n as Sep43Error, o as StellarSignTransactionOptions, r as Sep43Result, s as WaaPStellarProviderInterface, t as InitWaaPStellarOptions } from "./types-DqdVfkaW.js";
7
8
  import { t as SilkWalletConnect } from "./WalletConnect-BTT6LtUu.js";
8
- import { n as UIMessageManager, r as UI_EVENT_NAMES } from "./initializerContext-Z7JeZRsm.js";
9
- import { n as WaaPSuiWallet, t as registerWaaPSuiWallet } from "./register-MK9ivXiJ.js";
10
- import { n as WaaPSolanaProvider, t as registerWaaPSolanaWallet } from "./register-CMv6n7ak.js";
9
+ import { n as UI_EVENT_NAMES, t as UIMessageManager } from "./UIMessageManager-4xqSTTBS.js";
10
+ import { n as WaaPSuiWallet, t as registerWaaPSuiWallet } from "./register-C1hFwh4A.js";
11
+ import { n as WaaPSolanaProvider, t as registerWaaPSolanaWallet } from "./register-GiWQpcBY.js";
12
+ import { n as WaaPStellarProvider, t as initWaaPStellar } from "./init-C-52fEJS.js";
11
13
  import { EventEmitter } from "events";
12
14
  //#region ../silk-interface-core/dist/esm/types/squidLifecycle.d.ts
13
15
  /**
@@ -340,4 +342,4 @@ interface AnchorIdlInstruction {
340
342
  */
341
343
  declare function permissionTokenSolanaAnchorInstruction(programId: string, instruction: AnchorIdlInstruction): string;
342
344
  //#endregion
343
- export { type AnchorIdlInstruction, type Async2faRequiredEvent, type AsyncEvent, type AsyncEventType, type AsyncSignCompleteEvent, type AsyncSignFailedEvent, type AsyncSignPendingEvent, type AsyncTxConfirmedEvent, type AsyncTxFailedEvent, type AsyncTxPendingEvent, type AsyncTxResponse, type AuthenticationMethod, type CancelWaaPPreload, type CredentialType, EthereumProvider, EthereumProviderExtension, type InitSilkOptions, type InitWaaPMultiOptions, type InitWaaPOptions, type InitWaaPSolanaOptions, type InitWaaPSquidOptions, type InitWaaPSuiOptions, type InitWaaPTapOptions, type LinkAddressNonceResult, type LinkedAddressesResult, type PermissionTokenClearResult, type PermissionTokenQuery, type PermissionTokenStatus, type PostSilkRequestArgs, type PostSilkRequestArgs as PostWaaPRequestArgs, type ProjectConfig, type RequestPermissionTokenParams, type RequestPermissionTokenResult, SILK_METHOD, SILK_METHOD as WAAP_METHOD, type SilkEthereumProviderInterface, type SilkEthereumProviderInterface as WaaPEthereumProviderInterface, type SilkOptions, type SilkProvider, type SilkProvider as WaaPProvider, SilkWalletConnect, SilkWalletConnect as WaaPWalletConnect, type SocialProvider, type SolanaAccount, type SolanaChain, type SolanaConnectInput, type SolanaConnectOutput, type SolanaSignAndSendTransactionInput, type SolanaSignAndSendTransactionOutput, type SolanaSignMessageInput, type SolanaSignMessageOutput, type SolanaSignTransactionInput, type SolanaSignTransactionOutput, type SolanaStandardSignAndSendTransactionInput, type SolanaStandardSignAndSendTransactionOutput, type SolanaStandardSignMessageInput, type SolanaStandardSignMessageOutput, type SolanaStandardSignTransactionInput, type SolanaStandardSignTransactionOutput, type SquidFailedEvent, type SquidLifecycleEventType, type SquidPendingEvent, type SquidReadyEvent, type StylesConfig, type SuiAccount, type SuiChain, type SuiConnectInput, type SuiConnectOutput, type SuiSignAndExecuteTransactionInput, type SuiSignAndExecuteTransactionOutput, type SuiSignPersonalMessageInput, type SuiSignPersonalMessageOutput, type SuiSignTransactionInput, type SuiSignTransactionOutput, type SuiTransactionInput, type TxState, UIMessageManager, UI_EVENT_NAMES, type UseWaapTransactionOptions, type UseWaapTransactionReturn, WAAP_EVENTS, WaapWalletElement as WaaP, type WaaPAccountMode, type WaaPAccountStatus, type WaaPChain, type WaaPEnvironment, WaaPError, type WaaPErrorCode, type WaaPIdlePreloadOptions, type WaaPIframeDiagnostics, type WaaPIframeLifecycleEvent, type WaaPIframeLifecyclePhase, type WaaPLoginOptions, type WaaPOperationMetadata, type WaaPPreloadTarget, type WaaPSessionProtection, WaaPSolanaProvider, type WaaPSolanaProviderInterface, type WaaPSolanaWalletFeatures, type WaaPSquid, type WaaPSquidChain, type WaaPSquidLifecycle, type WaaPSquidSession, type WaaPSquidStatus, type WaaPSquidStatusState, WaaPSuiWallet, type WaaPSuiWalletFeatures, type WaaPSuiWalletInterface, type WaaPTap, type WaaPTapSession, type WaaPWalletTargetOptions, WalletMessageManager, getWaaPIframeDiagnostics, handleWalletRequestAndResponse, initWaaP, initWaaPMulti, initWaaPSolana, initWaaPSquid, initWaaPSui, initWaaPTap, normalizeWaaPError, permissionTokenEvmContract, permissionTokenEvmFunction, permissionTokenRecipient, permissionTokenSolanaAnchorInstruction, permissionTokenSolanaDiscriminator, permissionTokenSolanaInstruction, permissionTokenSolanaProgram, permissionTokenSuiFunction, permissionTokenSuiPackage, preloadWaaPOnIdle, registerWaaPSolanaWallet, registerWaaPSuiWallet, resolveWalletOrigin, rpcMethodRequiresUI, subscribeWaaPIframeLifecycle, useWaapAuth, useWaapTransaction, validateWalletOrigin };
345
+ export { type AnchorIdlInstruction, type Async2faRequiredEvent, type AsyncEvent, type AsyncEventType, type AsyncSignCompleteEvent, type AsyncSignFailedEvent, type AsyncSignPendingEvent, type AsyncTxConfirmedEvent, type AsyncTxFailedEvent, type AsyncTxPendingEvent, type AsyncTxResponse, type AuthenticationMethod, type CancelWaaPPreload, type CredentialType, EthereumProvider, EthereumProviderExtension, type InitSilkOptions, type InitWaaPMultiOptions, type InitWaaPOptions, type InitWaaPSolanaOptions, type InitWaaPSquidOptions, type InitWaaPStellarOptions, type InitWaaPSuiOptions, type InitWaaPTapOptions, type LinkAddressNonceResult, type LinkedAddressesResult, type PermissionTokenClearResult, type PermissionTokenQuery, type PermissionTokenStatus, type PostSilkRequestArgs, type PostSilkRequestArgs as PostWaaPRequestArgs, type ProjectConfig, type RequestPermissionTokenParams, type RequestPermissionTokenResult, SILK_METHOD, SILK_METHOD as WAAP_METHOD, type Sep43Error, type Sep43Result, type SilkEthereumProviderInterface, type SilkEthereumProviderInterface as WaaPEthereumProviderInterface, type SilkOptions, type SilkProvider, type SilkProvider as WaaPProvider, SilkWalletConnect, SilkWalletConnect as WaaPWalletConnect, type SocialProvider, type SolanaAccount, type SolanaChain, type SolanaConnectInput, type SolanaConnectOutput, type SolanaSignAndSendTransactionInput, type SolanaSignAndSendTransactionOutput, type SolanaSignMessageInput, type SolanaSignMessageOutput, type SolanaSignTransactionInput, type SolanaSignTransactionOutput, type SolanaStandardSignAndSendTransactionInput, type SolanaStandardSignAndSendTransactionOutput, type SolanaStandardSignMessageInput, type SolanaStandardSignMessageOutput, type SolanaStandardSignTransactionInput, type SolanaStandardSignTransactionOutput, type SquidFailedEvent, type SquidLifecycleEventType, type SquidPendingEvent, type SquidReadyEvent, type StellarNetwork, type StellarSignBlobOptions, type StellarSignTransactionOptions, type StylesConfig, type SuiAccount, type SuiChain, type SuiConnectInput, type SuiConnectOutput, type SuiSignAndExecuteTransactionInput, type SuiSignAndExecuteTransactionOutput, type SuiSignPersonalMessageInput, type SuiSignPersonalMessageOutput, type SuiSignTransactionInput, type SuiSignTransactionOutput, type SuiTransactionInput, type TxState, UIMessageManager, UI_EVENT_NAMES, type UseWaapTransactionOptions, type UseWaapTransactionReturn, WAAP_EVENTS, WaapWalletElement as WaaP, type WaaPAccountMode, type WaaPAccountStatus, type WaaPChain, type WaaPEnvironment, WaaPError, type WaaPErrorCode, type WaaPIdlePreloadOptions, type WaaPIframeDiagnostics, type WaaPIframeLifecycleEvent, type WaaPIframeLifecyclePhase, type WaaPLoginOptions, type WaaPMultiChain, type WaaPOperationMetadata, type WaaPPreloadTarget, type WaaPSessionProtection, WaaPSolanaProvider, type WaaPSolanaProviderInterface, type WaaPSolanaWalletFeatures, type WaaPSquid, type WaaPSquidChain, type WaaPSquidLifecycle, type WaaPSquidSession, type WaaPSquidStatus, type WaaPSquidStatusState, WaaPStellarProvider, type WaaPStellarProviderInterface, WaaPSuiWallet, type WaaPSuiWalletFeatures, type WaaPSuiWalletInterface, type WaaPTap, type WaaPTapSession, type WaaPWalletTargetOptions, WalletMessageManager, getWaaPIframeDiagnostics, handleWalletRequestAndResponse, initWaaP, initWaaPMulti, initWaaPSolana, initWaaPSquid, initWaaPStellar, initWaaPSui, initWaaPTap, normalizeWaaPError, permissionTokenEvmContract, permissionTokenEvmFunction, permissionTokenRecipient, permissionTokenSolanaAnchorInstruction, permissionTokenSolanaDiscriminator, permissionTokenSolanaInstruction, permissionTokenSolanaProgram, permissionTokenSuiFunction, permissionTokenSuiPackage, preloadWaaPOnIdle, registerWaaPSolanaWallet, registerWaaPSuiWallet, resolveWalletOrigin, rpcMethodRequiresUI, subscribeWaaPIframeLifecycle, useWaapAuth, useWaapTransaction, validateWalletOrigin };