@frak-labs/nexus-sdk 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/bundle.js +1 -1
- package/dist/{chunk-ACCWBBZ7.js → chunk-6LI5YIZB.js} +3 -1
- package/dist/{chunk-LAO7FUQ2.cjs → chunk-QRECYKIR.cjs} +3 -1
- package/dist/core/actions/index.cjs +2 -2
- package/dist/core/actions/index.js +1 -1
- package/dist/react/index.cjs +8 -8
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
package/dist/bundle/bundle.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`),{name:"AbiEncodingArrayLengthMismatchError"})}},ke=class extends H{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${$(r)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},He=class extends H{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${r}`].join(`
|
|
4
4
|
`),{name:"AbiEncodingLengthMismatchError"})}},ze=class extends H{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
5
5
|
`),{docsPath:r,name:"InvalidAbiEncodingType"})}},Le=class extends H{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
|
|
6
|
-
`),{name:"InvalidArrayError"})}}});var xe,ye,lt=M(()=>{"use strict";ie();xe=class extends H{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},ye=class extends H{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}});function U(e,{dir:t,size:r=32}={}){return typeof e=="string"?q(e,{dir:t,size:r}):Wt(e,{dir:t,size:r})}function q(e,{dir:t,size:r=32}={}){if(r===null)return e;let n=e.replace("0x","");if(n.length>r*2)throw new ye({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function Wt(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new ye({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let i=0;i<r;i++){let p=t==="right";n[p?i:r-i-1]=e[p?i:e.length-i-1]}return n}var be=M(()=>{"use strict";lt()});var $e,Ue,dt=M(()=>{"use strict";ie();$e=class extends H{constructor({max:t,min:r,signed:n,size:i,value:p}){super(`Number "${p}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},Ue=class extends H{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function ae(e,{size:t}){if($(e)>t)throw new Ue({givenSize:$(e),maxSize:t})}var mt=M(()=>{"use strict";dt();he()});function _(e,t={}){return typeof e=="number"||typeof e=="bigint"?K(e,t):typeof e=="string"?De(e,t):typeof e=="boolean"?_e(e,t):ge(e,t)}function _e(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(ae(r,{size:t.size}),U(r,{size:t.size})):r}function ge(e,t={}){let r="";for(let i=0;i<e.length;i++)r+=Kr[e[i]];let n=`0x${r}`;return typeof t.size=="number"?(ae(n,{size:t.size}),U(n,{dir:"right",size:t.size})):n}function K(e,t={}){let{signed:r,size:n}=t,i=BigInt(e),p;n?r?p=(1n<<BigInt(n)*8n-1n)-1n:p=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(p=BigInt(Number.MAX_SAFE_INTEGER));let l=typeof p=="bigint"&&r?-p-1n:0;if(p&&i>p||i<l){let f=typeof e=="bigint"?"n":"";throw new $e({max:p?`${p}${f}`:void 0,min:`${l}${f}`,signed:r,size:n,value:`${e}${f}`})}let E=`0x${(r&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?U(E,{size:n}):E}function De(e,t={}){let r=Jr.encode(e);return ge(r,t)}var Kr,Jr,we=M(()=>{"use strict";dt();be();mt();Kr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));Jr=new TextEncoder});function ht(e,t={}){return typeof e=="number"||typeof e=="bigint"?Jt(e,t):typeof e=="boolean"?Kt(e,t):Z(e)?Ie(e,t):Ne(e,t)}function Kt(e,t={}){let r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(ae(r,{size:t.size}),U(r,{size:t.size})):r}function qt(e){if(e>=J.zero&&e<=J.nine)return e-J.zero;if(e>=J.A&&e<=J.F)return e-(J.A-10);if(e>=J.a&&e<=J.f)return e-(J.a-10)}function Ie(e,t={}){let r=e;t.size&&(ae(r,{size:t.size}),r=U(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let i=n.length/2,p=new Uint8Array(i);for(let l=0,E=0;l<i;l++){let f=qt(n.charCodeAt(E++)),F=qt(n.charCodeAt(E++));if(f===void 0||F===void 0)throw new H(`Invalid byte sequence ("${n[E-2]}${n[E-1]}" in "${n}").`);p[l]=f*16+F}return p}function Jt(e,t){let r=K(e,t);return Ie(r)}function Ne(e,t={}){let r=Gr.encode(e);return typeof t.size=="number"?(ae(r,{size:t.size}),U(r,{dir:"right",size:t.size})):r}var Gr,J,Oe=M(()=>{"use strict";ie();me();be();mt();we();Gr=new TextEncoder;J={zero:48,nine:57,A:65,F:70,a:97,f:102}});function xt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Xr(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Ee(e,...t){if(!Xr(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function yt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Gt(e,t){Ee(e);let r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var bt=M(()=>{"use strict"});function Yr(e,t=!1){return t?{h:Number(e&je),l:Number(e>>Xt&je)}:{h:Number(e>>Xt&je)|0,l:Number(e&je)|0}}function Yt(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:p,l}=Yr(e[i],t);[r[i],n[i]]=[p,l]}return[r,n]}var je,Xt,Zt,Qt,er,tr,rr=M(()=>{"use strict";je=BigInt(4294967295),Xt=BigInt(32);Zt=(e,t,r)=>e<<r|t>>>32-r,Qt=(e,t,r)=>t<<r|e>>>32-r,er=(e,t,r)=>t<<r-32|e>>>64-r,tr=(e,t,r)=>e<<r-32|t>>>64-r});function wt(e){for(let t=0;t<e.length;t++)e[t]=Zr(e[t])}function Qr(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function We(e){return typeof e=="string"&&(e=Qr(e)),Ee(e),e}function nr(e){let t=n=>e().update(We(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function ir(e){let t=(n,i)=>e(i).update(We(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}var or,gt,Zr,Ve,qn,ar=M(()=>{"use strict";bt();or=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),gt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Zr=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;Ve=class{clone(){return this._cloneInto()}},qn={}.toString});function so(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let l=0;l<10;l++)r[l]=e[l]^e[l+10]^e[l+20]^e[l+30]^e[l+40];for(let l=0;l<10;l+=2){let E=(l+8)%10,f=(l+2)%10,F=r[f],y=r[f+1],d=sr(F,y,1)^r[E],h=cr(F,y,1)^r[E+1];for(let a=0;a<50;a+=10)e[l+a]^=d,e[l+a+1]^=h}let i=e[2],p=e[3];for(let l=0;l<24;l++){let E=ur[l],f=sr(i,p,E),F=cr(i,p,E),y=pr[l];i=e[y],p=e[y+1],e[y]=f,e[y+1]=F}for(let l=0;l<50;l+=10){for(let E=0;E<10;E++)r[E]=e[l+E];for(let E=0;E<10;E++)e[l+E]^=~r[(E+2)%10]&r[(E+4)%10]}e[0]^=io[n],e[1]^=ao[n]}r.fill(0)}var pr,ur,fr,eo,ve,to,ro,oo,no,io,ao,sr,cr,qe,Q,Yn,Zn,Qn,ei,ti,lr,ri,oi,dr,ni,ii,mr=M(()=>{"use strict";bt();rr();ar();pr=[],ur=[],fr=[],eo=BigInt(0),ve=BigInt(1),to=BigInt(2),ro=BigInt(7),oo=BigInt(256),no=BigInt(113);for(let e=0,t=ve,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],pr.push(2*(5*n+r)),ur.push((e+1)*(e+2)/2%64);let i=eo;for(let p=0;p<7;p++)t=(t<<ve^(t>>ro)*no)%oo,t&to&&(i^=ve<<(ve<<BigInt(p))-ve);fr.push(i)}[io,ao]=Yt(fr,!0),sr=(e,t,r)=>r>32?er(e,t,r):Zt(e,t,r),cr=(e,t,r)=>r>32?tr(e,t,r):Qt(e,t,r);qe=class e extends Ve{constructor(t,r,n,i=!1,p=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=p,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,xt(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=or(this.state)}keccak(){gt||wt(this.state32),so(this.state32,this.rounds),gt||wt(this.state32),this.posOut=0,this.pos=0}update(t){yt(this);let{blockLen:r,state:n}=this;t=We(t);let i=t.length;for(let p=0;p<i;){let l=Math.min(r-this.pos,i-p);for(let E=0;E<l;E++)n[this.pos++]^=t[p++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,r&128&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){yt(this,!1),Ee(t),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,p=t.length;i<p;){this.posOut>=n&&this.keccak();let l=Math.min(n-this.posOut,p-i);t.set(r.subarray(this.posOut,this.posOut+l),i),this.posOut+=l,i+=l}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return xt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Gt(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:p,enableXOF:l}=this;return t||(t=new e(r,n,i,l,p)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=p,t.suffix=n,t.outputLen=i,t.enableXOF=l,t.destroyed=this.destroyed,t}},Q=(e,t,r)=>nr(()=>new qe(t,e,r)),Yn=Q(6,144,224/8),Zn=Q(6,136,256/8),Qn=Q(6,104,384/8),ei=Q(6,72,512/8),ti=Q(1,144,224/8),lr=Q(1,136,256/8),ri=Q(1,104,384/8),oi=Q(1,72,512/8),dr=(e,t,r)=>ir((n={})=>new qe(t,e,n.dkLen===void 0?r:n.dkLen,!0)),ni=dr(31,168,128/8),ii=dr(31,136,256/8)});function Te(e,t){let r=t||"hex",n=lr(Z(e,{strict:!1})?ht(e):e);return r==="bytes"?n:_(n)}var It=M(()=>{"use strict";mr();me();Oe();we()});var se,Et=M(()=>{"use strict";ie();se=class extends H{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var pe,vt=M(()=>{"use strict";pe=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let n=this.keys().next().value;n&&this.delete(n)}return this}}});function hr(e,t){if(Tt.has(`${e}.${t}`))return Tt.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=Te(Ne(r),"bytes"),i=(t?r.substring(`${t}0x`.length):r).split("");for(let l=0;l<40;l+=2)n[l>>1]>>4>=8&&i[l]&&(i[l]=i[l].toUpperCase()),(n[l>>1]&15)>=8&&i[l+1]&&(i[l+1]=i[l+1].toUpperCase());let p=`0x${i.join("")}`;return Tt.set(`${e}.${t}`,p),p}var Tt,xr=M(()=>{"use strict";Oe();It();vt();Tt=new pe(8192)});function Se(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(St.has(n))return St.get(n);let i=co.test(e)?e.toLowerCase()===e?!0:r?hr(e)===e:!0:!1;return St.set(n,i),i}var co,St,Ft=M(()=>{"use strict";vt();xr();co=/^0x[a-fA-F0-9]{40}$/,St=new pe(8192)});function ee(e){return typeof e[0]=="string"?j(e):yr(e)}function yr(e){let t=0;for(let i of e)t+=i.length;let r=new Uint8Array(t),n=0;for(let i of e)r.set(i,n),n+=i.length;return r}function j(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var At=M(()=>{"use strict"});function br(e,t,r,{strict:n}={}){return Z(e,{strict:!1})?uo(e,t,r,{strict:n}):po(e,t,r,{strict:n})}function gr(e,t){if(typeof t=="number"&&t>0&&t>$(e)-1)throw new xe({offset:t,position:"start",size:$(e)})}function wr(e,t,r){if(typeof t=="number"&&typeof r=="number"&&$(e)!==r-t)throw new xe({offset:r,position:"end",size:$(e)})}function po(e,t,r,{strict:n}={}){gr(e,t);let i=e.slice(t,r);return n&&wr(i,t,r),i}function uo(e,t,r,{strict:n}={}){gr(e,t);let i=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&wr(i,t,r),i}var Ir=M(()=>{"use strict";lt();me();he()});function Ct(e,t){if(e.length!==t.length)throw new He({expectedLength:e.length,givenLength:t.length});let r=fo({params:e,values:t}),n=Rt(r);return n.length===0?"0x":n}function fo({params:e,values:t}){let r=[];for(let n=0;n<e.length;n++)r.push(Pt({param:e[n],value:t[n]}));return r}function Pt({param:e,value:t}){let r=wo(e.type);if(r){let[n,i]=r;return mo(t,{length:n,param:{...e,type:i}})}if(e.type==="tuple")return go(t,{param:e});if(e.type==="address")return lo(t);if(e.type==="bool")return xo(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let n=e.type.startsWith("int");return yo(t,{signed:n})}if(e.type.startsWith("bytes"))return ho(t,{param:e});if(e.type==="string")return bo(t);throw new ze(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Rt(e){let t=0;for(let p=0;p<e.length;p++){let{dynamic:l,encoded:E}=e[p];l?t+=32:t+=$(E)}let r=[],n=[],i=0;for(let p=0;p<e.length;p++){let{dynamic:l,encoded:E}=e[p];l?(r.push(K(t+i,{size:32})),n.push(E),i+=$(E)):r.push(E)}return ee([...r,...n])}function lo(e){if(!Se(e))throw new se({address:e});return{dynamic:!1,encoded:q(e.toLowerCase())}}function mo(e,{length:t,param:r}){let n=t===null;if(!Array.isArray(e))throw new Le(e);if(!n&&e.length!==t)throw new Be({expectedLength:t,givenLength:e.length,type:`${r.type}[${t}]`});let i=!1,p=[];for(let l=0;l<e.length;l++){let E=Pt({param:r,value:e[l]});E.dynamic&&(i=!0),p.push(E)}if(n||i){let l=Rt(p);if(n){let E=K(p.length,{size:32});return{dynamic:!0,encoded:p.length>0?ee([E,l]):E}}if(i)return{dynamic:!0,encoded:l}}return{dynamic:!1,encoded:ee(p.map(({encoded:l})=>l))}}function ho(e,{param:t}){let[,r]=t.type.split("bytes"),n=$(e);if(!r){let i=e;return n%32!==0&&(i=q(i,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:ee([q(K(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new ke({expectedSize:Number.parseInt(r),value:e});return{dynamic:!1,encoded:q(e,{dir:"right"})}}function xo(e){if(typeof e!="boolean")throw new H(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:q(_e(e))}}function yo(e,{signed:t}){return{dynamic:!1,encoded:K(e,{size:32,signed:t})}}function bo(e){let t=De(e),r=Math.ceil($(t)/32),n=[];for(let i=0;i<r;i++)n.push(q(br(t,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:ee([q(K($(t),{size:32})),...n])}}function go(e,{param:t}){let r=!1,n=[];for(let i=0;i<t.components.length;i++){let p=t.components[i],l=Array.isArray(e)?i:p.name,E=Pt({param:p,value:e[l]});n.push(E),E.dynamic&&(r=!0)}return{dynamic:r,encoded:r?Rt(n):ee(n.map(({encoded:i})=>i))}}function wo(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}var Er=M(()=>{"use strict";Vt();Et();ie();Ft();At();be();he();Ir();we()});function Mt(e,t){if(!Se(e,{strict:!1}))throw new se({address:e});if(!Se(t,{strict:!1}))throw new se({address:t});return e.toLowerCase()===t.toLowerCase()}var vr=M(()=>{"use strict";Et();Ft()});var ko={};Vr(ko,{Deferred:()=>W,FrakContextManager:()=>te,FrakRpcError:()=>k,PressInteractionEncoder:()=>Hr,PurchaseInteractionEncoder:()=>zr,ReferralInteractionEncoder:()=>Ze,RpcErrorCodes:()=>L,WebShopInteractionEncoder:()=>Lr,compressJson:()=>le,createIFrameNexusClient:()=>pt,createIframe:()=>st,decompressDataAndCheckHash:()=>ne,decompressJson:()=>de,displayModal:()=>re,hashAndCompressData:()=>oe,interactionTypes:()=>V,openSso:()=>Mr,processReferral:()=>Qe,productTypes:()=>D,productTypesMask:()=>Pr,referralInteraction:()=>Ur,sendInteraction:()=>Xe,sendTransaction:()=>kr,siweAuthenticate:()=>Br,walletStatus:()=>Ye,watchWalletStatus:()=>Ge});var k=class extends Error{constructor(r,n,i){super(n);this.code=r;this.data=i}};var Pe=class extends k{constructor(t){super(L.internalError,t)}};var L={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006};var W=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve=t=>{this._resolve?.(t)};reject=t=>{this._reject?.(t)}};var $t=Ce(ot(),1),it=Ce(nt(),1);async function oe(e){let t=(0,it.sha256)(JSON.stringify(e)),r={...e,validationHash:t},n=await le(r),i=(0,it.sha256)(n);return{compressed:n,compressedHash:i}}async function le(e){return(0,$t.compressToBase64)(JSON.stringify(e))}var Ut=Ce(ot(),1),at=Ce(nt(),1);async function ne(e){if(!(e?.compressed&&e?.compressedHash))throw new k(L.corruptedResponse,"Missing compressed data");let t=await de(e.compressed);if(!t)throw new k(L.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new k(L.corruptedResponse,"Missing validation hash");if((0,at.sha256)(e.compressed)!==e.compressedHash)throw new k(L.corruptedResponse,"Invalid compressed hash");let{validationHash:n,...i}=t;if((0,at.sha256)(JSON.stringify(i))!==t.validationHash)throw new k(L.corruptedResponse,"Invalid data validation hash");return t}async function de(e){let t=await(0,Ut.decompressFromBase64)(e);try{return JSON.parse(t)}catch(r){return console.error("Invalid compressed data",{e:r,decompressed:t}),null}}var ce="nexus-wallet-backup";function _t(){let e=new Map;return{createChannel:t=>{let r=Math.random().toString(36).substring(7);return e.set(r,t),r},getRpcResolver:t=>e.get(t),removeChannel:t=>e.delete(t),destroy:()=>e.clear()}}var Me={id:"nexus-wallet",name:"nexus-wallet",allow:"publickey-credentials-get *; clipboard-write; web-share *",style:{width:"0",height:"0",border:"0",position:"absolute",zIndex:1e3,top:"-1000px",left:"-1000px"}};function st({walletBaseUrl:e}){let t=document.querySelector("#nexus-wallet");if(t)return Promise.resolve(t);let r=document.createElement("iframe");return r.id=Me.id,r.name=Me.name,r.allow=Me.allow,r.style.zIndex=Me.style.zIndex.toString(),ct({iframe:r,isVisible:!1}),document.body.appendChild(r),new Promise(n=>{r?.addEventListener("load",()=>n(r)),r.src=`${e}/listener`})}function ct({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}function Dt({iframe:e}){let t=new W;return{handleEvent:async n=>{switch(n.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":n.data.backup?localStorage.setItem(ce,n.data.backup):localStorage.removeItem(ce);break;case"remove-backup":localStorage.removeItem(ce);break;case"show":case"hide":ct({iframe:e,isVisible:n.iframeLifecycle==="show"});break}},isConnected:t.promise}}function Nt({nexusWalletUrl:e,iframe:t,channelManager:r,iframeLifecycleManager:n}){if(typeof window>"u")throw new k(L.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new k(L.configError,"The iframe does not have a product window");let i=t.contentWindow,p=async f=>{if(!(f.origin&&URL.canParse(f.origin))||new URL(f.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase())return;if("iframeLifecycle"in f.data){await n.handleEvent(f.data);return}if("clientLifecycle"in f.data){console.error("Client lifecycle event received on the client side, dismissing it");return}let F=f.data.id,y=r.getRpcResolver(F);y&&await y(f.data)};return window.addEventListener("message",p),{sendEvent:f=>{i.postMessage(f,{targetOrigin:e})},cleanup:()=>{window.removeEventListener("message",p)}}}function pt({config:e,iframe:t}){let r=_t(),n=Dt({iframe:t}),i=Nt({nexusWalletUrl:e.walletUrl,iframe:t,channelManager:r,iframeLifecycleManager:n}),p=async F=>{if(!await n.isConnected)throw new k(L.clientNotConnected,"The iframe provider isn't connected yet");let d=new W,h=r.createChannel(async b=>{let o=await ne(b.data);o.error?d.reject(new k(o.error.code,o.error.message,o.error?.data)):d.resolve(o.result),r.removeChannel(h)}),a=await oe(F);return i.sendEvent({id:h,topic:F.method,data:a}),d.promise},l=async(F,y)=>{if(!await n.isConnected)throw new k(L.clientNotConnected,"The iframe provider isn't connected yet");let h=r.createChannel(async b=>{let o=await ne(b.data);if(o.result)y(o.result);else throw new Pe("No valid result in the response")}),a=await oe(F);i.sendEvent({id:h,topic:F.method,data:a})},E=async()=>{r.destroy(),i.cleanup(),t.remove()},f=qr({config:e,messageHandler:i,lifecycleManager:n});return{config:e,waitForConnection:n.isConnected,waitForSetup:f,request:p,listenerRequest:l,destroy:E}}async function qr({config:e,messageHandler:t,lifecycleManager:r}){await r.isConnected;let n=async()=>{let p=e.metadata.css;p&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:p}})},i=async()=>{if(typeof window>"u")return;let p=window.localStorage.getItem(ce);p&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:p}})};await Promise.all([n(),i()])}var Ke=256,Je;function Tr(e=11){if(!Je||Ke+e>256*2){Je="",Ke=0;for(let t=0;t<256;t++)Je+=(256+Math.random()*256|0).toString(16).substring(1)}return Je.substring(Ke,Ke+++e)}Er();Oe();we();At();vr();It();be();var Bt="fCtx";function Io(e){return btoa(Array.from(e,t=>String.fromCharCode(t)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Eo(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(t===0?0:4-t),"=")),r=>r.charCodeAt(0))}function Sr(e){if(e?.r)try{let t=Ie(e.r);return Io(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function Fr(e){if(!(!e||e.length===0))try{let t=Eo(e);return{r:ge(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function Ar({url:e}){if(!e)return null;let r=new URL(e).searchParams.get(Bt);return r?Fr(r):null}function Cr({url:e,context:t}){if(!e)return null;let r=Ar({url:e}),n=r?{...r,...t}:t;if(!n.r)return;let i=Sr(n);if(!i)return;let p=new URL(e);return p.searchParams.set(Bt,i),p.toString()}function vo(e){let t=new URL(e);return t.searchParams.delete(Bt),t.toString()}function To({url:e,context:t}){if(!window.location?.href||typeof window>"u"){console.error("No window found, can't update context");return}let r=Cr({url:e,context:t});r&&window.history.replaceState(null,"",r.toString())}var te={compress:Sr,decompress:Fr,parse:Ar,update:Cr,remove:vo,replaceUrl:To};var D={dapp:1,press:2,webshop:3,referral:30,purchase:31},Pr=Object.entries(D).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{});var V={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4"}};function Ge(e,t){return e.listenerRequest({method:"frak_listenToWalletStatus"},t)}function Rr({domain:e}){return Te(_(e))}async function Xe(e,{productId:t,interaction:r,validation:n}){let i=t??Rr(e.config);return await e.request({method:"frak_sendInteraction",params:[i,r,n]})}async function re(e,{steps:t,metadata:r}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,r]})}async function Mr(e,t){let{metadata:r}=e.config;await e.request({method:"frak_sso",params:[t,r.name,r.css]})}function kt(){return Tr(96)}async function Br(e,{siwe:t,metadata:r}){let n=t?.statement??`I confirm that I want to use my Frak wallet on: ${e.config.metadata.name}`,i={...t,statement:n,nonce:t?.nonce??kt(),uri:t?.uri??`https://${e.config.domain}`,version:t?.version??"1",domain:e.config.domain};return(await re(e,{metadata:r,steps:{login:{},siweAuthenticate:{siwe:i}}})).siweAuthenticate}async function kr(e,{tx:t,metadata:r}){return(await re(e,{metadata:r,steps:{login:{},sendTransaction:{tx:t}}})).sendTransaction}async function Ye(e,t){let r=new W,n=!1;return await Ge(e,i=>{t?.(i),n||(r.resolve(i),n=!0)}),r.promise}function So({articleId:e}){let t=j([V.press.openArticle,U(e,{size:32})]);return{handlerTypeDenominator:_(D.press),interactionData:t}}function Fo({articleId:e}){let t=j([V.press.readArticle,U(e,{size:32})]);return{handlerTypeDenominator:_(D.press),interactionData:t}}var Hr={openArticle:So,readArticle:Fo};function Ao(){let e=j([V.referral.createLink,"0x"]);return{handlerTypeDenominator:_(D.referral),interactionData:e}}function Co({referrer:e}){let t=j([V.referral.referred,U(e,{size:32})]);return{handlerTypeDenominator:_(D.referral),interactionData:t}}var Ze={createLink:Ao,referred:Co};function Po({purchaseId:e}){let t=j([V.purchase.started,U(e,{size:32})]);return{handlerTypeDenominator:_(D.purchase),interactionData:t}}function Ro({purchaseId:e,proof:t}){let r=Ct([{type:"uint256"},{type:"bytes32[]"}],[BigInt(e),t]),n=j([V.purchase.completed,r]);return{handlerTypeDenominator:_(D.purchase),interactionData:n}}var zr={startPurchase:Po,completedPurchase:Ro};function Mo(){let e=j([V.webshop.open,"0x"]);return{handlerTypeDenominator:_(D.webshop),interactionData:e}}var Lr={open:Mo};async function Qe(e,{walletStatus:t,frakContext:r,modalConfig:n,productId:i}){try{let p=t?.wallet;if(!r?.r)return p&&te.replaceUrl({url:window.location?.href,context:{r:p}}),"no-referrer";if(p||(p=await $r(e,{modalConfig:n,walletStatus:t})),p&&Mt(r.r,p))return"self-referral";t?.interactionSession||(p=await $r(e,{modalConfig:n,walletStatus:t})),p&&te.replaceUrl({url:window.location?.href,context:{r:p}});let l=Ze.referred({referrer:r.r});return await Xe(e,{productId:i,interaction:l}),"success"}catch(p){return Bo(p)}}async function $r(e,{modalConfig:t,walletStatus:r}){return r?.interactionSession?r.wallet??void 0:t?(await re(e,t))?.login?.wallet??void 0:void 0}function Bo(e){if(e instanceof k)switch(e.code){case L.walletNotConnected:return"no-wallet";case L.serverErrorForInteractionDelegation:return"no-session";default:return"error"}return"error"}async function Ur(e,{productId:t,modalConfig:r}={}){let n=te.parse({url:window.location.href}),i=await Ye(e);try{return await Qe(e,{walletStatus:i,frakContext:n,modalConfig:r,productId:t})}catch(p){return p}}return Wr(ko);})();
|
|
6
|
+
`),{name:"InvalidArrayError"})}}});var xe,ye,lt=M(()=>{"use strict";ie();xe=class extends H{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},ye=class extends H{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}});function U(e,{dir:t,size:r=32}={}){return typeof e=="string"?q(e,{dir:t,size:r}):Wt(e,{dir:t,size:r})}function q(e,{dir:t,size:r=32}={}){if(r===null)return e;let n=e.replace("0x","");if(n.length>r*2)throw new ye({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function Wt(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new ye({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let i=0;i<r;i++){let p=t==="right";n[p?i:r-i-1]=e[p?i:e.length-i-1]}return n}var be=M(()=>{"use strict";lt()});var $e,Ue,dt=M(()=>{"use strict";ie();$e=class extends H{constructor({max:t,min:r,signed:n,size:i,value:p}){super(`Number "${p}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},Ue=class extends H{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function ae(e,{size:t}){if($(e)>t)throw new Ue({givenSize:$(e),maxSize:t})}var mt=M(()=>{"use strict";dt();he()});function _(e,t={}){return typeof e=="number"||typeof e=="bigint"?K(e,t):typeof e=="string"?De(e,t):typeof e=="boolean"?_e(e,t):ge(e,t)}function _e(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(ae(r,{size:t.size}),U(r,{size:t.size})):r}function ge(e,t={}){let r="";for(let i=0;i<e.length;i++)r+=Kr[e[i]];let n=`0x${r}`;return typeof t.size=="number"?(ae(n,{size:t.size}),U(n,{dir:"right",size:t.size})):n}function K(e,t={}){let{signed:r,size:n}=t,i=BigInt(e),p;n?r?p=(1n<<BigInt(n)*8n-1n)-1n:p=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(p=BigInt(Number.MAX_SAFE_INTEGER));let l=typeof p=="bigint"&&r?-p-1n:0;if(p&&i>p||i<l){let f=typeof e=="bigint"?"n":"";throw new $e({max:p?`${p}${f}`:void 0,min:`${l}${f}`,signed:r,size:n,value:`${e}${f}`})}let E=`0x${(r&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?U(E,{size:n}):E}function De(e,t={}){let r=Jr.encode(e);return ge(r,t)}var Kr,Jr,we=M(()=>{"use strict";dt();be();mt();Kr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));Jr=new TextEncoder});function ht(e,t={}){return typeof e=="number"||typeof e=="bigint"?Jt(e,t):typeof e=="boolean"?Kt(e,t):Z(e)?Ie(e,t):Ne(e,t)}function Kt(e,t={}){let r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(ae(r,{size:t.size}),U(r,{size:t.size})):r}function qt(e){if(e>=J.zero&&e<=J.nine)return e-J.zero;if(e>=J.A&&e<=J.F)return e-(J.A-10);if(e>=J.a&&e<=J.f)return e-(J.a-10)}function Ie(e,t={}){let r=e;t.size&&(ae(r,{size:t.size}),r=U(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let i=n.length/2,p=new Uint8Array(i);for(let l=0,E=0;l<i;l++){let f=qt(n.charCodeAt(E++)),F=qt(n.charCodeAt(E++));if(f===void 0||F===void 0)throw new H(`Invalid byte sequence ("${n[E-2]}${n[E-1]}" in "${n}").`);p[l]=f*16+F}return p}function Jt(e,t){let r=K(e,t);return Ie(r)}function Ne(e,t={}){let r=Gr.encode(e);return typeof t.size=="number"?(ae(r,{size:t.size}),U(r,{dir:"right",size:t.size})):r}var Gr,J,Oe=M(()=>{"use strict";ie();me();be();mt();we();Gr=new TextEncoder;J={zero:48,nine:57,A:65,F:70,a:97,f:102}});function xt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Xr(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Ee(e,...t){if(!Xr(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function yt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Gt(e,t){Ee(e);let r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var bt=M(()=>{"use strict"});function Yr(e,t=!1){return t?{h:Number(e&je),l:Number(e>>Xt&je)}:{h:Number(e>>Xt&je)|0,l:Number(e&je)|0}}function Yt(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:p,l}=Yr(e[i],t);[r[i],n[i]]=[p,l]}return[r,n]}var je,Xt,Zt,Qt,er,tr,rr=M(()=>{"use strict";je=BigInt(4294967295),Xt=BigInt(32);Zt=(e,t,r)=>e<<r|t>>>32-r,Qt=(e,t,r)=>t<<r|e>>>32-r,er=(e,t,r)=>t<<r-32|e>>>64-r,tr=(e,t,r)=>e<<r-32|t>>>64-r});function wt(e){for(let t=0;t<e.length;t++)e[t]=Zr(e[t])}function Qr(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function We(e){return typeof e=="string"&&(e=Qr(e)),Ee(e),e}function nr(e){let t=n=>e().update(We(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function ir(e){let t=(n,i)=>e(i).update(We(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}var or,gt,Zr,Ve,qn,ar=M(()=>{"use strict";bt();or=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),gt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Zr=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;Ve=class{clone(){return this._cloneInto()}},qn={}.toString});function so(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let l=0;l<10;l++)r[l]=e[l]^e[l+10]^e[l+20]^e[l+30]^e[l+40];for(let l=0;l<10;l+=2){let E=(l+8)%10,f=(l+2)%10,F=r[f],y=r[f+1],d=sr(F,y,1)^r[E],h=cr(F,y,1)^r[E+1];for(let a=0;a<50;a+=10)e[l+a]^=d,e[l+a+1]^=h}let i=e[2],p=e[3];for(let l=0;l<24;l++){let E=ur[l],f=sr(i,p,E),F=cr(i,p,E),y=pr[l];i=e[y],p=e[y+1],e[y]=f,e[y+1]=F}for(let l=0;l<50;l+=10){for(let E=0;E<10;E++)r[E]=e[l+E];for(let E=0;E<10;E++)e[l+E]^=~r[(E+2)%10]&r[(E+4)%10]}e[0]^=io[n],e[1]^=ao[n]}r.fill(0)}var pr,ur,fr,eo,ve,to,ro,oo,no,io,ao,sr,cr,qe,Q,Yn,Zn,Qn,ei,ti,lr,ri,oi,dr,ni,ii,mr=M(()=>{"use strict";bt();rr();ar();pr=[],ur=[],fr=[],eo=BigInt(0),ve=BigInt(1),to=BigInt(2),ro=BigInt(7),oo=BigInt(256),no=BigInt(113);for(let e=0,t=ve,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],pr.push(2*(5*n+r)),ur.push((e+1)*(e+2)/2%64);let i=eo;for(let p=0;p<7;p++)t=(t<<ve^(t>>ro)*no)%oo,t&to&&(i^=ve<<(ve<<BigInt(p))-ve);fr.push(i)}[io,ao]=Yt(fr,!0),sr=(e,t,r)=>r>32?er(e,t,r):Zt(e,t,r),cr=(e,t,r)=>r>32?tr(e,t,r):Qt(e,t,r);qe=class e extends Ve{constructor(t,r,n,i=!1,p=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=p,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,xt(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=or(this.state)}keccak(){gt||wt(this.state32),so(this.state32,this.rounds),gt||wt(this.state32),this.posOut=0,this.pos=0}update(t){yt(this);let{blockLen:r,state:n}=this;t=We(t);let i=t.length;for(let p=0;p<i;){let l=Math.min(r-this.pos,i-p);for(let E=0;E<l;E++)n[this.pos++]^=t[p++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,r&128&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){yt(this,!1),Ee(t),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,p=t.length;i<p;){this.posOut>=n&&this.keccak();let l=Math.min(n-this.posOut,p-i);t.set(r.subarray(this.posOut,this.posOut+l),i),this.posOut+=l,i+=l}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return xt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Gt(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:p,enableXOF:l}=this;return t||(t=new e(r,n,i,l,p)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=p,t.suffix=n,t.outputLen=i,t.enableXOF=l,t.destroyed=this.destroyed,t}},Q=(e,t,r)=>nr(()=>new qe(t,e,r)),Yn=Q(6,144,224/8),Zn=Q(6,136,256/8),Qn=Q(6,104,384/8),ei=Q(6,72,512/8),ti=Q(1,144,224/8),lr=Q(1,136,256/8),ri=Q(1,104,384/8),oi=Q(1,72,512/8),dr=(e,t,r)=>ir((n={})=>new qe(t,e,n.dkLen===void 0?r:n.dkLen,!0)),ni=dr(31,168,128/8),ii=dr(31,136,256/8)});function Te(e,t){let r=t||"hex",n=lr(Z(e,{strict:!1})?ht(e):e);return r==="bytes"?n:_(n)}var It=M(()=>{"use strict";mr();me();Oe();we()});var se,Et=M(()=>{"use strict";ie();se=class extends H{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var pe,vt=M(()=>{"use strict";pe=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let n=this.keys().next().value;n&&this.delete(n)}return this}}});function hr(e,t){if(Tt.has(`${e}.${t}`))return Tt.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=Te(Ne(r),"bytes"),i=(t?r.substring(`${t}0x`.length):r).split("");for(let l=0;l<40;l+=2)n[l>>1]>>4>=8&&i[l]&&(i[l]=i[l].toUpperCase()),(n[l>>1]&15)>=8&&i[l+1]&&(i[l+1]=i[l+1].toUpperCase());let p=`0x${i.join("")}`;return Tt.set(`${e}.${t}`,p),p}var Tt,xr=M(()=>{"use strict";Oe();It();vt();Tt=new pe(8192)});function Se(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(St.has(n))return St.get(n);let i=co.test(e)?e.toLowerCase()===e?!0:r?hr(e)===e:!0:!1;return St.set(n,i),i}var co,St,Ft=M(()=>{"use strict";vt();xr();co=/^0x[a-fA-F0-9]{40}$/,St=new pe(8192)});function ee(e){return typeof e[0]=="string"?j(e):yr(e)}function yr(e){let t=0;for(let i of e)t+=i.length;let r=new Uint8Array(t),n=0;for(let i of e)r.set(i,n),n+=i.length;return r}function j(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var At=M(()=>{"use strict"});function br(e,t,r,{strict:n}={}){return Z(e,{strict:!1})?uo(e,t,r,{strict:n}):po(e,t,r,{strict:n})}function gr(e,t){if(typeof t=="number"&&t>0&&t>$(e)-1)throw new xe({offset:t,position:"start",size:$(e)})}function wr(e,t,r){if(typeof t=="number"&&typeof r=="number"&&$(e)!==r-t)throw new xe({offset:r,position:"end",size:$(e)})}function po(e,t,r,{strict:n}={}){gr(e,t);let i=e.slice(t,r);return n&&wr(i,t,r),i}function uo(e,t,r,{strict:n}={}){gr(e,t);let i=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&wr(i,t,r),i}var Ir=M(()=>{"use strict";lt();me();he()});function Ct(e,t){if(e.length!==t.length)throw new He({expectedLength:e.length,givenLength:t.length});let r=fo({params:e,values:t}),n=Rt(r);return n.length===0?"0x":n}function fo({params:e,values:t}){let r=[];for(let n=0;n<e.length;n++)r.push(Pt({param:e[n],value:t[n]}));return r}function Pt({param:e,value:t}){let r=wo(e.type);if(r){let[n,i]=r;return mo(t,{length:n,param:{...e,type:i}})}if(e.type==="tuple")return go(t,{param:e});if(e.type==="address")return lo(t);if(e.type==="bool")return xo(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let n=e.type.startsWith("int");return yo(t,{signed:n})}if(e.type.startsWith("bytes"))return ho(t,{param:e});if(e.type==="string")return bo(t);throw new ze(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Rt(e){let t=0;for(let p=0;p<e.length;p++){let{dynamic:l,encoded:E}=e[p];l?t+=32:t+=$(E)}let r=[],n=[],i=0;for(let p=0;p<e.length;p++){let{dynamic:l,encoded:E}=e[p];l?(r.push(K(t+i,{size:32})),n.push(E),i+=$(E)):r.push(E)}return ee([...r,...n])}function lo(e){if(!Se(e))throw new se({address:e});return{dynamic:!1,encoded:q(e.toLowerCase())}}function mo(e,{length:t,param:r}){let n=t===null;if(!Array.isArray(e))throw new Le(e);if(!n&&e.length!==t)throw new Be({expectedLength:t,givenLength:e.length,type:`${r.type}[${t}]`});let i=!1,p=[];for(let l=0;l<e.length;l++){let E=Pt({param:r,value:e[l]});E.dynamic&&(i=!0),p.push(E)}if(n||i){let l=Rt(p);if(n){let E=K(p.length,{size:32});return{dynamic:!0,encoded:p.length>0?ee([E,l]):E}}if(i)return{dynamic:!0,encoded:l}}return{dynamic:!1,encoded:ee(p.map(({encoded:l})=>l))}}function ho(e,{param:t}){let[,r]=t.type.split("bytes"),n=$(e);if(!r){let i=e;return n%32!==0&&(i=q(i,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:ee([q(K(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new ke({expectedSize:Number.parseInt(r),value:e});return{dynamic:!1,encoded:q(e,{dir:"right"})}}function xo(e){if(typeof e!="boolean")throw new H(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:q(_e(e))}}function yo(e,{signed:t}){return{dynamic:!1,encoded:K(e,{size:32,signed:t})}}function bo(e){let t=De(e),r=Math.ceil($(t)/32),n=[];for(let i=0;i<r;i++)n.push(q(br(t,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:ee([q(K($(t),{size:32})),...n])}}function go(e,{param:t}){let r=!1,n=[];for(let i=0;i<t.components.length;i++){let p=t.components[i],l=Array.isArray(e)?i:p.name,E=Pt({param:p,value:e[l]});n.push(E),E.dynamic&&(r=!0)}return{dynamic:r,encoded:r?Rt(n):ee(n.map(({encoded:i})=>i))}}function wo(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}var Er=M(()=>{"use strict";Vt();Et();ie();Ft();At();be();he();Ir();we()});function Mt(e,t){if(!Se(e,{strict:!1}))throw new se({address:e});if(!Se(t,{strict:!1}))throw new se({address:t});return e.toLowerCase()===t.toLowerCase()}var vr=M(()=>{"use strict";Et();Ft()});var ko={};Vr(ko,{Deferred:()=>W,FrakContextManager:()=>te,FrakRpcError:()=>k,PressInteractionEncoder:()=>Hr,PurchaseInteractionEncoder:()=>zr,ReferralInteractionEncoder:()=>Ze,RpcErrorCodes:()=>L,WebShopInteractionEncoder:()=>Lr,compressJson:()=>le,createIFrameNexusClient:()=>pt,createIframe:()=>st,decompressDataAndCheckHash:()=>ne,decompressJson:()=>de,displayModal:()=>re,hashAndCompressData:()=>oe,interactionTypes:()=>V,openSso:()=>Mr,processReferral:()=>Qe,productTypes:()=>D,productTypesMask:()=>Pr,referralInteraction:()=>Ur,sendInteraction:()=>Xe,sendTransaction:()=>kr,siweAuthenticate:()=>Br,walletStatus:()=>Ye,watchWalletStatus:()=>Ge});var k=class extends Error{constructor(r,n,i){super(n);this.code=r;this.data=i}};var Pe=class extends k{constructor(t){super(L.internalError,t)}};var L={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006};var W=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve=t=>{this._resolve?.(t)};reject=t=>{this._reject?.(t)}};var $t=Ce(ot(),1),it=Ce(nt(),1);async function oe(e){let t=(0,it.sha256)(JSON.stringify(e)),r={...e,validationHash:t},n=await le(r),i=(0,it.sha256)(n);return{compressed:n,compressedHash:i}}async function le(e){return(0,$t.compressToBase64)(JSON.stringify(e))}var Ut=Ce(ot(),1),at=Ce(nt(),1);async function ne(e){if(!(e?.compressed&&e?.compressedHash))throw new k(L.corruptedResponse,"Missing compressed data");let t=await de(e.compressed);if(!t)throw new k(L.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new k(L.corruptedResponse,"Missing validation hash");if((0,at.sha256)(e.compressed)!==e.compressedHash)throw new k(L.corruptedResponse,"Invalid compressed hash");let{validationHash:n,...i}=t;if((0,at.sha256)(JSON.stringify(i))!==t.validationHash)throw new k(L.corruptedResponse,"Invalid data validation hash");return t}async function de(e){let t=await(0,Ut.decompressFromBase64)(e);try{return JSON.parse(t)}catch(r){return console.error("Invalid compressed data",{e:r,decompressed:t}),null}}var ce="nexus-wallet-backup";function _t(){let e=new Map;return{createChannel:t=>{let r=Math.random().toString(36).substring(7);return e.set(r,t),r},getRpcResolver:t=>e.get(t),removeChannel:t=>e.delete(t),destroy:()=>e.clear()}}var Me={id:"nexus-wallet",name:"nexus-wallet",allow:"publickey-credentials-get *; clipboard-write; web-share *",style:{width:"0",height:"0",border:"0",position:"absolute",zIndex:1e3,top:"-1000px",left:"-1000px"}};function st({walletBaseUrl:e}){let t=document.querySelector("#nexus-wallet");if(t)return Promise.resolve(t);let r=document.createElement("iframe");return r.id=Me.id,r.name=Me.name,r.allow=Me.allow,r.style.zIndex=Me.style.zIndex.toString(),ct({iframe:r,isVisible:!1}),document.body.appendChild(r),new Promise(n=>{r?.addEventListener("load",()=>n(r)),r.src=`${e}/listener`})}function ct({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}function Dt({iframe:e}){let t=new W;return{handleEvent:async n=>{switch(n.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":n.data.backup?localStorage.setItem(ce,n.data.backup):localStorage.removeItem(ce);break;case"remove-backup":localStorage.removeItem(ce);break;case"show":case"hide":ct({iframe:e,isVisible:n.iframeLifecycle==="show"});break}},isConnected:t.promise}}function Nt({nexusWalletUrl:e,iframe:t,channelManager:r,iframeLifecycleManager:n}){if(typeof window>"u")throw new k(L.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new k(L.configError,"The iframe does not have a product window");let i=t.contentWindow,p=async f=>{if(!(f.origin&&URL.canParse(f.origin))||new URL(f.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase())return;if("iframeLifecycle"in f.data){await n.handleEvent(f.data);return}if("clientLifecycle"in f.data){console.error("Client lifecycle event received on the client side, dismissing it");return}let F=f.data.id,y=r.getRpcResolver(F);y&&await y(f.data)};return window.addEventListener("message",p),{sendEvent:f=>{i.postMessage(f,{targetOrigin:e})},cleanup:()=>{window.removeEventListener("message",p)}}}function pt({config:e,iframe:t}){let r=_t(),n=Dt({iframe:t}),i=Nt({nexusWalletUrl:e.walletUrl,iframe:t,channelManager:r,iframeLifecycleManager:n}),p=async F=>{if(!await n.isConnected)throw new k(L.clientNotConnected,"The iframe provider isn't connected yet");let d=new W,h=r.createChannel(async b=>{let o=await ne(b.data);o.error?d.reject(new k(o.error.code,o.error.message,o.error?.data)):d.resolve(o.result),r.removeChannel(h)}),a=await oe(F);return i.sendEvent({id:h,topic:F.method,data:a}),d.promise},l=async(F,y)=>{if(!await n.isConnected)throw new k(L.clientNotConnected,"The iframe provider isn't connected yet");let h=r.createChannel(async b=>{let o=await ne(b.data);if(o.result)y(o.result);else throw new Pe("No valid result in the response")}),a=await oe(F);i.sendEvent({id:h,topic:F.method,data:a})},E=async()=>{r.destroy(),i.cleanup(),t.remove()},f=qr({config:e,messageHandler:i,lifecycleManager:n});return{config:e,waitForConnection:n.isConnected,waitForSetup:f,request:p,listenerRequest:l,destroy:E}}async function qr({config:e,messageHandler:t,lifecycleManager:r}){await r.isConnected;let n=async()=>{let p=e.metadata.css;p&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:p}})},i=async()=>{if(typeof window>"u")return;let p=window.localStorage.getItem(ce);p&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:p}})};await Promise.all([n(),i()])}var Ke=256,Je;function Tr(e=11){if(!Je||Ke+e>256*2){Je="",Ke=0;for(let t=0;t<256;t++)Je+=(256+Math.random()*256|0).toString(16).substring(1)}return Je.substring(Ke,Ke+++e)}Er();Oe();we();At();vr();It();be();var Bt="fCtx";function Io(e){return btoa(Array.from(e,t=>String.fromCharCode(t)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Eo(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(t===0?0:4-t),"=")),r=>r.charCodeAt(0))}function Sr(e){if(e?.r)try{let t=Ie(e.r);return Io(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function Fr(e){if(!(!e||e.length===0))try{let t=Eo(e);return{r:ge(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function Ar({url:e}){if(!e)return null;let r=new URL(e).searchParams.get(Bt);return r?Fr(r):null}function Cr({url:e,context:t}){if(!e)return null;let r=Ar({url:e}),n=r?{...r,...t}:t;if(!n.r)return;let i=Sr(n);if(!i)return;let p=new URL(e);return p.searchParams.set(Bt,i),p.toString()}function vo(e){let t=new URL(e);return t.searchParams.delete(Bt),t.toString()}function To({url:e,context:t}){if(!window.location?.href||typeof window>"u"){console.error("No window found, can't update context");return}let r=Cr({url:e,context:t});r&&window.history.replaceState(null,"",r.toString())}var te={compress:Sr,decompress:Fr,parse:Ar,update:Cr,remove:vo,replaceUrl:To};var D={dapp:1,press:2,webshop:3,referral:30,purchase:31},Pr=Object.entries(D).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{});var V={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4"}};function Ge(e,t){return e.listenerRequest({method:"frak_listenToWalletStatus"},t)}function Rr({domain:e}){return Te(_(e))}async function Xe(e,{productId:t,interaction:r,validation:n}){let i=t??Rr(e.config);return await e.request({method:"frak_sendInteraction",params:[i,r,n]})}async function re(e,{steps:t,metadata:r}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,r]})}async function Mr(e,t){let{metadata:r}=e.config;await e.request({method:"frak_sso",params:[t,r.name,r.css]})}function kt(){return Tr(96)}async function Br(e,{siwe:t,metadata:r}){let n=t?.statement??`I confirm that I want to use my Frak wallet on: ${e.config.metadata.name}`,i={...t,statement:n,nonce:t?.nonce??kt(),uri:t?.uri??`https://${e.config.domain}`,version:t?.version??"1",domain:e.config.domain};return(await re(e,{metadata:r,steps:{login:{},siweAuthenticate:{siwe:i}}})).siweAuthenticate}async function kr(e,{tx:t,metadata:r}){return(await re(e,{metadata:r,steps:{login:{},sendTransaction:{tx:t}}})).sendTransaction}async function Ye(e,t){let r=new W,n=!1;return await Ge(e,i=>{t?.(i),n||(r.resolve(i),n=!0)}),r.promise}function So({articleId:e}){let t=j([V.press.openArticle,U(e,{size:32})]);return{handlerTypeDenominator:_(D.press),interactionData:t}}function Fo({articleId:e}){let t=j([V.press.readArticle,U(e,{size:32})]);return{handlerTypeDenominator:_(D.press),interactionData:t}}var Hr={openArticle:So,readArticle:Fo};function Ao(){let e=j([V.referral.createLink,"0x"]);return{handlerTypeDenominator:_(D.referral),interactionData:e}}function Co({referrer:e}){let t=j([V.referral.referred,U(e,{size:32})]);return{handlerTypeDenominator:_(D.referral),interactionData:t}}var Ze={createLink:Ao,referred:Co};function Po({purchaseId:e}){let t=j([V.purchase.started,U(e,{size:32})]);return{handlerTypeDenominator:_(D.purchase),interactionData:t}}function Ro({purchaseId:e,proof:t}){let r=Ct([{type:"uint256"},{type:"bytes32[]"}],[BigInt(e),t]),n=j([V.purchase.completed,r]);return{handlerTypeDenominator:_(D.purchase),interactionData:n}}var zr={startPurchase:Po,completedPurchase:Ro};function Mo(){let e=j([V.webshop.open,"0x"]);return{handlerTypeDenominator:_(D.webshop),interactionData:e}}var Lr={open:Mo};async function Qe(e,{walletStatus:t,frakContext:r,modalConfig:n,productId:i}){try{let p=t?.wallet;if(!r?.r)return p&&te.replaceUrl({url:window.location?.href,context:{r:p}}),"no-referrer";let l=!1;if(p||(p=await $r(e,{modalConfig:n,walletStatus:t}),l=!0),p&&Mt(r.r,p))return"self-referral";t?.interactionSession||l||(p=await $r(e,{modalConfig:n,walletStatus:t})),p&&te.replaceUrl({url:window.location?.href,context:{r:p}});let E=Ze.referred({referrer:r.r});return await Xe(e,{productId:i,interaction:E}),"success"}catch(p){return Bo(p)}}async function $r(e,{modalConfig:t,walletStatus:r}){return r?.interactionSession?r.wallet??void 0:t?(await re(e,t))?.login?.wallet??void 0:void 0}function Bo(e){if(e instanceof k)switch(e.code){case L.walletNotConnected:return"no-wallet";case L.serverErrorForInteractionDelegation:return"no-session";default:return"error"}return"error"}async function Ur(e,{productId:t,modalConfig:r}={}){let n=te.parse({url:window.location.href}),i=await Ye(e);try{return await Qe(e,{walletStatus:i,frakContext:n,modalConfig:r,productId:t})}catch(p){return p}}return Wr(ko);})();
|
|
7
7
|
/*! Bundled license information:
|
|
8
8
|
|
|
9
9
|
js-sha256/src/sha256.js:
|
|
@@ -119,16 +119,18 @@ async function processReferral(client, {
|
|
|
119
119
|
}
|
|
120
120
|
return "no-referrer";
|
|
121
121
|
}
|
|
122
|
+
let walletRequested = false;
|
|
122
123
|
if (!currentWallet) {
|
|
123
124
|
currentWallet = await ensureWalletConnected(client, {
|
|
124
125
|
modalConfig,
|
|
125
126
|
walletStatus: walletStatus2
|
|
126
127
|
});
|
|
128
|
+
walletRequested = true;
|
|
127
129
|
}
|
|
128
130
|
if (currentWallet && isAddressEqual(frakContext.r, currentWallet)) {
|
|
129
131
|
return "self-referral";
|
|
130
132
|
}
|
|
131
|
-
if (!walletStatus2?.interactionSession) {
|
|
133
|
+
if (!(walletStatus2?.interactionSession || walletRequested)) {
|
|
132
134
|
currentWallet = await ensureWalletConnected(client, {
|
|
133
135
|
modalConfig,
|
|
134
136
|
walletStatus: walletStatus2
|
|
@@ -119,16 +119,18 @@ async function processReferral(client, {
|
|
|
119
119
|
}
|
|
120
120
|
return "no-referrer";
|
|
121
121
|
}
|
|
122
|
+
let walletRequested = false;
|
|
122
123
|
if (!currentWallet) {
|
|
123
124
|
currentWallet = await ensureWalletConnected(client, {
|
|
124
125
|
modalConfig,
|
|
125
126
|
walletStatus: walletStatus2
|
|
126
127
|
});
|
|
128
|
+
walletRequested = true;
|
|
127
129
|
}
|
|
128
130
|
if (currentWallet && _viem.isAddressEqual.call(void 0, frakContext.r, currentWallet)) {
|
|
129
131
|
return "self-referral";
|
|
130
132
|
}
|
|
131
|
-
if (!_optionalChain([walletStatus2, 'optionalAccess', _10 => _10.interactionSession])) {
|
|
133
|
+
if (!(_optionalChain([walletStatus2, 'optionalAccess', _10 => _10.interactionSession]) || walletRequested)) {
|
|
132
134
|
currentWallet = await ensureWalletConnected(client, {
|
|
133
135
|
modalConfig,
|
|
134
136
|
walletStatus: walletStatus2
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkQRECYKIRcjs = require('../../chunk-QRECYKIR.cjs');
|
|
12
12
|
require('../../chunk-YDZBXUC4.cjs');
|
|
13
13
|
require('../../chunk-A3XYA7S7.cjs');
|
|
14
14
|
require('../../chunk-UFJ7W6CQ.cjs');
|
|
@@ -22,4 +22,4 @@ require('../../chunk-UFJ7W6CQ.cjs');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.displayModal =
|
|
25
|
+
exports.displayModal = _chunkQRECYKIRcjs.displayModal; exports.openSso = _chunkQRECYKIRcjs.openSso; exports.processReferral = _chunkQRECYKIRcjs.processReferral; exports.referralInteraction = _chunkQRECYKIRcjs.referralInteraction; exports.sendInteraction = _chunkQRECYKIRcjs.sendInteraction; exports.sendTransaction = _chunkQRECYKIRcjs.sendTransaction; exports.siweAuthenticate = _chunkQRECYKIRcjs.siweAuthenticate; exports.walletStatus = _chunkQRECYKIRcjs.walletStatus; exports.watchWalletStatus = _chunkQRECYKIRcjs.watchWalletStatus;
|
package/dist/react/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ var _chunk2SDBW6QCcjs = require('../chunk-2SDBW6QC.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkQRECYKIRcjs = require('../chunk-QRECYKIR.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -86,7 +86,7 @@ function useWalletStatus() {
|
|
|
86
86
|
if (!client) {
|
|
87
87
|
throw new (0, _chunkYDZBXUC4cjs.ClientNotFound)();
|
|
88
88
|
}
|
|
89
|
-
return
|
|
89
|
+
return _chunkQRECYKIRcjs.walletStatus.call(void 0, client, newStatusUpdated);
|
|
90
90
|
},
|
|
91
91
|
enabled: !!client
|
|
92
92
|
});
|
|
@@ -105,7 +105,7 @@ function useSendTransactionAction({
|
|
|
105
105
|
if (!client) {
|
|
106
106
|
throw new (0, _chunkYDZBXUC4cjs.ClientNotFound)();
|
|
107
107
|
}
|
|
108
|
-
return
|
|
108
|
+
return _chunkQRECYKIRcjs.sendTransaction.call(void 0, client, params);
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
}
|
|
@@ -127,7 +127,7 @@ function useSiweAuthenticate({
|
|
|
127
127
|
if (!client) {
|
|
128
128
|
throw new (0, _chunkYDZBXUC4cjs.ClientNotFound)();
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return _chunkQRECYKIRcjs.siweAuthenticate.call(void 0, client, params);
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
}
|
|
@@ -224,7 +224,7 @@ function useReferralInteraction({
|
|
|
224
224
|
if (!client) {
|
|
225
225
|
throw new (0, _chunkYDZBXUC4cjs.ClientNotFound)();
|
|
226
226
|
}
|
|
227
|
-
return
|
|
227
|
+
return _chunkQRECYKIRcjs.processReferral.call(void 0, client, {
|
|
228
228
|
walletStatus: walletStatus2,
|
|
229
229
|
frakContext,
|
|
230
230
|
modalConfig,
|
|
@@ -253,7 +253,7 @@ function useSendInteraction({
|
|
|
253
253
|
if (!client) {
|
|
254
254
|
throw new (0, _chunkYDZBXUC4cjs.ClientNotFound)();
|
|
255
255
|
}
|
|
256
|
-
return
|
|
256
|
+
return _chunkQRECYKIRcjs.sendInteraction.call(void 0, client, params);
|
|
257
257
|
}
|
|
258
258
|
});
|
|
259
259
|
}
|
|
@@ -271,7 +271,7 @@ function useDisplayModal({
|
|
|
271
271
|
if (!client) {
|
|
272
272
|
throw new (0, _chunkYDZBXUC4cjs.ClientNotFound)();
|
|
273
273
|
}
|
|
274
|
-
return
|
|
274
|
+
return _chunkQRECYKIRcjs.displayModal.call(void 0, client, args);
|
|
275
275
|
}
|
|
276
276
|
});
|
|
277
277
|
}
|
|
@@ -287,7 +287,7 @@ function useOpenSso({ mutations } = {}) {
|
|
|
287
287
|
if (!client) {
|
|
288
288
|
throw new (0, _chunkYDZBXUC4cjs.ClientNotFound)();
|
|
289
289
|
}
|
|
290
|
-
return
|
|
290
|
+
return _chunkQRECYKIRcjs.openSso.call(void 0, client, params);
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
293
|
}
|
package/dist/react/index.js
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.
|
|
14
|
+
"version": "0.0.20",
|
|
15
15
|
"description": "Frak Wallet client SDK, helping any person to interact with the Frak wallet, and require the unlock of a premium article within the Frak ecosystem.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|