PageSourceSearch

https://super-split.vercel.app/static/js/5380.8f27a2c8.chunk.js

js super-split.vercel.app collected 2026-10-03 07:50:37 UTC 8,968 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunksdk_web_test=self.webpackChunksdk_web_test||[]).push([[5380],{45380:(e,t,s)=>{s.d(t,{default:()=>j});const a=e=>e.toString(16).padStart(2,"0"),n=()=>"undefined"!=typeof window?(e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,a).join("")})(10):(new Date).getTime().toString(36);class i{}var r,o;i.makeRequest=(e,t)=>({id:n(),method:e,params:t,env:{sdkVersion:"9.1.0"}}),i.makeResponse=(e,t,s)=>({id:e,success:!0,version:s,data:t}),i.makeErrorResponse=(e,t,s)=>({id:e,success:!1,error:t,version:s}),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"}(r||(r={})),function(e){e.requestAddressBook="requestAddressBook"}(o||(o={}));const c=class{constructor(e=null,t=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer="undefined"==typeof window,this.isValidMessage=({origin:e,data:t,source:s})=>{const a=!t,n=!this.isServer&&s===window.parent,i=void 0!==t.version&&parseInt(t.version.split(".")[0]),r="number"==typeof i&&i>=1;let o=!0;return Array.isArray(this.allowedOrigins)&&(o=void 0!==this.allowedOrigins.find((t=>t.test(e)))),!a&&n&&r&&o},this.logIncomingMessage=e=>{console.info(`Safe Apps SDK v1: A message was received from origin ${e.origin}. `,e.data)},this.onParentMessage=e=>{this.isValidMessage(e)&&(this.debugMode&&this.logIncomingMessage(e),this.handleIncomingMessage(e.data))},this.handleIncomingMessage=e=>{const{id:t}=e,s=this.callbacks.get(t);s&&(s(e),this.callbacks.delete(t))},this.send=(e,t)=>{const s=i.makeRequest(e,t);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(s,"*"),new Promise(((e,t)=>{this.callbacks.set(s.id,(s=>{s.success?e(s):t(new Error(s.error))}))}))},this.allowedOrigins=e,this.debugMode=t,this.isServer||window.addEventListener("message",this.onParentMessage)}},l=e=>"object"==typeof e&&null!=e&&"domain"in e&&"types"in e&&"message"in e;s(82997);class u{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(r.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const t={message:e};return(await this.communicator.send(r.signMessage,t)).data}async signTypedMessage(e){if(!l(e))throw new Error("Invalid typed data");return(await this.communicator.send(r.signTypedMessage,{typedData:e})).data}async send({txs:e,params:t}){if(!e||!e.length)throw new Error("No transactions were passed");const s={txs:e,params:t};return(await this.communicator.send(r.sendTransactions,s)).data}}const d="eth_call",h="eth_gasPrice",g="eth_getLogs",m="eth_getBalance",y="eth_getCode",f="eth_getBlockByHash",p="eth_getBlockByNumber",w="eth_getStorageAt",b="eth_getTransactionByHash",v="eth_getTransactionReceipt",k="eth_getTransactionCount",S="eth_estimateGas",B="safe_setSettings",P={defaultBlockParam:(e="latest")=>e,returnFullTxObjectParam:(e=!1)=>e,blockNumberToHex:e=>Number.isInteger(e)?`0x${e.toString(16)}`:e};class T{constructor(e){this.communicator=e,this.call=this.buildRequest({call:d,formatters:[null,P.defaultBlockParam]}),this.getBalance=this.buildRequest({call:m,formatters:[null,P.defaultBlockParam]}),this.getCode=this.buildRequest({call:y,formatters:[null,P.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:w,formatters:[null,P.blockNumberToHex,P.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:g}),this.getBlockByHash=this.buildRequest({call:f,formatters:[null,P.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:p,formatters:[P.blockNumberToHex,P.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:b}),this.getTransactionReceipt=this.buildRequest({call:v}),this.getTransactionCount=this.buildRequest({call:k,formatters:[null,P.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:h}),this.getEstimateGas=e=>this.buildRequest({call:S})([e]),this.setSafeSettings=this.buildRequest({call:B})}buildRequest(e){const{call:t,formatters:s}=e;return async e=>
1{s&&Array.isArray(e)&&s.forEach(((t,s)=>{t&&(e[s]=t(e[s]))}));const a={call:t,params:e||[]};return(await this.communicator.send(r.rpcCall,a)).data}}}var q=s(5276),M=s(90369),x=s(86236);const _=4001;class I extends Error{constructor(e,t,s){super(e),this.code=t,this.data=s,Object.setPrototypeOf(this,I.prototype)}}class R{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(r.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new I("Permissions request is invalid",_);try{return(await this.communicator.send(r.wallet_requestPermissions,e)).data}catch{throw new I("Permissions rejected",_)}}isPermissionRequestValid(e){return e.every((e=>"object"==typeof e&&Object.keys(e).every((e=>!!Object.values(o).includes(e)))))}}const C=(e,t)=>t.some((t=>t.parentCapability===e)),H=()=>(e,t,s)=>{const a=s.value;return s.value=async function(){const e=new R(this.communicator);let s=await e.getPermissions();if(C(t,s)||(s=await e.requestPermissions([{[t]:{}}])),!C(t,s))throw new I("Permissions rejected",_);return a.apply(this)},s};var A=function(e,t,s,a){var n,i=arguments.length,r=i<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,s):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,a);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(i<3?n(r):i>3?n(t,s,r):n(t,s))||r);return i>3&&r&&Object.defineProperty(t,s,r),r};class O{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(r.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(r.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(r.getSafeBalances,{currency:e})).data}async check1271Signature(e,t="0x"){const s=await this.getInfo(),a=(0,q.p)({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:[e,t]}),n={call:d,params:[{to:s.safeAddress,data:a},"latest"]};try{return"0x1626ba7e"===(await this.communicator.send(r.rpcCall,n)).data.slice(0,10).toLowerCase()}catch(i){return!1}}async check1271SignatureBytes(e,t="0x"){const s=await this.getInfo(),a=(0,q.p)({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:[e,t]}),n={call:d,params:[{to:s.safeAddress,data:a},"latest"]};try{return"0x20c13b0b"===(await this.communicator.send(r.rpcCall,n)).data.slice(0,10).toLowerCase()}catch(i){return!1}}calculateMessageHash(e){return(0,M.A)(e)}calculateTypedMessageHash(e){const t="object"==typeof e.domain.chainId?e.domain.chainId.toNumber():Number(e.domain.chainId);let s=e.primaryType;if(!s){const t=Object.values(e.types),a=Object.keys(e.types).filter((e=>t.every((t=>t.every((({type:t})=>t.replace("[","").replace("]","")!==e))))));if(0===a.length||a.length>1)throw new Error("Please specify primaryType");s=a[0]}return(0,x.Zh)({message:e.message,domain:{...e.domain,chainId:t,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:s})}async getOffChainSignature(e){return(await this.communicator.send(r.getOffChainSignature,e)).data}async isMessageSigned(e,t="0x"){let s;if("string"==typeof e&&(s=async()=>{const s=this.calculateMessageHash(e);return await this.isMessageHashSigned(s,t)}),l(e)&&(s=async()=>{const s=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(s,t)}),s){return await s()}throw new Error("Invalid message type")}async isMessageHashSigned(e,t="0x"){const s=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const a of s){if(await a(e,t))return!0}return!1}async getEnvironmentInfo(){return(await this.communicator.send(r.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(r.requestAddressBook,void 0)).data}}A([H()],O.prototype,"requestAddressBook",null);const j=class{constructor(e={}){const{allowedDomains:t=null,debug:s=!1}=e;this.communicator=new c(t,s),this.eth=new T(this.communicator),this.txs=new u(this.communicator),this.safe=new O(this.communicator),this.wallet=new R(this.communicator)}}}}]);
2//# sourceMappingURL=5380.8f27a2c8.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.