@stakekit/widget 0.0.273 → 0.0.275

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 (55) hide show
  1. package/dist/bundle/index.bundle.css +1 -1
  2. package/dist/bundle/index.bundle.js +54 -54
  3. package/dist/package/index.package.css +0 -7
  4. package/dist/package/index.package.js +1311 -1209
  5. package/dist/types/components/molecules/select-opportunity-list-item/index.d.ts +7 -5
  6. package/dist/types/domain/types/stake.d.ts +3 -3
  7. package/dist/types/domain/types/yields.d.ts +14 -17
  8. package/dist/types/hooks/api/use-dashboard-yield-catalog.d.ts +23 -0
  9. package/dist/types/hooks/api/use-multi-yields.d.ts +2 -1
  10. package/dist/types/hooks/api/use-token-list-yields.d.ts +10 -5
  11. package/dist/types/hooks/api/use-yield-opportunity/get-yield-opportunity.d.ts +5 -1
  12. package/dist/types/hooks/api/use-yield-providers.d.ts +13 -0
  13. package/dist/types/hooks/api/use-yield-summaries.d.ts +58 -0
  14. package/dist/types/pages/details/earn-page/components/select-token-section/select-token-list-item.d.ts +1 -3
  15. package/dist/types/pages/details/earn-page/components/select-token-section/styles.css.d.ts +0 -2
  16. package/dist/types/pages/details/earn-page/state/types.d.ts +7 -1
  17. package/dist/types/pages/details/earn-page/types.d.ts +3 -3
  18. package/dist/types/pages/position-details/hooks/use-unstake-machine.d.ts +7 -118
  19. package/dist/types/pages/review/hooks/use-stake-review.hook.d.ts +37 -1
  20. package/dist/types/providers/api/api-client-provider.d.ts +6 -22
  21. package/dist/types/providers/api/api-client.d.ts +6 -22
  22. package/dist/types/providers/ethereum/config.d.ts +4 -3
  23. package/dist/types/providers/settings/types.d.ts +1 -0
  24. package/dist/types/providers/wagmi/index.d.ts +1 -0
  25. package/dist/website/assets/{basic-ThspdnuL.js → basic-AvmmQyRT.js} +1 -1
  26. package/dist/website/assets/{basic-Bo7SBwII.js → basic-B4L21H7R.js} +1 -1
  27. package/dist/website/assets/{browser-DskDvf4V.js → browser-CD2gtnKg.js} +1 -1
  28. package/dist/website/assets/{build-BmJ27Vry.js → build-CEL1SZmV.js} +1 -1
  29. package/dist/website/assets/{build-DN0pJtdR.js → build-DWB27dsZ.js} +1 -1
  30. package/dist/website/assets/{cardano-connector-B2Ea9uXJ.js → cardano-connector-BNJvqm1_.js} +1 -1
  31. package/dist/website/assets/{core-BFFu4TZK.js → core-NRhVeH3P.js} +2 -2
  32. package/dist/website/assets/{dist-BC-yZnz1.js → dist-CH4nKZqs.js} +1 -1
  33. package/dist/website/assets/{dist-DwMZ-Epn.js → dist-DRLRXyTA.js} +1 -1
  34. package/dist/website/assets/en_US-IFPOGBSL-DcKUUZBp.js +1 -0
  35. package/dist/website/assets/{esm-Bvq2M2B2.js → esm-CX7v7VH6.js} +1 -1
  36. package/dist/website/assets/{exports-BEqJeoxC.js → exports-CZja-uIB.js} +1 -1
  37. package/dist/website/assets/{index-DTVV95ia.js → index-BEIkkHR9.js} +43 -43
  38. package/dist/website/assets/{index-E_6jknHw.css → index-BmH6Rgkr.css} +1 -1
  39. package/dist/website/assets/{index.es-qQnPYJtJ.js → index.es-C4PtkNtC.js} +2 -2
  40. package/dist/website/assets/{ledger-connector-C520fQQY.js → ledger-connector-CQI9gS0Q.js} +1 -1
  41. package/dist/website/assets/{receive-Dcx0aHWA.js → receive-D87X5CO9.js} +1 -1
  42. package/dist/website/assets/{registry-CvkKYDcW.js → registry-DFrHgvrU.js} +1 -1
  43. package/dist/website/assets/{safe-connector-CDGYW3b8.js → safe-connector-D5A7hhAW.js} +1 -1
  44. package/dist/website/assets/{socials-BDwTFvCa.js → socials-DlOk7Wls.js} +1 -1
  45. package/dist/website/assets/{solana-connector-BcHaSaSq.js → solana-connector-C1qGbaG8.js} +1 -1
  46. package/dist/website/assets/{substrate-connector-DxYe9s4o.js → substrate-connector-DfJfljNz.js} +1 -1
  47. package/dist/website/assets/{ton-connector-sD5IEuy2.js → ton-connector-DA1-w57X.js} +1 -1
  48. package/dist/website/assets/{tron-connector-DgBR_biA.js → tron-connector-BTe1GdWY.js} +3 -3
  49. package/dist/website/assets/tx-zX2fdmDi.js +1 -0
  50. package/dist/website/assets/{wallet-manager-4JkYZ_Wn.js → wallet-manager-pYzGZQVw.js} +3 -3
  51. package/dist/website/assets/{wui-qr-code-CadVdoQK.js → wui-qr-code-BgRoILGj.js} +1 -1
  52. package/dist/website/index.html +2 -2
  53. package/package.json +1 -1
  54. package/dist/website/assets/en_US-IFPOGBSL-DY8aJwVh.js +0 -1
  55. package/dist/website/assets/tx-Cjn1Xzt5.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e}from"./index-BEIkkHR9.js";export{e as default};
@@ -1 +1 @@
1
- import{t as e}from"./encodeFunctionData-dy9a9oBR.js";import{H as t,V as n}from"./index-DTVV95ia.js";import{t as r}from"./dist-DOMzXoQL.js";var i=()=>`9.1.0`,a=e=>e.toString(16).padStart(2,`0`),o=e=>{let t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,a).join(``)},s=()=>typeof window<`u`?o(10):new Date().getTime().toString(36),c=class{};c.makeRequest=(e,t)=>({id:s(),method:e,params:t,env:{sdkVersion:i()}}),c.makeResponse=(e,t,n)=>({id:e,success:!0,version:n,data:t}),c.makeErrorResponse=(e,t,n)=>({id:e,success:!1,error:t,version:n});var l;(function(e){e.sendTransactions=`sendTransactions`,e.rpcCall=`rpcCall`,e.getChainInfo=`getChainInfo`,e.getSafeInfo=`getSafeInfo`,e.getTxBySafeTxHash=`getTxBySafeTxHash`,e.getSafeBalances=`getSafeBalances`,e.signMessage=`signMessage`,e.signTypedMessage=`signTypedMessage`,e.getEnvironmentInfo=`getEnvironmentInfo`,e.getOffChainSignature=`getOffChainSignature`,e.requestAddressBook=`requestAddressBook`,e.wallet_getPermissions=`wallet_getPermissions`,e.wallet_requestPermissions=`wallet_requestPermissions`})(l||={});var u;(function(e){e.requestAddressBook=`requestAddressBook`})(u||={});var d=class{constructor(e=null,t=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>`u`,this.isValidMessage=({origin:e,data:t,source:n})=>{let r=!t,i=!this.isServer&&n===window.parent,a=t.version!==void 0&&parseInt(t.version.split(`.`)[0]),o=typeof a==`number`&&a>=1,s=!0;return Array.isArray(this.allowedOrigins)&&(s=this.allowedOrigins.find(t=>t.test(e))!==void 0),!r&&i&&o&&s},this.logIncomingMessage=e=>{},this.onParentMessage=e=>{this.isValidMessage(e)&&(this.debugMode&&this.logIncomingMessage(e),this.handleIncomingMessage(e.data))},this.handleIncomingMessage=e=>{let{id:t}=e,n=this.callbacks.get(t);n&&(n(e),this.callbacks.delete(t))},this.send=(e,t)=>{let n=c.makeRequest(e,t);if(this.isServer)throw Error(`Window doesn't exist`);return window.parent.postMessage(n,`*`),new Promise((e,t)=>{this.callbacks.set(n.id,n=>{if(!n.success){t(Error(n.error));return}e(n)})})},this.allowedOrigins=e,this.debugMode=t,this.isServer||window.addEventListener(`message`,this.onParentMessage)}},f=e=>typeof e==`object`&&!!e&&`domain`in e&&`types`in e&&`message`in e,p=r(),m=class{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw Error(`Invalid safeTxHash`);return(await this.communicator.send(l.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){let t={message:e};return(await this.communicator.send(l.signMessage,t)).data}async signTypedMessage(e){if(!f(e))throw Error(`Invalid typed data`);return(await this.communicator.send(l.signTypedMessage,{typedData:e})).data}async send({txs:e,params:t}){if(!e||!e.length)throw Error(`No transactions were passed`);let n={txs:e,params:t};return(await this.communicator.send(l.sendTransactions,n)).data}},h={eth_call:`eth_call`,eth_gasPrice:`eth_gasPrice`,eth_getLogs:`eth_getLogs`,eth_getBalance:`eth_getBalance`,eth_getCode:`eth_getCode`,eth_getBlockByHash:`eth_getBlockByHash`,eth_getBlockByNumber:`eth_getBlockByNumber`,eth_getStorageAt:`eth_getStorageAt`,eth_getTransactionByHash:`eth_getTransactionByHash`,eth_getTransactionReceipt:`eth_getTransactionReceipt`,eth_getTransactionCount:`eth_getTransactionCount`,eth_estimateGas:`eth_estimateGas`,safe_setSettings:`safe_setSettings`},g={defaultBlockParam:(e=`latest`)=>e,returnFullTxObjectParam:(e=!1)=>e,blockNumberToHex:e=>Number.isInteger(e)?`0x${e.toString(16)}`:e},_=class{constructor(e){this.communicator=e,this.call=this.buildRequest({call:h.eth_call,formatters:[null,g.defaultBlockParam]}),this.getBalance=this.buildRequest({call:h.eth_getBalance,formatters:[null,g.defaultBlockParam]}),this.getCode=this.buildRequest({call:h.eth_getCode,formatters:[null,g.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:h.eth_getStorageAt,formatters:[null,g.blockNumberToHex,g.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:h.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:h.eth_getBlockByHash,formatters:[null,g.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:h.eth_getBlockByNumber,formatters:[g.blockNumberToHex,g.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:h.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:h.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:h.eth_getTransactionCount,formatters:[null,g.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:h.eth_gasPrice}),this.getEstimateGas=e=>this.buildRequest({call:h.eth_estimateGas})([e]),this.setSafeSettings=this.buildRequest({call:h.safe_setSettings})}buildRequest(e){let{call:t,formatters:n}=e;return async e=>{n&&Array.isArray(e)&&n.forEach((t,n)=>{t&&(e[n]=t(e[n]))});let r={call:t,params:e||[]};return(await this.communicator.send(l.rpcCall,r)).data}}},v=`0x1626ba7e`,y=`0x20c13b0b`,b=4001,x=class e extends Error{constructor(t,n,r){super(t),this.code=n,this.data=r,Object.setPrototypeOf(this,e.prototype)}},S=class{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(l.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new x(`Permissions request is invalid`,b);try{return(await this.communicator.send(l.wallet_requestPermissions,e)).data}catch{throw new x(`Permissions rejected`,b)}}isPermissionRequestValid(e){return e.every(e=>typeof e==`object`?Object.keys(e).every(e=>!!Object.values(u).includes(e)):!1)}},C=(e,t)=>t.some(t=>t.parentCapability===e),w=()=>(e,t,n)=>{let r=n.value;return n.value=async function(){let e=new S(this.communicator),n=await e.getPermissions();if(C(t,n)||(n=await e.requestPermissions([{[t]:{}}])),!C(t,n))throw new x(`Permissions rejected`,b);return r.apply(this)},n},T=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},E=class{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(l.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(l.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e=`usd`}={}){return(await this.communicator.send(l.getSafeBalances,{currency:e})).data}async check1271Signature(t,n=`0x`){let r=await this.getInfo(),i=e({abi:[{constant:!1,inputs:[{name:`_dataHash`,type:`bytes32`},{name:`_signature`,type:`bytes`}],name:`isValidSignature`,outputs:[{name:``,type:`bytes4`}],payable:!1,stateMutability:`nonpayable`,type:`function`}],functionName:`isValidSignature`,args:[t,n]}),a={call:h.eth_call,params:[{to:r.safeAddress,data:i},`latest`]};try{return(await this.communicator.send(l.rpcCall,a)).data.slice(0,10).toLowerCase()===v}catch{return!1}}async check1271SignatureBytes(t,n=`0x`){let r=await this.getInfo(),i=e({abi:[{constant:!1,inputs:[{name:`_data`,type:`bytes`},{name:`_signature`,type:`bytes`}],name:`isValidSignature`,outputs:[{name:``,type:`bytes4`}],payable:!1,stateMutability:`nonpayable`,type:`function`}],functionName:`isValidSignature`,args:[t,n]}),a={call:h.eth_call,params:[{to:r.safeAddress,data:i},`latest`]};try{return(await this.communicator.send(l.rpcCall,a)).data.slice(0,10).toLowerCase()===y}catch{return!1}}calculateMessageHash(e){return t(e)}calculateTypedMessageHash(e){let t=typeof e.domain.chainId==`object`?e.domain.chainId.toNumber():Number(e.domain.chainId),r=e.primaryType;if(!r){let t=Object.values(e.types),n=Object.keys(e.types).filter(e=>t.every(t=>t.every(({type:t})=>t.replace(`[`,``).replace(`]`,``)!==e)));if(n.length===0||n.length>1)throw Error(`Please specify primaryType`);r=n[0]}return n({message:e.message,domain:{...e.domain,chainId:t,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:r})}async getOffChainSignature(e){return(await this.communicator.send(l.getOffChainSignature,e)).data}async isMessageSigned(e,t=`0x`){let n;if(typeof e==`string`&&(n=async()=>{let n=this.calculateMessageHash(e);return await this.isMessageHashSigned(n,t)}),f(e)&&(n=async()=>{let n=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(n,t)}),n)return await n();throw Error(`Invalid message type`)}async isMessageHashSigned(e,t=`0x`){let n=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(let r of n)if(await r(e,t))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(l.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(l.requestAddressBook,void 0)).data}};T([w()],E.prototype,`requestAddressBook`,null);var D=class{constructor(e={}){let{allowedDomains:t=null,debug:n=!1}=e;this.communicator=new d(t,n),this.eth=new _(this.communicator),this.txs=new m(this.communicator),this.safe=new E(this.communicator),this.wallet=new S(this.communicator)}},O=p.Operation,k=p.TokenType,A=p.TransactionStatus,j=p.TransferDirection;export{c as MessageFormatter,l as Methods,O as Operation,h as RPC_CALLS,u as RestrictedMethods,k as TokenType,A as TransactionStatus,j as TransferDirection,D as default,i as getSDKVersion,f as isObjectEIP712TypedData,p as t};
1
+ import{t as e}from"./encodeFunctionData-dy9a9oBR.js";import{H as t,V as n}from"./index-BEIkkHR9.js";import{t as r}from"./dist-DOMzXoQL.js";var i=()=>`9.1.0`,a=e=>e.toString(16).padStart(2,`0`),o=e=>{let t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,a).join(``)},s=()=>typeof window<`u`?o(10):new Date().getTime().toString(36),c=class{};c.makeRequest=(e,t)=>({id:s(),method:e,params:t,env:{sdkVersion:i()}}),c.makeResponse=(e,t,n)=>({id:e,success:!0,version:n,data:t}),c.makeErrorResponse=(e,t,n)=>({id:e,success:!1,error:t,version:n});var l;(function(e){e.sendTransactions=`sendTransactions`,e.rpcCall=`rpcCall`,e.getChainInfo=`getChainInfo`,e.getSafeInfo=`getSafeInfo`,e.getTxBySafeTxHash=`getTxBySafeTxHash`,e.getSafeBalances=`getSafeBalances`,e.signMessage=`signMessage`,e.signTypedMessage=`signTypedMessage`,e.getEnvironmentInfo=`getEnvironmentInfo`,e.getOffChainSignature=`getOffChainSignature`,e.requestAddressBook=`requestAddressBook`,e.wallet_getPermissions=`wallet_getPermissions`,e.wallet_requestPermissions=`wallet_requestPermissions`})(l||={});var u;(function(e){e.requestAddressBook=`requestAddressBook`})(u||={});var d=class{constructor(e=null,t=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>`u`,this.isValidMessage=({origin:e,data:t,source:n})=>{let r=!t,i=!this.isServer&&n===window.parent,a=t.version!==void 0&&parseInt(t.version.split(`.`)[0]),o=typeof a==`number`&&a>=1,s=!0;return Array.isArray(this.allowedOrigins)&&(s=this.allowedOrigins.find(t=>t.test(e))!==void 0),!r&&i&&o&&s},this.logIncomingMessage=e=>{},this.onParentMessage=e=>{this.isValidMessage(e)&&(this.debugMode&&this.logIncomingMessage(e),this.handleIncomingMessage(e.data))},this.handleIncomingMessage=e=>{let{id:t}=e,n=this.callbacks.get(t);n&&(n(e),this.callbacks.delete(t))},this.send=(e,t)=>{let n=c.makeRequest(e,t);if(this.isServer)throw Error(`Window doesn't exist`);return window.parent.postMessage(n,`*`),new Promise((e,t)=>{this.callbacks.set(n.id,n=>{if(!n.success){t(Error(n.error));return}e(n)})})},this.allowedOrigins=e,this.debugMode=t,this.isServer||window.addEventListener(`message`,this.onParentMessage)}},f=e=>typeof e==`object`&&!!e&&`domain`in e&&`types`in e&&`message`in e,p=r(),m=class{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw Error(`Invalid safeTxHash`);return(await this.communicator.send(l.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){let t={message:e};return(await this.communicator.send(l.signMessage,t)).data}async signTypedMessage(e){if(!f(e))throw Error(`Invalid typed data`);return(await this.communicator.send(l.signTypedMessage,{typedData:e})).data}async send({txs:e,params:t}){if(!e||!e.length)throw Error(`No transactions were passed`);let n={txs:e,params:t};return(await this.communicator.send(l.sendTransactions,n)).data}},h={eth_call:`eth_call`,eth_gasPrice:`eth_gasPrice`,eth_getLogs:`eth_getLogs`,eth_getBalance:`eth_getBalance`,eth_getCode:`eth_getCode`,eth_getBlockByHash:`eth_getBlockByHash`,eth_getBlockByNumber:`eth_getBlockByNumber`,eth_getStorageAt:`eth_getStorageAt`,eth_getTransactionByHash:`eth_getTransactionByHash`,eth_getTransactionReceipt:`eth_getTransactionReceipt`,eth_getTransactionCount:`eth_getTransactionCount`,eth_estimateGas:`eth_estimateGas`,safe_setSettings:`safe_setSettings`},g={defaultBlockParam:(e=`latest`)=>e,returnFullTxObjectParam:(e=!1)=>e,blockNumberToHex:e=>Number.isInteger(e)?`0x${e.toString(16)}`:e},_=class{constructor(e){this.communicator=e,this.call=this.buildRequest({call:h.eth_call,formatters:[null,g.defaultBlockParam]}),this.getBalance=this.buildRequest({call:h.eth_getBalance,formatters:[null,g.defaultBlockParam]}),this.getCode=this.buildRequest({call:h.eth_getCode,formatters:[null,g.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:h.eth_getStorageAt,formatters:[null,g.blockNumberToHex,g.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:h.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:h.eth_getBlockByHash,formatters:[null,g.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:h.eth_getBlockByNumber,formatters:[g.blockNumberToHex,g.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:h.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:h.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:h.eth_getTransactionCount,formatters:[null,g.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:h.eth_gasPrice}),this.getEstimateGas=e=>this.buildRequest({call:h.eth_estimateGas})([e]),this.setSafeSettings=this.buildRequest({call:h.safe_setSettings})}buildRequest(e){let{call:t,formatters:n}=e;return async e=>{n&&Array.isArray(e)&&n.forEach((t,n)=>{t&&(e[n]=t(e[n]))});let r={call:t,params:e||[]};return(await this.communicator.send(l.rpcCall,r)).data}}},v=`0x1626ba7e`,y=`0x20c13b0b`,b=4001,x=class e extends Error{constructor(t,n,r){super(t),this.code=n,this.data=r,Object.setPrototypeOf(this,e.prototype)}},S=class{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(l.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new x(`Permissions request is invalid`,b);try{return(await this.communicator.send(l.wallet_requestPermissions,e)).data}catch{throw new x(`Permissions rejected`,b)}}isPermissionRequestValid(e){return e.every(e=>typeof e==`object`?Object.keys(e).every(e=>!!Object.values(u).includes(e)):!1)}},C=(e,t)=>t.some(t=>t.parentCapability===e),w=()=>(e,t,n)=>{let r=n.value;return n.value=async function(){let e=new S(this.communicator),n=await e.getPermissions();if(C(t,n)||(n=await e.requestPermissions([{[t]:{}}])),!C(t,n))throw new x(`Permissions rejected`,b);return r.apply(this)},n},T=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},E=class{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(l.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(l.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e=`usd`}={}){return(await this.communicator.send(l.getSafeBalances,{currency:e})).data}async check1271Signature(t,n=`0x`){let r=await this.getInfo(),i=e({abi:[{constant:!1,inputs:[{name:`_dataHash`,type:`bytes32`},{name:`_signature`,type:`bytes`}],name:`isValidSignature`,outputs:[{name:``,type:`bytes4`}],payable:!1,stateMutability:`nonpayable`,type:`function`}],functionName:`isValidSignature`,args:[t,n]}),a={call:h.eth_call,params:[{to:r.safeAddress,data:i},`latest`]};try{return(await this.communicator.send(l.rpcCall,a)).data.slice(0,10).toLowerCase()===v}catch{return!1}}async check1271SignatureBytes(t,n=`0x`){let r=await this.getInfo(),i=e({abi:[{constant:!1,inputs:[{name:`_data`,type:`bytes`},{name:`_signature`,type:`bytes`}],name:`isValidSignature`,outputs:[{name:``,type:`bytes4`}],payable:!1,stateMutability:`nonpayable`,type:`function`}],functionName:`isValidSignature`,args:[t,n]}),a={call:h.eth_call,params:[{to:r.safeAddress,data:i},`latest`]};try{return(await this.communicator.send(l.rpcCall,a)).data.slice(0,10).toLowerCase()===y}catch{return!1}}calculateMessageHash(e){return t(e)}calculateTypedMessageHash(e){let t=typeof e.domain.chainId==`object`?e.domain.chainId.toNumber():Number(e.domain.chainId),r=e.primaryType;if(!r){let t=Object.values(e.types),n=Object.keys(e.types).filter(e=>t.every(t=>t.every(({type:t})=>t.replace(`[`,``).replace(`]`,``)!==e)));if(n.length===0||n.length>1)throw Error(`Please specify primaryType`);r=n[0]}return n({message:e.message,domain:{...e.domain,chainId:t,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:r})}async getOffChainSignature(e){return(await this.communicator.send(l.getOffChainSignature,e)).data}async isMessageSigned(e,t=`0x`){let n;if(typeof e==`string`&&(n=async()=>{let n=this.calculateMessageHash(e);return await this.isMessageHashSigned(n,t)}),f(e)&&(n=async()=>{let n=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(n,t)}),n)return await n();throw Error(`Invalid message type`)}async isMessageHashSigned(e,t=`0x`){let n=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(let r of n)if(await r(e,t))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(l.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(l.requestAddressBook,void 0)).data}};T([w()],E.prototype,`requestAddressBook`,null);var D=class{constructor(e={}){let{allowedDomains:t=null,debug:n=!1}=e;this.communicator=new d(t,n),this.eth=new _(this.communicator),this.txs=new m(this.communicator),this.safe=new E(this.communicator),this.wallet=new S(this.communicator)}},O=p.Operation,k=p.TokenType,A=p.TransactionStatus,j=p.TransferDirection;export{c as MessageFormatter,l as Methods,O as Operation,h as RPC_CALLS,u as RestrictedMethods,k as TokenType,A as TransactionStatus,j as TransferDirection,D as default,i as getSDKVersion,f as isObjectEIP712TypedData,p as t};
@@ -1,4 +1,4 @@
1
- import{a as e,i as t,r as n,s as r,t as i,u as a}from"./exports-ifnvj7kn.js";import{i as o,l as s,t as c}from"./lit-element-CPGuB_v8.js";import{C as l,F as u,G as d,N as f,P as p,S as ee,Y as m,_ as h,a as te,b as g,g as _,h as ne,i as v,j as y,k as re,l as b,m as x,p as ie,s as S,t as C,u as ae,w as oe,x as w,y as se}from"./AccountController-BHkVezUY.js";import{n as ce,t as le}from"./HelpersUtil-DARuFVLj.js";import"./lit-CVrrzrGA.js";import{a as T,o as E,s as D,t as ue}from"./class-map-BhcOy3ep.js";import"./class-map-fHNEycfA.js";import"./w3m-tooltip-B_eCHhBV.js";import{t as de}from"./w3m-legal-footer-mRPcrcuQ.js";import{t as fe}from"./SIWXUtil-BzHVfaWD.js";import"./wui-loading-spinner-4RmW82LV.js";import"./wui-text-srwqZdvu.js";import"./wui-button-wFo2QXAv.js";import"./wui-icon-CtPUwMGG.js";import"./wui-icon-BbFdniVd.js";import{t as pe}from"./wui-wallet-image-DXujOL0i.js";import"./wui-icon-link-6Qj31OuA.js";import"./wui-image-D_LQx7Zq.js";import"./wui-icon-box-DSb6SzSK.js";import"./wui-list-item-y7UWG-hq.js";import"./wui-loading-spinner-BAtOIaIv.js";import"./wui-separator-DblKz-FD.js";import{t as me}from"./ConstantsUtil-B93nmDo9.js";import{i as O,n as he,r as ge,t as _e}from"./ConnectorUtil-D6X_-_EG.js";import"./wui-loading-thumbnail-CAnobd9Y.js";import"./wui-link-D46W0upB.js";import{t as ve}from"./W3mFrameProvider-BJza4ZWx.js";import"./wui-icon-box-HYYcHgEF.js";import{n as ye,t as be}from"./ref-CQce-LA_.js";import"./ref-Cjfeo2-0.js";import"./wui-input-text-CTMqIyuq.js";import"./wui-email-input-CvU7ctfi.js";import"./wui-tag-DU77t7NN.js";import"./wui-list-token-0M8QOgtv.js";import{t as xe}from"./w3m-router-Dk3sxqZ8.js";import"./w3m-activity-list-CmprdRv9.js";import"./wui-shimmer-DLrwZ3J7.js";import"./w3m-tooltip-trigger-Du8nmhF7.js";import"./wui-shimmer-B3m5DSa1.js";import{t as Se}from"./wui-list-social-CufThWE9.js";import"./wui-chip-button-DDxeGzp9.js";import"./wui-qr-code-CadVdoQK.js";import"./wui-visual-BCz9REEp.js";import"./wui-input-text-CH_ak0IH.js";var Ce=s`
1
+ import{a as e,i as t,r as n,s as r,t as i,u as a}from"./exports-ifnvj7kn.js";import{i as o,l as s,t as c}from"./lit-element-CPGuB_v8.js";import{C as l,F as u,G as d,N as f,P as p,S as ee,Y as m,_ as h,a as te,b as g,g as _,h as ne,i as v,j as y,k as re,l as b,m as x,p as ie,s as S,t as C,u as ae,w as oe,x as w,y as se}from"./AccountController-BHkVezUY.js";import{n as ce,t as le}from"./HelpersUtil-DARuFVLj.js";import"./lit-CVrrzrGA.js";import{a as T,o as E,s as D,t as ue}from"./class-map-BhcOy3ep.js";import"./class-map-fHNEycfA.js";import"./w3m-tooltip-B_eCHhBV.js";import{t as de}from"./w3m-legal-footer-mRPcrcuQ.js";import{t as fe}from"./SIWXUtil-BzHVfaWD.js";import"./wui-loading-spinner-4RmW82LV.js";import"./wui-text-srwqZdvu.js";import"./wui-button-wFo2QXAv.js";import"./wui-icon-CtPUwMGG.js";import"./wui-icon-BbFdniVd.js";import{t as pe}from"./wui-wallet-image-DXujOL0i.js";import"./wui-icon-link-6Qj31OuA.js";import"./wui-image-D_LQx7Zq.js";import"./wui-icon-box-DSb6SzSK.js";import"./wui-list-item-y7UWG-hq.js";import"./wui-loading-spinner-BAtOIaIv.js";import"./wui-separator-DblKz-FD.js";import{t as me}from"./ConstantsUtil-B93nmDo9.js";import{i as O,n as he,r as ge,t as _e}from"./ConnectorUtil-D6X_-_EG.js";import"./wui-loading-thumbnail-CAnobd9Y.js";import"./wui-link-D46W0upB.js";import{t as ve}from"./W3mFrameProvider-BJza4ZWx.js";import"./wui-icon-box-HYYcHgEF.js";import{n as ye,t as be}from"./ref-CQce-LA_.js";import"./ref-Cjfeo2-0.js";import"./wui-input-text-CTMqIyuq.js";import"./wui-email-input-CvU7ctfi.js";import"./wui-tag-DU77t7NN.js";import"./wui-list-token-0M8QOgtv.js";import{t as xe}from"./w3m-router-Dk3sxqZ8.js";import"./w3m-activity-list-CmprdRv9.js";import"./wui-shimmer-DLrwZ3J7.js";import"./w3m-tooltip-trigger-Du8nmhF7.js";import"./wui-shimmer-B3m5DSa1.js";import{t as Se}from"./wui-list-social-CufThWE9.js";import"./wui-chip-button-DDxeGzp9.js";import"./wui-qr-code-BgRoILGj.js";import"./wui-visual-BCz9REEp.js";import"./wui-input-text-CH_ak0IH.js";var Ce=s`
2
2
  :host {
3
3
  display: block;
4
4
  }