@stacks/connect
Advanced tools
Comparing version 7.8.1-alpha.3e8f85a.0 to 7.8.1-alpha.6d44dc7.0
@@ -1,3 +0,3 @@ | ||
'use strict';var auth=require('@stacks/auth'),jsontokens=require('jsontokens'),connectUi=require('@stacks/connect-ui'),networkV6=require('@stacks/network-v6'),network=require('@stacks/network'),common=require('@stacks/common'),transactions=require('@stacks/transactions'),transactionsV6=require('@stacks/transactions-v6'),loader=require('@stacks/connect-ui/loader');var et=Object.defineProperty,nt=Object.defineProperties;var ot=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var O=(e,t,n)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,s=(e,t)=>{for(var n in t||(t={}))k.call(t,n)&&O(e,n,t[n]);if(x)for(var n of x(t))E.call(t,n)&&O(e,n,t[n]);return e},u=(e,t)=>nt(e,ot(t));var g=(e,t)=>{var n={};for(var o in e)k.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&x)for(var o of x(e))t.indexOf(o)<0&&E.call(e,o)&&(n[o]=e[o]);return n};function l(){return connectUi.getProviderFromId(connectUi.getSelectedProviderId())||window.StacksProvider||window.BlockstackProvider}function ge(){return !!l()}function y(e){return e?typeof e=="string"?networkV6.StacksNetwork.fromName(e):"version"in e?e:"url"in e?new networkV6.StacksMainnet({url:e.url}):e.transactionVersion===network.TransactionVersion.Mainnet?new networkV6.StacksMainnet:new networkV6.StacksTestnet:new networkV6.StacksTestnet}var Ie="https://app.blockstack.org";typeof window!="undefined"&&(window.__CONNECT_VERSION__="__VERSION__");var dt=()=>{let e=navigator.userAgent;return /android/i.test(e)||/iPad|iPhone|iPod/.test(e)?!0:/windows phone/i.test(e)},Ce=()=>!dt(),b=e=>{if(!e){let t=new auth.AppConfig(["store_write"],document.location.href);e=new auth.UserSession({appConfig:t});}return e},U=async(e,t=l())=>{if(!t)throw new Error("[Connect] No installed Stacks wallet found");let{redirectTo:n="/",manifestPath:o,onFinish:a,onCancel:r,sendToSignIn:i=!1,userSession:d,appDetails:p}=e,c=b(d);c.isUserSignedIn()&&c.signUserOut();let C=c.generateAndStoreTransitKey(),A=c.makeAuthRequest(C,`${document.location.origin}${n}`,`${document.location.origin}${o}`,c.appConfig.scopes,void 0,void 0,{sendToSignIn:i,appDetails:p,connectVersion:"__VERSION__"});try{let j=await t.authenticationRequest(A);await c.handlePendingSignIn(j);let T=jsontokens.decodeToken(j),tt=T==null?void 0:T.payload;a==null||a({authResponse:j,authResponsePayload:tt,userSession:c});}catch(j){console.error("[Connect] Error during auth request",j),r==null||r();}},je=async e=>(e=b(e),e.isUserSignedIn()?e.loadUserData():e.isSignInPending()?e.handlePendingSignIn():null);var lt=(o=>(o.ContractCall="contract_call",o.ContractDeploy="smart_contract",o.STXTransfer="token_transfer",o))(lt||{}),gt=(r=>(r.BUFFER="buffer",r.UINT="uint",r.INT="int",r.PRINCIPAL="principal",r.BOOL="bool",r))(gt||{});var D=e=>{let t=e;if(!t){let n=new auth.AppConfig(["store_write"],document.location.href);t=new auth.UserSession({appConfig:n});}return t};function M(e){try{return D(e).loadUserData().appPrivateKey}catch(t){return !1}}var S=e=>{let n=D(e).loadUserData().appPrivateKey,o=jsontokens.SECP256K1Client.derivePublicKey(n);return {privateKey:n,publicKey:o}};function At(e){var p;let{stxAddress:t,userSession:n,network:o}=e;if(t)return t;if(!n||!o)return;let a=(p=n==null?void 0:n.loadUserData().profile)==null?void 0:p.stxAddress,r={[network.ChainId.Mainnet]:"mainnet",[network.ChainId.Testnet]:"testnet"},i=y(o);return a==null?void 0:a[r[i.chainId]]}function xt(e){let t=y(e.network),n=D(e.userSession),o=u(s({},e),{network:t,userSession:n});return s({stxAddress:At(o)},o)}async function N(e,t){let{postConditions:n}=e;return n&&n.length>0&&typeof n[0]!="string"&&(typeof n[0].type=="string"?n=n.map(transactions.postConditionToHex):n=n.map(a=>common.bytesToHex(transactionsV6.serializePostCondition(a)))),new jsontokens.TokenSigner("ES256k",t).signAsync(u(s({},e),{postConditions:n}))}function f(e){let{postConditions:t}=e;return t&&t.length>0&&typeof t[0]!="string"&&(typeof t[0].type=="string"?t=t.map(transactions.postConditionToHex):t=t.map(n=>common.bytesToHex(transactionsV6.serializePostCondition(n)))),jsontokens.createUnsecuredToken(u(s({},e),{postConditions:t}))}var Nt=async({token:e,options:t},n)=>{var o,a,r;try{let i=await n.transactionRequest(e),{txRaw:d}=i,p=common.hexToBytes(d.replace(/^0x/,"")),c=transactions.deserializeTransaction(p);if("sponsored"in t&&t.sponsored){(o=t.onFinish)==null||o.call(t,u(s({},i),{stacksTransaction:c}));return}(a=t.onFinish)==null||a.call(t,u(s({},i),{stacksTransaction:c}));}catch(i){console.error("[Connect] Error during transaction request",i),(r=t.onCancel)==null||r.call(t);}},ft=async e=>{let d=e,{functionArgs:t,appDetails:n,userSession:o}=d,a=g(d,["functionArgs","appDetails","userSession"]),r=t.map(p=>typeof p=="string"?p:typeof p.type=="string"?transactions.serializeCV(p):common.bytesToHex(transactionsV6.serializeCV(p)));if(M(o)){let{privateKey:p,publicKey:c}=S(o),C=u(s({},a),{functionArgs:r,txType:"contract_call",publicKey:c});return n&&(C.appDetails=n),N(C,p)}let i=u(s({},a),{functionArgs:r,txType:"contract_call"});return n&&(i.appDetails=n),f(i)},wt=async e=>{let r=e,{appDetails:t,userSession:n}=r,o=g(r,["appDetails","userSession"]);if(M(n)){let{privateKey:i,publicKey:d}=S(n),p=u(s({},o),{publicKey:d,txType:"smart_contract"});return t&&(p.appDetails=t),N(p,i)}let a=u(s({},o),{txType:"smart_contract"});return t&&(a.appDetails=t),f(a)},Pt=async e=>{let i=e,{amount:t,appDetails:n,userSession:o}=i,a=g(i,["amount","appDetails","userSession"]);if(M(o)){let{privateKey:d,publicKey:p}=S(o),c=u(s({},a),{amount:t.toString(10),publicKey:p,txType:"token_transfer"});return n&&(c.appDetails=n),N(c,d)}let r=u(s({},a),{amount:t.toString(10),txType:"token_transfer"});return n&&(r.appDetails=n),f(r)},mt=async e=>{let i=e,{txHex:t,appDetails:n,userSession:o}=i,a=g(i,["txHex","appDetails","userSession"]);if(M(o)){let{privateKey:d,publicKey:p}=S(o),c=u(s({},a),{txHex:t,publicKey:p});return n&&(c.appDetails=n),N(c,d)}let r=u(s({},a),{txHex:t});return n&&(r.appDetails=n),f(r)};async function w(e,t,n){let o=await t(u(s(s({},xt(e)),e),{network:y(e.network)}));return Nt({token:o,options:e},n)}function Y(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return w(e,ft,t)}function B(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return w(e,wt,t)}function G(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return w(e,Pt,t)}function q(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return w(e,mt,t)}async function Et(e,t){return new jsontokens.TokenSigner("ES256k",t).signAsync(s({},e))}function ht(e){let t=y(e.network),n=D(e.userSession),o=u(s({},e),{network:t,userSession:n});return s({},o)}async function zt({token:e,options:t},n){var o,a;if(!n)throw new Error("[Connect] No installed Stacks wallet found");try{let r=await n.psbtRequest(e);(o=t.onFinish)==null||o.call(t,r);}catch(r){console.error("[Connect] Error during psbt request",r),(a=t.onCancel)==null||a.call(t);}}var bt=async e=>{let d=e,{allowedSighash:t,hex:n,signAtIndex:o,userSession:a}=d,r=g(d,["allowedSighash","hex","signAtIndex","userSession"]);if(M(a)){let{privateKey:p,publicKey:c}=S(a),C=u(s({},r),{allowedSighash:t,hex:n,signAtIndex:o,publicKey:c});return Et(C,p)}let i=s({},r);return jsontokens.createUnsecuredToken(i)};async function Ut(e,t,n){let o=await t(s(s({},ht(e)),e));return zt({token:o,options:e},n)}function F(e,t=l()){return Ut(e,bt,t)}function Qt(e){var d;let{userSession:t,network:n}=e;if(!t||!n)return;let o=(d=t==null?void 0:t.loadUserData().profile)==null?void 0:d.stxAddress,a={[network.ChainId.Mainnet]:"mainnet",[network.ChainId.Testnet]:"testnet"},r=y(n);return o==null?void 0:o[a[r.chainId]]}async function Yt(e,t){return new jsontokens.TokenSigner("ES256k",t).signAsync(s({},e))}function m(e){let t=y(e.network),n=D(e.userSession),o=u(s({},e),{network:t,userSession:n});return s({stxAddress:Qt(o)},o)}async function Bt({token:e,options:t},n){var o,a;try{let r=await n.signatureRequest(e);(o=t.onFinish)==null||o.call(t,r);}catch(r){console.error("[Connect] Error during signature request",r),(a=t.onCancel)==null||a.call(t);}}var Gt=async e=>{let a=e,{userSession:t}=a,n=g(a,["userSession"]);if(M(t)){let{privateKey:r,publicKey:i}=S(t),d=u(s({},n),{publicKey:i});return Yt(d,r)}let o=s({},n);return jsontokens.createUnsecuredToken(o)};async function qt(e,t,n){let o=await t(s(s({},m(e)),e));return Bt({token:o,options:e},n)}function W(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return qt(e,Gt,t)}async function Wt(e,t,n){let o=await t(s(s({},m(e)),e));return Kt({token:o,options:e},n)}function _(e){let{message:t,domain:n}=e;return typeof t.type=="string"&&typeof n.type=="string"?u(s({},e),{message:transactions.serializeCV(t),domain:transactions.serializeCV(n)}):u(s({},e),{message:common.bytesToHex(transactionsV6.serializeCV(t)),domain:common.bytesToHex(transactionsV6.serializeCV(n))})}async function Vt(e,t){return new jsontokens.TokenSigner("ES256k",t).signAsync(_(e))}async function Xt(e){let o=e,{userSession:t}=o,n=g(o,["userSession"]);if(M(t)){let{privateKey:a,publicKey:r}=S(t),i=u(s({},n),{publicKey:r});return Vt(i,a)}return jsontokens.createUnsecuredToken(_(e))}async function Kt({token:e,options:t},n){var o,a;try{let r=await n.structuredDataSignatureRequest(e);(o=t.onFinish)==null||o.call(t,r);}catch(r){console.error("[Connect] Error during signature request",r),(a=t.onCancel)==null||a.call(t);}}function J(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return Wt(e,Xt,t)}async function Ht(e,t){return new jsontokens.TokenSigner("ES256k",t).signAsync(s({},e))}function $t(e){let t=y(e.network),n=D(e.userSession),o=u(s({},e),{network:t,userSession:n});return s({},o)}async function te({token:e,options:t},n){var o,a;try{let r=await n.profileUpdateRequest(e);(o=t.onFinish)==null||o.call(t,r);}catch(r){console.error("[Connect] Error during signature request",r),(a=t.onCancel)==null||a.call(t);}}var ee=async e=>{let r=e,{userSession:t,profile:n}=r,o=g(r,["userSession","profile"]);if(M(t)){let{privateKey:i,publicKey:d}=S(t),p=u(s({},o),{profile:n,publicKey:d});return Ht(p,i)}let a=s({},o);return jsontokens.createUnsecuredToken(a)};async function ne(e,t,n){let o=await t(s(s({},$t(e)),e));return te({token:o,options:e},n)}function H(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return ne(e,ee,t)}var oe=(r=>(r[r.DEFAULT=0]="DEFAULT",r[r.ALL=1]="ALL",r[r.NONE=2]="NONE",r[r.SINGLE=3]="SINGLE",r[r.ANYONECANPAY=128]="ANYONECANPAY",r))(oe||{});var $=[{id:"LeatherProvider",name:"Leather",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiByeD0iMjYuODM4NyIgZmlsbD0iIzEyMTAwRiIvPgo8cGF0aCBkPSJNNzQuOTE3MSA1Mi43MTE0QzgyLjQ3NjYgNTEuNTQwOCA5My40MDg3IDQzLjU4MDQgOTMuNDA4NyAzNy4zNzYxQzkzLjQwODcgMzUuNTAzMSA5MS44OTY4IDM0LjIxNTQgODkuNjg3MSAzNC4yMTU0Qzg1LjUwMDQgMzQuMjE1NCA3OC40MDYxIDQwLjUzNjggNzQuOTE3MSA1Mi43MTE0Wk0zOS45MTEgODMuNDk5MUMzMC4wMjU2IDgzLjQ5OTEgMj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lcehhmanlj",mozillaAddOnsUrl:"https://leather.io/install-extension"},{id:"XverseProviders.StacksProvider",name:"Xverse Wallet",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MDAiIGhlaWdodD0iNjAwIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGZpbGw9IiMxNzE3MTciIGQ9Ik0wIDBoNjAwdjYwMEgweiIvPjxwYXRoIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTQ0MCA0MzUuNHYtNTFjMC0yLS44LTMuOS0yLjItNS4zTDIyMCAxNjIuMmE3LjYgNy42IDAgMCAwLTUuNC0yLjJoLTUxLjFjLTIuNSAwLTQuNiAyLTQuNiA0LjZ2NDcuM2MwIDIgLjggNCAyLjIgNS40bDc4LjIgNzcuOGE0LjYgNC42IDAgMCAxIDAgNi41bC03OSA3OC43Yy0xIC45LTEuNCAyLTEuNCAzLjJ2NTJjMCAyLjQgMiA0LjUgNC42IDQuNUgyNDljMi42IDAgNC42LTIgNC42LTQuNlY0MDVjMC0xLjIuNS0yLjQgMS40LTMuM2w0Mi40LTQyLjJhNC42IDQuNiAwIDAgMSA2LjQgMGw3OC43IDc4LjRhNy42IDcuNiAwIDAgMCA1LjQgMi4yaDQ3LjVjMi41IDAgNC42LTIgNC42LTQuNloiLz48cGF0aCBmaWxsPSIjRUU3QTMwIiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0zMjUuNiAyMjcuMmg0Mi44YzIuNiAwIDQuNiAyLjEgNC42IDQuNnY0Mi42YzAgNCA1IDYuMSA4IDMuMmw1OC43LTU4LjVjLjgtLjggMS4zLTIgMS4zLTMuMnYtNTEuMmMwLTIuNi0yLTQuNi00LjYtNC42TDM4NCAxNjBjLTEuMiAwLTIuNC41LTMuMyAxLjNsLTU4LjQgNTguMWE0LjYgNC42IDAgMCAwIDMuMiA3LjhaIi8+PC9nPjwvc3ZnPg==",webUrl:"https://xverse.app",chromeWebStoreUrl:"https://chrome.google.com/webstore/detail/xverse-wallet/idnnbdplmphpflfnlkomgpfbpcgelopg",googlePlayStoreUrl:"https://play.google.com/store/apps/details?id=com.secretkeylabs.xverse",iOSAppStoreUrl:"https://apps.apple.com/app/xverse-bitcoin-web3-wallet/id1552272513",mozillaAddOnsUrl:"https://www.xverse.app/download"},{id:"AsignaProvider",name:"Asigna",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMDEwMCIgZD0iTTAgMGgzMnYzMkgweiIvPjxwYXRoIGZpbGw9InVybCgjYSkiIGQ9Ik0xNS4xMSA1LjU1YTMgMyAwIDAgMC0xLjgyIDEuM2wtLjA1LjA4LS40My43Mi0uMDcuMTEtLjUuODUtLjA1LjA5LTEuMjkgMi4xOC0uMDQuMDctLjQ3LjgtLjA2LjEtLjQ2Ljc4LS4wNy4xMS0xLjYzIDIuNzYtLjA3LjExLS4zOC42Ni0uMDUuMDgtLjczIDEuMjQtLjM1LjYtLjQuNjctLjA1LjA5TDUuMSAyMC43bC0uMTEuMTgtLjE0LjIzLS4wNy4xMy0uMzMuNTUtLjA0LjA3di4wMWExLjI2IDEuMjYgMCAwIDAtLjE0LjQ3IDEuMzEgMS4zMSAwIDAgMCAxLjI0IDEuNGgxLjVsLjA1LS4wNi4wNC0uMDYuODctMS4yMS4wNS0uMDguNzctMS4wNy4wNS0uMDcuNC0uNTcuMDUtLjA2LjI0LS4zNGExLjUyIDEuNTIgMCAwIDEgMS4zOS0uNjIgMS41IDEuNSAwIDAgMSAuNjQuMiAxLjQ3IDEuNDcgMCAwIDEgLjczIDEuMjcgMS40NCAxLjQ0IDAgMCAxLS4yNy44NGwtLjYzLjg4LS4wNS4w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wvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjwvc3ZnPg==",webUrl:"https://asigna.io",chromeWebStoreUrl:"https://chromewebstore.google.com/detail/asigna-multisig/gopddoinbenlokghakiafackadkbnlid"}];function I(e,t=!0){return function(o,a){var T;if(a)return e(o,a);let r=connectUi.getSelectedProviderId(),i=l();if(r&&i)return e(o,i);if(typeof window=="undefined")return;loader.defineCustomElements(window);let d=(T=o==null?void 0:o.defaultProviders)!=null?T:$,p=connectUi.getInstalledProviders(d),c=document.createElement("connect-modal");c.defaultProviders=d,c.installedProviders=p,c.persistSelection=t;let C=document.body.style.overflow;document.body.style.overflow="hidden";let A=()=>{c.remove(),document.body.style.overflow=C;};c.callback=L=>{A(),e(o,L);},c.cancelCallback=()=>{var L;A(),(L=o.onCancel)==null||L.call(o);},document.body.appendChild(c);let j=L=>{L.key==="Escape"&&(document.removeEventListener("keydown",j),c.remove());};document.addEventListener("keydown",j);}}var ce=I(U,!1),Nn=I(G),fn=I(Y),wn=I(B),Pn=I(q),mn=I(F),On=I(H),kn=I(W),En=I(J),hn=connectUi.clearSelectedProviderId,zn=ce; | ||
Object.defineProperty(exports,"clearSelectedProviderId",{enumerable:true,get:function(){return connectUi.clearSelectedProviderId}});Object.defineProperty(exports,"getSelectedProviderId",{enumerable:true,get:function(){return connectUi.getSelectedProviderId}});Object.defineProperty(exports,"setSelectedProviderId",{enumerable:true,get:function(){return connectUi.setSelectedProviderId}});exports.ContractCallArgumentType=gt;exports.DEFAULT_PROVIDERS=$;exports.SignatureHash=oe;exports.TransactionTypes=lt;exports.authenticate=U;exports.defaultAuthURL=Ie;exports.disconnect=hn;exports.getDefaultProfileUpdateRequestOptions=$t;exports.getDefaultPsbtRequestOptions=ht;exports.getDefaultSignatureRequestOptions=m;exports.getKeys=S;exports.getOrCreateUserSession=b;exports.getStacksProvider=l;exports.getStxAddress=At;exports.getUserData=je;exports.getUserSession=D;exports.hasAppPrivateKey=M;exports.isMobile=dt;exports.isStacksWalletInstalled=ge;exports.legacyNetworkFromConnectNetwork=y;exports.makeContractCallToken=ft;exports.makeContractDeployToken=wt;exports.makeProfileUpdateToken=ee;exports.makePsbtToken=bt;exports.makeSTXTransferToken=Pt;exports.makeSignTransaction=mt;exports.openContractCall=Y;exports.openContractDeploy=B;exports.openProfileUpdateRequestPopup=H;exports.openPsbtRequestPopup=F;exports.openSTXTransfer=G;exports.openSignTransaction=q;exports.openSignatureRequestPopup=W;exports.openStructuredDataSignatureRequestPopup=J;exports.shouldUsePopup=Ce;exports.showBlockstackConnect=zn;exports.showConnect=ce;exports.showContractCall=fn;exports.showContractDeploy=wn;exports.showProfileUpdate=On;exports.showPsbt=mn;exports.showSTXTransfer=Nn;exports.showSignMessage=kn;exports.showSignStructuredMessage=En;exports.showSignTransaction=Pn;exports.signMessage=Gt;exports.signStructuredMessage=Xt;Object.keys(auth).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return auth[k]}})});//# sourceMappingURL=index.js.map | ||
'use strict';var auth=require('@stacks/auth'),jsontokens=require('jsontokens'),connectUi=require('@stacks/connect-ui'),networkV6=require('@stacks/network-v6'),network=require('@stacks/network'),common=require('@stacks/common'),transactions=require('@stacks/transactions'),transactionsV6=require('@stacks/transactions-v6'),loader=require('@stacks/connect-ui/loader');var et=Object.defineProperty,nt=Object.defineProperties;var ot=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var O=(e,t,n)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,a=(e,t)=>{for(var n in t||(t={}))k.call(t,n)&&O(e,n,t[n]);if(A)for(var n of A(t))E.call(t,n)&&O(e,n,t[n]);return e},u=(e,t)=>nt(e,ot(t));var M=(e,t)=>{var n={};for(var o in e)k.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&A)for(var o of A(e))t.indexOf(o)<0&&E.call(e,o)&&(n[o]=e[o]);return n};function l(){return connectUi.getProviderFromId(connectUi.getSelectedProviderId())||window.StacksProvider||window.BlockstackProvider}function Me(){return !!l()}function y(e){if(!e)return new networkV6.StacksTestnet;if(typeof e=="string")return networkV6.StacksNetwork.fromName(e);if("version"in e)return e;let t="url"in e?e.url:e.client.baseUrl;return ("url"in e?network.TransactionVersion.Mainnet:e.transactionVersion)===network.TransactionVersion.Mainnet?new networkV6.StacksMainnet({url:t}):new networkV6.StacksTestnet({url:t})}var Ie="https://app.blockstack.org";typeof window!="undefined"&&(window.__CONNECT_VERSION__="__VERSION__");var dt=()=>{let e=navigator.userAgent;return /android/i.test(e)||/iPad|iPhone|iPod/.test(e)?!0:/windows phone/i.test(e)},Ce=()=>!dt(),b=e=>{if(!e){let t=new auth.AppConfig(["store_write"],document.location.href);e=new auth.UserSession({appConfig:t});}return e},U=async(e,t=l())=>{if(!t)throw new Error("[Connect] No installed Stacks wallet found");let{redirectTo:n="/",manifestPath:o,onFinish:s,onCancel:r,sendToSignIn:i=!1,userSession:d,appDetails:p}=e,c=b(d);c.isUserSignedIn()&&c.signUserOut();let C=c.generateAndStoreTransitKey(),x=c.makeAuthRequest(C,`${document.location.origin}${n}`,`${document.location.origin}${o}`,c.appConfig.scopes,void 0,void 0,{sendToSignIn:i,appDetails:p,connectVersion:"__VERSION__"});try{let j=await t.authenticationRequest(x);await c.handlePendingSignIn(j);let T=jsontokens.decodeToken(j),tt=T==null?void 0:T.payload;s==null||s({authResponse:j,authResponsePayload:tt,userSession:c});}catch(j){console.error("[Connect] Error during auth request",j),r==null||r();}},je=async e=>(e=b(e),e.isUserSignedIn()?e.loadUserData():e.isSignInPending()?e.handlePendingSignIn():null);var lt=(o=>(o.ContractCall="contract_call",o.ContractDeploy="smart_contract",o.STXTransfer="token_transfer",o))(lt||{}),Mt=(r=>(r.BUFFER="buffer",r.UINT="uint",r.INT="int",r.PRINCIPAL="principal",r.BOOL="bool",r))(Mt||{});var D=e=>{let t=e;if(!t){let n=new auth.AppConfig(["store_write"],document.location.href);t=new auth.UserSession({appConfig:n});}return t};function g(e){try{return D(e).loadUserData().appPrivateKey}catch(t){return !1}}var S=e=>{let n=D(e).loadUserData().appPrivateKey,o=jsontokens.SECP256K1Client.derivePublicKey(n);return {privateKey:n,publicKey:o}};function xt(e){var p;let{stxAddress:t,userSession:n,network:o}=e;if(t)return t;if(!n||!o)return;let s=(p=n==null?void 0:n.loadUserData().profile)==null?void 0:p.stxAddress,r={[network.ChainId.Mainnet]:"mainnet",[network.ChainId.Testnet]:"testnet"},i=y(o);return s==null?void 0:s[r[i.chainId]]}function At(e){let t=y(e.network),n=D(e.userSession),o=u(a({},e),{network:t,userSession:n});return a({stxAddress:xt(o)},o)}async function N(e,t){let{postConditions:n}=e;return n&&n.length>0&&typeof n[0]!="string"&&(typeof n[0].type=="string"?n=n.map(transactions.postConditionToHex):n=n.map(s=>common.bytesToHex(transactionsV6.serializePostCondition(s)))),new jsontokens.TokenSigner("ES256k",t).signAsync(u(a({},e),{postConditions:n}))}function f(e){let{postConditions:t}=e;return t&&t.length>0&&typeof t[0]!="string"&&(typeof t[0].type=="string"?t=t.map(transactions.postConditionToHex):t=t.map(n=>common.bytesToHex(transactionsV6.serializePostCondition(n)))),jsontokens.createUnsecuredToken(u(a({},e),{postConditions:t}))}var Nt=async({token:e,options:t},n)=>{var o,s,r;try{let i=await n.transactionRequest(e),{txRaw:d}=i,p=common.hexToBytes(d.replace(/^0x/,"")),c=transactions.deserializeTransaction(p);if("sponsored"in t&&t.sponsored){(o=t.onFinish)==null||o.call(t,u(a({},i),{stacksTransaction:c}));return}(s=t.onFinish)==null||s.call(t,u(a({},i),{stacksTransaction:c}));}catch(i){console.error("[Connect] Error during transaction request",i),(r=t.onCancel)==null||r.call(t);}},ft=async e=>{let d=e,{functionArgs:t,appDetails:n,userSession:o}=d,s=M(d,["functionArgs","appDetails","userSession"]),r=t.map(p=>typeof p=="string"?p:typeof p.type=="string"?transactions.serializeCV(p):common.bytesToHex(transactionsV6.serializeCV(p)));if(g(o)){let{privateKey:p,publicKey:c}=S(o),C=u(a({},s),{functionArgs:r,txType:"contract_call",publicKey:c});return n&&(C.appDetails=n),N(C,p)}let i=u(a({},s),{functionArgs:r,txType:"contract_call"});return n&&(i.appDetails=n),f(i)},wt=async e=>{let r=e,{appDetails:t,userSession:n}=r,o=M(r,["appDetails","userSession"]);if(g(n)){let{privateKey:i,publicKey:d}=S(n),p=u(a({},o),{publicKey:d,txType:"smart_contract"});return t&&(p.appDetails=t),N(p,i)}let s=u(a({},o),{txType:"smart_contract"});return t&&(s.appDetails=t),f(s)},Pt=async e=>{let i=e,{amount:t,appDetails:n,userSession:o}=i,s=M(i,["amount","appDetails","userSession"]);if(g(o)){let{privateKey:d,publicKey:p}=S(o),c=u(a({},s),{amount:t.toString(10),publicKey:p,txType:"token_transfer"});return n&&(c.appDetails=n),N(c,d)}let r=u(a({},s),{amount:t.toString(10),txType:"token_transfer"});return n&&(r.appDetails=n),f(r)},mt=async e=>{let i=e,{txHex:t,appDetails:n,userSession:o}=i,s=M(i,["txHex","appDetails","userSession"]);if(g(o)){let{privateKey:d,publicKey:p}=S(o),c=u(a({},s),{txHex:t,publicKey:p});return n&&(c.appDetails=n),N(c,d)}let r=u(a({},s),{txHex:t});return n&&(r.appDetails=n),f(r)};async function w(e,t,n){let o=await t(u(a(a({},At(e)),e),{network:y(e.network)}));return Nt({token:o,options:e},n)}function Y(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return w(e,ft,t)}function B(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return w(e,wt,t)}function G(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return w(e,Pt,t)}function q(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return w(e,mt,t)}async function Et(e,t){return new jsontokens.TokenSigner("ES256k",t).signAsync(a({},e))}function ht(e){let t=y(e.network),n=D(e.userSession),o=u(a({},e),{network:t,userSession:n});return a({},o)}async function zt({token:e,options:t},n){var o,s;if(!n)throw new Error("[Connect] No installed Stacks wallet found");try{let r=await n.psbtRequest(e);(o=t.onFinish)==null||o.call(t,r);}catch(r){console.error("[Connect] Error during psbt request",r),(s=t.onCancel)==null||s.call(t);}}var bt=async e=>{let d=e,{allowedSighash:t,hex:n,signAtIndex:o,userSession:s}=d,r=M(d,["allowedSighash","hex","signAtIndex","userSession"]);if(g(s)){let{privateKey:p,publicKey:c}=S(s),C=u(a({},r),{allowedSighash:t,hex:n,signAtIndex:o,publicKey:c});return Et(C,p)}let i=a({},r);return jsontokens.createUnsecuredToken(i)};async function Ut(e,t,n){let o=await t(a(a({},ht(e)),e));return zt({token:o,options:e},n)}function F(e,t=l()){return Ut(e,bt,t)}function Qt(e){var d;let{userSession:t,network:n}=e;if(!t||!n)return;let o=(d=t==null?void 0:t.loadUserData().profile)==null?void 0:d.stxAddress,s={[network.ChainId.Mainnet]:"mainnet",[network.ChainId.Testnet]:"testnet"},r=y(n);return o==null?void 0:o[s[r.chainId]]}async function Yt(e,t){return new jsontokens.TokenSigner("ES256k",t).signAsync(a({},e))}function m(e){let t=y(e.network),n=D(e.userSession),o=u(a({},e),{network:t,userSession:n});return a({stxAddress:Qt(o)},o)}async function Bt({token:e,options:t},n){var o,s;try{let r=await n.signatureRequest(e);(o=t.onFinish)==null||o.call(t,r);}catch(r){console.error("[Connect] Error during signature request",r),(s=t.onCancel)==null||s.call(t);}}var Gt=async e=>{let s=e,{userSession:t}=s,n=M(s,["userSession"]);if(g(t)){let{privateKey:r,publicKey:i}=S(t),d=u(a({},n),{publicKey:i});return Yt(d,r)}let o=a({},n);return jsontokens.createUnsecuredToken(o)};async function qt(e,t,n){let o=await t(a(a({},m(e)),e));return Bt({token:o,options:e},n)}function W(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return qt(e,Gt,t)}async function Wt(e,t,n){let o=await t(a(a({},m(e)),e));return Kt({token:o,options:e},n)}function _(e){let{message:t,domain:n}=e;return typeof t.type=="string"&&typeof n.type=="string"?u(a({},e),{message:transactions.serializeCV(t),domain:transactions.serializeCV(n)}):u(a({},e),{message:common.bytesToHex(transactionsV6.serializeCV(t)),domain:common.bytesToHex(transactionsV6.serializeCV(n))})}async function Vt(e,t){return new jsontokens.TokenSigner("ES256k",t).signAsync(_(e))}async function Xt(e){let o=e,{userSession:t}=o,n=M(o,["userSession"]);if(g(t)){let{privateKey:s,publicKey:r}=S(t),i=u(a({},n),{publicKey:r});return Vt(i,s)}return jsontokens.createUnsecuredToken(_(e))}async function Kt({token:e,options:t},n){var o,s;try{let r=await n.structuredDataSignatureRequest(e);(o=t.onFinish)==null||o.call(t,r);}catch(r){console.error("[Connect] Error during signature request",r),(s=t.onCancel)==null||s.call(t);}}function J(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return Wt(e,Xt,t)}async function Ht(e,t){return new jsontokens.TokenSigner("ES256k",t).signAsync(a({},e))}function $t(e){let t=y(e.network),n=D(e.userSession),o=u(a({},e),{network:t,userSession:n});return a({},o)}async function te({token:e,options:t},n){var o,s;try{let r=await n.profileUpdateRequest(e);(o=t.onFinish)==null||o.call(t,r);}catch(r){console.error("[Connect] Error during signature request",r),(s=t.onCancel)==null||s.call(t);}}var ee=async e=>{let r=e,{userSession:t,profile:n}=r,o=M(r,["userSession","profile"]);if(g(t)){let{privateKey:i,publicKey:d}=S(t),p=u(a({},o),{profile:n,publicKey:d});return Ht(p,i)}let s=a({},o);return jsontokens.createUnsecuredToken(s)};async function ne(e,t,n){let o=await t(a(a({},$t(e)),e));return te({token:o,options:e},n)}function H(e,t=l()){if(!t)throw new Error("[Connect] No installed Stacks wallet found");return ne(e,ee,t)}var oe=(r=>(r[r.DEFAULT=0]="DEFAULT",r[r.ALL=1]="ALL",r[r.NONE=2]="NONE",r[r.SINGLE=3]="SINGLE",r[r.ANYONECANPAY=128]="ANYONECANPAY",r))(oe||{});var $=[{id:"LeatherProvider",name:"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A4NjQgMzUuODQwNSA0Ny45MTE4IDQzLjYzMjYgMzAuNDY5M0g1Ni4xOTI5QzQ5LjIxNSA0Mi4wNTg2IDUzLjk4MzIgNTEuNjU3OCA2Mi44MjIgNTIuNzExNEM2Ny41OTAzIDM1LjczNzIgNzcuODI0NiAyMi41MDkgOTEuNDMxNiAyMi41MDlDOTkuMTA3NCAyMi41MDkgMTA1LjE1NSAyNy41NDI4IDEwNS4xNTUgMzYuNjczN0MxMDUuMTU1IDUxLjMwNjYgODYuMDgxOSA2My4yNDcxIDcxLjY2MDcgNjQuNDE3N0w2NS43Mjk1IDg1LjM3MjFDNzIuNDc0OCA5My4yMTUzIDkxLjE5OSAxMDAuODI0IDkxLjE5OSA3OS4yODQ4SDEwMi44MjlaIiBmaWxsPSIjRjVGMUVEIi8+Cjwvc3ZnPgo=",webUrl:"https://leather.io",chromeWebStoreUrl:"https://chrome.google.com/webstore/detail/hiro-wallet/ldinpeekobnhjjdofggfgjlcehhmanlj",mozillaAddOnsUrl:"https://leather.io/install-extension"},{id:"XverseProviders.StacksProvider",name:"Xverse Wallet",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MDAiIGhlaWdodD0iNjAwIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGZpbGw9IiMxNzE3MTciIGQ9Ik0wIDBoNjAwdjYwMEgweiIvPjxwYXRoIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTQ0MCA0MzUuNHYtNTFjMC0yLS44LTMuOS0yLjItNS4zTDIyMCAxNjIuMmE3LjYgNy42IDAgMCAwLTUuNC0yLjJoLTUxLjFjLTIuNSAwLTQuNiAyLTQuNiA0LjZ2NDcuM2MwIDIgLjggNCAyLjIgNS40bDc4LjIgNzcuOGE0LjYgNC42IDAgMCAxIDAgNi41bC03OSA3OC43Yy0xIC45LTEuNCAyLTEuNCAzLjJ2NTJjMCAyLjQgMiA0LjUgNC42IDQuNUgyNDljMi42IDAgNC42LTIgNC42LTQuNlY0MDVjMC0xLjIuNS0yLjQgMS40LTMuM2w0Mi40LTQyLjJhNC42IDQuNiAwIDAgMSA2LjQgMGw3OC43IDc4LjRhNy42IDcuNiAwIDAgMCA1LjQgMi4yaDQ3LjVjMi41IDAgNC42LTIgNC42LTQuNloiLz48cGF0aCBmaWxsPSIjRUU3QTMwIiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0zMjUuNiAyMjcuMmg0Mi44YzIuNiAwIDQuNiAyLjEgNC42IDQuNnY0Mi42YzAgNCA1IDYuMSA4IDMuMmw1OC43LTU4LjVjLjgtLjggMS4zLTIgMS4zLTMuMnYtNTEuMmMwLTIuNi0yLTQuNi00LjYtNC42TDM4NCAxNjBjLTEuMiAwLTIuNC41LTMuMyAxLjNsLTU4LjQgNTguMWE0LjYgNC42IDAgMCAwIDMuMiA3LjhaIi8+PC9nPjwvc3ZnPg==",webUrl:"https://xverse.app",chromeWebStoreUrl:"https://chrome.google.com/webstore/detail/xverse-wallet/idnnbdplmphpflfnlkomgpfbpcgelopg",googlePlayStoreUrl:"https://play.google.com/store/apps/details?id=com.secretkeylabs.xverse",iOSAppStoreUrl:"https://apps.apple.com/app/xverse-bitcoin-web3-wallet/id1552272513",mozillaAddOnsUrl:"https://www.xverse.app/download"},{id:"AsignaProvider",name:"Asigna",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMDEwMCIgZD0iTTAgMGgzMnYzMkgweiIvPjxwYXRoIGZpbGw9InVybCgjYSkiIGQ9Ik0xNS4xMSA1LjU1YTMgMyAwIDAgMC0xLjgyIDEuM2wtLjA1LjA4LS40My43Mi0uMDcuMTEtLjUuODUt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geTE9IjI1Ljc4IiB5Mj0iNi4xMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiM2NTIyRjQiLz48c3RvcCBvZmZzZXQ9Ii41NSIgc3RvcC1jb2xvcj0iIzlCNkJGRiIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0E1ODVGRiIvPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IGlkPSJiIiB4MT0iMjIuNTkiIHgyPSIyNC44IiB5MT0iMjQuNzEiIHkyPSIxNS41MyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiM0MjFGOEIiLz48c3RvcCBvZmZzZXQ9Ii41NSIgc3RvcC1jb2xvcj0iIzcyMzBGRiIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzk3NzNGRiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjwvc3ZnPg==",webUrl:"https://asigna.io",chromeWebStoreUrl:"https://chromewebstore.google.com/detail/asigna-multisig/gopddoinbenlokghakiafackadkbnlid"}];function I(e,t=!0){return function(o,s){var T;if(s)return e(o,s);let r=connectUi.getSelectedProviderId(),i=l();if(r&&i)return e(o,i);if(typeof window=="undefined")return;loader.defineCustomElements(window);let d=(T=o==null?void 0:o.defaultProviders)!=null?T:$,p=connectUi.getInstalledProviders(d),c=document.createElement("connect-modal");c.defaultProviders=d,c.installedProviders=p,c.persistSelection=t;let C=document.body.style.overflow;document.body.style.overflow="hidden";let x=()=>{c.remove(),document.body.style.overflow=C;};c.callback=L=>{x(),e(o,L);},c.cancelCallback=()=>{var L;x(),(L=o.onCancel)==null||L.call(o);},document.body.appendChild(c);let j=L=>{L.key==="Escape"&&(document.removeEventListener("keydown",j),c.remove());};document.addEventListener("keydown",j);}}var ce=I(U,!1),Nn=I(G),fn=I(Y),wn=I(B),Pn=I(q),mn=I(F),On=I(H),kn=I(W),En=I(J),hn=connectUi.clearSelectedProviderId,zn=ce; | ||
Object.defineProperty(exports,"clearSelectedProviderId",{enumerable:true,get:function(){return connectUi.clearSelectedProviderId}});Object.defineProperty(exports,"getSelectedProviderId",{enumerable:true,get:function(){return connectUi.getSelectedProviderId}});Object.defineProperty(exports,"setSelectedProviderId",{enumerable:true,get:function(){return connectUi.setSelectedProviderId}});exports.ContractCallArgumentType=Mt;exports.DEFAULT_PROVIDERS=$;exports.SignatureHash=oe;exports.TransactionTypes=lt;exports.authenticate=U;exports.defaultAuthURL=Ie;exports.disconnect=hn;exports.getDefaultProfileUpdateRequestOptions=$t;exports.getDefaultPsbtRequestOptions=ht;exports.getDefaultSignatureRequestOptions=m;exports.getKeys=S;exports.getOrCreateUserSession=b;exports.getStacksProvider=l;exports.getStxAddress=xt;exports.getUserData=je;exports.getUserSession=D;exports.hasAppPrivateKey=g;exports.isMobile=dt;exports.isStacksWalletInstalled=Me;exports.legacyNetworkFromConnectNetwork=y;exports.makeContractCallToken=ft;exports.makeContractDeployToken=wt;exports.makeProfileUpdateToken=ee;exports.makePsbtToken=bt;exports.makeSTXTransferToken=Pt;exports.makeSignTransaction=mt;exports.openContractCall=Y;exports.openContractDeploy=B;exports.openProfileUpdateRequestPopup=H;exports.openPsbtRequestPopup=F;exports.openSTXTransfer=G;exports.openSignTransaction=q;exports.openSignatureRequestPopup=W;exports.openStructuredDataSignatureRequestPopup=J;exports.shouldUsePopup=Ce;exports.showBlockstackConnect=zn;exports.showConnect=ce;exports.showContractCall=fn;exports.showContractDeploy=wn;exports.showProfileUpdate=On;exports.showPsbt=mn;exports.showSTXTransfer=Nn;exports.showSignMessage=kn;exports.showSignStructuredMessage=En;exports.showSignTransaction=Pn;exports.signMessage=Gt;exports.signStructuredMessage=Xt;Object.keys(auth).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return auth[k]}})});//# sourceMappingURL=index.js.map | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@stacks/connect", | ||
"version": "7.8.1-alpha.3e8f85a.0", | ||
"version": "7.8.1-alpha.6d44dc7.0", | ||
"license": "MIT", | ||
@@ -16,3 +16,3 @@ "scripts": { | ||
"@stacks/common": "^7.0.0", | ||
"@stacks/connect-ui": "^6.5.1-alpha.3e8f85a.0", | ||
"@stacks/connect-ui": "^6.5.1-alpha.6d44dc7.0", | ||
"@stacks/network": "^7.0.0", | ||
@@ -59,3 +59,3 @@ "@stacks/network-v6": "npm:@stacks/network@^6.16.0", | ||
}, | ||
"gitHead": "f92160d8421d211c74de9601c299325bb83b50a8" | ||
"gitHead": "1011b380e3c647489012046332e2f1d36d96a579" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4472550