@privy-io/react-auth 3.3.0 → 3.4.0
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/cjs/{SignRequestScreen-CvBcoZRA.js → SignRequestScreen-BtiA_kjR.js} +19 -19
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/index.js +7 -7
- package/dist/cjs/{smart-wallets-Cgmp6lBz.js → smart-wallets-CT6HYICU.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/use-export-wallet-C_4yZPUM.js +2 -0
- package/dist/cjs/{useActiveWallet-DAK4USsc.js → useActiveWallet-DygS7fQB.js} +1 -1
- package/dist/cjs/{usePrivy-BQiDRA6a.js → usePrivy-8s4mCLcX.js} +1 -1
- package/dist/dts/extended-chains.d.mts +1 -1
- package/dist/dts/extended-chains.d.ts +1 -1
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +6 -4
- package/dist/dts/index.d.ts +6 -4
- package/dist/dts/smart-wallets.d.mts +2 -2
- package/dist/dts/smart-wallets.d.ts +2 -2
- package/dist/dts/solana.d.mts +4 -5
- package/dist/dts/solana.d.ts +4 -5
- package/dist/dts/{types-C97UOzaM.d.mts → types-tFJ_e9u8.d.mts} +5 -5
- package/dist/dts/{types-C97UOzaM.d.ts → types-tFJ_e9u8.d.ts} +5 -5
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/{SignRequestScreen-Dnn_x6kV.mjs → SignRequestScreen-Dkx-HBRI.mjs} +17 -17
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/{internal-context-LlMdpfkb.mjs → internal-context-CfE_S5P-.mjs} +1 -1
- package/dist/esm/{privy-context-C7K3ZBW-.mjs → privy-context-DDSW3jEM.mjs} +1 -1
- package/dist/esm/{smart-wallets-D86YXRN5.mjs → smart-wallets-BElFh8An.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +2 -2
- package/dist/esm/use-export-wallet-OoiI5as_.mjs +1 -0
- package/dist/esm/{use-sign-with-user-signer-DwqsbciW.mjs → use-sign-with-user-signer-DVcbjNtZ.mjs} +1 -1
- package/dist/esm/{useActiveWallet-YrSgEFNG.mjs → useActiveWallet-BjD-txC9.mjs} +1 -1
- package/dist/esm/{usePrivy-CYAVrCyA.mjs → usePrivy-BJYprMT0.mjs} +1 -1
- package/package.json +6 -6
- package/dist/cjs/use-export-wallet-Crjmwv6E.js +0 -2
- package/dist/esm/use-export-wallet-DVZxxj2x.mjs +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("./SignRequestScreen-BtiA_kjR.js"),n=require("react/jsx-runtime"),t=require("@heroicons/react/24/outline/CheckCircleIcon"),a=require("react"),r=require("@privy-io/js-sdk-core"),i=require("./paths-B00ZrFQm.js"),s=require("./internal-context-DNWjSiYq.js"),o=require("./privy-context-NMR-GjnL.js"),l=require("./usePrivy-8s4mCLcX.js"),c=require("eventemitter3"),d=require("@scure/base"),u=require("./use-sign-with-user-signer-Q0_LRVtz.js"),p=require("styled-components"),m=require("@solana/kit"),g=require("@solana-program/system"),f=require("@solana-program/token");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=/*#__PURE__*/h(t),w=/*#__PURE__*/h(r),v=/*#__PURE__*/h(c);function A({rows:t}){/*#__PURE__*/return n.jsx(e.Rows,{children:t.filter((e=>!!e)).map(((t,a)=>null!=t.value||t.isLoading?/*#__PURE__*/n.jsxs(e.Row,{children:[/*#__PURE__*/n.jsx(e.LabelSm,{children:t.label}),/*#__PURE__*/n.jsx(e.Value,{$isLoading:t.isLoading,children:t.value})]},a):null))})}const S=["solana:mainnet","solana:devnet","solana:testnet"];function T(e,n){if(!Object.prototype.hasOwnProperty.call(e,n))throw TypeError("attempted to use private field on non-instance");return e}var I=0,b="__private_"+I+++"__implementation";class C extends v.default{setImplementation(e){T(this,b)[b]=e}async signMessage(e){return T(this,b)[b].signMessage(e)}async signAndSendTransaction(e){return T(this,b)[b].signAndSendTransaction(e)}async signTransaction(e){return T(this,b)[b].signTransaction(e)}constructor(e){super(),Object.defineProperty(this,b,{writable:!0,value:void 0}),T(this,b)[b]=e}}function E(e,n){if(!Object.prototype.hasOwnProperty.call(e,n))throw TypeError("attempted to use private field on non-instance");return e}var P=0;function x(e){return"__private_"+P+++"_"+e}var O=/*#__PURE__*/x("_address"),k=/*#__PURE__*/x("_publicKey"),F=/*#__PURE__*/x("_chains"),_=/*#__PURE__*/x("_features"),M=/*#__PURE__*/x("_label"),j=/*#__PURE__*/x("_icon");class W{get address(){return E(this,O)[O]}get publicKey(){return E(this,k)[k].slice()}get chains(){return E(this,F)[F].slice()}get features(){return E(this,_)[_].slice()}get label(){return E(this,M)[M]}get icon(){return E(this,j)[j]}constructor({address:e,publicKey:n,label:t,icon:a}){Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,F,{writable:!0,value:void 0}),Object.defineProperty(this,_,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),E(this,O)[O]=e,E(this,k)[k]=n,E(this,F)[F]=S,E(this,M)[M]=t,E(this,j)[j]=a,E(this,_)[_]=["solana:signAndSendTransaction","solana:signTransaction","solana:signMessage"],new.target===W&&Object.freeze(this)}}function U(e,n){if(!Object.prototype.hasOwnProperty.call(e,n))throw TypeError("attempted to use private field on non-instance");return e}var D=0;function L(e){return"__private_"+D+++"_"+e}var R=/*#__PURE__*/L("_listeners"),B=/*#__PURE__*/L("_version"),N=/*#__PURE__*/L("_name"),$=/*#__PURE__*/L("_icon"),V=/*#__PURE__*/L("_injection"),q=/*#__PURE__*/L("_isPrivyWallet"),G=/*#__PURE__*/L("_accounts"),J=/*#__PURE__*/L("_on"),K=/*#__PURE__*/L("_emit"),Y=/*#__PURE__*/L("_off"),H=/*#__PURE__*/L("_connected"),Q=/*#__PURE__*/L("_connect"),Z=/*#__PURE__*/L("_disconnect"),z=/*#__PURE__*/L("_signMessage"),X=/*#__PURE__*/L("_signAndSendTransaction"),ee=/*#__PURE__*/L("_signTransaction");function ne(e,...n){U(this,R)[R][e]?.forEach((e=>e.apply(null,n)))}function te(e,n){U(this,R)[R][e]=U(this,R)[R][e]?.filter((e=>n!==e))}const ae=/*#__PURE__*/p.styled.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],(e=>e.color??"var(--privy-color-accent)"),(e=>e.color??"var(--privy-color-accent)")),re=({instruction:t,fees:a,transactionInfo:r,solPrice:i,chain:s})=>/*#__PURE__*/n.jsxs(e.Rows,{children:[r?.action&&/*#__PURE__*/n.jsxs(e.Row,{children:[/*#__PURE__*/n.jsx(e.LabelSm,{children:"Action"}),/*#__PURE__*/n.jsx(e.Value,{children:r.action})]}),null!=t?.total&&/*#__PURE__*/n.jsxs(e.Row,{children:[/*#__PURE__*/n.jsx(e.LabelSm,{children:"Total"}),/*#__PURE__*/n.jsx(e.Value,{children:t.total})]}),!t?.total&&null!=t?.amount&&/*#__PURE__*/n.jsxs(e.Row,{children:[/*#__PURE__*/n.jsx(e.LabelSm,{children:"Total"}),/*#__PURE__*/n.jsx(e.Value,{children:/*#__PURE__*/n.jsx(e.SolanaPriceDisplay,{quantities:[t.amount,a],tokenPrice:i})})]}),/*#__PURE__*/n.jsxs(e.Row,{children:[/*#__PURE__*/n.jsx(e.LabelSm,{children:"Fees"}),/*#__PURE__*/n.jsx(e.Value,{children:/*#__PURE__*/n.jsx(e.SolanaPriceDisplay,{quantities:[a],tokenPrice:i})})]}),t?.to&&/*#__PURE__*/n.jsxs(e.Row,{children:[/*#__PURE__*/n.jsx(e.LabelSm,{children:"To"}),/*#__PURE__*/n.jsx(e.Value,{children:/*#__PURE__*/n.jsx(e.WalletLink,{walletAddress:t.to,chainId:s,chainType:"solana"})})]})]}),ie=({fees:t,onClose:a,receiptHeader:r,receiptDescription:i,transactionInfo:s,solPrice:o,signOnly:l,instruction:c,chain:d})=>/*#__PURE__*/n.jsxs(n.Fragment,{children:[/*#__PURE__*/n.jsx(e.ModalHeader,{onClose:a}),/*#__PURE__*/n.jsx(e.e$2,{style:{marginBottom:"16px"},children:/*#__PURE__*/n.jsxs("div",{children:[/*#__PURE__*/n.jsx(ae,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n.jsx(y.default,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n.jsx(e.CenteredScreenHeader,{title:r??`Transaction ${l?"signed":"complete"}!`,description:i??"You're all set."}),/*#__PURE__*/n.jsx(re,{solPrice:o,instruction:c,fees:t,transactionInfo:s,chain:d}),/*#__PURE__*/n.jsx(e.Grow,{}),/*#__PURE__*/n.jsx(se,{loading:!1,onClick:a,children:"Close"}),/*#__PURE__*/n.jsx(e.RefactorSpacerBottom,{}),/*#__PURE__*/n.jsx(e.BlobbyFooter,{})]});let se=/*#__PURE__*/p.styled(e.PrimaryButton).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);function oe(e){return new Uint8Array(m.getTransactionDecoder().decode(e).messageBytes)}async function le(e,n){try{return await e}catch{return n}}const ce=(...e)=>{if("undefined"==typeof Buffer)throw new i.PrivyClientError("Buffer is not defined.",void 0,i.PrivyErrorCode.BUFFER_NOT_DEFINED);return Buffer.from(...e)};function de(e){switch(e){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function ue({privyClient:n,chain:t,mint:a}){let r=e.DEFAULT_TOKENS_DATA[t];if(!r[a]){let e=await n.getSplTokenMetadata({mintAddress:a,cluster:de(t)});e&&(r[a]={address:a,symbol:e.symbol,decimals:e.decimals})}return r[a]}async function pe({solanaClient:e,tx:n}){let t=m.getBase64Decoder().decode(oe(n)),{value:a}=await e.rpc.getFeeForMessage(t).send();return a??0n}async function me({solanaClient:e,tx:n,replaceRecentBlockhash:t}){let{value:a}=await e.rpc.simulateTransaction(m.getBase64Decoder().decode(n),{commitment:"confirmed",encoding:"base64",sigVerify:!1,replaceRecentBlockhash:t}).send();if("BlockhashNotFound"===a.err&&t)throw Error("Simulation failed: Blockhash not found");return"BlockhashNotFound"===a.err?await me({solanaClient:e,tx:n,replaceRecentBlockhash:!0}):{logs:a.logs??[],error:a.err,hasError:!!a.err,hasFunds:a.logs?.every((e=>!/insufficient funds/gi.test(e)&&!/insufficient lamports/gi.test(e)))??!0}}async function ge({tx:n,solanaClient:t,privyClient:a,checkFunds:r}){let i=m.getCompiledTransactionMessageDecoder().decode(oe(n)),s=i.staticAccounts[0]??"",o=await pe({solanaClient:t,tx:n}),l=r?await le(me({solanaClient:t,tx:n})):void 0,c=l?.hasFunds??!0,d={},u=[],p=await async function({solanaClient:e,message:n}){if(!("addressTableLookups"in n)||!n.addressTableLookups)return[...n.staticAccounts];let t=n.addressTableLookups.map((e=>e.lookupTableAddress)),a=await m.fetchAddressesForLookupTables(t,e.rpc),r=t.map(((e,t)=>[...n.addressTableLookups[t]?.writableIndexes.map((n=>{let r=a[e]?.[n];if(r)return{key:r,isWritable:!0,altIdx:t}}))??[],...n.addressTableLookups[t]?.readonlyIndexes.map((n=>{let r=a[e]?.[n];if(r)return{key:r,isWritable:!1,altIdx:t}}))??[]])).flat().filter((e=>!!e)).sort(((e,n)=>e.isWritable!==n.isWritable?e.isWritable?-1:1:e.altIdx-n.altIdx)).map((({key:e})=>e));return[...n.staticAccounts,...r]}({solanaClient:t,message:i});for(let n of i.instructions){let r=i.staticAccounts[n.programAddressIndex]||"";if(r!==e.TOKEN_PROGRAM_ID&&r!==e.TOKEN_2022_PROGRAM_ID)if(r!==e.SYSTEM_PROGRAM_ID){if(r===e.ASSOCIATED_TOKEN_PROGRAM_ID){let e=await le(function(e,n,t){let[a,r,i,s]=e.accountIndices?.map((e=>n[e]))??[];return{type:"ata-creation",program:t,payer:a,ata:r,owner:i,mint:s}}(n,p,r));if(!e){u.push({type:"unknown",program:r,discriminator:n.data?.[0]});continue}if(u.push(e),e.ata&&e.owner&&e.mint){d[e.ata]={owner:e.owner,mint:e.mint};continue}}if(e.RAYDIUM_SWAP_PROGRAM_IDS.includes(r)){let e=await le(we(n,p,t,a,r));if(!e){u.push({type:"unknown",program:r,discriminator:n.data?.[0]});continue}u.push(e)}else if(e.JUPITER_SWAP_PROGRAM_IDS.includes(r)){let e=await le(ve(n,p,t,a,r));if(!e){u.push({type:"unknown",program:r,discriminator:n.data?.[0]});continue}u.push(e)}else u.push({type:"unknown",program:r,discriminator:n.data?.[0]})}else{let e=await le(ye(n,p));if(!e){u.push({type:"unknown",program:r,discriminator:n.data?.[0]});continue}u.push(e)}else{let e=await le(he(n,p,t,a,d,r));if(!e){u.push({type:"unknown",program:r,discriminator:n.data?.[0]});continue}u.push(e),"spl-transfer"===e.type&&(e.fromAta&&e.fromAccount&&e.token.address&&(d[e.fromAta]??={owner:e.fromAccount,mint:e.token.address}),e.toAta&&e.toAccount&&e.token.address&&(d[e.toAta]??={owner:e.toAccount,mint:e.token.address}))}}return{spender:s,fee:o,instructions:u,hasFunds:!!c}}function fe(e,n=0){try{return function(e,n=0){let t=0n;for(let a=0;a<8;a++)t|=BigInt(e[n+a])<<BigInt(8*a);return t}(e,n)}catch{}try{return e.readBigInt64LE(n)}catch{}let t=ce(e);try{return((e,n=0)=>{let t=e[n],a=e[n+7];if(!t||!a)throw Error(`Buffer offset out of range: first: ${t}, last: ${a}.`);return(BigInt(e[n+4]+256*e[n+5]+65536*e[n+6]+(a<<24))<<32n)+BigInt(t+256*e[++n]+65536*e[++n]+16777216*e[++n])})(t)}catch{}try{return t.subarray(n).readBigInt64LE()}catch{}try{return t.readBigInt64LE(n)}catch{}return 0n}async function he(e,n,t,a,r,i){let s=e.data?.[0],o=e.accountIndices?.map((e=>n[e]))??[];if(1===s){let[e,n,t]=o;return{type:"spl-init-account",program:i,account:e,mint:n,owner:t}}if(3===s){let n,s,[l,c,d]=o,u="",p=c?r[c]:void 0;if(p)n=p.owner,u=p.mint;else if(c){let e=await t.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),a=e.value?.data;n=a?.parsed?.info?.owner,u=a?.parsed?.info?.mint??"",s=a?.parsed?.info?.tokenAmount?.decimals}if(!u&&l){let e=await t.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send(),n=e.value?.data;u=n?.parsed?.info?.mint??""}let m=await ue({privyClient:a,chain:t.chain,mint:u}),g=m?.symbol??"";return s??=m?.decimals??9,{type:"spl-transfer",program:i,fromAta:l,fromAccount:d,toAta:c,toAccount:n,value:fe(e.data,1),token:{symbol:g,decimals:s,address:u}}}if(9===s){let[e,n,t]=o;return{type:"spl-close-account",program:i,source:e,destination:n,owner:t}}if(17===s)return{type:"spl-sync-native",program:i};throw Error(`Token program instruction type ${s} not supported`)}async function ye(n,t){let a=n.data?.[0],r=n.accountIndices?.map((e=>t[e]))??[];if(0===a){let[,t]=r;return{type:"create-account",program:e.SYSTEM_PROGRAM_ID,account:t?.toString(),value:fe(n.data,4),withSeed:!1}}if(2===a){let[t,a]=r;return{type:"sol-transfer",program:e.SYSTEM_PROGRAM_ID,fromAccount:t,toAccount:a,token:{symbol:"SOL",decimals:9},value:fe(n.data,4),withSeed:!1}}if(3===a){let[,t]=r;return{type:"create-account",program:e.SYSTEM_PROGRAM_ID,account:t,withSeed:!0,value:fe(n.data.slice(n.data.length-32-8-8))}}if(11===a){let[t,a]=r;return{type:"sol-transfer",program:e.SYSTEM_PROGRAM_ID,fromAccount:t,toAccount:a,value:fe(n.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${a} not supported`)}async function we(e,n,t,a,r){let i=e.accountIndices?.map((e=>n[e]))??[],s=e.data?.[0];if(143===s){let n=i[10],s=i[11];return{type:"raydium-swap-base-input",program:r,mintIn:n,mintOut:s,tokenIn:n?await ue({privyClient:a,chain:t.chain,mint:n}):void 0,tokenOut:s?await ue({privyClient:a,chain:t.chain,mint:s}):void 0,amountIn:fe(e.data,8),minimumAmountOut:fe(e.data,16)}}if(55===s){let n=i[10],s=i[11];return{type:"raydium-swap-base-output",program:r,mintIn:n,mintOut:s,tokenIn:n?await ue({privyClient:a,chain:t.chain,mint:n}):void 0,tokenOut:s?await ue({privyClient:a,chain:t.chain,mint:s}):void 0,maxAmountIn:fe(e.data,8),amountOut:fe(e.data,16)}}throw Error(`Raydium swap program instruction type ${s} not supported`)}async function ve(e,n,t,a,r){let i=e.data?.[0],s=e.accountIndices?.map((e=>n[e]))??[];if([208,51,239,151,123,43,237,92].includes(i)){let n=s[5],i=s[6];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:i,tokenIn:n?await ue({privyClient:a,chain:t.chain,mint:n}):void 0,tokenOut:i?await ue({privyClient:a,chain:t.chain,mint:i}):void 0,outAmount:fe(e.data,e.data.length-1-2-8-8),quotedInAmount:fe(e.data,e.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(i)){let n=s[7],i=s[8];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:i,tokenIn:n?await ue({privyClient:a,chain:t.chain,mint:n}):void 0,tokenOut:i?await ue({privyClient:a,chain:t.chain,mint:i}):void 0,outAmount:fe(e.data,e.data.length-1-2-8-8),quotedInAmount:fe(e.data,e.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(i)){let n=s[7],i=s[8];return{type:"jupiter-swap-shared-accounts-route",program:r,mintIn:n,mintOut:i,tokenIn:n?await ue({privyClient:a,chain:t.chain,mint:n}):void 0,tokenOut:i?await ue({privyClient:a,chain:t.chain,mint:i}):void 0,inAmount:fe(e.data,e.data.length-1-2-8-8),quotedOutAmount:fe(e.data,e.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(i)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(i)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(i)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(i)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(i)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(i)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(i)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(i)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(i)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(i)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(i)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${i} not supported`)}async function Ae({rpcSubscriptions:e,signature:n,timeout:t}){let a=new AbortController,r=await e.signatureNotifications(n,{commitment:"confirmed"}).subscribe({abortSignal:a.signal}),i=await Promise.race([new Promise((e=>{setTimeout((()=>{a.abort(),e(Error("Transaction confirmation timed out"))}),t)})),new Promise((async e=>{for await(let n of r){if(a.abort(),n.value.err)return e(Error("Transaction confirmation failed"));e(void 0)}}))]);if(i instanceof Error)throw i}function Se({rpc:e,rpcSubscriptions:n,chain:t,blockExplorerUrl:a}){let r=function({rpc:e,rpcSubscriptions:n}){return async t=>new Promise((async(a,r)=>{try{let r=await e.sendTransaction(ce(t).toString("base64"),{preflightCommitment:"confirmed",encoding:"base64"}).send();await Ae({rpcSubscriptions:n,signature:r,timeout:1e4}),a({signature:new Uint8Array(m.getBase58Encoder().encode(r))})}catch(e){r(e)}}))}({rpc:e,rpcSubscriptions:n});return{rpc:e,rpcSubscriptions:n,chain:t,blockExplorerUrl:a,sendAndConfirmTransaction:r}}function Te(){let n=e.useAppConfig(),t=a.useMemo((()=>Object.fromEntries(["solana:mainnet","solana:devnet","solana:testnet"].map((e=>[e,n.solanaRpcs[e]?Se({chain:e,rpc:n.solanaRpcs[e].rpc,rpcSubscriptions:n.solanaRpcs[e].rpcSubscriptions,blockExplorerUrl:n.solanaRpcs[e].blockExplorerUrl??`https://explorer.solana.com?cluster=${e.replace("solana:","")}`}):null])))),[n.solanaRpcs]);return a.useCallback((e=>{if(!t[e])throw Error(`No RPC configuration found for chain ${e}`);return t[e]}),[t])}const Ie={component:()=>{let{data:t,onUserCloseViaDialogOrKeybindRef:i,setModalData:l,navigate:c}=e.usePrivyModal(),{client:d,closePrivyModal:u,walletProxy:p,showFiatPrices:g}=s.usePrivyInternal(),f=e.useAppConfig(),{user:h}=o.usePrivyContext(),y=Te()(t?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[w,v]=a.useState(t?.standardSignAndSendTransaction?.transaction),[A,S]=a.useState(),[T,I]=a.useState(),[b,C]=a.useState({value:0n,isLoading:!1}),[E,P]=a.useState(!1),[x,O]=a.useState({}),[k,F]=a.useState(),_=t?.standardSignAndSendTransaction?.account,M=!!t?.standardSignAndSendTransaction?.signOnly,j=_?.imported?o.getImportedPrivySolanaWallets(h).find((e=>e.address===_.address)):o.getPrivyPrimaryWallet(h),{solPrice:W,isSolPriceLoading:U}=e.useGetSolPrice({enabled:g}),D=a.useMemo((()=>{if(!A)return;let n=A.spender,t=e.getNativeCurrencyFromLamports(A.fee),a=e.getNativeCurrencyFromLamports(b.value,3,!0),i=A.instructions.filter((e=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(e.type))),s=i.at(0);if(!s||i.length>1)return{fee:t,spender:n,balance:a};if("sol-transfer"===s.type)return{fee:t,spender:n,balance:a,total:e.getNativeCurrencyFromLamports(s.value)};if("spl-transfer"===s.type)return{fee:t,spender:n,balance:a,total:`${r.formatTokenAmount({amount:s.value,decimals:s.token.decimals})} ${s.token.symbol}`};if("raydium-swap-base-input"===s.type&&s.tokenIn&&s.tokenOut){return{fee:t,spender:n,balance:a,swap:`${`${r.formatTokenAmount({amount:s.amountIn,decimals:s.tokenIn.decimals})} ${s.tokenIn.symbol}`} → ${`${r.formatTokenAmount({amount:s.minimumAmountOut,decimals:s.tokenOut.decimals})} ${s.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===s.type&&s.tokenIn&&s.tokenOut){return{fee:t,spender:n,balance:a,swap:`${`${r.formatTokenAmount({amount:s.maxAmountIn,decimals:s.tokenIn.decimals})} ${s.tokenIn.symbol}`} → ${`${r.formatTokenAmount({amount:s.amountOut,decimals:s.tokenOut.decimals})} ${s.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===s.type&&s.tokenIn&&s.tokenOut){return{fee:t,spender:n,balance:a,swap:`${`${r.formatTokenAmount({amount:s.inAmount,decimals:s.tokenIn.decimals})} ${s.tokenIn.symbol}`} → ${`${r.formatTokenAmount({amount:s.quotedOutAmount,decimals:s.tokenOut.decimals})} ${s.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===s.type&&s.tokenIn&&s.tokenOut){return{fee:t,spender:n,balance:a,swap:`${`${r.formatTokenAmount({amount:s.quotedInAmount,decimals:s.tokenIn.decimals})} ${s.tokenIn.symbol}`} → ${`${r.formatTokenAmount({amount:s.outAmount,decimals:s.tokenOut.decimals})} ${s.tokenOut.symbol}`}`}}return{fee:t,spender:n,balance:a}}),[A,_?.address,b]),L=a.useMemo((()=>{let n;if(!A||!g||!W||U)return;function t(...n){return e.getFormattedUsdFromLamports(n.reduce(((e,n)=>e+n),0n),W??0)}_?.address===A.spender&&(n=t(A.fee));let a=t(b.value),i=A.instructions.filter((e=>"sol-transfer"===e.type||"spl-transfer"===e.type)).at(0);return!i||A.instructions.length>1?{fee:n,balance:a}:"sol-transfer"===i.type?{fee:n,balance:a,total:t(i.value,_?.address===A.spender?A.fee:0n)}:"spl-transfer"===i.type?{fee:n,balance:a,total:`${r.formatTokenAmount({amount:i.value,decimals:i.token.decimals})} ${i.token.symbol}`}:{fee:n,balance:a}}),[A,g,W,U,_?.address,b]);if(a.useEffect((()=>{!async function(){if(w&&d)try{I(void 0);let e=await ge({tx:w,solanaClient:y,privyClient:d,checkFunds:!M});S(e)}catch(e){console.error("Failed to prepare transaction",e),I(e)}}()}),[w,y,d,M]),a.useEffect((()=>{(async function(){if(!_)return;C({value:b.value,isLoading:!0});let{value:e}=await y.rpc.getBalance(_.address,{commitment:"confirmed"}).send();C({value:e??0n,isLoading:!1})})().catch(console.error)}),[A]),!w||!t?.standardSignAndSendTransaction||!_){let a=Error("Invalid transaction request");/*#__PURE__*/return n.jsx(e.ErrorScreenView,{error:a,allowlistConfig:f.allowlistConfig,onRetry:()=>{t?.standardSignAndSendTransaction?.onFailure(a),u({shouldCallAuthOnSuccess:!1})}})}let R=()=>{if(!E)return x.signature||x.signedTransaction?t?.standardSignAndSendTransaction?.onSuccess({signature:x.signature,signedTransaction:x.signedTransaction}):t?.standardSignAndSendTransaction?.onFailure(k??T??Error("User exited the modal before submitting the transaction")),u({shouldCallAuthOnSuccess:!1})};i.current=R;let B=t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/n.jsx("img",{src:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,N=!!(t.funding&&t.funding.supportedOptions.length>0),$=!A?.hasFunds&&N;if(x.signature||x.signedTransaction){let e=A?.instructions.filter((e=>"sol-transfer"===e.type||"spl-transfer"===e.type)),a=1===e?.length?e?.at(0):void 0;/*#__PURE__*/return n.jsx(ie,{fees:x.fees??0n,onClose:R,transactionInfo:t.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:W,receiptHeader:t.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:t.standardSignAndSendTransaction?.uiOptions.successDescription,chain:y.chain,signOnly:M,instruction:"sol-transfer"===a?.type?{to:a.toAccount,amount:a.value}:{to:a?.toAccount||a?.toAta,total:D?.total}})}return k?/*#__PURE__*/n.jsx(e.TransactionErrorView,{transactionError:k,chainId:y.chain,onClose:R,chainType:"solana",onRetry:async()=>{F(void 0);let{value:e}=await y.rpc.getLatestBlockhash().send();v(function(e,n){return m.pipe(m.getCompiledTransactionMessageDecoder().decode(oe(e)),(e=>m.decompileTransactionMessage(e)),(e=>m.setTransactionMessageLifetimeUsingBlockhash(n,e)),(e=>m.compileTransaction(e)),(e=>new Uint8Array(m.getTransactionEncoder().encode(e))))}(w,e))}}):/*#__PURE__*/n.jsx(e.SendSolanaTransactionScreenView,{img:B,title:t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:t.standardSignAndSendTransaction?.uiOptions?.description||`${f.name} wants your permission to approve the following transaction.`,cta:$?"Add funds":t.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:A?.instructions??[],network:"solana:mainnet"==y.chain?"Solana":y.chain.replace("solana:",""),blockExplorerUrl:y.blockExplorerUrl,total:g?L?.total:D?.total,fee:g?L?.fee:D?.fee,balance:g?L?.balance:D?.balance,swap:D?.swap,transactingWalletAddress:_.address,disabled:!A?.hasFunds&&!N,isSubmitting:E,isPreparing:!A||b.isLoading,isTokenPriceLoading:g&&U,isMissingFunds:!A?.hasFunds,submitError:k??void 0,isSponsored:!!t.standardSignAndSendTransaction?.isSponsored,parseError:T,onClick:$?async()=>{if(_){if(!N)throw Error("Funding wallet is not enabled");l({...t,funding:{...t.funding,methodScreen:e.FundingMethodSelectionScreen},solanaFundingData:t?.solanaFundingData}),c(e.FundingMethodSelectionScreen)}}:async()=>{try{if(P(!0),E||!_||!p||!h||!j)return;let e=await t.standardSignAndSendTransaction.onConfirm(w);if("signature"in e){let n=await async function({solanaClient:e,signature:n}){let t=m.getBase58Decoder().decode(n),a=await e.rpc.getTransaction(t,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return a?{fee:a.meta?.fee??0n}:null}({solanaClient:y,signature:e.signature});return void O({...e,fees:n?.fee})}O(e)}catch(e){console.warn({transaction:w,error:e}),F(e)}finally{P(!1)}},onClose:R})}};function be(e,n,t){let a=structuredClone(m.getTransactionDecoder().decode(e)),r=m.address(n);return r in a.signatures&&(a.signatures[r]=t),new Uint8Array(m.getTransactionEncoder().encode(a))}function Ce(){let{isHeadlessSigning:n,walletProxy:t,initializeWalletProxy:a,recoverEmbeddedWallet:c,openModal:d,privy:p,client:m}=s.usePrivyInternal(),{user:g}=l.usePrivy(),{setModalData:f}=e.usePrivyModal(),{signWithUserSigner:h}=u.useSignWithUserSigner();return{signMessage:({message:s,address:l,options:u})=>new Promise((async(y,w)=>{let v=o.getPrivyWalletWithAddress(g,l);if("privy"!==v?.walletClientType)return void w(new i.PrivyClientError("Wallet is not a Privy wallet",void 0,i.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND));let{entropyId:A,entropyIdVerifier:S}=e.getEntropyDetailsForUser(g,v),T=o.getIsUnifiedWallet(v),I=ce(s).toString("base64");if(I.length<1)return void w(new i.PrivyClientError("Message must be a non-empty string",void 0,i.PrivyErrorCode.INVALID_MESSAGE));let b=async()=>{let e;if(!g)throw Error("User must be authenticated before signing with a Privy wallet");let n=await m.getAccessToken();if(!n)throw Error("User must be authenticated to use their embedded wallet.");let i=t??await a(15e3);if(!i)throw Error("Failed to initialize embedded wallet proxy.");if(!await c({address:v.address}))throw Error("Unable to connect to wallet");if(T){let n=await r.rpc(p,h,{chain_type:"solana",method:"signMessage",params:{message:I,encoding:"base64"},wallet_id:v.id});if(!n.data||!("signature"in n.data))throw Error("Failed to sign message");e=n.data.signature}else{let{response:t}=await i.rpc({accessToken:n,entropyId:A,entropyIdVerifier:S,chainType:"solana",hdWalletIndex:v.walletIndex??0,requesterAppId:u?.uiOptions?.requesterAppId,request:{method:"signMessage",params:{message:I}}});e=t.data.signature}return e};if(n({showWalletUIs:u?.uiOptions?.showWalletUIs}))try{let e=await b(),n=new Uint8Array(ce(e,"base64"));y({signature:n})}catch(e){w(e)}else f({signMessage:{method:"solana_signMessage",data:I,confirmAndSign:b,onSuccess:e=>{y({signature:new Uint8Array(ce(e,"base64"))})},onFailure:e=>{w(e)},uiOptions:u?.uiOptions??{}},connectWallet:{recoveryMethod:v.recoveryMethod,connectingWalletAddress:v.address,entropyId:A,entropyIdVerifier:S,isUnifiedWallet:T,onCompleteNavigateTo:e.SignRequestScreen,onFailure:e=>{w(new i.PrivyClientError("Failed to connect to wallet",e,i.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR))}}}),d(e.EmbeddedWalletConnectingScreen)}))}}function Ee(){let{isHeadlessSigning:n,openModal:t}=s.usePrivyInternal(),{setModalData:a}=e.usePrivyModal(),{signMessage:r}=Ce(),{user:c}=l.usePrivy();return{signTransaction:async({transaction:s,options:l,chain:d="solana:mainnet",address:u})=>{async function p(e){let{signature:n}=await r({message:oe(e),address:u,options:{...l,uiOptions:{...l?.uiOptions,showWalletUIs:!1}}});return{signedTransaction:be(e,u,n)}}return n({showWalletUIs:l?.uiOptions?.showWalletUIs})?p(s):new Promise((async(n,r)=>{let m=o.getPrivyWalletWithAddress(c,u);if("privy"!==m?.walletClientType)return void r(new i.PrivyClientError("Wallet is not a Privy wallet",void 0,i.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND));let{entropyId:g,entropyIdVerifier:f}=e.getEntropyDetailsForUser(c,m),h=o.getIsUnifiedWallet(m);function y(e){return n=>{n instanceof i.PrivyClientError?r(n):r(new i.PrivyClientError("Failed to connect to wallet",n,e))}}let w={account:m,transaction:s,chain:d,signOnly:!0,uiOptions:l?.uiOptions||{},onConfirm:p,onSuccess:n,onFailure:y(i.PrivyErrorCode.TRANSACTION_FAILURE)};a({connectWallet:{recoveryMethod:m.recoveryMethod,connectingWalletAddress:m.address,entropyId:g,entropyIdVerifier:f,isUnifiedWallet:h,onCompleteNavigateTo:Ie,onFailure:y(i.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR)},standardSignAndSendTransaction:w}),t(e.EmbeddedWalletConnectingScreen)}))}}}let Pe=new C({signTransaction:s.notImplementedWithMessage("signTransaction was not injected"),signAndSendTransaction:s.notImplementedWithMessage("signAndSendTransaction was not injected"),signMessage:s.notImplementedWithMessage("signMessage was not injected")}),xe=new class{get version(){return U(this,B)[B]}get name(){return U(this,N)[N]}get icon(){return U(this,$)[$]}get chains(){return S.slice()}get features(){return{"standard:connect":{version:"1.0.0",connect:U(this,Q)[Q]},"standard:disconnect":{version:"1.0.0",disconnect:U(this,Z)[Z]},"standard:events":{version:"1.0.0",on:U(this,J)[J]},"solana:signAndSendTransaction":{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:U(this,X)[X]},"solana:signTransaction":{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:U(this,ee)[ee]},"solana:signMessage":{version:"1.0.0",signMessage:U(this,z)[z]},"privy:":{privy:{signMessage:U(this,V)[V].signMessage,signTransaction:U(this,V)[V].signTransaction,signAndSendTransaction:U(this,V)[V].signAndSendTransaction}}}}get accounts(){return U(this,G)[G].slice()}get isPrivyWallet(){return U(this,q)[q]}constructor({name:e,icon:n,version:t,injection:a,wallets:r}){Object.defineProperty(this,K,{value:ne}),Object.defineProperty(this,Y,{value:te}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,B,{writable:!0,value:void 0}),Object.defineProperty(this,N,{writable:!0,value:void 0}),Object.defineProperty(this,$,{writable:!0,value:void 0}),Object.defineProperty(this,V,{writable:!0,value:void 0}),Object.defineProperty(this,q,{writable:!0,value:void 0}),Object.defineProperty(this,G,{writable:!0,value:void 0}),Object.defineProperty(this,J,{writable:!0,value:void 0}),Object.defineProperty(this,H,{writable:!0,value:void 0}),Object.defineProperty(this,Q,{writable:!0,value:void 0}),Object.defineProperty(this,Z,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,X,{writable:!0,value:void 0}),Object.defineProperty(this,ee,{writable:!0,value:void 0}),U(this,R)[R]={},U(this,J)[J]=(e,n)=>(U(this,R)[R][e]?.push(n)||(U(this,R)[R][e]=[n]),()=>U(this,Y)[Y](e,n)),U(this,H)[H]=e=>{null!=e&&(U(this,G)[G]=e.map((({address:e})=>new W({address:e,publicKey:d.base58.decode(e)})))),U(this,K)[K]("change",{accounts:this.accounts})},U(this,Q)[Q]=async()=>(U(this,K)[K]("change",{accounts:this.accounts}),{accounts:this.accounts}),U(this,Z)[Z]=async()=>{U(this,K)[K]("change",{accounts:this.accounts})},U(this,z)[z]=async(...e)=>{let n=[];for(let{account:t,...a}of e){let{signature:e}=await U(this,V)[V].signMessage({...a,address:t.address});n.push({signedMessage:a.message,signature:e})}return n},U(this,X)[X]=async(...e)=>{let n=[];for(let t of e){let{signature:e}=await U(this,V)[V].signAndSendTransaction({...t,transaction:t.transaction,address:t.account.address,chain:t.chain||"solana:mainnet",options:t.options});n.push({signature:e})}return n},U(this,ee)[ee]=async(...e)=>{let n=[];for(let{transaction:t,account:a,options:r,chain:i}of e){let{signedTransaction:e}=await U(this,V)[V].signTransaction({transaction:t,address:a.address,chain:i||"solana:mainnet",options:r});n.push({signedTransaction:e})}return n},U(this,N)[N]=e,U(this,$)[$]=n,U(this,B)[B]=t,U(this,V)[V]=a,U(this,G)[G]=[],U(this,q)[q]=!0,a.on("accountChanged",U(this,H)[H],this),U(this,H)[H](r)}}({name:"Privy",version:"1.0.0",icon:"data:image/png;base64,AAABAAEAFBQAAAAAIABlAQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAUAAAAFAgGAAAAjYkdDQAAAAlwSFlzAAAOwwAADsMBx2+oZAAAAQVJREFUeJxiYMANZIC4E4ivAPFPIP4FxDeAuB+IlfDowwBMQFwJxF+B+D8O/AOI66Bq8QJGIF6ExyB0vAqImfEZmEeCYTDcgMswPiB+T4aB34FYApuBsWQYBsP52AycToGBK7EZuJECAw9jM3AVBQbuwWZgIwUGTsZmoDkFBnpiMxAEjpJh2FV8iVsbiD+TYBgoDVrgMgwGnID4HRGGgTKBGyHDYEAaiBdCSxh0g/5AU4Q8sYYhAzEgjoGmABBOgFo2eACowFABYn0oVgViAVINkQTiZUD8DIj/ATF6GILEXgLxCiCWIsZAbiAuBeKtQHwHiEHJ6C8UfwHie0C8E4jLoWpRAAAAAP//rcbhsQAAAAZJREFUAwBYFs3VKJ0cuQAAAABJRU5ErkJggg==",wallets:[],injection:Pe});function Oe(){let{ready:n}=e.useWallets(),{user:t}=l.usePrivy(),{signMessage:c}=Ce(),{signTransaction:p}=Ee(),{signAndSendTransaction:m}=function(){let n=e.useAppConfig(),{isHeadlessSigning:t,openModal:a}=s.usePrivyInternal(),{setModalData:c}=e.usePrivyModal(),{signTransaction:p}=Ee(),m=Te(),{user:g}=l.usePrivy(),{signWithUserSigner:f}=u.useSignWithUserSigner();return{signAndSendTransaction:async({transaction:s,address:u,chain:h="solana:mainnet",options:y})=>{async function v(e){if(y?.sponsor)return await T(e);let{signedTransaction:n}=await p({transaction:e,address:u,chain:h,options:{...y,uiOptions:{...y?.uiOptions,showWalletUIs:!1}}}),{signature:t}=await m(h).sendAndConfirmTransaction(n);return{signature:t}}if(t({showWalletUIs:y?.uiOptions?.showWalletUIs}))return v(s);let A=o.getPrivyWalletWithAddress(g,u);if("privy"!==A?.walletClientType)throw new i.PrivyClientError("Wallet is not a Privy wallet",void 0,i.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND);let S=o.getIsUnifiedWallet(A),T=async t=>{if(!S)throw new i.PrivyClientError("Sponsoring transactions is only supported for wallets on the TEE stack",i.PrivyErrorCode.INVALID_DATA);let a=new w.default({appId:n.id,clientId:n.appClientId,storage:e.f}),s=await r.rpc(a,f,{chain_type:"solana",method:"signAndSendTransaction",sponsor:!0,params:{transaction:Buffer.from(t).toString("base64"),encoding:"base64"},caip2:`solana:${(await m(h).rpc.getGenesisHash().send()).substring(0,32)}`,wallet_id:A.id});if(s.data&&"hash"in s.data)return{signature:d.base58.decode(s.data.hash)};throw Error("Failed to sign and send transaction")};return new Promise((async(t,r)=>{let o,d,{entropyId:p,entropyIdVerifier:m}=e.getEntropyDetailsForUser(g,A);function f(e){return n=>{n instanceof i.PrivyClientError?r(n):r(new i.PrivyClientError("Failed to connect to wallet",n,e))}}let w={account:A,transaction:s,chain:h,signOnly:!1,uiOptions:y?.uiOptions||{},onConfirm:v,onSuccess:t,onFailure:f(i.PrivyErrorCode.TRANSACTION_FAILURE),isSponsored:!!y?.sponsor},T={recoveryMethod:A.recoveryMethod,connectingWalletAddress:A.address,entropyId:p,entropyIdVerifier:m,isUnifiedWallet:S,onCompleteNavigateTo:Ie,onFailure:f(i.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR)};n.fundingConfig&&(o=l.prepareSolanaFundingModalData({address:u,appConfig:n,methodScreen:e.FundingMethodSelectionScreen,fundWalletConfig:{...y,asset:"native-currency",chain:h},externalSolanaFundingScreen:De}),d={amount:n.fundingConfig.defaultRecommendedAmount,asset:"SOL",chain:h,destinationAddress:u,afterSuccessScreen:Ie,sourceWalletData:void 0}),c({connectWallet:T,standardSignAndSendTransaction:w,funding:o,solanaFundingData:d}),a(e.EmbeddedWalletConnectingScreen)}))}}}(),g=a.useMemo((()=>{let e=[...o.getPrivySolanaHDWallets(t).sort(((e,n)=>(e.walletIndex??0)-(n.walletIndex??0)))],n=o.getImportedPrivySolanaWallets(t);return n.length?[...e,...n]:e}),[t]),f=a.useMemo((()=>({signMessage:async({message:e,address:n,options:t})=>await c({message:e,address:n,options:t}),signTransaction:async({transaction:e,address:n,chain:t,options:a})=>await p({transaction:e,address:n,chain:t,options:a}),async signAndSendTransaction({transaction:e,address:n,chain:t,options:a}){let{signature:r}=await m({transaction:e,address:n,chain:t,options:a});return{signature:r}}})),[c,p,m]);return a.useEffect((()=>{Pe?.setImplementation(f)}),[f]),a.useEffect((()=>{var e;!n||(e=xe.accounts).length===g.length&&e.every(((e,n)=>e.address===g[n]?.address))||Pe?.emit("accountChanged",g)}),[n,g]),{ready:n,wallet:xe}}function ke(){let{client:e}=s.usePrivyInternal(),{ready:n,wallet:t}=Oe(),[r,i]=a.useState([]),[o,l]=a.useState([]);return a.useEffect((()=>{let e=[t,...r.filter((e=>"solana"===e.chainType&&!!e.wallet.features)).map((e=>e.wallet))];l(e);let n=e.map((n=>n.features["standard:events"]?.on("change",(()=>{l([...e])}))));return()=>{n.forEach((e=>e?.()))}}),[r]),a.useEffect((()=>{if(!n)return;i(e.connectors?.walletConnectors.filter((e=>"solana"===e.chainType))??[]);let t=()=>{i(e.connectors?.walletConnectors.filter((e=>"solana"===e.chainType))??[])};return e.connectors?.on("connectorInitialized",t),()=>{e.connectors?.off("connectorInitialized",t)}}),[n,e.connectors]),{ready:n,wallets:o}}function Fe(){let{ready:e,wallets:n}=ke();return{ready:e,wallets:a.useMemo((()=>n.flatMap((e=>e.accounts.map((n=>new r.ConnectedStandardSolanaWallet({wallet:e,account:n})))))),[n])}}function _e(e){return m.getBase58Decoder().decode(e)}function Me(e){return BigInt(Math.floor(1e9*parseFloat(e)))}function je(e){return+We.format(parseFloat(e.toString())/1e9)}let We=Intl.NumberFormat(void 0,{maximumFractionDigits:8});async function Ue({tx:n,solanaClient:t,amount:a,asset:r,tokenPrice:i}){if(!n)return null;if("SOL"===r&&i){let r=Me(a),s=e.getFormattedUsdFromLamports(r,i),o=await pe({solanaClient:t,tx:n});return{amountInUsd:s,feeInUsd:i?e.getFormattedUsdFromLamports(o,i):void 0,totalInUsd:e.getFormattedUsdFromLamports(r+o,i)}}if("USDC"===r&&i){let r="$"+a,s=await pe({solanaClient:t,tx:n}),o=function(n,t){let a=parseFloat(n.toString())/e.LAMPORTS_PER_SOL*t;return a<.01?0:a}(s,i);return{amountInUsd:r,feeInUsd:e.getFormattedUsdFromLamports(s,i),totalInUsd:"$"+(parseFloat(a)+o).toFixed(2)}}if("SOL"===r){let e=Me(a),r=await pe({solanaClient:t,tx:n});return{amountInSol:a+" SOL",feeInSol:je(r)+" SOL",totalInSol:je(e+r)+" SOL"}}return{amountInUsdc:a+" USDC",feeInSol:je(await pe({solanaClient:t,tx:n}))+" SOL"}}const De={component:function(){let t=e.useAppConfig(),{closePrivyModal:o,createAnalyticsEvent:l}=s.usePrivyInternal(),{data:c,setModalData:d,navigate:u}=e.usePrivyModal(),{wallets:p}=Fe(),[h,w]=a.useState("preparing"),[v,S]=a.useState(),[T,I]=a.useState(),[b,C]=a.useState();if(!c?.solanaFundingData)throw Error("Funding config is missing");if(!c.solanaFundingData.sourceWalletData)throw Error("Funding config is missing source wallet data");let{amount:E,asset:P,chain:x,sourceWalletData:O,destinationAddress:k,afterSuccessScreen:F}=c.solanaFundingData,_=p.find((n=>n.address===O.address&&e.toSolanaWalletClientType(O.walletClientType)===e.toSolanaWalletClientType(n.standardWallet.name))),M=Te()(x),{tokenPrice:j,isTokenPriceLoading:W}=e.useGetTokenPrice("solana");return a.useEffect((()=>{if("preparing"!==h||W||!_)return;let n="SOL"===P?Me(E):function(e){return BigInt(Math.floor(1e6*parseFloat(e)))}(E);I({amount:("SOL"===P&&j?e.getFormattedUsdFromLamports(n,j):E)??E}),("SOL"===P?async function({solanaClient:e,source:n,destination:t,amountInLamports:a}){let{value:r}=await e.rpc.getLatestBlockhash().send(),i={address:n},s=m.pipe(m.createTransactionMessage({version:0}),(e=>m.setTransactionMessageFeePayerSigner(i,e)),(e=>m.setTransactionMessageLifetimeUsingBlockhash(r,e)),(e=>m.appendTransactionMessageInstruction(g.getTransferSolInstruction({amount:a,source:i,destination:t}),e)),(e=>m.compileTransaction(e)));return new Uint8Array(m.getTransactionEncoder().encode(s))}({solanaClient:M,source:_.address,destination:k,amountInLamports:n}):async function({solanaClient:n,source:t,destination:a,amountInBaseUnits:r}){let i=e.getUsdcMintAddress(n.chain),{value:s}=await n.rpc.getLatestBlockhash().send(),o={address:t},[l]=await f.findAssociatedTokenPda({mint:i,owner:t,tokenProgram:e.TOKEN_PROGRAM_ID}),[c]=await f.findAssociatedTokenPda({mint:i,owner:a,tokenProgram:e.TOKEN_PROGRAM_ID}),[d,u]=await Promise.all([n.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null)),n.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null))]);if(!d?.value)throw Error(`Source token account does not exist for address: ${t}`);let p=f.getCreateAssociatedTokenIdempotentInstruction({payer:o,ata:c,owner:a,mint:i}),g=m.pipe(m.createTransactionMessage({version:0}),(e=>m.setTransactionMessageFeePayerSigner(o,e)),(e=>m.setTransactionMessageLifetimeUsingBlockhash(s,e)),(e=>u?.value?e:m.appendTransactionMessageInstruction(p,e)),(e=>m.appendTransactionMessageInstruction(f.getTransferInstruction({source:l,destination:c,authority:o,amount:r}),e)),(e=>m.compileTransaction(e)));return new Uint8Array(m.getTransactionEncoder().encode(g))}({solanaClient:M,source:_.address,destination:k,amountInBaseUnits:n})).then(S).catch((e=>{w("error"),C(e)}))}),[h,E,P,x,_,k,W,j]),a.useEffect((()=>{"preparing"===h&&v&&Ue({tx:v,solanaClient:M,amount:E,asset:P,tokenPrice:j}).then((e=>{w("loaded"),I({amount:e?.amountInUsd??e?.amountInUsdc??e?.amountInSol??E,fee:e?.feeInUsd??e?.feeInSol,total:e?.totalInUsd??e?.totalInSol})})).catch((e=>{w("error"),C(e)}))}),[v,E,P,h,j]),a.useEffect((()=>{"error"===h&&b&&(d({errorModalData:{error:b,previousScreen:De},solanaFundingData:c.solanaFundingData}),u(e.ErrorScreen,!1))}),[h,u]),a.useEffect((()=>{if("success"!==h)return;let n=setTimeout(F?()=>u(F):o,e.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS);return()=>clearTimeout(n)}),[h]),"success"===h?/*#__PURE__*/n.jsxs(n.Fragment,{children:[/*#__PURE__*/n.jsx(e.i,{}),/*#__PURE__*/n.jsx(e.RefactorSpacerTop,{}),/*#__PURE__*/n.jsxs(e.CenteredItemWithGap,{children:[/*#__PURE__*/n.jsx(y.default,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/n.jsx(e.CenteredScreenHeader,{title:"Success!",description:`You’ve successfully added ${E} ${P} to your ${t.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/n.jsx(e.RefactorSpacerBottom,{}),/*#__PURE__*/n.jsx(e.BlobbyFooter,{})]}):"preparing"===h||"loaded"===h||"sending"===h?/*#__PURE__*/n.jsxs(n.Fragment,{children:[/*#__PURE__*/n.jsx(e.i,{}),/*#__PURE__*/n.jsx(e.CenteredItem,{style:{marginTop:"16px"},children:/*#__PURE__*/n.jsx(e.InjectedWalletIcon,{icon:_?.standardWallet.icon,name:_?.standardWallet.name})}),/*#__PURE__*/n.jsx(e.CenteredScreenHeader,{style:{marginTop:"8px",marginBottom:"12px"},title:"sending"===h&&_?`Confirming with ${_.standardWallet.name}`:"Confirm transaction"}),/*#__PURE__*/n.jsx(A,{rows:[{label:"Source",value:r.formatWalletAddress(O.address)},{label:"Destination",value:r.formatWalletAddress(k)},{label:"Network",value:e.getChainName(x)},{label:"Amount",value:T?.amount,isLoading:"preparing"===h},{label:"Estimated fee",value:T?.fee,isLoading:"preparing"===h},{label:"Total",value:T?.total,isLoading:"preparing"===h}]}),/*#__PURE__*/n.jsx(e.PrimaryButton,{style:{marginTop:"1rem"},loading:"preparing"===h||"sending"===h,onClick:function(){"loaded"===h&&v&&_&&(w("sending"),async function({transaction:e,chain:n,sourceWallet:t,solanaClient:a}){let{hasFunds:s}=await me({solanaClient:a,tx:e});if(!s)throw new i.PrivyClientError(`Wallet ${r.formatWalletAddress(t.address)} does not have enough funds.`,void 0,i.PrivyErrorCode.INSUFFICIENT_BALANCE);let o=_e((await t.signAndSendTransaction({transaction:e,chain:n}).catch((e=>{throw new i.PrivyClientError("Transaction was rejected by the user",e,i.PrivyErrorCode.TRANSACTION_FAILURE)}))).signature);return await Ae({rpcSubscriptions:a.rpcSubscriptions,signature:o,timeout:2e4}),o}({solanaClient:M,transaction:v,chain:x,sourceWallet:_}).then((n=>{w("success"),l({eventName:e.ON_RAMP_COMPLETE_ANALYTICS_EVENT,payload:{provider:"external",status:"success",txHash:n,address:_.address,value:E,chainType:"solana",clusterName:x,token:P,destinationAddress:k,destinationValue:E,destinationChainType:"solana",destinationClusterName:x,destinationToken:P}})})).catch((e=>{w("error"),C(e)})))},children:"Confirm"}),/*#__PURE__*/n.jsx(e.BlobbyFooter,{})]}):
|
|
2
|
+
/*#__PURE__*/n.jsxs(n.Fragment,{children:[/*#__PURE__*/n.jsx(e.i,{}),/*#__PURE__*/n.jsx(e.NeutralSpinner,{}),/*#__PURE__*/n.jsx("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/n.jsx(e.BlobbyFooter,{})]})}};exports.fetchTransactionEstimatedFees=pe,exports.getAddressFromBuffer=_e,exports.getSolanaRpcClient=Se,exports.simulateTransaction=me,exports.useExportWallet=function(){let{user:n,getAccessToken:t}=o.usePrivyContext(),{walletProxy:r,openModal:c,client:d}=s.usePrivyInternal(),{setModalData:u}=e.usePrivyModal(),p=e.useAppConfig();return a.useMemo((()=>({exportWallet:a=>new Promise((async(s,m)=>{if(!n)return void m(new i.PrivyClientError("User must be authenticated before exporting their Privy wallet"));let g=a?.address?o.getPrivyWalletWithAddress(n,a.address):o.getPrivySolanaWallet(n);if(!g)return void m(new i.PrivyClientError("User must have an embedded wallet."));if(!l.isFirstClassChainWallet(g))return void m(Error(`Export is not supported for ${g.chainType} wallets`));let f=o.getIsUnifiedWallet(g),{entropyId:h,entropyIdVerifier:y}=e.getEntropyDetailsForUser(n,g);await t()?r?(u({connectWallet:{recoveryMethod:g.recoveryMethod,connectingWalletAddress:g.address,isUnifiedWallet:f,entropyId:h,entropyIdVerifier:y,onCompleteNavigateTo:e.EmbeddedWalletKeyExportScreen,onFailure:m,shouldForceMFA:!0},keyExport:{appId:p.id,appClientId:p.appClientId,origin:d.apiUrl,address:g.address,entropyId:h,entropyIdVerifier:y,hdWalletIndex:g.walletIndex,chainType:g.chainType,walletId:g.id,isUnifiedWallet:f,imported:g.imported,onSuccess:s,onFailure:m}}),c(e.EmbeddedWalletConnectingScreen)):m(new i.PrivyClientError("Wallet not ready for export")):m(new i.PrivyClientError("Must have valid access token."))}))})),[n,t,r,c,d,u,p])},exports.useFundWallet=function(){let n=e.useAppConfig(),{openModal:t}=s.usePrivyInternal(),{setModalData:a}=e.usePrivyModal();return{fundWallet:async({address:r,options:i})=>{let s=i?.amount||n.fundingConfig?.defaultRecommendedAmount||"1",o=i?.asset||n.fundingConfig?.defaultRecommendedCurrency.asset||"native-currency",c=i?.chain||"solana:mainnet";a({funding:l.prepareSolanaFundingModalData({address:r,appConfig:n,methodScreen:e.FundingMethodSelectionScreen,fundWalletConfig:{...i,amount:s,asset:o,chain:c},externalSolanaFundingScreen:De}),solanaFundingData:{amount:s,asset:"native-currency"===o?"SOL":"USDC",chain:c,destinationAddress:r,sourceWalletData:void 0}}),t(e.FundingMethodSelectionScreen)}}},exports.useSolanaStandardWallets=ke,exports.useWallets=Fe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("./SignRequestScreen-
|
|
1
|
+
"use strict";var e=require("react"),t=require("./SignRequestScreen-BtiA_kjR.js"),n=require("./privy-context-NMR-GjnL.js"),l=require("styled-components"),r=require("./internal-context-DNWjSiYq.js");const s=/*#__PURE__*/l.styled.div.withConfig({displayName:"Column",componentId:"sc-cfc52180-0"})(["display:flex;flex-direction:column;"]);exports.Column=s,exports.useActiveWallet=()=>{let n=t.useAppConfig(),{wallets:l}=t.useWallets(),{connectors:s}=r.usePrivyInternal(),i=e.useMemo((()=>s.filter(t.isSolanaWalletConnector).flatMap((e=>e.wallets))),[s]),o=t.useActiveWalletStore((e=>e.wallet));e.useEffect((()=>{if(!n.id)return;let e=t.f.get(t.toActiveWalletKey(n.id));t.useActiveWalletStore.setState({wallet:e})}),[n.id]);let u=e.useMemo((()=>{if(!o)return;let[,e]=o.split(":");return l.find((t=>t.address===e))||i.find((t=>t.address===e))}),[o,l,i]),a=e.useMemo((()=>u?"ethereum"===u.type?u.chainId:"solana":void 0),[u]);return{connect:async e=>{e?.reset&&(t.f.del(t.toActiveWalletKey(n.id)),t.useActiveWalletStore.setState({wallet:void 0}));let{wallet:r}=await t.open();if(!r)return{};let[,s]=r.split(":"),o=l.find((e=>e.address===s));if(o)return{wallet:o,network:o.chainId};let u=i.find((e=>e.address===s));return u?{wallet:u,network:"solana"}:{}},setActiveWallet:e.useCallback((e=>{t.setActiveWallet({address:e.address,client:e.walletClientType,appId:n.id})}),[n.id]),wallet:u,network:a}},exports.useConnectWallet=function(l){let{connectWallet:r}=e.useContext(n.PrivyContext);return t.usePrivyEventSubscription("connectWallet",l),{connectWallet:r}},exports.useElementHeight=t=>{let[n,l]=e.useState("auto");return e.useEffect((()=>{let e=new ResizeObserver((e=>{l(e[0]?.contentRect.height??"auto")}));return t.current&&e.observe(t.current),()=>{t.current&&e.unobserve(t.current)}}),[t.current]),n},exports.useFundWallet=e=>{t.usePrivyEventSubscription("fundWallet",e);let{fundWallet:n}=r.usePrivyInternal();return{fundWallet:({address:e,options:t})=>n(e,t)}},exports.useLogin=function(l){let{login:r}=e.useContext(n.PrivyContext);return t.usePrivyEventSubscription("login",l),{login:r}},exports.useLogout=function(l){let{logout:r}=e.useContext(n.PrivyContext);return t.usePrivyEventSubscription("logout",l),{logout:r}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./paths-B00ZrFQm.js"),r=require("@privy-io/js-sdk-core"),t=require("react"),n=require("./privy-context-NMR-GjnL.js"),a=require("./SignRequestScreen-CvBcoZRA.js"),i=require("./internal-context-DNWjSiYq.js");function o(e){let r=e.replace("eip155:","");if(r)return parseInt(r);throw Error("Chain ID not compatible with CAIP-2 format.")}const l=e=>e.filter((e=>"wallets"===e.method||("exchange"===e.method?"coinbase"===e.provider:"card"===e.method||"payment-request"===e.method?"coinbase"===e.provider||"moonpay"===e.provider:(e.method,!1)))),d={[r.mainnet.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[r.sepolia.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[r.optimism.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[r.optimismSepolia.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[r.polygon.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[r.polygonAmoy.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[r.base.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[r.baseSepolia.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[r.avalanche.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[r.avalancheFuji.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[r.arbitrum.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[r.arbitrumSepolia.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"};const s=e=>e.reduce(((e,r)=>!e||e.walletIndex<r.walletIndex?r:e),null),c=async({appConfig:r,getAccessToken:t,initializeWalletProxy:n,user:i,privy:o,emitPrivyEvent:l,recoverEmbeddedWallet:d,setModalData:c,openModal:p,setUser:E,options:f,timeoutDuration:h,refreshSessionAndUser:y,chainType:m})=>{let[v,g]=await Promise.all([n(h),t()]);if(!g||!i)throw l("createWallet","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");if(!v&&r.customAuth?.enabled)throw l("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(f&&"walletIndex"in f&&"number"==typeof f.walletIndex){if("user-controlled-server-wallets-only"===r.embeddedWallets.mode)throw l("createWallet","onError",e.PrivyErrorCode.INVALID_DATA),Error("Invalid input, use `createAdditional` instead of `walletIndex` to create additional wallets.");return u({accessToken:g,appConfig:r,privy:o,emitPrivyEvent:l,openModal:p,proxy:v,refreshSessionAndUser:y,recoverEmbeddedWallet:d,setModalData:c,user:i,walletIndex:f.walletIndex,chainType:m,setUser:E})}let C=f&&"createAdditional"in f&&f.createAdditional,w=a.getPrivyWalletsWithFilter(i,{chainType:m});if(w[0]&&!C)throw l("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");return u({accessToken:g,appConfig:r,privy:o,emitPrivyEvent:l,openModal:p,proxy:v,recoverEmbeddedWallet:d,setModalData:c,user:i,walletIndex:(s(w)?.walletIndex??-1)+1,chainType:m,refreshSessionAndUser:y,setUser:E})};let u=async({accessToken:r,appConfig:t,privy:i,emitPrivyEvent:o,proxy:l,refreshSessionAndUser:d,recoverEmbeddedWallet:s,user:c,walletIndex:u,setModalData:E,openModal:f,chainType:h,setUser:y})=>{if(u<0)throw o("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${u}) is invalid.`);let m=n.getPrivyPrimaryWallet(c);if(u>0&&!m)throw o("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),Error("Must have an existing embedded wallet to create an additional wallet.");if(t.embeddedWallets.requireUserOwnedRecoveryOnCreate&&"user-controlled-server-wallets-only"===t.embeddedWallets.mode)throw o("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error("User owned recovery not yet supported for this app.");if(!m&&t.embeddedWallets.requireUserOwnedRecoveryOnCreate)return await p({emitPrivyEvent:o,setModalData:E,openModal:f,chainType:h});let v=a.getPrivyWalletsWithFilter(c,{chainType:h,walletIndex:u})[0];if(v)return{user:c,account:v};if(0===u&&!l)return p({emitPrivyEvent:o,setModalData:E,openModal:f,chainType:h});if(!l)throw o("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return a.createWalletAtIndex({appConfig:t,walletIndex:u,chainType:h,user:c,accessToken:r,proxy:l,refreshSessionAndUser:d,privy:i,recoverEmbeddedWallet:s,setUser:y})},p=async({emitPrivyEvent:r,setModalData:t,openModal:n,chainType:i})=>new Promise(((o,l)=>{t({createWallet:{onSuccess:({user:e,account:t})=>{r("createWallet","onSuccess",{wallet:t}),o({user:e,account:t})},onFailure:t=>{r("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),l(t)},callAuthOnSuccessOnClose:!1,shouldCreateEth:"ethereum"===i,shouldCreateSol:"solana"===i}}),n(a.EmbeddedWalletOnAccountCreateScreen)}));const E=()=>{let r=a.useAppConfig(),t=a.useEmitPrivyEvent(),{setModalData:n}=a.usePrivyModal(),{initializeWalletProxy:o,recoverEmbeddedWallet:l,setUser:d,openModal:s,refreshSessionAndUser:u,privy:p,client:E}=i.usePrivyInternal();return{create:async({chainType:i,options:f,latestUser:h})=>{let y=h;if(y||(y=await u()),!y)throw t("createWallet","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return await c({appConfig:r,privy:p,getAccessToken:()=>E.getAccessToken(),refreshSessionAndUser:u,initializeWalletProxy:o,user:y,emitPrivyEvent:t,recoverEmbeddedWallet:l,setModalData:n,openModal:s,setUser:d,options:f,timeoutDuration:a.WALLET_PROXY_TIMEOUT,chainType:i})}}};function f(e){let{create:r}=E();return a.usePrivyEventSubscription("createWallet",e),{createWallet:async e=>{e&&"target"in e&&e&&(e=void 0);let{account:t}=await r({chainType:"ethereum",options:e});return t}}}const h=async({emitPrivyEvent:r,getAccessToken:t,initializeWalletProxy:a,refreshSessionAndUser:i,user:o,appConfig:l},{privateKey:d,chainType:s,additionalSigners:c})=>{if(!o)throw r("linkAccount","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new e.PrivyClientError("User must be authenticated before linking an account.");let u="user-controlled-server-wallets-only"===l.embeddedWallets.mode?"tee":"on-device";if(c&&"on-device"===u)throw new e.PrivyClientError("Specifying additionalSigners is only supported for TEE execution and this app uses On-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let[p,E]=await Promise.all([t(),a(15e3)]);if(!E||!p)throw r("linkAccount","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new e.PrivyClientError("User must be authenticated before linking an account.");let{address:f}=await E.importWallet({privateKey:d,accessToken:p,chainType:s,mode:u,additionalSigners:c}),h=await i(),y="solana"===s?n.getImportedPrivySolanaWallets(h):n.getImportedPrivyEthereumWallets(h),m=y?.find((e=>e.address===f));if(!m)throw r("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return r("createWallet","onSuccess",{wallet:m}),m},y=()=>{let{user:e}=n.usePrivyContext(),{client:r,refreshSessionAndUser:o,initializeWalletProxy:l}=i.usePrivyInternal(),d=a.useEmitPrivyEvent(),s=a.useAppConfig();return{importWallet:t.useCallback((({privateKey:t,additionalSigners:n})=>h({getAccessToken:()=>r.getAccessToken(),user:e,initializeWalletProxy:l,refreshSessionAndUser:o,emitPrivyEvent:d,appConfig:s},{privateKey:t,chainType:"ethereum",additionalSigners:n})),[e,r,o,l,d,s])}};exports.extractChainIdFromCAIP2=o,exports.filterSupportedOptions=l,exports.importWallet=h,exports.isFirstClassChainWallet=function(e){return["ethereum","solana"].includes(e.chainType)},exports.prepareFundingModalData=({address:r,appConfig:t,fundWalletConfig:n,methodScreen:a,chainIdOverride:i,comingFromSendTransactionScreen:s=!1})=>{let c,u;if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let p=l(t.fundingConfig.options);if(p.length<1)throw Error("Wallet funding is not enabled");c=i||(n?.chain?n.chain.id:o(t.fundingConfig.defaultRecommendedCurrency.chain));let E=t.chains.find((e=>e.id===c));if(!E)throw new e.PrivyClientError(`Funding chain ${c} is not in PrivyProvider chains list`);let f=n?.amount??t.fundingConfig.defaultRecommendedAmount,h=!1;function y(){if(!c)return;let e=d[c];p.find((e=>"wallets"===e.method))&&!e&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),u=e,h=!0}n&&"asset"in n?"USDC"===n.asset?y():"string"!=typeof n.asset&&"erc20"in n.asset&&(h=((e,r)=>e===d[r.id])(u=n.asset.erc20,E)):"USDC"===t.fundingConfig.defaultRecommendedCurrency.asset&&y();let m=n?.defaultFundingMethod;return{chainType:"ethereum",address:r,amount:f,chain:E,erc20Address:u,erc20ContractInfo:h?{symbol:"USDC",decimals:6}:void 0,isUSDC:h,methodScreen:a,supportedOptions:p,comingFromSendTransactionScreen:s,defaultFundingMethod:m,usingDefaultFundingMethod:!!m,preferredCardProvider:n?.card?.preferredProvider,crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,solanaChain:"solana:mainnet",uiConfig:n&&"uiConfig"in n?n.uiConfig:void 0,externalSolanaFundingScreen:null}},exports.prepareSolanaFundingModalData=function({address:e,fundWalletConfig:r,appConfig:t,comingFromSendTransactionScreen:n,externalSolanaFundingScreen:a,methodScreen:i}){if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let o=l(t.fundingConfig.options);if(o.length<1)throw Error("Wallet funding is not enabled");if("USDC"===r?.asset&&"solana:testnet"===r?.chain)throw Error("USDC funding is not supported on the Solana testnet");let d=r?.amount??t.fundingConfig.defaultRecommendedAmount,s=r?.defaultFundingMethod;return{chainType:"solana",address:e,supportedOptions:o,amount:d,isUSDC:"USDC"===r?.asset,methodScreen:i,comingFromSendTransactionScreen:n,chain:r?.chain||"solana:mainnet",crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:s,preferredCardProvider:r?.card?.preferredProvider,usingDefaultFundingMethod:!!s,uiConfig:r?.uiConfig,externalSolanaFundingScreen:a}},exports.useCreateWallet=f,exports.useCreateWalletInternal=E,exports.useImportWallet=y,exports.usePrivy=()=>{let{importWallet:e}=y(),{createWallet:r}=f();return{...t.useContext(n.PrivyContext),importWallet:e,createWallet:r}};
|
|
1
|
+
"use strict";var e=require("./paths-B00ZrFQm.js"),r=require("@privy-io/js-sdk-core"),t=require("react"),n=require("./privy-context-NMR-GjnL.js"),a=require("./SignRequestScreen-BtiA_kjR.js"),i=require("./internal-context-DNWjSiYq.js");function o(e){let r=e.replace("eip155:","");if(r)return parseInt(r);throw Error("Chain ID not compatible with CAIP-2 format.")}const l=e=>e.filter((e=>"wallets"===e.method||("exchange"===e.method?"coinbase"===e.provider:"card"===e.method||"payment-request"===e.method?"coinbase"===e.provider||"moonpay"===e.provider:(e.method,!1)))),d={[r.mainnet.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[r.sepolia.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[r.optimism.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[r.optimismSepolia.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[r.polygon.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[r.polygonAmoy.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[r.base.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[r.baseSepolia.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[r.avalanche.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[r.avalancheFuji.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[r.arbitrum.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[r.arbitrumSepolia.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"};const s=e=>e.reduce(((e,r)=>!e||e.walletIndex<r.walletIndex?r:e),null),c=async({appConfig:r,getAccessToken:t,initializeWalletProxy:n,user:i,privy:o,emitPrivyEvent:l,recoverEmbeddedWallet:d,setModalData:c,openModal:p,setUser:E,options:f,timeoutDuration:h,refreshSessionAndUser:y,chainType:m})=>{let[v,g]=await Promise.all([n(h),t()]);if(!g||!i)throw l("createWallet","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");if(!v&&r.customAuth?.enabled)throw l("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(f&&"walletIndex"in f&&"number"==typeof f.walletIndex){if("user-controlled-server-wallets-only"===r.embeddedWallets.mode)throw l("createWallet","onError",e.PrivyErrorCode.INVALID_DATA),Error("Invalid input, use `createAdditional` instead of `walletIndex` to create additional wallets.");return u({accessToken:g,appConfig:r,privy:o,emitPrivyEvent:l,openModal:p,proxy:v,refreshSessionAndUser:y,recoverEmbeddedWallet:d,setModalData:c,user:i,walletIndex:f.walletIndex,chainType:m,setUser:E})}let C=f&&"createAdditional"in f&&f.createAdditional,w=a.getPrivyWalletsWithFilter(i,{chainType:m});if(w[0]&&!C)throw l("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");return u({accessToken:g,appConfig:r,privy:o,emitPrivyEvent:l,openModal:p,proxy:v,recoverEmbeddedWallet:d,setModalData:c,user:i,walletIndex:(s(w)?.walletIndex??-1)+1,chainType:m,refreshSessionAndUser:y,setUser:E})};let u=async({accessToken:r,appConfig:t,privy:i,emitPrivyEvent:o,proxy:l,refreshSessionAndUser:d,recoverEmbeddedWallet:s,user:c,walletIndex:u,setModalData:E,openModal:f,chainType:h,setUser:y})=>{if(u<0)throw o("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${u}) is invalid.`);let m=n.getPrivyPrimaryWallet(c);if(u>0&&!m)throw o("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),Error("Must have an existing embedded wallet to create an additional wallet.");if(t.embeddedWallets.requireUserOwnedRecoveryOnCreate&&"user-controlled-server-wallets-only"===t.embeddedWallets.mode)throw o("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error("User owned recovery not yet supported for this app.");if(!m&&t.embeddedWallets.requireUserOwnedRecoveryOnCreate)return await p({emitPrivyEvent:o,setModalData:E,openModal:f,chainType:h});let v=a.getPrivyWalletsWithFilter(c,{chainType:h,walletIndex:u})[0];if(v)return{user:c,account:v};if(0===u&&!l)return p({emitPrivyEvent:o,setModalData:E,openModal:f,chainType:h});if(!l)throw o("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return a.createWalletAtIndex({appConfig:t,walletIndex:u,chainType:h,user:c,accessToken:r,proxy:l,refreshSessionAndUser:d,privy:i,recoverEmbeddedWallet:s,setUser:y})},p=async({emitPrivyEvent:r,setModalData:t,openModal:n,chainType:i})=>new Promise(((o,l)=>{t({createWallet:{onSuccess:({user:e,account:t})=>{r("createWallet","onSuccess",{wallet:t}),o({user:e,account:t})},onFailure:t=>{r("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),l(t)},callAuthOnSuccessOnClose:!1,shouldCreateEth:"ethereum"===i,shouldCreateSol:"solana"===i}}),n(a.EmbeddedWalletOnAccountCreateScreen)}));const E=()=>{let r=a.useAppConfig(),t=a.useEmitPrivyEvent(),{setModalData:n}=a.usePrivyModal(),{initializeWalletProxy:o,recoverEmbeddedWallet:l,setUser:d,openModal:s,refreshSessionAndUser:u,privy:p,client:E}=i.usePrivyInternal();return{create:async({chainType:i,options:f,latestUser:h})=>{let y=h;if(y||(y=await u()),!y)throw t("createWallet","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return await c({appConfig:r,privy:p,getAccessToken:()=>E.getAccessToken(),refreshSessionAndUser:u,initializeWalletProxy:o,user:y,emitPrivyEvent:t,recoverEmbeddedWallet:l,setModalData:n,openModal:s,setUser:d,options:f,timeoutDuration:a.WALLET_PROXY_TIMEOUT,chainType:i})}}};function f(e){let{create:r}=E();return a.usePrivyEventSubscription("createWallet",e),{createWallet:async e=>{e&&"target"in e&&e&&(e=void 0);let{account:t}=await r({chainType:"ethereum",options:e});return t}}}const h=async({emitPrivyEvent:r,getAccessToken:t,initializeWalletProxy:a,refreshSessionAndUser:i,user:o,appConfig:l},{privateKey:d,chainType:s,additionalSigners:c})=>{if(!o)throw r("linkAccount","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new e.PrivyClientError("User must be authenticated before linking an account.");let u="user-controlled-server-wallets-only"===l.embeddedWallets.mode?"tee":"on-device";if(c&&"on-device"===u)throw new e.PrivyClientError("Specifying additionalSigners is only supported for TEE execution and this app uses On-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let[p,E]=await Promise.all([t(),a(15e3)]);if(!E||!p)throw r("linkAccount","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new e.PrivyClientError("User must be authenticated before linking an account.");let{address:f}=await E.importWallet({privateKey:d,accessToken:p,chainType:s,mode:u,additionalSigners:c}),h=await i(),y="solana"===s?n.getImportedPrivySolanaWallets(h):n.getImportedPrivyEthereumWallets(h),m=y?.find((e=>e.address===f));if(!m)throw r("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return r("createWallet","onSuccess",{wallet:m}),m},y=()=>{let{user:e}=n.usePrivyContext(),{client:r,refreshSessionAndUser:o,initializeWalletProxy:l}=i.usePrivyInternal(),d=a.useEmitPrivyEvent(),s=a.useAppConfig();return{importWallet:t.useCallback((({privateKey:t,additionalSigners:n})=>h({getAccessToken:()=>r.getAccessToken(),user:e,initializeWalletProxy:l,refreshSessionAndUser:o,emitPrivyEvent:d,appConfig:s},{privateKey:t,chainType:"ethereum",additionalSigners:n})),[e,r,o,l,d,s])}};exports.extractChainIdFromCAIP2=o,exports.filterSupportedOptions=l,exports.importWallet=h,exports.isFirstClassChainWallet=function(e){return["ethereum","solana"].includes(e.chainType)},exports.prepareFundingModalData=({address:r,appConfig:t,fundWalletConfig:n,methodScreen:a,chainIdOverride:i,comingFromSendTransactionScreen:s=!1})=>{let c,u;if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let p=l(t.fundingConfig.options);if(p.length<1)throw Error("Wallet funding is not enabled");c=i||(n?.chain?n.chain.id:o(t.fundingConfig.defaultRecommendedCurrency.chain));let E=t.chains.find((e=>e.id===c));if(!E)throw new e.PrivyClientError(`Funding chain ${c} is not in PrivyProvider chains list`);let f=n?.amount??t.fundingConfig.defaultRecommendedAmount,h=!1;function y(){if(!c)return;let e=d[c];p.find((e=>"wallets"===e.method))&&!e&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),u=e,h=!0}n&&"asset"in n?"USDC"===n.asset?y():"string"!=typeof n.asset&&"erc20"in n.asset&&(h=((e,r)=>e===d[r.id])(u=n.asset.erc20,E)):"USDC"===t.fundingConfig.defaultRecommendedCurrency.asset&&y();let m=n?.defaultFundingMethod;return{chainType:"ethereum",address:r,amount:f,chain:E,erc20Address:u,erc20ContractInfo:h?{symbol:"USDC",decimals:6}:void 0,isUSDC:h,methodScreen:a,supportedOptions:p,comingFromSendTransactionScreen:s,defaultFundingMethod:m,usingDefaultFundingMethod:!!m,preferredCardProvider:n?.card?.preferredProvider,crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,solanaChain:"solana:mainnet",uiConfig:n&&"uiConfig"in n?n.uiConfig:void 0,externalSolanaFundingScreen:null}},exports.prepareSolanaFundingModalData=function({address:e,fundWalletConfig:r,appConfig:t,comingFromSendTransactionScreen:n,externalSolanaFundingScreen:a,methodScreen:i}){if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let o=l(t.fundingConfig.options);if(o.length<1)throw Error("Wallet funding is not enabled");if("USDC"===r?.asset&&"solana:testnet"===r?.chain)throw Error("USDC funding is not supported on the Solana testnet");let d=r?.amount??t.fundingConfig.defaultRecommendedAmount,s=r?.defaultFundingMethod;return{chainType:"solana",address:e,supportedOptions:o,amount:d,isUSDC:"USDC"===r?.asset,methodScreen:i,comingFromSendTransactionScreen:n,chain:r?.chain||"solana:mainnet",crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:s,preferredCardProvider:r?.card?.preferredProvider,usingDefaultFundingMethod:!!s,uiConfig:r?.uiConfig,externalSolanaFundingScreen:a}},exports.useCreateWallet=f,exports.useCreateWalletInternal=E,exports.useImportWallet=y,exports.usePrivy=()=>{let{importWallet:e}=y(),{createWallet:r}=f();return{...t.useContext(n.PrivyContext),importWallet:e,createWallet:r}};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExtendedChainType, WalletResponseType, CurveSigningChainType } from '@privy-io/public-api';
|
|
2
|
-
import { U as User } from './types-
|
|
2
|
+
import { U as User } from './types-tFJ_e9u8.js';
|
|
3
3
|
import '@coinbase/wallet-sdk';
|
|
4
4
|
import '@solana/kit';
|
|
5
5
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExtendedChainType, WalletResponseType, CurveSigningChainType } from '@privy-io/public-api';
|
|
2
|
-
import { U as User } from './types-
|
|
2
|
+
import { U as User } from './types-tFJ_e9u8.js';
|
|
3
3
|
import '@coinbase/wallet-sdk';
|
|
4
4
|
import '@solana/kit';
|
|
5
5
|
import 'react';
|
package/dist/dts/farcaster.d.mts
CHANGED
package/dist/dts/farcaster.d.ts
CHANGED
package/dist/dts/index.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { MouseEvent } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export { au as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, ay as CrossAppAccount, aK as CrossAppAccountWithMetadata, ar as Discord, aC as DiscordOAuthWithMetadata, aM as Email, am as EmailWithMetadata, aS as Farcaster, aI as FarcasterWithMetadata, as as Github, aD as GithubOAuthWithMetadata, ap as Google, aA as GoogleOAuthWithMetadata, aw as Line, aF as LineOAuthWithMetadata, az as LinkedAccountType, at as LinkedIn, aG as LinkedInOAuthWithMetadata, aU as LoginMethodOrderOption, ae as MessageTypes, ag as MoonpayCurrencyCode, ah as MoonpayPaymentMethod, aQ as NativeFundingConfig, al as NonEmptyArray, aT as Passkey, aL as PasskeyWithMetadata, aN as Phone, an as PhoneWithMetadata, aR as PriceDisplayOptions, ai as Quantity, aV as SiwsFlowState, af as SmartWallet, ax as Telegram, aJ as TelegramWithMetadata, av as Tiktok, aE as TiktokOAuthWithMetadata, aj as TransactionLog, ak as TransactionReceipt, aO as TransactionUIOptions, aq as Twitter, aB as TwitterOAuthWithMetadata, ad as TypedMessage, ao as WalletWithMetadata } from './types-
|
|
3
|
+
import { M as MfaSubmitArgs, g as UserRecoveryMethod, c as SessionSignerInput, E as EthereumRpcRequestType, h as SolanaRpcRequestType, i as EthereumRpcResponseType, j as SolanaRpcResponseType, P as PrivyFarcasterSignerInitResponse, k as EIP1193Provider, l as EntropyIdVerifier$1, H as HDWalletWithMetadata, m as RequestArguments, n as WalletConnector, B as BaseConnectedEthereumWallet, o as PrivyProxyProvider, p as WalletClientType, q as ConnectedWalletMetadata, r as PrivyClientConfig, s as ConnectorType, u as SetBaseAccountSdkType, v as WalletListEntry, A as AppConfig, w as BaseConnectedWallet, f as SolanaWalletConnector, U as User, x as ConnectWalletModalOptions, y as LoginModalOptions, C as CreateWalletOptions, W as Wallet, z as SetWalletRecoveryOptions, b as SignMessageModalUIOptions, D as SignTypedDataParams, F as MfaMethod, G as UnsignedTransactionRequest, a as SendTransactionModalUIOptions, I as FundWalletConfig, J as ConnectedWallet, O as OAuthTokens, K as CrossAppProviderDetails, N as MoonpaySignRequest, Q as MoonpaySignResponse, T as SmartWalletConfig, V as SiwsMessageType, X as LoginMethod, Y as ExternalWalletMetadata, Z as TelegramAuthResult, _ as TelegramWebAppData, $ as OAuthUserInfo, a0 as LinkedAccountWithMetadata, a1 as PrivyErrorCode, a2 as BaseConnectedSolanaWallet, a3 as FundingMethod, S as SolanaChain, a4 as OAuthFlowState, a5 as LoginWithCode, a6 as OtpFlowState, a7 as PasskeyFlowState, a8 as SiweFlowState, a9 as BaseAccountSdkType, aa as UnsignedTransactionRequestWithChainId, ab as BaseConnectedWalletType, ac as TelegramAuthFlowState } from './types-tFJ_e9u8.js';
|
|
4
|
+
export { au as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, ay as CrossAppAccount, aK as CrossAppAccountWithMetadata, ar as Discord, aC as DiscordOAuthWithMetadata, aM as Email, am as EmailWithMetadata, aS as Farcaster, aI as FarcasterWithMetadata, as as Github, aD as GithubOAuthWithMetadata, ap as Google, aA as GoogleOAuthWithMetadata, aw as Line, aF as LineOAuthWithMetadata, az as LinkedAccountType, at as LinkedIn, aG as LinkedInOAuthWithMetadata, aU as LoginMethodOrderOption, ae as MessageTypes, ag as MoonpayCurrencyCode, ah as MoonpayPaymentMethod, aQ as NativeFundingConfig, al as NonEmptyArray, aT as Passkey, aL as PasskeyWithMetadata, aN as Phone, an as PhoneWithMetadata, aR as PriceDisplayOptions, ai as Quantity, aV as SiwsFlowState, af as SmartWallet, ax as Telegram, aJ as TelegramWithMetadata, av as Tiktok, aE as TiktokOAuthWithMetadata, aj as TransactionLog, ak as TransactionReceipt, aO as TransactionUIOptions, aq as Twitter, aB as TwitterOAuthWithMetadata, ad as TypedMessage, ao as WalletWithMetadata } from './types-tFJ_e9u8.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { TurnstileProps } from '@marsidev/react-turnstile';
|
|
7
7
|
import EventEmitter from 'eventemitter3';
|
|
8
8
|
import { Store, EIP6963ProviderDetail } from 'mipd';
|
|
9
9
|
import Privy, { Chain, RpcConfig, GenerateAuthorizationSignatureInput, GenerateAuthorizationSignatureOutput } from '@privy-io/js-sdk-core';
|
|
10
10
|
export { DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, addPrivyRpcToChain, addRpcUrlOverrideToChain } from '@privy-io/js-sdk-core';
|
|
11
|
-
import { PasskeyAuthenticateInputType,
|
|
11
|
+
import { PasskeyAuthenticateInputType, SmartWalletType, CustomOAuthProvider, CustomMetadataType, OAuthProviderType, PrivyCoinbaseOnRampInitInput, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampStatusResponse, PrivyTransactionScanningInputType, PrivyTransactionScanningResponseType } from '@privy-io/public-api';
|
|
12
12
|
export { OAuthProviderType } from '@privy-io/public-api';
|
|
13
13
|
import * as viem from 'viem';
|
|
14
14
|
import { Address, HttpTransport, Hex } from 'viem';
|
|
@@ -3879,7 +3879,9 @@ type UseAuthMfaEnrollment = {
|
|
|
3879
3879
|
* @param o options for the verification flow
|
|
3880
3880
|
* @returns a promise that resolves to an object with the updated user
|
|
3881
3881
|
*/
|
|
3882
|
-
enroll: (o?:
|
|
3882
|
+
enroll: (o?: {
|
|
3883
|
+
onBack?: () => void;
|
|
3884
|
+
}) => Promise<{
|
|
3883
3885
|
user: User;
|
|
3884
3886
|
}>;
|
|
3885
3887
|
};
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { MouseEvent } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export { au as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, ay as CrossAppAccount, aK as CrossAppAccountWithMetadata, ar as Discord, aC as DiscordOAuthWithMetadata, aM as Email, am as EmailWithMetadata, aS as Farcaster, aI as FarcasterWithMetadata, as as Github, aD as GithubOAuthWithMetadata, ap as Google, aA as GoogleOAuthWithMetadata, aw as Line, aF as LineOAuthWithMetadata, az as LinkedAccountType, at as LinkedIn, aG as LinkedInOAuthWithMetadata, aU as LoginMethodOrderOption, ae as MessageTypes, ag as MoonpayCurrencyCode, ah as MoonpayPaymentMethod, aQ as NativeFundingConfig, al as NonEmptyArray, aT as Passkey, aL as PasskeyWithMetadata, aN as Phone, an as PhoneWithMetadata, aR as PriceDisplayOptions, ai as Quantity, aV as SiwsFlowState, af as SmartWallet, ax as Telegram, aJ as TelegramWithMetadata, av as Tiktok, aE as TiktokOAuthWithMetadata, aj as TransactionLog, ak as TransactionReceipt, aO as TransactionUIOptions, aq as Twitter, aB as TwitterOAuthWithMetadata, ad as TypedMessage, ao as WalletWithMetadata } from './types-
|
|
3
|
+
import { M as MfaSubmitArgs, g as UserRecoveryMethod, c as SessionSignerInput, E as EthereumRpcRequestType, h as SolanaRpcRequestType, i as EthereumRpcResponseType, j as SolanaRpcResponseType, P as PrivyFarcasterSignerInitResponse, k as EIP1193Provider, l as EntropyIdVerifier$1, H as HDWalletWithMetadata, m as RequestArguments, n as WalletConnector, B as BaseConnectedEthereumWallet, o as PrivyProxyProvider, p as WalletClientType, q as ConnectedWalletMetadata, r as PrivyClientConfig, s as ConnectorType, u as SetBaseAccountSdkType, v as WalletListEntry, A as AppConfig, w as BaseConnectedWallet, f as SolanaWalletConnector, U as User, x as ConnectWalletModalOptions, y as LoginModalOptions, C as CreateWalletOptions, W as Wallet, z as SetWalletRecoveryOptions, b as SignMessageModalUIOptions, D as SignTypedDataParams, F as MfaMethod, G as UnsignedTransactionRequest, a as SendTransactionModalUIOptions, I as FundWalletConfig, J as ConnectedWallet, O as OAuthTokens, K as CrossAppProviderDetails, N as MoonpaySignRequest, Q as MoonpaySignResponse, T as SmartWalletConfig, V as SiwsMessageType, X as LoginMethod, Y as ExternalWalletMetadata, Z as TelegramAuthResult, _ as TelegramWebAppData, $ as OAuthUserInfo, a0 as LinkedAccountWithMetadata, a1 as PrivyErrorCode, a2 as BaseConnectedSolanaWallet, a3 as FundingMethod, S as SolanaChain, a4 as OAuthFlowState, a5 as LoginWithCode, a6 as OtpFlowState, a7 as PasskeyFlowState, a8 as SiweFlowState, a9 as BaseAccountSdkType, aa as UnsignedTransactionRequestWithChainId, ab as BaseConnectedWalletType, ac as TelegramAuthFlowState } from './types-tFJ_e9u8.js';
|
|
4
|
+
export { au as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, ay as CrossAppAccount, aK as CrossAppAccountWithMetadata, ar as Discord, aC as DiscordOAuthWithMetadata, aM as Email, am as EmailWithMetadata, aS as Farcaster, aI as FarcasterWithMetadata, as as Github, aD as GithubOAuthWithMetadata, ap as Google, aA as GoogleOAuthWithMetadata, aw as Line, aF as LineOAuthWithMetadata, az as LinkedAccountType, at as LinkedIn, aG as LinkedInOAuthWithMetadata, aU as LoginMethodOrderOption, ae as MessageTypes, ag as MoonpayCurrencyCode, ah as MoonpayPaymentMethod, aQ as NativeFundingConfig, al as NonEmptyArray, aT as Passkey, aL as PasskeyWithMetadata, aN as Phone, an as PhoneWithMetadata, aR as PriceDisplayOptions, ai as Quantity, aV as SiwsFlowState, af as SmartWallet, ax as Telegram, aJ as TelegramWithMetadata, av as Tiktok, aE as TiktokOAuthWithMetadata, aj as TransactionLog, ak as TransactionReceipt, aO as TransactionUIOptions, aq as Twitter, aB as TwitterOAuthWithMetadata, ad as TypedMessage, ao as WalletWithMetadata } from './types-tFJ_e9u8.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { TurnstileProps } from '@marsidev/react-turnstile';
|
|
7
7
|
import EventEmitter from 'eventemitter3';
|
|
8
8
|
import { Store, EIP6963ProviderDetail } from 'mipd';
|
|
9
9
|
import Privy, { Chain, RpcConfig, GenerateAuthorizationSignatureInput, GenerateAuthorizationSignatureOutput } from '@privy-io/js-sdk-core';
|
|
10
10
|
export { DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, addPrivyRpcToChain, addRpcUrlOverrideToChain } from '@privy-io/js-sdk-core';
|
|
11
|
-
import { PasskeyAuthenticateInputType,
|
|
11
|
+
import { PasskeyAuthenticateInputType, SmartWalletType, CustomOAuthProvider, CustomMetadataType, OAuthProviderType, PrivyCoinbaseOnRampInitInput, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampStatusResponse, PrivyTransactionScanningInputType, PrivyTransactionScanningResponseType } from '@privy-io/public-api';
|
|
12
12
|
export { OAuthProviderType } from '@privy-io/public-api';
|
|
13
13
|
import * as viem from 'viem';
|
|
14
14
|
import { Address, HttpTransport, Hex } from 'viem';
|
|
@@ -3879,7 +3879,9 @@ type UseAuthMfaEnrollment = {
|
|
|
3879
3879
|
* @param o options for the verification flow
|
|
3880
3880
|
* @returns a promise that resolves to an object with the updated user
|
|
3881
3881
|
*/
|
|
3882
|
-
enroll: (o?:
|
|
3882
|
+
enroll: (o?: {
|
|
3883
|
+
onBack?: () => void;
|
|
3884
|
+
}) => Promise<{
|
|
3883
3885
|
user: User;
|
|
3884
3886
|
}>;
|
|
3885
3887
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import react__default from 'react';
|
|
3
|
-
import { a as SendTransactionModalUIOptions, b as SignMessageModalUIOptions } from './types-
|
|
3
|
+
import { a as SendTransactionModalUIOptions, b as SignMessageModalUIOptions } from './types-tFJ_e9u8.js';
|
|
4
4
|
import { SmartAccountClient } from 'permissionless';
|
|
5
|
-
import {
|
|
5
|
+
import { EIP1193Provider, Chain, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema, SendTransactionParameters, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters } from 'viem';
|
|
6
6
|
import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
|
|
7
7
|
import { SmartWalletType } from '@privy-io/js-sdk-core';
|
|
8
8
|
import '@coinbase/wallet-sdk';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import react__default from 'react';
|
|
3
|
-
import { a as SendTransactionModalUIOptions, b as SignMessageModalUIOptions } from './types-
|
|
3
|
+
import { a as SendTransactionModalUIOptions, b as SignMessageModalUIOptions } from './types-tFJ_e9u8.js';
|
|
4
4
|
import { SmartAccountClient } from 'permissionless';
|
|
5
|
-
import {
|
|
5
|
+
import { EIP1193Provider, Chain, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema, SendTransactionParameters, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters } from 'viem';
|
|
6
6
|
import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
|
|
7
7
|
import { SmartWalletType } from '@privy-io/js-sdk-core';
|
|
8
8
|
import '@coinbase/wallet-sdk';
|
package/dist/dts/solana.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as SessionSignerInput, W as Wallet, b as SignMessageModalUIOptions, S as SolanaChain, d as SolanaStandardWallet, C as CreateWalletOptions, a as SendTransactionModalUIOptions, e as SolanaFundingConfig } from './types-
|
|
2
|
-
export { f as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
1
|
+
import { c as SessionSignerInput, W as Wallet, b as SignMessageModalUIOptions, S as SolanaChain, d as SolanaStandardWallet, C as CreateWalletOptions, a as SendTransactionModalUIOptions, e as SolanaFundingConfig } from './types-tFJ_e9u8.js';
|
|
2
|
+
export { f as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-tFJ_e9u8.js';
|
|
3
3
|
import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
|
|
4
4
|
import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
|
|
5
5
|
import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
|
|
@@ -39,9 +39,6 @@ declare const useImportWallet: () => UseImportWalletInterface;
|
|
|
39
39
|
|
|
40
40
|
declare const useSolanaFundingPlugin: () => void;
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated This plugin is no longer used, as Phantom now supports Solana Ledger signatures out of the box
|
|
44
|
-
*/
|
|
45
42
|
declare const useSolanaLedgerPlugin: () => void;
|
|
46
43
|
|
|
47
44
|
/**
|
|
@@ -81,6 +78,7 @@ interface StandardWalletImplementation {
|
|
|
81
78
|
transaction: Uint8Array;
|
|
82
79
|
address: string;
|
|
83
80
|
chain: SolanaChain;
|
|
81
|
+
sponsor?: boolean;
|
|
84
82
|
options?: SolanaSignAndSendTransactionOptions;
|
|
85
83
|
}): Promise<{
|
|
86
84
|
signature: Uint8Array;
|
|
@@ -271,6 +269,7 @@ type SignAndSendTransactionInput = {
|
|
|
271
269
|
chain?: SolanaChain;
|
|
272
270
|
options?: SolanaSignAndSendTransactionOptions & {
|
|
273
271
|
uiOptions?: SendTransactionModalUIOptions;
|
|
272
|
+
sponsor?: boolean;
|
|
274
273
|
};
|
|
275
274
|
};
|
|
276
275
|
type SignAndSendTransactionOutput = {
|
package/dist/dts/solana.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as SessionSignerInput, W as Wallet, b as SignMessageModalUIOptions, S as SolanaChain, d as SolanaStandardWallet, C as CreateWalletOptions, a as SendTransactionModalUIOptions, e as SolanaFundingConfig } from './types-
|
|
2
|
-
export { f as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
1
|
+
import { c as SessionSignerInput, W as Wallet, b as SignMessageModalUIOptions, S as SolanaChain, d as SolanaStandardWallet, C as CreateWalletOptions, a as SendTransactionModalUIOptions, e as SolanaFundingConfig } from './types-tFJ_e9u8.js';
|
|
2
|
+
export { f as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-tFJ_e9u8.js';
|
|
3
3
|
import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
|
|
4
4
|
import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
|
|
5
5
|
import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
|
|
@@ -39,9 +39,6 @@ declare const useImportWallet: () => UseImportWalletInterface;
|
|
|
39
39
|
|
|
40
40
|
declare const useSolanaFundingPlugin: () => void;
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated This plugin is no longer used, as Phantom now supports Solana Ledger signatures out of the box
|
|
44
|
-
*/
|
|
45
42
|
declare const useSolanaLedgerPlugin: () => void;
|
|
46
43
|
|
|
47
44
|
/**
|
|
@@ -81,6 +78,7 @@ interface StandardWalletImplementation {
|
|
|
81
78
|
transaction: Uint8Array;
|
|
82
79
|
address: string;
|
|
83
80
|
chain: SolanaChain;
|
|
81
|
+
sponsor?: boolean;
|
|
84
82
|
options?: SolanaSignAndSendTransactionOptions;
|
|
85
83
|
}): Promise<{
|
|
86
84
|
signature: Uint8Array;
|
|
@@ -271,6 +269,7 @@ type SignAndSendTransactionInput = {
|
|
|
271
269
|
chain?: SolanaChain;
|
|
272
270
|
options?: SolanaSignAndSendTransactionOptions & {
|
|
273
271
|
uiOptions?: SendTransactionModalUIOptions;
|
|
272
|
+
sponsor?: boolean;
|
|
274
273
|
};
|
|
275
274
|
};
|
|
276
275
|
type SignAndSendTransactionOutput = {
|
|
@@ -2,8 +2,8 @@ import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk';
|
|
|
2
2
|
import { Rpc, SolanaRpcApi, RpcSubscriptions, SolanaRpcSubscriptionsApi } from '@solana/kit';
|
|
3
3
|
import { ReactElement, ReactNode } from 'react';
|
|
4
4
|
import { Hex } from 'viem';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { CountryCode, Chain, ConnectedStandardSolanaWallet, RpcConfig, ChainLikeWithId } from '@privy-io/js-sdk-core';
|
|
6
|
+
import { OAuthProviderType, PrivyAppResponse, PasskeyAuthenticateInputType, CustomOAuthProvider, ChainType, SmartWalletType, CustomMetadataType } from '@privy-io/public-api';
|
|
7
7
|
import { createBaseAccountSDK } from '@base-org/account';
|
|
8
8
|
import { WalletWithFeatures, Wallet as Wallet$1 } from '@wallet-standard/base';
|
|
9
9
|
import { SolanaSignMessageFeature, SolanaSignTransactionFeature, SolanaSignAndSendTransactionFeature, SolanaSignInFeature } from '@solana/wallet-standard-features';
|
|
@@ -405,7 +405,7 @@ type LoginWithCode = {
|
|
|
405
405
|
};
|
|
406
406
|
declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"];
|
|
407
407
|
type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number];
|
|
408
|
-
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "haha_wallet", "crypto.com_wallet_extension", "crypto.com_onchain", "binance", "
|
|
408
|
+
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "haha_wallet", "crypto.com_wallet_extension", "crypto.com_onchain", "binance", "bitget_wallet"];
|
|
409
409
|
type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number];
|
|
410
410
|
declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet", "base_account"];
|
|
411
411
|
type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
@@ -1081,7 +1081,7 @@ type PriceDisplayOptions = {
|
|
|
1081
1081
|
};
|
|
1082
1082
|
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'base_account' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1083
1083
|
/** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
|
|
1084
|
-
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'wallet_connect_qr' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack' | 'binance' | 'binanceus' | '
|
|
1084
|
+
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'wallet_connect_qr' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack' | 'binance' | 'binanceus' | 'bitget_wallet';
|
|
1085
1085
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
1086
1086
|
type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderType | `privy:${string}` | 'farcaster' | 'telegram';
|
|
1087
1087
|
type ExternalWalletsConfig = {
|
|
@@ -2305,4 +2305,4 @@ type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransac
|
|
|
2305
2305
|
type SolanaRpcRequestType = solana_signMessage;
|
|
2306
2306
|
type SolanaRpcResponseType = solana_signMessageResponse;
|
|
2307
2307
|
|
|
2308
|
-
export { type OAuthUserInfo as $, type AppConfig as A, type BaseConnectedEthereumWallet as B, type CreateWalletOptions as C, type SignTypedDataParams as D, type EthereumRpcRequestType as E, type MfaMethod as F, type UnsignedTransactionRequest as G, type HDWalletWithMetadata as H, type FundWalletConfig as I, type ConnectedWallet as J, type CrossAppProviderDetails as K, type LoginToMiniApp as L, type MfaSubmitArgs as M, type MoonpaySignRequest as N, type OAuthTokens as O, type PrivyFarcasterSignerInitResponse as P, type MoonpaySignResponse as Q, type RuntimeLoginOverridableOptions as R, type SolanaChain as S, type SmartWalletConfig as T, type User as U, type SiwsMessageType as V, type Wallet as W, type LoginMethod as X, type ExternalWalletMetadata as Y, type TelegramAuthResult as Z, type TelegramWebAppData as _, type SendTransactionModalUIOptions as a,
|
|
2308
|
+
export { type OAuthUserInfo as $, type AppConfig as A, type BaseConnectedEthereumWallet as B, type CreateWalletOptions as C, type SignTypedDataParams as D, type EthereumRpcRequestType as E, type MfaMethod as F, type UnsignedTransactionRequest as G, type HDWalletWithMetadata as H, type FundWalletConfig as I, type ConnectedWallet as J, type CrossAppProviderDetails as K, type LoginToMiniApp as L, type MfaSubmitArgs as M, type MoonpaySignRequest as N, type OAuthTokens as O, type PrivyFarcasterSignerInitResponse as P, type MoonpaySignResponse as Q, type RuntimeLoginOverridableOptions as R, type SolanaChain as S, type SmartWalletConfig as T, type User as U, type SiwsMessageType as V, type Wallet as W, type LoginMethod as X, type ExternalWalletMetadata as Y, type TelegramAuthResult as Z, type TelegramWebAppData as _, type SendTransactionModalUIOptions as a, type LinkedAccountWithMetadata as a0, PrivyErrorCode as a1, type BaseConnectedSolanaWallet as a2, type FundingMethod as a3, type OAuthFlowState as a4, type LoginWithCode as a5, type OtpFlowState as a6, type PasskeyFlowState as a7, type SiweFlowState as a8, type BaseAccountSdkType as a9, type GoogleOAuthWithMetadata as aA, type TwitterOAuthWithMetadata as aB, type DiscordOAuthWithMetadata as aC, type GithubOAuthWithMetadata as aD, type TiktokOAuthWithMetadata as aE, type LineOAuthWithMetadata as aF, type LinkedInOAuthWithMetadata as aG, type AppleOAuthWithMetadata as aH, type FarcasterWithMetadata as aI, type TelegramWithMetadata as aJ, type CrossAppAccountWithMetadata as aK, type PasskeyWithMetadata as aL, type Email as aM, type Phone as aN, type TransactionUIOptions as aO, type ContractUIOptions as aP, type NativeFundingConfig as aQ, type PriceDisplayOptions as aR, type Farcaster as aS, type Passkey as aT, type LoginMethodOrderOption as aU, type SiwsFlowState as aV, type UnsignedTransactionRequestWithChainId as aa, type BaseConnectedWalletType as ab, type TelegramAuthFlowState as ac, type TypedMessage as ad, type MessageTypes as ae, type SmartWallet as af, type MoonpayCurrencyCode as ag, type MoonpayPaymentMethod as ah, type Quantity as ai, type TransactionLog as aj, type TransactionReceipt as ak, type NonEmptyArray as al, type EmailWithMetadata as am, type PhoneWithMetadata as an, type WalletWithMetadata as ao, type Google as ap, type Twitter as aq, type Discord as ar, type Github as as, type LinkedIn as at, type Apple as au, type Tiktok as av, type Line as aw, type Telegram as ax, type CrossAppAccount as ay, type LinkedAccountType as az, type SignMessageModalUIOptions as b, type SessionSignerInput as c, type SolanaStandardWallet as d, type SolanaFundingConfig as e, SolanaWalletConnector as f, type UserRecoveryMethod as g, type SolanaRpcRequestType as h, type EthereumRpcResponseType as i, type SolanaRpcResponseType as j, type EIP1193Provider as k, type EntropyIdVerifier as l, type RequestArguments as m, WalletConnector as n, PrivyProxyProvider as o, type WalletClientType as p, type ConnectedWalletMetadata as q, type PrivyClientConfig as r, type ConnectorType as s, toSolanaWalletConnectors as t, type SetBaseAccountSdkType as u, type WalletListEntry as v, type BaseConnectedWallet as w, type ConnectWalletModalOptions as x, type LoginModalOptions as y, type SetWalletRecoveryOptions as z };
|
|
@@ -2,8 +2,8 @@ import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk';
|
|
|
2
2
|
import { Rpc, SolanaRpcApi, RpcSubscriptions, SolanaRpcSubscriptionsApi } from '@solana/kit';
|
|
3
3
|
import { ReactElement, ReactNode } from 'react';
|
|
4
4
|
import { Hex } from 'viem';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { CountryCode, Chain, ConnectedStandardSolanaWallet, RpcConfig, ChainLikeWithId } from '@privy-io/js-sdk-core';
|
|
6
|
+
import { OAuthProviderType, PrivyAppResponse, PasskeyAuthenticateInputType, CustomOAuthProvider, ChainType, SmartWalletType, CustomMetadataType } from '@privy-io/public-api';
|
|
7
7
|
import { createBaseAccountSDK } from '@base-org/account';
|
|
8
8
|
import { WalletWithFeatures, Wallet as Wallet$1 } from '@wallet-standard/base';
|
|
9
9
|
import { SolanaSignMessageFeature, SolanaSignTransactionFeature, SolanaSignAndSendTransactionFeature, SolanaSignInFeature } from '@solana/wallet-standard-features';
|
|
@@ -405,7 +405,7 @@ type LoginWithCode = {
|
|
|
405
405
|
};
|
|
406
406
|
declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"];
|
|
407
407
|
type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number];
|
|
408
|
-
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "haha_wallet", "crypto.com_wallet_extension", "crypto.com_onchain", "binance", "
|
|
408
|
+
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "haha_wallet", "crypto.com_wallet_extension", "crypto.com_onchain", "binance", "bitget_wallet"];
|
|
409
409
|
type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number];
|
|
410
410
|
declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet", "base_account"];
|
|
411
411
|
type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
@@ -1081,7 +1081,7 @@ type PriceDisplayOptions = {
|
|
|
1081
1081
|
};
|
|
1082
1082
|
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'base_account' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1083
1083
|
/** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
|
|
1084
|
-
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'wallet_connect_qr' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack' | 'binance' | 'binanceus' | '
|
|
1084
|
+
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'wallet_connect_qr' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack' | 'binance' | 'binanceus' | 'bitget_wallet';
|
|
1085
1085
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
1086
1086
|
type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderType | `privy:${string}` | 'farcaster' | 'telegram';
|
|
1087
1087
|
type ExternalWalletsConfig = {
|
|
@@ -2305,4 +2305,4 @@ type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransac
|
|
|
2305
2305
|
type SolanaRpcRequestType = solana_signMessage;
|
|
2306
2306
|
type SolanaRpcResponseType = solana_signMessageResponse;
|
|
2307
2307
|
|
|
2308
|
-
export { type OAuthUserInfo as $, type AppConfig as A, type BaseConnectedEthereumWallet as B, type CreateWalletOptions as C, type SignTypedDataParams as D, type EthereumRpcRequestType as E, type MfaMethod as F, type UnsignedTransactionRequest as G, type HDWalletWithMetadata as H, type FundWalletConfig as I, type ConnectedWallet as J, type CrossAppProviderDetails as K, type LoginToMiniApp as L, type MfaSubmitArgs as M, type MoonpaySignRequest as N, type OAuthTokens as O, type PrivyFarcasterSignerInitResponse as P, type MoonpaySignResponse as Q, type RuntimeLoginOverridableOptions as R, type SolanaChain as S, type SmartWalletConfig as T, type User as U, type SiwsMessageType as V, type Wallet as W, type LoginMethod as X, type ExternalWalletMetadata as Y, type TelegramAuthResult as Z, type TelegramWebAppData as _, type SendTransactionModalUIOptions as a,
|
|
2308
|
+
export { type OAuthUserInfo as $, type AppConfig as A, type BaseConnectedEthereumWallet as B, type CreateWalletOptions as C, type SignTypedDataParams as D, type EthereumRpcRequestType as E, type MfaMethod as F, type UnsignedTransactionRequest as G, type HDWalletWithMetadata as H, type FundWalletConfig as I, type ConnectedWallet as J, type CrossAppProviderDetails as K, type LoginToMiniApp as L, type MfaSubmitArgs as M, type MoonpaySignRequest as N, type OAuthTokens as O, type PrivyFarcasterSignerInitResponse as P, type MoonpaySignResponse as Q, type RuntimeLoginOverridableOptions as R, type SolanaChain as S, type SmartWalletConfig as T, type User as U, type SiwsMessageType as V, type Wallet as W, type LoginMethod as X, type ExternalWalletMetadata as Y, type TelegramAuthResult as Z, type TelegramWebAppData as _, type SendTransactionModalUIOptions as a, type LinkedAccountWithMetadata as a0, PrivyErrorCode as a1, type BaseConnectedSolanaWallet as a2, type FundingMethod as a3, type OAuthFlowState as a4, type LoginWithCode as a5, type OtpFlowState as a6, type PasskeyFlowState as a7, type SiweFlowState as a8, type BaseAccountSdkType as a9, type GoogleOAuthWithMetadata as aA, type TwitterOAuthWithMetadata as aB, type DiscordOAuthWithMetadata as aC, type GithubOAuthWithMetadata as aD, type TiktokOAuthWithMetadata as aE, type LineOAuthWithMetadata as aF, type LinkedInOAuthWithMetadata as aG, type AppleOAuthWithMetadata as aH, type FarcasterWithMetadata as aI, type TelegramWithMetadata as aJ, type CrossAppAccountWithMetadata as aK, type PasskeyWithMetadata as aL, type Email as aM, type Phone as aN, type TransactionUIOptions as aO, type ContractUIOptions as aP, type NativeFundingConfig as aQ, type PriceDisplayOptions as aR, type Farcaster as aS, type Passkey as aT, type LoginMethodOrderOption as aU, type SiwsFlowState as aV, type UnsignedTransactionRequestWithChainId as aa, type BaseConnectedWalletType as ab, type TelegramAuthFlowState as ac, type TypedMessage as ad, type MessageTypes as ae, type SmartWallet as af, type MoonpayCurrencyCode as ag, type MoonpayPaymentMethod as ah, type Quantity as ai, type TransactionLog as aj, type TransactionReceipt as ak, type NonEmptyArray as al, type EmailWithMetadata as am, type PhoneWithMetadata as an, type WalletWithMetadata as ao, type Google as ap, type Twitter as aq, type Discord as ar, type Github as as, type LinkedIn as at, type Apple as au, type Tiktok as av, type Line as aw, type Telegram as ax, type CrossAppAccount as ay, type LinkedAccountType as az, type SignMessageModalUIOptions as b, type SessionSignerInput as c, type SolanaStandardWallet as d, type SolanaFundingConfig as e, SolanaWalletConnector as f, type UserRecoveryMethod as g, type SolanaRpcRequestType as h, type EthereumRpcResponseType as i, type SolanaRpcResponseType as j, type EIP1193Provider as k, type EntropyIdVerifier as l, type RequestArguments as m, WalletConnector as n, PrivyProxyProvider as o, type WalletClientType as p, type ConnectedWalletMetadata as q, type PrivyClientConfig as r, type ConnectorType as s, toSolanaWalletConnectors as t, type SetBaseAccountSdkType as u, type WalletListEntry as v, type BaseConnectedWallet as w, type ConnectWalletModalOptions as x, type LoginModalOptions as y, type SetWalletRecoveryOptions as z };
|
package/dist/dts/ui.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions, S as SolanaChain } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions, S as SolanaChain } from './types-tFJ_e9u8.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Chain } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@coinbase/wallet-sdk';
|
package/dist/dts/ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions, S as SolanaChain } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions, S as SolanaChain } from './types-tFJ_e9u8.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Chain } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@coinbase/wallet-sdk';
|