@privy-io/react-auth 1.99.1 → 1.100.0-beta-20250110141708

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.
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/ChevronDownIcon"),n=require("react"),i=require("styled-components"),s=require("../ModalHeader.js"),o=require("../ui/layout/Row.js"),t=require("../ui/typography/LabelSm.js"),c=require("../ui/typography/Value.js"),a=require("./PriceDisplay.js"),l=require("./WalletLink.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../configuration/context.js"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../hooks/internal-context.js"),require("../../hooks/index.js"),require("../ui/animation/LoadingSkeleton.js"),require("@ethersproject/units"),require("../../lib/ethers.js"),require("@ethersproject/bignumber"),require("@privy-io/js-sdk-core"),require("../../utils/index.js"),require("@ethersproject/providers"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../errors.js"),require("ofetch"),require("../../lib/solana/transaction.js"),require("../../utils/buffer/readBigInt64LE.js");var d=/*#__PURE__*/u(r);function j({instruction:r,rpcEndpoint:n,solPrice:i,hideAmount:s}){return r?/*#__PURE__*/e.jsxs(o.Rows,{children:[!s&&!!r.amount&&/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(a.SolanaPriceDisplay,{quantities:[r.amount],tokenPrice:i,tokenSymbol:r.token?.symbol??"SOL",tokenDecimals:r.token?.decimals??9})})]}),r.to&&/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(l.WalletLink,{walletAddress:r.to,rpcEndpoint:n,network:"solana"})})]}),r.from&&/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"From"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(l.WalletLink,{walletAddress:r.from,rpcEndpoint:n,network:"solana"})})]})]}):null}let h=/*#__PURE__*/i.styled.div.withConfig({displayName:"InstructionsBox",componentId:"sc-3551ef3c-0"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),p=/*#__PURE__*/i.styled.header.withConfig({displayName:"InstructionsBoxHeader",componentId:"sc-3551ef3c-1"})(["display:flex;justify-content:space-between;align-items:center;padding:12px;background-color:var(--privy-color-background-2);"]),q=/*#__PURE__*/i.styled.h4.withConfig({displayName:"HeaderTitle",componentId:"sc-3551ef3c-2"})(["font-size:14px;font-weight:500;line-height:19.6px;"]),x=/*#__PURE__*/i.styled.div.withConfig({displayName:"InstructionsBoxContent",componentId:"sc-3551ef3c-3"})(["padding:12px;"]),m=/*#__PURE__*/i.styled.div.withConfig({displayName:"NavigationButtonsConatiner",componentId:"sc-3551ef3c-4"})(["display:flex;gap:8px;align-items:center;"]),f=/*#__PURE__*/i.styled(t.LabelSm).withConfig({displayName:"InteractiveLabel",componentId:"sc-3551ef3c-5"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;"]);exports.SolanaTransactionDetails=({instructions:r,fees:i,transactionInfo:l,solPrice:u,rpcEndpoint:y})=>{let g=r.reduce(((e,{amount:r,token:n})=>r&&"SOL"===n?.symbol?e+r:e),0n),[b,w]=n.useState(0),[k,S]=n.useState(!1),v=r[b];return n.useEffect((()=>{w(0)}),[r]),/*#__PURE__*/e.jsxs(o.Rows,{children:[/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(a.SolanaPriceDisplay,{quantities:[g,i],tokenPrice:u})})]}),l&&l.action&&/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(c.Value,{children:l.action})]}),/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Fees"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(a.SolanaPriceDisplay,{quantities:[i||0n],tokenPrice:u})})]}),r.length>1?/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(o.Row,{children:/*#__PURE__*/e.jsxs(f,{onClick:()=>S((e=>!e)),children:[/*#__PURE__*/e.jsx("span",{children:"Details"}),/*#__PURE__*/e.jsx(d.default,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:k?"rotate(180deg)":void 0}})]})}),k&&/*#__PURE__*/e.jsx(o.Row,{children:/*#__PURE__*/e.jsxs(h,{children:[/*#__PURE__*/e.jsxs(p,{children:[/*#__PURE__*/e.jsxs(q,{children:[b+1," of ",r.length," instructions"]}),/*#__PURE__*/e.jsxs(m,{children:[b>0&&/*#__PURE__*/e.jsx(s.BackButton,{backFn:()=>w((e=>e-1))}),b<r.length-1&&/*#__PURE__*/e.jsx(s.NextButton,{nextFn:()=>w((e=>e+1))})]})]}),/*#__PURE__*/e.jsx(x,{children:/*#__PURE__*/e.jsx(j,{instruction:v,rpcEndpoint:y,solPrice:u})})]})})]}):/*#__PURE__*/e.jsx(j,{instruction:v,rpcEndpoint:y,solPrice:u,hideAmount:!0})]})};
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/ChevronDownIcon"),n=require("react"),i=require("styled-components"),s=require("../ModalHeader.js"),o=require("../ui/layout/Row.js"),t=require("../ui/typography/LabelSm.js"),c=require("../ui/typography/Value.js"),a=require("./PriceDisplay.js"),l=require("./WalletLink.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../configuration/context.js"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../hooks/internal-context.js"),require("../../hooks/index.js"),require("../ui/animation/LoadingSkeleton.js"),require("@ethersproject/units"),require("../../lib/ethers.js"),require("@ethersproject/bignumber"),require("@privy-io/js-sdk-core"),require("../../utils/index.js"),require("@ethersproject/providers"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../errors.js"),require("ofetch"),require("../../lib/solana/transaction.js"),require("../../utils/buffer/readBigInt64LE.js");var d=/*#__PURE__*/u(r);function j({instruction:r,rpcEndpoint:n,solPrice:i,hideAmount:s}){return r?/*#__PURE__*/e.jsxs(o.Rows,{children:[!s&&!!r.amount&&/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(a.SolanaPriceDisplay,{quantities:[r.amount],tokenPrice:i,tokenSymbol:r.token?.symbol??"SOL",tokenDecimals:r.token?.decimals??9})})]}),r.to&&/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(l.WalletLink,{walletAddress:r.to,rpcEndpoint:n,network:"solana"})})]}),r.tokenAccount&&/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token account"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(l.WalletLink,{walletAddress:r.tokenAccount,rpcEndpoint:n,network:"solana"})})]}),r.tokenAccountOwner&&/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token account owner"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(l.WalletLink,{walletAddress:r.tokenAccountOwner,rpcEndpoint:n,network:"solana"})})]}),r.from&&/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"From"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(l.WalletLink,{walletAddress:r.from,rpcEndpoint:n,network:"solana"})})]})]}):null}let h=/*#__PURE__*/i.styled.div.withConfig({displayName:"InstructionsBox",componentId:"sc-702e760-0"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),p=/*#__PURE__*/i.styled.header.withConfig({displayName:"InstructionsBoxHeader",componentId:"sc-702e760-1"})(["display:flex;justify-content:space-between;align-items:center;padding:12px;background-color:var(--privy-color-background-2);"]),x=/*#__PURE__*/i.styled.h4.withConfig({displayName:"HeaderTitle",componentId:"sc-702e760-2"})(["font-size:14px;font-weight:500;line-height:19.6px;"]),q=/*#__PURE__*/i.styled.div.withConfig({displayName:"InstructionsBoxContent",componentId:"sc-702e760-3"})(["padding:12px;"]),m=/*#__PURE__*/i.styled.div.withConfig({displayName:"NavigationButtonsConatiner",componentId:"sc-702e760-4"})(["display:flex;gap:8px;align-items:center;"]),y=/*#__PURE__*/i.styled(t.LabelSm).withConfig({displayName:"InteractiveLabel",componentId:"sc-702e760-5"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;"]);exports.SolanaTransactionDetails=({instructions:r,fees:i,transactionInfo:l,solPrice:u,rpcEndpoint:g})=>{let f=r.reduce(((e,{amount:r,token:n})=>r&&"SOL"===n?.symbol?e+r:e),0n),[w,k]=n.useState(0),[b,S]=n.useState(!1),v=r[w];/*#__PURE__*/return e.jsxs(o.Rows,{children:[/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(a.SolanaPriceDisplay,{quantities:[f,i],tokenPrice:u})})]}),l&&l.action&&/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(c.Value,{children:l.action})]}),/*#__PURE__*/e.jsxs(o.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Fees"}),/*#__PURE__*/e.jsx(c.Value,{children:/*#__PURE__*/e.jsx(a.SolanaPriceDisplay,{quantities:[i||0n],tokenPrice:u})})]}),r.length>1?/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(o.Row,{children:/*#__PURE__*/e.jsxs(y,{onClick:()=>S((e=>!e)),children:[/*#__PURE__*/e.jsx("span",{children:"Details"}),/*#__PURE__*/e.jsx(d.default,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:b?"rotate(180deg)":void 0}})]})}),b&&/*#__PURE__*/e.jsx(o.Row,{children:/*#__PURE__*/e.jsxs(h,{children:[/*#__PURE__*/e.jsxs(p,{children:[/*#__PURE__*/e.jsxs(x,{children:[w+1," of ",r.length," instructions"]}),/*#__PURE__*/e.jsxs(m,{children:[w>0&&/*#__PURE__*/e.jsx(s.BackButton,{backFn:()=>k((e=>e-1))}),w<r.length-1&&/*#__PURE__*/e.jsx(s.NextButton,{nextFn:()=>k((e=>e+1))})]})]}),/*#__PURE__*/e.jsx(q,{children:/*#__PURE__*/e.jsx(j,{instruction:v,rpcEndpoint:g,solPrice:u})})]})})]}):/*#__PURE__*/e.jsx(j,{instruction:v,rpcEndpoint:g,solPrice:u,hideAmount:!0})]})};
@@ -1 +1 @@
1
- "use strict";exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.CUSTOMER_ACCESS_TOKEN_COOKIE_KEY="privy-token",exports.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY="privy:token",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.JWT_ALGORITHM="ES256",exports.JWT_ISSUER="privy.io",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.OPTIMISM_STACK_GAS_PRICE_ORACLE_ABI=["function getL1Fee(bytes memory _data) external view returns (uint256)"],exports.OPTIMISM_STACK_GAS_PRICE_ORACLE_ADDRESS="0x420000000000000000000000000000000000000F",exports.PRIVY_ACCESS_TOKEN_STORAGE_KEY="privy:pat",exports.PRIVY_ETHERSCAN_ID="AZD8ITQ3ZQS63BQIJN3SPP767ZZY89SZJX",exports.PRIVY_WALLETCONNECT_CLOUD_ID="34357d3c125c2bcf2ce2bc3309d98715",exports.PRIVY_WALLET_KEY_PREFIX="privy:wallet",exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.VERSION="1.99.1",exports.WALLET_CONNECT_INFURA_POLLING_INTERVAL=3e4,exports.WALLET_CONNECT_STORAGE_KEY="walletconnect",exports.WALLET_PROXY_TIMEOUT=3e4,exports.getGuestCredentialStorageKey=_=>`privy:guest:${_}`,exports.getPrivyWalletKey=_=>`privy:wallet:${_}`,exports.getProviderAccessTokenStorageKey=_=>`privy:cross-app:${_}`;
1
+ "use strict";exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.CUSTOMER_ACCESS_TOKEN_COOKIE_KEY="privy-token",exports.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY="privy:token",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.JWT_ALGORITHM="ES256",exports.JWT_ISSUER="privy.io",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.OPTIMISM_STACK_GAS_PRICE_ORACLE_ABI=["function getL1Fee(bytes memory _data) external view returns (uint256)"],exports.OPTIMISM_STACK_GAS_PRICE_ORACLE_ADDRESS="0x420000000000000000000000000000000000000F",exports.PRIVY_ACCESS_TOKEN_STORAGE_KEY="privy:pat",exports.PRIVY_ETHERSCAN_ID="AZD8ITQ3ZQS63BQIJN3SPP767ZZY89SZJX",exports.PRIVY_WALLETCONNECT_CLOUD_ID="34357d3c125c2bcf2ce2bc3309d98715",exports.PRIVY_WALLET_KEY_PREFIX="privy:wallet",exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.VERSION="1.100.0-beta-20250110141708",exports.WALLET_CONNECT_INFURA_POLLING_INTERVAL=3e4,exports.WALLET_CONNECT_STORAGE_KEY="walletconnect",exports.WALLET_PROXY_TIMEOUT=3e4,exports.getGuestCredentialStorageKey=_=>`privy:guest:${_}`,exports.getPrivyWalletKey=_=>`privy:wallet:${_}`,exports.getProviderAccessTokenStorageKey=_=>`privy:cross-app:${_}`;
@@ -1 +1 @@
1
- "use strict";var e=require("./index.js"),t=require("../../utils/buffer/readBigInt64LE.js");let n=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function r(e,t=6,n=!1,r=!1){let a=(parseFloat(e.toString())/1e9).toFixed(t).replace(/0+$/,"").replace(/\.$/,""),o=r?"":" SOL";return n?`${a}${o}`:`${"0"===a?"<0.001":a}${o}`}function a(e,t){let r=parseFloat(e.toString())/1e9,a=n.format(t*r);return"$0.00"===a?"<$0.01":a}function o(e){return"version"in e}async function s(e,t){return BigInt((o(e)?(await t.getFeeForMessage(e.message)).value:await e.getEstimatedFee(t))??0)}function i(e,n){try{return t.readBigInt64LEFromUint8Array(e,n)}catch{}try{return e.readBigInt64LE(n)}catch{}let r=Buffer.from(e);try{return t.readBigInt64LE(r)}catch{}try{return r.subarray(n).readBigInt64LE()}catch{}try{return r.readBigInt64LE(n)}catch{}return 0n}async function c(t,n,r,a,o){let[s,c,u]=t.accountKeyIndexes.map((e=>n.staticAccountKeys[e]));if(!s||!c||!u)throw Error("Invalid instruction");let l=await r.getParsedAccountInfo(c,"confirmed"),d=l.value?.data,f=d?.parsed?.info?.owner,m=d?.parsed?.info?.mint??"",p=o[m];if(!p){let t=await a.getSplTokenMetadata({mintAddress:m,cluster:e.getSolanaNetworkFromRpcEndpoint(r.rpcEndpoint)});t&&(p={address:m,symbol:t.symbol,decimals:t.decimals})}let y=p?.symbol??"",g=p?.decimals??d?.parsed?.info?.tokenAmount?.decimals??9,A=i(t.data,1);return{type:"spl-transfer",fromAta:s.toBase58(),fromAccount:u.toBase58(),toAta:c.toBase58(),toAccount:f,value:A,token:{symbol:y,decimals:g,address:m}}}async function u(e,t){let[n,r]=e.accountKeyIndexes.map((e=>t.staticAccountKeys[e]));if(!n||!r)throw Error("Invalid instruction");let a=i(e.data,4);return{type:"sol-transfer",fromAccount:n.toBase58(),toAccount:r.toBase58(),value:a,token:{symbol:"SOL",decimals:9}}}exports.LAMPORTS_PER_SOL=1e9,exports.SYSTEM_PROGRAM_ID="11111111111111111111111111111111",exports.TOKEN_2022_PROGRAM_ID="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",exports.TOKEN_PROGRAM_ID="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",exports.createSolanaTransactionReceipt=function(e,t){return{signature:e,parsedTransaction:t,fees:BigInt(t?.meta?.fee||0)}},exports.getDollarsFromLamport=a,exports.getNativeCurrencyFromLamports=r,exports.getSolanaFormattedAmounts=function({amount:e,fee:t,tokenPrice:n}){let o=BigInt(1e9*parseFloat(e)),s=o+t;return{fundingAmountInBaseUnit:o,fundingAmountInUsd:n?a(o,n):void 0,totalPriceInUsd:n?a(s,n):void 0,totalPriceInNativeCurrency:r(s),feePriceInNativeCurrency:r(t),feePriceInUsd:n?a(t,n):void 0}},exports.getTransactionFees=s,exports.getWalletPublicKeyFromTransaction=function(e,t){let n=(o(e)?e.message:e.compileMessage()).staticAccountKeys.find((e=>e.toBase58()===t));if(!n)throw Error(`Transaction does not contain public key ${t}`);return n},exports.hasSufficientFunds=async function(e,t){let{value:n}=await t.simulateTransaction(e);return null==n.err&&n.logs?.every((e=>!/insufficient funds/gi.test(e)))},exports.isVersionedTransaction=o,exports.parseSolanaTransaction=async function({tx:e,connection:t,client:n}){let r=o(e)?e.message:e.compileMessage(),a=r.staticAccountKeys[0]?.toBase58()??"",i=await s(e,t),l={},d=[];for(let e of r.compiledInstructions){let a=r.staticAccountKeys[e.programIdIndex]?.toBase58()||"";if("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"!==a&&"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"!==a)"11111111111111111111111111111111"!==a?d.push({type:"unknown",program:a}):d.push(await u(e,r));else{let a=await c(e,r,t,n,l);d.push(a),l[a.token.address]=a.token}}return{spender:a,fee:i,instructions:d}};
1
+ "use strict";var e=require("./index.js"),t=require("../../utils/buffer/readBigInt64LE.js");let n=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function r(e,t=6,n=!1,r=!1){let a=(parseFloat(e.toString())/1e9).toFixed(t).replace(/0+$/,"").replace(/\.$/,""),o=r?"":" SOL";return n?`${a}${o}`:`${"0"===a?"<0.001":a}${o}`}function a(e,t){let r=parseFloat(e.toString())/1e9,a=n.format(t*r);return"$0.00"===a?"<$0.01":a}function o(e){return"version"in e}async function s(e,t){return BigInt((o(e)?(await t.getFeeForMessage(e.message)).value:await e.getEstimatedFee(t))??0)}function i(e,n){try{return t.readBigInt64LEFromUint8Array(e,n)}catch{}try{return e.readBigInt64LE(n)}catch{}let r=Buffer.from(e);try{return t.readBigInt64LE(r)}catch{}try{return r.subarray(n).readBigInt64LE()}catch{}try{return r.readBigInt64LE(n)}catch{}return 0n}async function c(t,n,r,a,o,s){let c,u,[l,d,f]=t.accountKeyIndexes.map((e=>n.staticAccountKeys[e]));if(!l||!d||!f)throw Error("Invalid instruction");let m="",p=s[d.toBase58()];if(p)c=p.owner,m=p.mint;else{let e=await r.getParsedAccountInfo(d,"confirmed"),t=e.value?.data;c=t?.parsed?.info?.owner,m=t?.parsed?.info?.mint??"",u=t?.parsed?.info?.tokenAmount?.decimals}if(!m){let e=await r.getParsedAccountInfo(l,"confirmed"),t=e.value?.data;m=t?.parsed?.info?.mint??""}let y=o[m];if(m&&!y){let t=await a.getSplTokenMetadata({mintAddress:m,cluster:e.getSolanaNetworkFromRpcEndpoint(r.rpcEndpoint)});t&&(y={address:m,symbol:t.symbol,decimals:t.decimals})}let A=y?.symbol??"";u??=y?.decimals??9;let g=i(t.data,1);return{type:"spl-transfer",fromAta:l.toBase58(),fromAccount:f.toBase58(),toAta:d.toBase58(),toAccount:c,value:g,token:{symbol:A,decimals:u,address:m}}}async function u(e,t){let[n,r]=e.accountKeyIndexes.map((e=>t.staticAccountKeys[e]));if(!n||!r)throw Error("Invalid instruction");let a=i(e.data,4);return{type:"sol-transfer",fromAccount:n.toBase58(),toAccount:r.toBase58(),value:a,token:{symbol:"SOL",decimals:9}}}exports.ASSOCIATED_TOKEN_PROGRAM_ID="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",exports.LAMPORTS_PER_SOL=1e9,exports.SYSTEM_PROGRAM_ID="11111111111111111111111111111111",exports.TOKEN_2022_PROGRAM_ID="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",exports.TOKEN_PROGRAM_ID="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",exports.createSolanaTransactionReceipt=function(e,t){return{signature:e,parsedTransaction:t,fees:BigInt(t?.meta?.fee||0)}},exports.getDollarsFromLamport=a,exports.getNativeCurrencyFromLamports=r,exports.getSolanaFormattedAmounts=function({amount:e,fee:t,tokenPrice:n}){let o=BigInt(1e9*parseFloat(e)),s=o+t;return{fundingAmountInBaseUnit:o,fundingAmountInUsd:n?a(o,n):void 0,totalPriceInUsd:n?a(s,n):void 0,totalPriceInNativeCurrency:r(s),feePriceInNativeCurrency:r(t),feePriceInUsd:n?a(t,n):void 0}},exports.getTransactionFees=s,exports.getWalletPublicKeyFromTransaction=function(e,t){let n=(o(e)?e.message:e.compileMessage()).staticAccountKeys.find((e=>e.toBase58()===t));if(!n)throw Error(`Transaction does not contain public key ${t}`);return n},exports.hasSufficientFunds=async function(e,t){let{value:n}=await t.simulateTransaction(e);return null==n.err&&n.logs?.every((e=>!/insufficient funds/gi.test(e)))},exports.isVersionedTransaction=o,exports.parseSolanaTransaction=async function({tx:e,connection:t,client:n}){let r=o(e)?e.message:e.compileMessage(),a=r.staticAccountKeys[0]?.toBase58()??"",i=await s(e,t),l={},d={},f=[];for(let e of r.compiledInstructions){let a=r.staticAccountKeys[e.programIdIndex]?.toBase58()||"";if("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"!==a&&"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"!==a)if("11111111111111111111111111111111"!==a)if("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"!==a)f.push({type:"unknown",program:a});else{let t=function(e,t){let[n,r,a,o]=e.accountKeyIndexes.map((e=>t.staticAccountKeys[e]));if(n&&r&&a&&o)return{type:"ata-creation",payer:n.toBase58(),ata:r.toBase58(),owner:a.toBase58(),mint:o.toBase58()}}(e,r);t&&(f.push(t),d[t.ata]={owner:t.owner,mint:t.mint})}else f.push(await u(e,r));else{let a=await c(e,r,t,n,l,d);f.push(a),l[a.token.address]=a.token,d[a.fromAta]??={owner:a.fromAccount,mint:a.token.address},a.toAccount&&(d[a.toAta]??={owner:a.toAccount,mint:a.token.address})}}return f.some((e=>"ata-creation"!==e.type))&&(f=f.filter((e=>"ata-creation"!==e.type))),{spender:a,fee:i,instructions:f}};
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),n=require("viem"),o=require("@privy-io/js-sdk-core"),t=require("../../client/user.js"),s=require("../../configuration/context.js"),i=require("../../embedded-wallets/solana/transaction.js"),a=require("../../hooks/internal-context.js"),c=require("../../hooks/modal-context.js"),u=require("../../hooks/privy-context.js"),l=require("../../hooks/useGetSolPrice.js"),d=require("../../lib/solana/index.js"),p=require("../../lib/solana/transaction.js"),m=require("../ErrorScreen.js"),q=require("../SendTransactionScreen/SendTransactionScreenView.js"),j=require("../SendTransactionScreen/TransactionErrorView.js"),h=require("../index.js"),f=require("./SolanaTransactionReceiptView.js");require("@ethersproject/address"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../utils/buffer/readBigInt64LE.js"),require("../../hooks/index.js"),require("../../components/PrefetchedImage.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("@heroicons/react/24/outline/PhoneIcon"),require("styled-components"),require("../../components/Button.js"),require("../../components/Loader.js"),require("../../components/CircleBorder.js"),require("../../components/ModalHeader.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../components/layout/StackedContainer.js"),require("../../embedded-wallets/errors.js"),require("../../embedded-wallets/types.js"),require("../../errors.js"),require("ofetch"),require("../../hooks/captcha-context.js"),require("../../utils/index.js"),require("@ethersproject/providers"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../svg/lock-closed.js"),require("@heroicons/react/24/outline"),require("../../components/ModalFooter.js"),require("../../svg/protected-by-privy.js"),require("../../components/ui/layout/Row.js"),require("../../components/ui/typography/ErrorMessage.js"),require("../../components/ui/typography/LabelSm.js"),require("../../components/ui/typography/Subtitle.js"),require("../../components/ui/typography/Title.js"),require("../../components/ui/typography/Value.js"),require("../../components/ui/animation/LoadingSkeleton.js"),require("../../components/ui/wallet/Address.js"),require("@heroicons/react/24/outline/CheckIcon"),require("@heroicons/react/24/outline/Square2StackIcon"),require("../../components/ui/wallet/WalletInfoCard.js"),require("../../components/ui/chips/Chip.js"),require("../../components/ui/layout/Column.js"),require("../../components/ui/typography/LabelXs.js"),require("../../components/ui/wallet/shared.js"),require("../LandingScreen/styles.js"),require("../SendTransactionScreen/TransactionDetail.js"),require("../SendTransactionScreen/useTransactionDetails.js"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/ClipboardDocumentIcon"),require("@heroicons/react/24/outline/ExclamationCircleIcon"),require("../SendTransactionScreen/EthersTransactionError.js"),require("@ethersproject/logger"),require("@heroicons/react/24/outline/CheckCircleIcon"),require("../../components/CircleBackground.js"),require("../../components/Layouts.js"),require("../../components/ScreenHeader.js"),require("../../components/embedded-wallets/SolanaTransactionDetails.js"),require("@heroicons/react/24/outline/ChevronDownIcon"),require("../../components/embedded-wallets/PriceDisplay.js"),require("@ethersproject/units"),require("../../lib/ethers.js"),require("@ethersproject/bignumber"),require("../../components/embedded-wallets/WalletLink.js");exports.SendSolanaTransactionScreen=()=>{let{data:g,onUserCloseViaDialogOrKeybindRef:y,setModalData:S,navigate:b}=c.usePrivyModal(),{client:k,closePrivyModal:T,walletProxy:w}=a.usePrivyInternal(),v=s.useAppConfig(),{user:I,getAccessToken:C}=u.usePrivyContext(),[x,A]=r.useState(g?.sendSolanaTransaction?.transactionRequest),[E,L]=r.useState(),[O,P]=r.useState(),[D,F]=r.useState(0),[M,V]=r.useState({value:0n,isLoading:!1}),[R,W]=r.useState(!1),[B,N]=r.useState(),[U,H]=r.useState(),$=g?.sendSolanaTransaction?.connection,z=g?.sendSolanaTransaction?.transactingWallet,G=E?.instructions.length??1,_=z?.imported?t.getImportedPrivySolanaWallet(I):t.getPrivyPrimaryWallet(I),X=d.getSolanaNetworkFromRpcEndpoint($?.rpcEndpoint||""),K="fiat-currency"===v.embeddedWallets.priceDisplay.primary,{solPrice:Q,isSolPriceLoading:J}=l.useGetSolPrice({enabled:K}),Y=r.useMemo((()=>{let e,r;if(!E)return;let o=E.spender;0===D&&z?.address===o&&(e=p.getNativeCurrencyFromLamports(E.fee));let t=p.getNativeCurrencyFromLamports(M.value,3,!0),s=E.instructions[D];if(!s)return{fee:e,spender:o,balance:t};if("unknown"===s.type)return{fee:e,spender:o,program:s.program,balance:t};let i=s.fromAccount,a="sol-transfer"===s.type?s.toAccount:s.toAccount||s.toAta,c="spl-transfer"===s.type?s.token.address:void 0;return null!=e&&"SOL"===s.token.symbol&&(r=p.getNativeCurrencyFromLamports(s.value+E.fee)),{fee:e,spender:o,from:i,to:a,tokenAddress:c,amount:`${n.formatUnits(s.value,s.token.decimals)} ${s.token.symbol}`.trim(),total:r,balance:t}}),[E,D,z?.address,M]),Z=r.useMemo((()=>{let e,r;if(!E||!K||!Q||J)return;function o(...e){return p.getDollarsFromLamport(e.reduce(((e,r)=>e+r),0n),Q??0)}0===D&&z?.address===E.spender&&(e=o(E.fee));let t=o(M.value),s=E.instructions[D];return s&&"unknown"!==s.type?(null!=e&&"SOL"===s.token.symbol&&(r=o(s.value,E.fee)),{fee:e,amount:"SOL"===s.token.symbol?o(s.value):`${n.formatUnits(s.value,s.token.decimals)} ${s.token.symbol}`.trim(),total:r,balance:t}):{fee:e,balance:t}}),[E,K,Q,J,z?.address,D,M]),ee=r.useMemo((()=>{if(!E||M.isLoading||D>0)return!1;let e=E.instructions[D];if(!e)return!1;let r=0n;return z?.address===E.spender&&(r+=E.fee),"unknown"!==e.type&&z?.address===e.fromAccount&&"SOL"===e.token.symbol&&(r+=e.value),M.value<r}),[E,M,D]);if(r.useEffect((()=>{!async function(){if(x&&$&&k)try{P(void 0);let e=await p.parseSolanaTransaction({tx:x,connection:$,client:k});L(e),F(0)}catch(e){console.error("Failed to prepare transaction",e),P(e)}}()}),[x,$,k]),r.useEffect((()=>{(async function(){if(!z||!$)return;V({value:M.value,isLoading:!0});let e=new o.SolanaClient({name:"mainnet-beta",rpcUrl:$.rpcEndpoint});V({value:await e.getBalance(z.address).catch((()=>0n))??0n,isLoading:!1})})().catch(console.error)}),[E,$]),!(x&&g?.sendSolanaTransaction&&z&&$)){let r=Error("Invalid transaction request");/*#__PURE__*/return e.jsx(m.ErrorScreenView,{error:r,onClick:()=>{g?.sendSolanaTransaction?.onFailure(r),T({shouldCallAuthOnSuccess:!1})}})}let re=()=>{if(!R)return B?g?.sendSolanaTransaction?.onSuccess(B):(g?.sendSolanaTransaction?.onFailure(U??O??Error("User exited the modal before submitting the transaction")),F(0)),T({shouldCallAuthOnSuccess:!1})};y.current=re;let ne=g.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/e.jsx("img",{src:g.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:g.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,oe=!!(g.funding&&g.funding.supportedOptions.length>0),te=ee&&oe;return B?/*#__PURE__*/e.jsx(f.SolanaTransactionReceiptView,{instructions:E?.instructions.map((e=>"unknown"===e.type?{}:"spl-transfer"===e.type?{from:e.fromAccount,to:e.toAccount||e.toAta,amount:e.value,token:e.token}:{from:e.fromAccount,to:e.toAccount,amount:e.value,token:e.token}))??[],fees:0===D?B.fees:0n,onClose:re,transactionInfo:g.sendTransaction?.uiOptions.transactionInfo,solPrice:Q,receiptHeader:g.sendTransaction?.uiOptions.successHeader,receiptDescription:g.sendTransaction?.uiOptions.successDescription,rpcEndpoint:$.rpcEndpoint}):U?/*#__PURE__*/e.jsx(j.TransactionErrorView,{transactionError:U,connection:$,onClose:re,network:"solana",onRetry:async()=>{H(void 0);let{blockhash:e}=await $.getLatestBlockhash();p.isVersionedTransaction(x)?x.message.recentBlockhash=e:x.recentBlockhash=e,A(x)}}):/*#__PURE__*/e.jsx(q.SendSolanaTransactionScreenView,{img:ne,title:g.sendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:g.sendTransaction?.uiOptions?.description||`${v.name} wants your permission to approve the following transaction.`,cta:te?"Add funds":g.sendTransaction?.uiOptions?.buttonText||"Approve",transactionIndex:D,maxIndex:G-1,network:"mainnet-beta"==X?"Solana":X,blockExplorerUrl:"https://explorer.solana.com",total:K?Z?.total:Y?.total,amount:K?Z?.amount:Y?.amount,fee:K?Z?.fee:Y?.fee,balance:K?Z?.balance:Y?.balance,from:Y?.from,to:Y?.to,tokenAddress:Y?.tokenAddress,transactingWalletAddress:z.address,programAddress:Y?.program,disabled:ee&&!oe,isSubmitting:R,isPreparing:!E||M.isLoading,isTokenPriceLoading:K&&J,isMissingFunds:ee,submitError:U??void 0,parseError:O,onClick:te?async()=>{if(!z)return;if(!oe)throw Error("Funding wallet is not enabled");let e=h.ModalScreen.FUNDING_METHOD_SELECTION_SCREEN;S({...g,funding:{...g.funding,methodScreen:e}}),b(e)}:async()=>{if(D<(E?.instructions.length??1)-1)F(D+1);else try{W(!0);let e=await C();if(R||!e||!z||!w||!I||!_)return;let{rootWallet:r}=t.getSolanaSigningAndRootWallet(I,z.address);if(!r)throw Error("No root wallet for transacting wallet found");let{entropyId:n,entropyIdVerifier:o}=t.getEntropyDetailsFromAccount(r),{signature:s,receipt:a}=await i.sendSolanaTransaction({tx:x,accessToken:e,connection:$,walletProxy:w,entropyId:n,entropyIdVerifier:o,transactingWalletAddress:z.address,transactingWalletIndex:z.walletIndex??0,transactionOptions:g.sendSolanaTransaction?.transactionOptions});N(p.createSolanaTransactionReceipt(s,a))}catch(e){console.warn({transaction:x,error:e}),H(e)}finally{W(!1)}},onClose:re,onBack:D>0&&G>1?()=>F(D-1):void 0})};
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),n=require("viem"),o=require("@privy-io/js-sdk-core"),t=require("../../client/user.js"),s=require("../../configuration/context.js"),i=require("../../embedded-wallets/solana/transaction.js"),a=require("../../hooks/internal-context.js"),c=require("../../hooks/modal-context.js"),u=require("../../hooks/privy-context.js"),l=require("../../hooks/useGetSolPrice.js"),d=require("../../lib/solana/index.js"),p=require("../../lib/solana/transaction.js"),m=require("../ErrorScreen.js"),q=require("../SendTransactionScreen/SendTransactionScreenView.js"),h=require("../SendTransactionScreen/TransactionErrorView.js"),j=require("../index.js"),f=require("./SolanaTransactionReceiptView.js");require("@ethersproject/address"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../utils/buffer/readBigInt64LE.js"),require("../../hooks/index.js"),require("../../components/PrefetchedImage.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("@heroicons/react/24/outline/PhoneIcon"),require("styled-components"),require("../../components/Button.js"),require("../../components/Loader.js"),require("../../components/CircleBorder.js"),require("../../components/ModalHeader.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../components/layout/StackedContainer.js"),require("../../embedded-wallets/errors.js"),require("../../embedded-wallets/types.js"),require("../../errors.js"),require("ofetch"),require("../../hooks/captcha-context.js"),require("../../utils/index.js"),require("@ethersproject/providers"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../svg/lock-closed.js"),require("@heroicons/react/24/outline"),require("../../components/ModalFooter.js"),require("../../svg/protected-by-privy.js"),require("../../components/ui/layout/Row.js"),require("../../components/ui/typography/ErrorMessage.js"),require("../../components/ui/typography/LabelSm.js"),require("../../components/ui/typography/Subtitle.js"),require("../../components/ui/typography/Title.js"),require("../../components/ui/typography/Value.js"),require("../../components/ui/animation/LoadingSkeleton.js"),require("../../components/ui/wallet/Address.js"),require("@heroicons/react/24/outline/CheckIcon"),require("@heroicons/react/24/outline/Square2StackIcon"),require("../../components/ui/wallet/WalletInfoCard.js"),require("../../components/ui/chips/Chip.js"),require("../../components/ui/layout/Column.js"),require("../../components/ui/typography/LabelXs.js"),require("../../components/ui/wallet/shared.js"),require("../LandingScreen/styles.js"),require("../SendTransactionScreen/TransactionDetail.js"),require("../SendTransactionScreen/useTransactionDetails.js"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/ClipboardDocumentIcon"),require("@heroicons/react/24/outline/ExclamationCircleIcon"),require("../SendTransactionScreen/EthersTransactionError.js"),require("@ethersproject/logger"),require("@heroicons/react/24/outline/CheckCircleIcon"),require("../../components/CircleBackground.js"),require("../../components/Layouts.js"),require("../../components/ScreenHeader.js"),require("../../components/embedded-wallets/SolanaTransactionDetails.js"),require("@heroicons/react/24/outline/ChevronDownIcon"),require("../../components/embedded-wallets/PriceDisplay.js"),require("@ethersproject/units"),require("../../lib/ethers.js"),require("@ethersproject/bignumber"),require("../../components/embedded-wallets/WalletLink.js");exports.SendSolanaTransactionScreen=()=>{let{data:g,onUserCloseViaDialogOrKeybindRef:y,setModalData:S,navigate:k}=c.usePrivyModal(),{client:b,closePrivyModal:w,walletProxy:T}=a.usePrivyInternal(),v=s.useAppConfig(),{user:A,getAccessToken:I}=u.usePrivyContext(),[C,x]=r.useState(g?.sendSolanaTransaction?.transactionRequest),[E,L]=r.useState(),[O,P]=r.useState(),[D,F]=r.useState(0),[M,V]=r.useState({value:0n,isLoading:!1}),[R,W]=r.useState(!1),[B,N]=r.useState(),[U,H]=r.useState(),$=g?.sendSolanaTransaction?.connection,z=g?.sendSolanaTransaction?.transactingWallet,G=E?.instructions.length??1,_=z?.imported?t.getImportedPrivySolanaWallet(A):t.getPrivyPrimaryWallet(A),X=d.getSolanaNetworkFromRpcEndpoint($?.rpcEndpoint||""),K="fiat-currency"===v.embeddedWallets.priceDisplay.primary,{solPrice:Q,isSolPriceLoading:J}=l.useGetSolPrice({enabled:K}),Y=r.useMemo((()=>{let e,r;if(!E)return;let o=E.spender;0===D&&z?.address===o&&(e=p.getNativeCurrencyFromLamports(E.fee));let t=p.getNativeCurrencyFromLamports(M.value,3,!0),s=E.instructions[D];if(!s)return{fee:e,spender:o,balance:t};if("unknown"===s.type)return{fee:e,spender:o,program:s.program,balance:t};if("ata-creation"===s.type)return{fee:e,spender:o,balance:t,tokenAccountOwner:s.owner,tokenAccount:s.ata,tokenAddress:s.mint};let i=s.fromAccount,a="sol-transfer"===s.type?s.toAccount:s.toAccount||s.toAta,c="spl-transfer"===s.type?s.token.address:void 0;return null!=e&&"SOL"===s.token.symbol&&(r=p.getNativeCurrencyFromLamports(s.value+E.fee)),{fee:e,spender:o,from:i,to:a,tokenAddress:c,amount:`${n.formatUnits(s.value,s.token.decimals)} ${s.token.symbol}`.trim(),total:r,balance:t}}),[E,D,z?.address,M]),Z=r.useMemo((()=>{let e,r;if(!E||!K||!Q||J)return;function o(...e){return p.getDollarsFromLamport(e.reduce(((e,r)=>e+r),0n),Q??0)}0===D&&z?.address===E.spender&&(e=o(E.fee));let t=o(M.value),s=E.instructions[D];return s&&"unknown"!==s.type&&"ata-creation"!==s.type?(null!=e&&"SOL"===s.token.symbol&&(r=o(s.value,E.fee)),{fee:e,amount:"SOL"===s.token.symbol?o(s.value):`${n.formatUnits(s.value,s.token.decimals)} ${s.token.symbol}`.trim(),total:r,balance:t}):{fee:e,balance:t}}),[E,K,Q,J,z?.address,D,M]),ee=r.useMemo((()=>{if(!E||M.isLoading||D>0)return!1;let e=E.instructions[D];if(!e)return!1;let r=0n;return z?.address===E.spender&&(r+=E.fee),"value"in e&&z?.address===e.fromAccount&&"SOL"===e.token.symbol&&(r+=e.value),M.value<r}),[E,M,D]);if(r.useEffect((()=>{!async function(){if(C&&$&&b)try{P(void 0);let e=await p.parseSolanaTransaction({tx:C,connection:$,client:b});L(e),F(0)}catch(e){console.error("Failed to prepare transaction",e),P(e)}}()}),[C,$,b]),r.useEffect((()=>{(async function(){if(!z||!$)return;V({value:M.value,isLoading:!0});let e=new o.SolanaClient({name:"mainnet-beta",rpcUrl:$.rpcEndpoint});V({value:await e.getBalance(z.address).catch((()=>0n))??0n,isLoading:!1})})().catch(console.error)}),[E,$]),!(C&&g?.sendSolanaTransaction&&z&&$)){let r=Error("Invalid transaction request");/*#__PURE__*/return e.jsx(m.ErrorScreenView,{error:r,onClick:()=>{g?.sendSolanaTransaction?.onFailure(r),w({shouldCallAuthOnSuccess:!1})}})}let re=()=>{if(!R)return B?g?.sendSolanaTransaction?.onSuccess(B):(g?.sendSolanaTransaction?.onFailure(U??O??Error("User exited the modal before submitting the transaction")),F(0)),w({shouldCallAuthOnSuccess:!1})};y.current=re;let ne=g.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/e.jsx("img",{src:g.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:g.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,oe=!!(g.funding&&g.funding.supportedOptions.length>0),te=ee&&oe;return B?/*#__PURE__*/e.jsx(f.SolanaTransactionReceiptView,{instructions:E?.instructions.reduce(((e,r)=>("ata-creation"===r.type&&e.push({tokenAccountOwner:r.owner,tokenAccount:r.ata}),"spl-transfer"===r.type&&e.push({from:r.fromAccount,to:r.toAccount||r.toAta,amount:r.value,token:r.token}),"sol-transfer"===r.type&&e.push({from:r.fromAccount,to:r.toAccount,amount:r.value,token:r.token}),e)),[])??[],fees:0===D?B.fees:0n,onClose:re,transactionInfo:g.sendTransaction?.uiOptions.transactionInfo,solPrice:Q,receiptHeader:g.sendTransaction?.uiOptions.successHeader,receiptDescription:g.sendTransaction?.uiOptions.successDescription,rpcEndpoint:$.rpcEndpoint}):U?/*#__PURE__*/e.jsx(h.TransactionErrorView,{transactionError:U,connection:$,onClose:re,network:"solana",onRetry:async()=>{H(void 0);let{blockhash:e}=await $.getLatestBlockhash();p.isVersionedTransaction(C)?C.message.recentBlockhash=e:C.recentBlockhash=e,x(C)}}):/*#__PURE__*/e.jsx(q.SendSolanaTransactionScreenView,{img:ne,title:g.sendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:g.sendTransaction?.uiOptions?.description||`${v.name} wants your permission to approve the following transaction.`,cta:te?"Add funds":g.sendTransaction?.uiOptions?.buttonText||"Approve",transactionIndex:D,maxIndex:G-1,network:"mainnet-beta"==X?"Solana":X,blockExplorerUrl:"https://explorer.solana.com",total:K?Z?.total:Y?.total,amount:K?Z?.amount:Y?.amount,fee:K?Z?.fee:Y?.fee,balance:K?Z?.balance:Y?.balance,from:Y?.from,to:Y?.to,tokenAccount:Y?.tokenAccount,tokenAccountOwner:Y?.tokenAccountOwner,tokenAddress:Y?.tokenAddress,transactingWalletAddress:z.address,programAddress:Y?.program,disabled:ee&&!oe,isSubmitting:R,isPreparing:!E||M.isLoading,isTokenPriceLoading:K&&J,isMissingFunds:ee,submitError:U??void 0,parseError:O,onClick:te?async()=>{if(!z)return;if(!oe)throw Error("Funding wallet is not enabled");let e=j.ModalScreen.FUNDING_METHOD_SELECTION_SCREEN;S({...g,funding:{...g.funding,methodScreen:e}}),k(e)}:async()=>{if(D<(E?.instructions.length??1)-1)F(D+1);else try{W(!0);let e=await I();if(R||!e||!z||!T||!A||!_)return;let{rootWallet:r}=t.getSolanaSigningAndRootWallet(A,z.address);if(!r)throw Error("No root wallet for transacting wallet found");let{entropyId:n,entropyIdVerifier:o}=t.getEntropyDetailsFromAccount(r),{signature:s,receipt:a}=await i.sendSolanaTransaction({tx:C,accessToken:e,connection:$,walletProxy:T,entropyId:n,entropyIdVerifier:o,transactingWalletAddress:z.address,transactingWalletIndex:z.walletIndex??0,transactionOptions:g.sendSolanaTransaction?.transactionOptions});N(p.createSolanaTransactionReceipt(s,a))}catch(e){console.warn({transaction:C,error:e}),H(e)}finally{W(!1)}},onClose:re,onBack:D>0&&G>1?()=>F(D-1):void 0})};
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/CheckCircleIcon"),o=require("styled-components"),n=require("../../components/Button.js"),s=require("../../components/CircleBackground.js"),i=require("../../components/Layouts.js"),c=require("../../components/ModalFooter.js"),t=require("../../components/ModalHeader.js"),a=require("../../components/ScreenHeader.js"),u=require("../../components/embedded-wallets/SolanaTransactionDetails.js"),l=require("../../components/layout/StackedContainer.js"),j=require("../LandingScreen/styles.js");function q(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../components/Loader.js"),require("../../svg/protected-by-privy.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../configuration/context.js"),require("react"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../hooks/internal-context.js"),require("../../hooks/index.js"),require("@heroicons/react/24/outline/ChevronDownIcon"),require("../../components/ui/layout/Row.js"),require("../../components/ui/typography/LabelSm.js"),require("../../components/ui/typography/Value.js"),require("../../components/ui/animation/LoadingSkeleton.js"),require("../../components/embedded-wallets/PriceDisplay.js"),require("@ethersproject/units"),require("../../lib/ethers.js"),require("@ethersproject/bignumber"),require("@privy-io/js-sdk-core"),require("../../utils/index.js"),require("@ethersproject/providers"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../errors.js"),require("ofetch"),require("../../lib/solana/transaction.js"),require("../../utils/buffer/readBigInt64LE.js"),require("../../components/embedded-wallets/WalletLink.js");var h=/*#__PURE__*/q(r);let d=/*#__PURE__*/o.styled(n.PrimaryButton).withConfig({displayName:"SubmitButton",componentId:"sc-d56ba196-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);exports.SolanaTransactionReceiptView=({instructions:r,fees:o,onClose:n,receiptHeader:q,receiptDescription:p,transactionInfo:m,solPrice:g,rpcEndpoint:y})=>/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(t.ModalHeader,{onClose:n}),/*#__PURE__*/e.jsx(l.default,{style:{marginBottom:"16px"},children:/*#__PURE__*/e.jsxs("div",{children:[/*#__PURE__*/e.jsx(s.CircleBackground,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/e.jsx(h.default,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/e.jsx(a.CenteredScreenHeader,{title:q??"Transaction completed successfully.",description:p??""}),/*#__PURE__*/e.jsx(u.SolanaTransactionDetails,{solPrice:g,instructions:r,fees:o,transactionInfo:m,rpcEndpoint:y}),/*#__PURE__*/e.jsx(j.Grow,{}),/*#__PURE__*/e.jsx(d,{loading:!1,onClick:n,children:"Close"}),/*#__PURE__*/e.jsx(i.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(c.BlobbyFooter,{})]});
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/CheckCircleIcon"),o=require("styled-components"),n=require("../../components/Button.js"),s=require("../../components/CircleBackground.js"),i=require("../../components/Layouts.js"),c=require("../../components/ModalFooter.js"),t=require("../../components/ModalHeader.js"),a=require("../../components/ScreenHeader.js"),u=require("../../components/embedded-wallets/SolanaTransactionDetails.js"),l=require("../../components/layout/StackedContainer.js"),j=require("../LandingScreen/styles.js");function q(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../components/Loader.js"),require("../../svg/protected-by-privy.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../configuration/context.js"),require("react"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../hooks/internal-context.js"),require("../../hooks/index.js"),require("@heroicons/react/24/outline/ChevronDownIcon"),require("../../components/ui/layout/Row.js"),require("../../components/ui/typography/LabelSm.js"),require("../../components/ui/typography/Value.js"),require("../../components/ui/animation/LoadingSkeleton.js"),require("../../components/embedded-wallets/PriceDisplay.js"),require("@ethersproject/units"),require("../../lib/ethers.js"),require("@ethersproject/bignumber"),require("@privy-io/js-sdk-core"),require("../../utils/index.js"),require("@ethersproject/providers"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../errors.js"),require("ofetch"),require("../../lib/solana/transaction.js"),require("../../utils/buffer/readBigInt64LE.js"),require("../../components/embedded-wallets/WalletLink.js");var h=/*#__PURE__*/q(r);let d=/*#__PURE__*/o.styled(n.PrimaryButton).withConfig({displayName:"SubmitButton",componentId:"sc-2effda18-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);exports.SolanaTransactionReceiptView=({instructions:r,fees:o,onClose:n,receiptHeader:q,receiptDescription:p,transactionInfo:m,solPrice:g,rpcEndpoint:y})=>/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(t.ModalHeader,{onClose:n}),/*#__PURE__*/e.jsx(l.default,{style:{marginBottom:"16px"},children:/*#__PURE__*/e.jsxs("div",{children:[/*#__PURE__*/e.jsx(s.CircleBackground,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/e.jsx(h.default,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/e.jsx(a.CenteredScreenHeader,{title:q??"Transaction completed successfully.",description:p??""}),/*#__PURE__*/e.jsx(u.SolanaTransactionDetails,{solPrice:g,instructions:r,fees:o,transactionInfo:m,rpcEndpoint:y}),/*#__PURE__*/e.jsx(j.Grow,{}),/*#__PURE__*/e.jsx(d,{loading:!1,onClick:n,children:"Close"}),/*#__PURE__*/e.jsx(i.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(c.BlobbyFooter,{})]});
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline"),s=require("styled-components"),n=require("../../components/Button.js"),i=require("../../components/ModalFooter.js"),o=require("../../components/ModalHeader.js"),a=require("../../components/ui/layout/Row.js"),t=require("../../components/ui/typography/ErrorMessage.js"),c=require("../../components/ui/typography/LabelSm.js"),l=require("../../components/ui/typography/Subtitle.js"),d=require("../../components/ui/typography/Title.js"),u=require("../../components/ui/typography/Value.js"),j=require("../../components/ui/wallet/Address.js"),h=require("../../components/ui/wallet/WalletInfoCard.js"),m=require("../LandingScreen/styles.js"),x=require("./TransactionDetail.js"),p=require("./useTransactionDetails.js");require("../../components/Loader.js"),require("../../svg/protected-by-privy.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../configuration/context.js"),require("react"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../hooks/internal-context.js"),require("../../hooks/index.js"),require("../../components/ui/animation/LoadingSkeleton.js"),require("@heroicons/react/24/outline/CheckIcon"),require("@heroicons/react/24/outline/Square2StackIcon"),require("../../utils/index.js"),require("@ethersproject/providers"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../errors.js"),require("ofetch"),require("../../components/ui/chips/Chip.js"),require("../../components/ui/layout/Column.js"),require("../../components/ui/typography/LabelXs.js"),require("../../components/ui/wallet/shared.js"),require("@ethersproject/address");const g=({transactionIndex:e,maxIndex:r})=>"number"!=typeof e||0===r?"":` (${e+1} / ${r+1})`;let q=/*#__PURE__*/s.styled(h.WalletInfoCard).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-67aab208-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),b="There was an error preparing your transaction. Your transaction request will likely fail.",y=/*#__PURE__*/s.styled.div.withConfig({displayName:"ImageContainer",componentId:"sc-67aab208-1"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]);exports.SendSolanaTransactionScreenView=({img:r,title:s,subtitle:h,cta:x,network:p,blockExplorerUrl:w,transactionIndex:S,maxIndex:f,isMissingFunds:k,submitError:L,parseError:T,total:I,amount:C,fee:A,balance:R,from:V,to:v,tokenAddress:M,programAddress:E,transactingWalletAddress:F,disabled:$,isSubmitting:D,isPreparing:N,isTokenPriceLoading:P,onClick:B,onClose:H,onBack:W})=>{let z=N||P;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(o.ModalHeader,{onClose:H,backFn:W}),r&&/*#__PURE__*/e.jsx(y,{children:r}),/*#__PURE__*/e.jsxs(d.Title,{style:{marginTop:r?"1.5rem":0},children:[s,/*#__PURE__*/e.jsx(g,{maxIndex:f,transactionIndex:S})]}),/*#__PURE__*/e.jsx(l.Subtitle,{children:h}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem"},children:[(I||z)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(u.Value,{$isLoading:z,children:I})]}),V&&V!==F&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"From"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:V,url:w,showCopyIcon:!1})})]}),v&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:v,url:w,showCopyIcon:!1})})]}),M&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Token address"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:M,url:w,showCopyIcon:!1})})]}),E&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Program address"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:E,url:w,showCopyIcon:!1})})]}),p&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(u.Value,{children:p})]}),(C||z)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(u.Value,{$isLoading:z,children:C})})]}),(A||z)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(u.Value,{$isLoading:z,children:A})]})]}),/*#__PURE__*/e.jsx(m.Grow,{}),L?/*#__PURE__*/e.jsx(t.ErrorMessage,{style:{marginTop:"2rem"},children:L.message}):T?/*#__PURE__*/e.jsx(t.ErrorMessage,{style:{marginTop:"2rem"},children:b}):null,/*#__PURE__*/e.jsx(q,{$useSmallMargins:!(!T&&!L),title:"Your wallet",address:F,balance:R,isLoading:N||P,errMsg:N||T||L||!k?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e.jsx(n.PrimaryButton,{style:{marginTop:"1rem"},loading:D,disabled:$||N,onClick:B,children:x}),/*#__PURE__*/e.jsx(i.BlobbyFooter,{})]})},exports.SendTransactionScreenView=({img:s,submitError:h,prepareError:w,onClose:S,action:f,title:k,subtitle:L,total:T,txValue:I,to:C,tokenAddress:A,network:R,missingFunds:V,fee:v,from:M,cta:E,disabled:F,chain:$,isSubmitting:D,isPreparing:N,isTokenPriceLoading:P,isTokenContractInfoLoading:B,isSponsored:H,symbol:W,balance:z,onClick:Y,transactionDetails:G,transactionIndex:X,maxIndex:Q,onBack:U,chainName:J})=>{let{showTransactionDetails:K,setShowTransactionDetails:O,hasMoreDetails:Z,isErc20Ish:_}=p.useTransactionDetails(G);/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(o.ModalHeader,{onClose:S,backFn:U}),s&&/*#__PURE__*/e.jsx(y,{children:s}),/*#__PURE__*/e.jsxs(d.Title,{style:{marginTop:s?"1.5rem":0},children:[k,/*#__PURE__*/e.jsx(g,{maxIndex:Q,transactionIndex:X})]}),/*#__PURE__*/e.jsx(l.Subtitle,{children:L}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem"},children:[_&&/*#__PURE__*/e.jsxs(e.Fragment,{children:["approve"===f&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(u.Value,{children:G?.action})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(u.Value,{$isLoading:_&&B,children:[G?.formattedAmount," ",W]})]})]}),T&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(u.Value,{$isLoading:N||P,children:T})]}),G&&"spender"in G&&G?.spender?/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Spender"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:G.spender,url:$?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,C&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:C,url:$?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),A&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Token address"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:A,url:$?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(u.Value,{children:R})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(c.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(u.Value,{$isLoading:N||P||void 0===H,children:H?"Sponsored":v})]}),Z&&/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.Row,{className:"cursor-pointer",onClick:()=>O(!K),children:/*#__PURE__*/e.jsxs(c.LabelSmPrimary,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e.jsx(r.ChevronDownIcon,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:K?"rotate(180deg)":void 0}})]})}),K&&G&&/*#__PURE__*/e.jsx(x.TransactionDetail,{action:f,chain:$,transactionDetails:G,isTokenContractInfoLoading:B,symbol:W})]})]}),/*#__PURE__*/e.jsx(m.Grow,{}),h?/*#__PURE__*/e.jsx(t.ErrorMessage,{style:{marginTop:"2rem"},children:h.message}):w?/*#__PURE__*/e.jsx(t.ErrorMessage,{style:{marginTop:"2rem"},children:b}):null,/*#__PURE__*/e.jsx(q,{$useSmallMargins:!(!w&&!h),title:Number(I)>0?void 0:!1!==H?"Your wallet":void 0,address:M,balance:z,isLoading:N||P,errMsg:N||w||h||!V?void 0:`Add funds on ${$?.name??J} to complete transaction.`}),/*#__PURE__*/e.jsx(n.PrimaryButton,{style:{marginTop:"1rem"},loading:D,disabled:F||N,onClick:Y,children:E}),/*#__PURE__*/e.jsx(i.BlobbyFooter,{})]})},exports.TransactionIndex=g;
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline"),s=require("styled-components"),n=require("../../components/Button.js"),o=require("../../components/ModalFooter.js"),i=require("../../components/ModalHeader.js"),a=require("../../components/ui/layout/Row.js"),c=require("../../components/ui/typography/ErrorMessage.js"),t=require("../../components/ui/typography/LabelSm.js"),l=require("../../components/ui/typography/Subtitle.js"),d=require("../../components/ui/typography/Title.js"),u=require("../../components/ui/typography/Value.js"),j=require("../../components/ui/wallet/Address.js"),h=require("../../components/ui/wallet/WalletInfoCard.js"),m=require("../LandingScreen/styles.js"),x=require("./TransactionDetail.js"),p=require("./useTransactionDetails.js");require("../../components/Loader.js"),require("../../svg/protected-by-privy.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../configuration/context.js"),require("react"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../hooks/internal-context.js"),require("../../hooks/index.js"),require("../../components/ui/animation/LoadingSkeleton.js"),require("@heroicons/react/24/outline/CheckIcon"),require("@heroicons/react/24/outline/Square2StackIcon"),require("../../utils/index.js"),require("@ethersproject/providers"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../errors.js"),require("ofetch"),require("../../components/ui/chips/Chip.js"),require("../../components/ui/layout/Column.js"),require("../../components/ui/typography/LabelXs.js"),require("../../components/ui/wallet/shared.js"),require("@ethersproject/address");const g=({transactionIndex:e,maxIndex:r})=>"number"!=typeof e||0===r?"":` (${e+1} / ${r+1})`;let q=/*#__PURE__*/s.styled(h.WalletInfoCard).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-bec19fef-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),b="There was an error preparing your transaction. Your transaction request will likely fail.",y=/*#__PURE__*/s.styled.div.withConfig({displayName:"ImageContainer",componentId:"sc-bec19fef-1"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]);exports.SendSolanaTransactionScreenView=({img:r,title:s,subtitle:h,cta:x,network:p,blockExplorerUrl:w,transactionIndex:S,maxIndex:f,isMissingFunds:k,submitError:L,parseError:T,total:I,amount:C,fee:A,balance:R,from:V,to:v,tokenAddress:M,tokenAccount:E,tokenAccountOwner:F,programAddress:$,transactingWalletAddress:D,disabled:N,isSubmitting:P,isPreparing:B,isTokenPriceLoading:H,onClick:W,onClose:z,onBack:Y})=>{let G=B||H;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(i.ModalHeader,{onClose:z,backFn:Y}),r&&/*#__PURE__*/e.jsx(y,{children:r}),/*#__PURE__*/e.jsxs(d.Title,{style:{marginTop:r?"1.5rem":0},children:[s,/*#__PURE__*/e.jsx(g,{maxIndex:f,transactionIndex:S})]}),/*#__PURE__*/e.jsx(l.Subtitle,{children:h}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem"},children:[(I||G)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(u.Value,{$isLoading:G,children:I})]}),V&&V!==D&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"From"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:V,url:w,showCopyIcon:!1})})]}),v&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:v,url:w,showCopyIcon:!1})})]}),F&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token account owner"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:F,url:w,showCopyIcon:!1})})]}),E&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token account"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:E,url:w,showCopyIcon:!1})})]}),M&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token address"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:M,url:w,showCopyIcon:!1})})]}),$&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program address"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:$,url:w,showCopyIcon:!1})})]}),p&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(u.Value,{children:p})]}),(C||G)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(u.Value,{$isLoading:G,children:C})})]}),(A||G)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(u.Value,{$isLoading:G,children:A})]})]}),/*#__PURE__*/e.jsx(m.Grow,{}),L?/*#__PURE__*/e.jsx(c.ErrorMessage,{style:{marginTop:"2rem"},children:L.message}):T?/*#__PURE__*/e.jsx(c.ErrorMessage,{style:{marginTop:"2rem"},children:b}):null,/*#__PURE__*/e.jsx(q,{$useSmallMargins:!(!T&&!L),title:"Your wallet",address:D,balance:R,isLoading:B||H,errMsg:B||T||L||!k?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e.jsx(n.PrimaryButton,{style:{marginTop:"1rem"},loading:P,disabled:N||B,onClick:W,children:x}),/*#__PURE__*/e.jsx(o.BlobbyFooter,{})]})},exports.SendTransactionScreenView=({img:s,submitError:h,prepareError:w,onClose:S,action:f,title:k,subtitle:L,total:T,txValue:I,to:C,tokenAddress:A,network:R,missingFunds:V,fee:v,from:M,cta:E,disabled:F,chain:$,isSubmitting:D,isPreparing:N,isTokenPriceLoading:P,isTokenContractInfoLoading:B,isSponsored:H,symbol:W,balance:z,onClick:Y,transactionDetails:G,transactionIndex:X,maxIndex:O,onBack:Q,chainName:U})=>{let{showTransactionDetails:J,setShowTransactionDetails:K,hasMoreDetails:Z,isErc20Ish:_}=p.useTransactionDetails(G);/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(i.ModalHeader,{onClose:S,backFn:Q}),s&&/*#__PURE__*/e.jsx(y,{children:s}),/*#__PURE__*/e.jsxs(d.Title,{style:{marginTop:s?"1.5rem":0},children:[k,/*#__PURE__*/e.jsx(g,{maxIndex:O,transactionIndex:X})]}),/*#__PURE__*/e.jsx(l.Subtitle,{children:L}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem"},children:[_&&/*#__PURE__*/e.jsxs(e.Fragment,{children:["approve"===f&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(u.Value,{children:G?.action})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(u.Value,{$isLoading:_&&B,children:[G?.formattedAmount," ",W]})]})]}),T&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(u.Value,{$isLoading:N||P,children:T})]}),G&&"spender"in G&&G?.spender?/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Spender"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:G.spender,url:$?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,C&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:C,url:$?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),A&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token address"}),/*#__PURE__*/e.jsx(u.Value,{children:/*#__PURE__*/e.jsx(j.Address,{address:A,url:$?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(u.Value,{children:R})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(u.Value,{$isLoading:N||P||void 0===H,children:H?"Sponsored":v})]}),Z&&/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.Row,{className:"cursor-pointer",onClick:()=>K(!J),children:/*#__PURE__*/e.jsxs(t.LabelSmPrimary,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e.jsx(r.ChevronDownIcon,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:J?"rotate(180deg)":void 0}})]})}),J&&G&&/*#__PURE__*/e.jsx(x.TransactionDetail,{action:f,chain:$,transactionDetails:G,isTokenContractInfoLoading:B,symbol:W})]})]}),/*#__PURE__*/e.jsx(m.Grow,{}),h?/*#__PURE__*/e.jsx(c.ErrorMessage,{style:{marginTop:"2rem"},children:h.message}):w?/*#__PURE__*/e.jsx(c.ErrorMessage,{style:{marginTop:"2rem"},children:b}):null,/*#__PURE__*/e.jsx(q,{$useSmallMargins:!(!w&&!h),title:Number(I)>0?void 0:!1!==H?"Your wallet":void 0,address:M,balance:z,isLoading:N||P,errMsg:N||w||h||!V?void 0:`Add funds on ${$?.name??U} to complete transaction.`}),/*#__PURE__*/e.jsx(n.PrimaryButton,{style:{marginTop:"1rem"},loading:D,disabled:F||N,onClick:Y,children:E}),/*#__PURE__*/e.jsx(o.BlobbyFooter,{})]})},exports.TransactionIndex=g;
@@ -1 +1 @@
1
- import{jsxs as o,jsx as n,Fragment as i}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ChevronDownIcon";import{useState as r,useEffect as e}from"react";import{styled as c}from"styled-components";import{BackButton as s,NextButton as m}from"../ModalHeader.mjs";import{Rows as a,Row as l}from"../ui/layout/Row.mjs";import{LabelSm as p}from"../ui/typography/LabelSm.mjs";import{Value as d}from"../ui/typography/Value.mjs";import{SolanaPriceDisplay as h}from"./PriceDisplay.mjs";import{WalletLink as j}from"./WalletLink.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"../../configuration/context.mjs";import"../../config.mjs";import"../../configuration/defaultClientConfig.mjs";import"../../constants.mjs";import"../../configuration/login-methods.mjs";import"../../configuration/wallets.mjs";import"../../connectors/chains/index.mjs";import"../../connectors/chains/arbitrum.mjs";import"../../connectors/chains/arbitrumSepolia.mjs";import"../../connectors/chains/avalanche.mjs";import"../../connectors/chains/avalancheFuji.mjs";import"../../connectors/chains/base.mjs";import"../../connectors/chains/baseSepolia.mjs";import"../../connectors/chains/berachainArtio.mjs";import"../../connectors/chains/celo.mjs";import"../../connectors/chains/celoAlfajores.mjs";import"../../connectors/chains/filecoin.mjs";import"../../connectors/chains/filecoinCalibration.mjs";import"../../connectors/chains/garnetHolesky.mjs";import"../../connectors/chains/holesky.mjs";import"../../connectors/chains/linea.mjs";import"../../connectors/chains/lineaTestnet.mjs";import"../../connectors/chains/lukso.mjs";import"../../connectors/chains/mainnet.mjs";import"../../connectors/chains/optimism.mjs";import"../../connectors/chains/optimismSepolia.mjs";import"../../connectors/chains/polygon.mjs";import"../../connectors/chains/polygonAmoy.mjs";import"../../connectors/chains/redstone.mjs";import"../../connectors/chains/sepolia.mjs";import"../../connectors/chains/zora.mjs";import"../../connectors/chains/zoraSepolia.mjs";import"../../connectors/chains/zoraTestnet.mjs";import"../../connectors/chains/utils.mjs";import"../../lib/solana/index.mjs";import"../../theme.mjs";import"tinycolor2";import"../../lib/cybr53.mjs";import"../../hooks/internal-context.mjs";import"../../hooks/index.mjs";import"../ui/animation/LoadingSkeleton.mjs";import"@ethersproject/units";import"../../lib/ethers.mjs";import"@ethersproject/bignumber";import"@privy-io/js-sdk-core";import"../../utils/index.mjs";import"@ethersproject/providers";import"../../connectors/get-legacy-injected-providers.mjs";import"../../connectors/is-wallet-installed.mjs";import"../../errors.mjs";import"ofetch";import"../../lib/solana/transaction.mjs";import"../../utils/buffer/readBigInt64LE.mjs";const u=({instructions:c,fees:j,transactionInfo:u,solPrice:v,rpcEndpoint:I})=>{let C=c.reduce(((o,{amount:n,token:i})=>n&&"SOL"===i?.symbol?o+n:o),0n),[A,S]=r(0),[L,P]=r(!1),E=c[A];return e((()=>{S(0)}),[c]),/*#__PURE__*/o(a,{children:[/*#__PURE__*/o(l,{children:[/*#__PURE__*/n(p,{children:"Total"}),/*#__PURE__*/n(d,{children:/*#__PURE__*/n(h,{quantities:[C,j],tokenPrice:v})})]}),u&&u.action&&/*#__PURE__*/o(l,{children:[/*#__PURE__*/n(p,{children:"Action"}),/*#__PURE__*/n(d,{children:u.action})]}),/*#__PURE__*/o(l,{children:[/*#__PURE__*/n(p,{children:"Fees"}),/*#__PURE__*/n(d,{children:/*#__PURE__*/n(h,{quantities:[j||0n],tokenPrice:v})})]}),c.length>1?/*#__PURE__*/o(i,{children:[/*#__PURE__*/n(l,{children:/*#__PURE__*/o(w,{onClick:()=>P((o=>!o)),children:[/*#__PURE__*/n("span",{children:"Details"}),/*#__PURE__*/n(t,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:L?"rotate(180deg)":void 0}})]})}),L&&/*#__PURE__*/n(l,{children:/*#__PURE__*/o(g,{children:[/*#__PURE__*/o(y,{children:[/*#__PURE__*/o(b,{children:[A+1," of ",c.length," instructions"]}),/*#__PURE__*/o(k,{children:[A>0&&/*#__PURE__*/n(s,{backFn:()=>S((o=>o-1))}),A<c.length-1&&/*#__PURE__*/n(m,{nextFn:()=>S((o=>o+1))})]})]}),/*#__PURE__*/n(x,{children:/*#__PURE__*/n(f,{instruction:E,rpcEndpoint:I,solPrice:v})})]})})]}):/*#__PURE__*/n(f,{instruction:E,rpcEndpoint:I,solPrice:v,hideAmount:!0})]})};function f({instruction:i,rpcEndpoint:t,solPrice:r,hideAmount:e}){return i?/*#__PURE__*/o(a,{children:[!e&&!!i.amount&&/*#__PURE__*/o(l,{children:[/*#__PURE__*/n(p,{children:"Amount"}),/*#__PURE__*/n(d,{children:/*#__PURE__*/n(h,{quantities:[i.amount],tokenPrice:r,tokenSymbol:i.token?.symbol??"SOL",tokenDecimals:i.token?.decimals??9})})]}),i.to&&/*#__PURE__*/o(l,{children:[/*#__PURE__*/n(p,{children:"To"}),/*#__PURE__*/n(d,{children:/*#__PURE__*/n(j,{walletAddress:i.to,rpcEndpoint:t,network:"solana"})})]}),i.from&&/*#__PURE__*/o(l,{children:[/*#__PURE__*/n(p,{children:"From"}),/*#__PURE__*/n(d,{children:/*#__PURE__*/n(j,{walletAddress:i.from,rpcEndpoint:t,network:"solana"})})]})]}):null}let g=/*#__PURE__*/c.div.withConfig({displayName:"InstructionsBox",componentId:"sc-3551ef3c-0"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),y=/*#__PURE__*/c.header.withConfig({displayName:"InstructionsBoxHeader",componentId:"sc-3551ef3c-1"})(["display:flex;justify-content:space-between;align-items:center;padding:12px;background-color:var(--privy-color-background-2);"]),b=/*#__PURE__*/c.h4.withConfig({displayName:"HeaderTitle",componentId:"sc-3551ef3c-2"})(["font-size:14px;font-weight:500;line-height:19.6px;"]),x=/*#__PURE__*/c.div.withConfig({displayName:"InstructionsBoxContent",componentId:"sc-3551ef3c-3"})(["padding:12px;"]),k=/*#__PURE__*/c.div.withConfig({displayName:"NavigationButtonsConatiner",componentId:"sc-3551ef3c-4"})(["display:flex;gap:8px;align-items:center;"]),w=/*#__PURE__*/c(p).withConfig({displayName:"InteractiveLabel",componentId:"sc-3551ef3c-5"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;"]);export{u as SolanaTransactionDetails};
1
+ import{jsxs as o,jsx as n,Fragment as i}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ChevronDownIcon";import{useState as r}from"react";import{styled as e}from"styled-components";import{BackButton as c,NextButton as s}from"../ModalHeader.mjs";import{Rows as m,Row as a}from"../ui/layout/Row.mjs";import{LabelSm as l}from"../ui/typography/LabelSm.mjs";import{Value as p}from"../ui/typography/Value.mjs";import{SolanaPriceDisplay as d}from"./PriceDisplay.mjs";import{WalletLink as h}from"./WalletLink.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"../../configuration/context.mjs";import"../../config.mjs";import"../../configuration/defaultClientConfig.mjs";import"../../constants.mjs";import"../../configuration/login-methods.mjs";import"../../configuration/wallets.mjs";import"../../connectors/chains/index.mjs";import"../../connectors/chains/arbitrum.mjs";import"../../connectors/chains/arbitrumSepolia.mjs";import"../../connectors/chains/avalanche.mjs";import"../../connectors/chains/avalancheFuji.mjs";import"../../connectors/chains/base.mjs";import"../../connectors/chains/baseSepolia.mjs";import"../../connectors/chains/berachainArtio.mjs";import"../../connectors/chains/celo.mjs";import"../../connectors/chains/celoAlfajores.mjs";import"../../connectors/chains/filecoin.mjs";import"../../connectors/chains/filecoinCalibration.mjs";import"../../connectors/chains/garnetHolesky.mjs";import"../../connectors/chains/holesky.mjs";import"../../connectors/chains/linea.mjs";import"../../connectors/chains/lineaTestnet.mjs";import"../../connectors/chains/lukso.mjs";import"../../connectors/chains/mainnet.mjs";import"../../connectors/chains/optimism.mjs";import"../../connectors/chains/optimismSepolia.mjs";import"../../connectors/chains/polygon.mjs";import"../../connectors/chains/polygonAmoy.mjs";import"../../connectors/chains/redstone.mjs";import"../../connectors/chains/sepolia.mjs";import"../../connectors/chains/zora.mjs";import"../../connectors/chains/zoraSepolia.mjs";import"../../connectors/chains/zoraTestnet.mjs";import"../../connectors/chains/utils.mjs";import"../../lib/solana/index.mjs";import"../../theme.mjs";import"tinycolor2";import"../../lib/cybr53.mjs";import"../../hooks/internal-context.mjs";import"../../hooks/index.mjs";import"../ui/animation/LoadingSkeleton.mjs";import"@ethersproject/units";import"../../lib/ethers.mjs";import"@ethersproject/bignumber";import"@privy-io/js-sdk-core";import"../../utils/index.mjs";import"@ethersproject/providers";import"../../connectors/get-legacy-injected-providers.mjs";import"../../connectors/is-wallet-installed.mjs";import"../../errors.mjs";import"ofetch";import"../../lib/solana/transaction.mjs";import"../../utils/buffer/readBigInt64LE.mjs";const u=({instructions:e,fees:h,transactionInfo:u,solPrice:x,rpcEndpoint:v})=>{let A=e.reduce(((o,{amount:n,token:i})=>n&&"SOL"===i?.symbol?o+n:o),0n),[I,C]=r(0),[E,S]=r(!1),L=e[I];/*#__PURE__*/return o(m,{children:[/*#__PURE__*/o(a,{children:[/*#__PURE__*/n(l,{children:"Total"}),/*#__PURE__*/n(p,{children:/*#__PURE__*/n(d,{quantities:[A,h],tokenPrice:x})})]}),u&&u.action&&/*#__PURE__*/o(a,{children:[/*#__PURE__*/n(l,{children:"Action"}),/*#__PURE__*/n(p,{children:u.action})]}),/*#__PURE__*/o(a,{children:[/*#__PURE__*/n(l,{children:"Fees"}),/*#__PURE__*/n(p,{children:/*#__PURE__*/n(d,{quantities:[h||0n],tokenPrice:x})})]}),e.length>1?/*#__PURE__*/o(i,{children:[/*#__PURE__*/n(a,{children:/*#__PURE__*/o(b,{onClick:()=>S((o=>!o)),children:[/*#__PURE__*/n("span",{children:"Details"}),/*#__PURE__*/n(t,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:E?"rotate(180deg)":void 0}})]})}),E&&/*#__PURE__*/n(a,{children:/*#__PURE__*/o(f,{children:[/*#__PURE__*/o(g,{children:[/*#__PURE__*/o(y,{children:[I+1," of ",e.length," instructions"]}),/*#__PURE__*/o(w,{children:[I>0&&/*#__PURE__*/n(c,{backFn:()=>C((o=>o-1))}),I<e.length-1&&/*#__PURE__*/n(s,{nextFn:()=>C((o=>o+1))})]})]}),/*#__PURE__*/n(k,{children:/*#__PURE__*/n(j,{instruction:L,rpcEndpoint:v,solPrice:x})})]})})]}):/*#__PURE__*/n(j,{instruction:L,rpcEndpoint:v,solPrice:x,hideAmount:!0})]})};function j({instruction:i,rpcEndpoint:t,solPrice:r,hideAmount:e}){return i?/*#__PURE__*/o(m,{children:[!e&&!!i.amount&&/*#__PURE__*/o(a,{children:[/*#__PURE__*/n(l,{children:"Amount"}),/*#__PURE__*/n(p,{children:/*#__PURE__*/n(d,{quantities:[i.amount],tokenPrice:r,tokenSymbol:i.token?.symbol??"SOL",tokenDecimals:i.token?.decimals??9})})]}),i.to&&/*#__PURE__*/o(a,{children:[/*#__PURE__*/n(l,{children:"To"}),/*#__PURE__*/n(p,{children:/*#__PURE__*/n(h,{walletAddress:i.to,rpcEndpoint:t,network:"solana"})})]}),i.tokenAccount&&/*#__PURE__*/o(a,{children:[/*#__PURE__*/n(l,{children:"Token account"}),/*#__PURE__*/n(p,{children:/*#__PURE__*/n(h,{walletAddress:i.tokenAccount,rpcEndpoint:t,network:"solana"})})]}),i.tokenAccountOwner&&/*#__PURE__*/o(a,{children:[/*#__PURE__*/n(l,{children:"Token account owner"}),/*#__PURE__*/n(p,{children:/*#__PURE__*/n(h,{walletAddress:i.tokenAccountOwner,rpcEndpoint:t,network:"solana"})})]}),i.from&&/*#__PURE__*/o(a,{children:[/*#__PURE__*/n(l,{children:"From"}),/*#__PURE__*/n(p,{children:/*#__PURE__*/n(h,{walletAddress:i.from,rpcEndpoint:t,network:"solana"})})]})]}):null}let f=/*#__PURE__*/e.div.withConfig({displayName:"InstructionsBox",componentId:"sc-702e760-0"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),g=/*#__PURE__*/e.header.withConfig({displayName:"InstructionsBoxHeader",componentId:"sc-702e760-1"})(["display:flex;justify-content:space-between;align-items:center;padding:12px;background-color:var(--privy-color-background-2);"]),y=/*#__PURE__*/e.h4.withConfig({displayName:"HeaderTitle",componentId:"sc-702e760-2"})(["font-size:14px;font-weight:500;line-height:19.6px;"]),k=/*#__PURE__*/e.div.withConfig({displayName:"InstructionsBoxContent",componentId:"sc-702e760-3"})(["padding:12px;"]),w=/*#__PURE__*/e.div.withConfig({displayName:"NavigationButtonsConatiner",componentId:"sc-702e760-4"})(["display:flex;gap:8px;align-items:center;"]),b=/*#__PURE__*/e(l).withConfig({displayName:"InteractiveLabel",componentId:"sc-702e760-5"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;"]);export{u as SolanaTransactionDetails};
@@ -1 +1 @@
1
- const e="AZD8ITQ3ZQS63BQIJN3SPP767ZZY89SZJX",i="34357d3c125c2bcf2ce2bc3309d98715",r="https://auth.privy.io",t=2e4,p=1400,o=2500,v=4e3,s="1.99.1",n="ES256",y="privy.io",c="privy:token",a="privy-token",_="privy:refresh_token",d="privy-refresh-token",l="privy:pat",h="privy:id_token",k="privy-id-token",f="privy-session",u="privy:session_transfer_token",b="privy:wallet",m="privy:caid",S=e=>`privy:guest:${e}`,Z=e=>`privy:cross-app:${e}`,w="privy:state_code",j="privy:code_verifier",x="privy:headless_oauth",F="privy:oauth_disable_signup",J=e=>`privy:wallet:${e}`,g="privy:connectors",I="privy:connections",L="walletconnect",Q=3e4,X=12e4,$=1,q="0x1",H=3e4,P="https://api.moonpay.com/v1",z="https://api.moonpay.com/v1",A="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",B="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",C="0x420000000000000000000000000000000000000F",D=["function getL1Fee(bytes memory _data) external view returns (uint256)"],E="deprecated";export{$ as CHAIN_ID_MAINNET,m as CLIENT_ANALYTICS_ID_KEY,j as CODE_VERIFIER_KEY,I as CONNECTIONS_HISTORY_KEY,g as CONNECTORS_STATE_KEY,a as CUSTOMER_ACCESS_TOKEN_COOKIE_KEY,c as CUSTOMER_ACCESS_TOKEN_STORAGE_KEY,t as DEFAULT_API_TIMEOUT_MS,q as DEFAULT_NETWORK,r as DEFAULT_PRIVY_API_URL,X as DEFAULT_RPC_TIMEOUT,p as DEFAULT_SUCCESS_SCREEN_DURATION_MS,v as DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS,o as DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS,E as DEPRECATED_REFRESH_TOKEN,u as FORKED_TOKEN_STORAGE_KEY,x as HEADLESS_OAUTH_KEY,k as IDENTITY_TOKEN_COOKIE_KEY,h as IDENTITY_TOKEN_STORAGE_KEY,n as JWT_ALGORITHM,y as JWT_ISSUER,P as MOONPAY_API_URL,z as MOONPAY_API_URL_SANDBOX,A as MOONPAY_PUBLIC_KEY,B as MOONPAY_PUBLIC_KEY_SANDBOX,F as OAUTH_DISABLE_SIGNUP_KEY,D as OPTIMISM_STACK_GAS_PRICE_ORACLE_ABI,C as OPTIMISM_STACK_GAS_PRICE_ORACLE_ADDRESS,l as PRIVY_ACCESS_TOKEN_STORAGE_KEY,e as PRIVY_ETHERSCAN_ID,i as PRIVY_WALLETCONNECT_CLOUD_ID,b as PRIVY_WALLET_KEY_PREFIX,d as REFRESH_TOKEN_COOKIE_KEY,_ as REFRESH_TOKEN_STORAGE_KEY,f as SESSION_COOKIE_KEY,w as STATE_CODE_KEY,s as VERSION,Q as WALLET_CONNECT_INFURA_POLLING_INTERVAL,L as WALLET_CONNECT_STORAGE_KEY,H as WALLET_PROXY_TIMEOUT,S as getGuestCredentialStorageKey,J as getPrivyWalletKey,Z as getProviderAccessTokenStorageKey};
1
+ const e="AZD8ITQ3ZQS63BQIJN3SPP767ZZY89SZJX",i="34357d3c125c2bcf2ce2bc3309d98715",t="https://auth.privy.io",r=2e4,p=1400,o=2500,v=4e3,s="1.100.0-beta-20250110141708",n="ES256",y="privy.io",c="privy:token",a="privy-token",_="privy:refresh_token",d="privy-refresh-token",l="privy:pat",h="privy:id_token",k="privy-id-token",f="privy-session",u="privy:session_transfer_token",b="privy:wallet",m="privy:caid",S=e=>`privy:guest:${e}`,Z=e=>`privy:cross-app:${e}`,w="privy:state_code",j="privy:code_verifier",x="privy:headless_oauth",F="privy:oauth_disable_signup",J=e=>`privy:wallet:${e}`,g="privy:connectors",I="privy:connections",L="walletconnect",Q=3e4,X=12e4,$=1,q="0x1",H=3e4,P="https://api.moonpay.com/v1",z="https://api.moonpay.com/v1",A="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",B="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",C="0x420000000000000000000000000000000000000F",D=["function getL1Fee(bytes memory _data) external view returns (uint256)"],E="deprecated";export{$ as CHAIN_ID_MAINNET,m as CLIENT_ANALYTICS_ID_KEY,j as CODE_VERIFIER_KEY,I as CONNECTIONS_HISTORY_KEY,g as CONNECTORS_STATE_KEY,a as CUSTOMER_ACCESS_TOKEN_COOKIE_KEY,c as CUSTOMER_ACCESS_TOKEN_STORAGE_KEY,r as DEFAULT_API_TIMEOUT_MS,q as DEFAULT_NETWORK,t as DEFAULT_PRIVY_API_URL,X as DEFAULT_RPC_TIMEOUT,p as DEFAULT_SUCCESS_SCREEN_DURATION_MS,v as DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS,o as DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS,E as DEPRECATED_REFRESH_TOKEN,u as FORKED_TOKEN_STORAGE_KEY,x as HEADLESS_OAUTH_KEY,k as IDENTITY_TOKEN_COOKIE_KEY,h as IDENTITY_TOKEN_STORAGE_KEY,n as JWT_ALGORITHM,y as JWT_ISSUER,P as MOONPAY_API_URL,z as MOONPAY_API_URL_SANDBOX,A as MOONPAY_PUBLIC_KEY,B as MOONPAY_PUBLIC_KEY_SANDBOX,F as OAUTH_DISABLE_SIGNUP_KEY,D as OPTIMISM_STACK_GAS_PRICE_ORACLE_ABI,C as OPTIMISM_STACK_GAS_PRICE_ORACLE_ADDRESS,l as PRIVY_ACCESS_TOKEN_STORAGE_KEY,e as PRIVY_ETHERSCAN_ID,i as PRIVY_WALLETCONNECT_CLOUD_ID,b as PRIVY_WALLET_KEY_PREFIX,d as REFRESH_TOKEN_COOKIE_KEY,_ as REFRESH_TOKEN_STORAGE_KEY,f as SESSION_COOKIE_KEY,w as STATE_CODE_KEY,s as VERSION,Q as WALLET_CONNECT_INFURA_POLLING_INTERVAL,L as WALLET_CONNECT_STORAGE_KEY,H as WALLET_PROXY_TIMEOUT,S as getGuestCredentialStorageKey,J as getPrivyWalletKey,Z as getProviderAccessTokenStorageKey};
@@ -1 +1 @@
1
- import{getSolanaNetworkFromRpcEndpoint as t}from"./index.mjs";import{readBigInt64LEFromUint8Array as e,readBigInt64LE as n}from"../../utils/buffer/readBigInt64LE.mjs";const r=1e9,a="11111111111111111111111111111111",o="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",i="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";let s=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function c(t,e=6,n=!1,r=!1){let a=(parseFloat(t.toString())/1e9).toFixed(e).replace(/0+$/,"").replace(/\.$/,""),o=r?"":" SOL";return n?`${a}${o}`:`${"0"===a?"<0.001":a}${o}`}function u(t,e){let n=parseFloat(t.toString())/1e9,r=s.format(e*n);return"$0.00"===r?"<$0.01":r}function l({amount:t,fee:e,tokenPrice:n}){let r=BigInt(1e9*parseFloat(t)),a=r+e;return{fundingAmountInBaseUnit:r,fundingAmountInUsd:n?u(r,n):void 0,totalPriceInUsd:n?u(a,n):void 0,totalPriceInNativeCurrency:c(a),feePriceInNativeCurrency:c(e),feePriceInUsd:n?u(e,n):void 0}}function d(t){return"version"in t}function f(t,e){let n=(d(t)?t.message:t.compileMessage()).staticAccountKeys.find((t=>t.toBase58()===e));if(!n)throw Error(`Transaction does not contain public key ${e}`);return n}async function m(t,e){return BigInt((d(t)?(await e.getFeeForMessage(t.message)).value:await t.getEstimatedFee(e))??0)}function y(t,e){return{signature:t,parsedTransaction:e,fees:BigInt(e?.meta?.fee||0)}}async function p(t,e){let{value:n}=await e.simulateTransaction(t);return null==n.err&&n.logs?.every((t=>!/insufficient funds/gi.test(t)))}async function g({tx:t,connection:e,client:n}){let r=d(t)?t.message:t.compileMessage(),a=r.staticAccountKeys[0]?.toBase58()??"",o=await m(t,e),i={},s=[];for(let t of r.compiledInstructions){let a=r.staticAccountKeys[t.programIdIndex]?.toBase58()||"";if("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"!==a&&"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"!==a)"11111111111111111111111111111111"!==a?s.push({type:"unknown",program:a}):s.push(await I(t,r));else{let a=await A(t,r,e,n,i);s.push(a),i[a.token.address]=a.token}}return{spender:a,fee:o,instructions:s}}function B(t,r){try{return e(t,r)}catch{}try{return t.readBigInt64LE(r)}catch{}let a=Buffer.from(t);try{return n(a)}catch{}try{return a.subarray(r).readBigInt64LE()}catch{}try{return a.readBigInt64LE(r)}catch{}return 0n}async function A(e,n,r,a,o){let[i,s,c]=e.accountKeyIndexes.map((t=>n.staticAccountKeys[t]));if(!i||!s||!c)throw Error("Invalid instruction");let u=await r.getParsedAccountInfo(s,"confirmed"),l=u.value?.data,d=l?.parsed?.info?.owner,f=l?.parsed?.info?.mint??"",m=o[f];if(!m){let e=await a.getSplTokenMetadata({mintAddress:f,cluster:t(r.rpcEndpoint)});e&&(m={address:f,symbol:e.symbol,decimals:e.decimals})}let y=m?.symbol??"",p=m?.decimals??l?.parsed?.info?.tokenAmount?.decimals??9,g=B(e.data,1);return{type:"spl-transfer",fromAta:i.toBase58(),fromAccount:c.toBase58(),toAta:s.toBase58(),toAccount:d,value:g,token:{symbol:y,decimals:p,address:f}}}async function I(t,e){let[n,r]=t.accountKeyIndexes.map((t=>e.staticAccountKeys[t]));if(!n||!r)throw Error("Invalid instruction");let a=B(t.data,4);return{type:"sol-transfer",fromAccount:n.toBase58(),toAccount:r.toBase58(),value:a,token:{symbol:"SOL",decimals:9}}}export{r as LAMPORTS_PER_SOL,a as SYSTEM_PROGRAM_ID,i as TOKEN_2022_PROGRAM_ID,o as TOKEN_PROGRAM_ID,y as createSolanaTransactionReceipt,u as getDollarsFromLamport,c as getNativeCurrencyFromLamports,l as getSolanaFormattedAmounts,m as getTransactionFees,f as getWalletPublicKeyFromTransaction,p as hasSufficientFunds,d as isVersionedTransaction,g as parseSolanaTransaction};
1
+ import{getSolanaNetworkFromRpcEndpoint as t}from"./index.mjs";import{readBigInt64LEFromUint8Array as e,readBigInt64LE as n}from"../../utils/buffer/readBigInt64LE.mjs";const a=1e9,o="11111111111111111111111111111111",r="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",i="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",s="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";let c=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function u(t,e=6,n=!1,a=!1){let o=(parseFloat(t.toString())/1e9).toFixed(e).replace(/0+$/,"").replace(/\.$/,""),r=a?"":" SOL";return n?`${o}${r}`:`${"0"===o?"<0.001":o}${r}`}function l(t,e){let n=parseFloat(t.toString())/1e9,a=c.format(e*n);return"$0.00"===a?"<$0.01":a}function d({amount:t,fee:e,tokenPrice:n}){let a=BigInt(1e9*parseFloat(t)),o=a+e;return{fundingAmountInBaseUnit:a,fundingAmountInUsd:n?l(a,n):void 0,totalPriceInUsd:n?l(o,n):void 0,totalPriceInNativeCurrency:u(o),feePriceInNativeCurrency:u(e),feePriceInUsd:n?l(e,n):void 0}}function f(t){return"version"in t}function m(t,e){let n=(f(t)?t.message:t.compileMessage()).staticAccountKeys.find((t=>t.toBase58()===e));if(!n)throw Error(`Transaction does not contain public key ${e}`);return n}async function y(t,e){return BigInt((f(t)?(await e.getFeeForMessage(t.message)).value:await t.getEstimatedFee(e))??0)}function p(t,e){return{signature:t,parsedTransaction:e,fees:BigInt(e?.meta?.fee||0)}}async function A(t,e){let{value:n}=await e.simulateTransaction(t);return null==n.err&&n.logs?.every((t=>!/insufficient funds/gi.test(t)))}async function g({tx:t,connection:e,client:n}){let a=f(t)?t.message:t.compileMessage(),o=a.staticAccountKeys[0]?.toBase58()??"",r=await y(t,e),i={},s={},c=[];for(let t of a.compiledInstructions){let o=a.staticAccountKeys[t.programIdIndex]?.toBase58()||"";if("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"!==o&&"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"!==o)if("11111111111111111111111111111111"!==o)if("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"!==o)c.push({type:"unknown",program:o});else{let e=function(t,e){let[n,a,o,r]=t.accountKeyIndexes.map((t=>e.staticAccountKeys[t]));if(n&&a&&o&&r)return{type:"ata-creation",payer:n.toBase58(),ata:a.toBase58(),owner:o.toBase58(),mint:r.toBase58()}}(t,a);e&&(c.push(e),s[e.ata]={owner:e.owner,mint:e.mint})}else c.push(await b(t,a));else{let o=await I(t,a,e,n,i,s);c.push(o),i[o.token.address]=o.token,s[o.fromAta]??={owner:o.fromAccount,mint:o.token.address},o.toAccount&&(s[o.toAta]??={owner:o.toAccount,mint:o.token.address})}}return c.some((t=>"ata-creation"!==t.type))&&(c=c.filter((t=>"ata-creation"!==t.type))),{spender:o,fee:r,instructions:c}}function B(t,a){try{return e(t,a)}catch{}try{return t.readBigInt64LE(a)}catch{}let o=Buffer.from(t);try{return n(o)}catch{}try{return o.subarray(a).readBigInt64LE()}catch{}try{return o.readBigInt64LE(a)}catch{}return 0n}async function I(e,n,a,o,r,i){let s,c,[u,l,d]=e.accountKeyIndexes.map((t=>n.staticAccountKeys[t]));if(!u||!l||!d)throw Error("Invalid instruction");let f="",m=i[l.toBase58()];if(m)s=m.owner,f=m.mint;else{let t=await a.getParsedAccountInfo(l,"confirmed"),e=t.value?.data;s=e?.parsed?.info?.owner,f=e?.parsed?.info?.mint??"",c=e?.parsed?.info?.tokenAmount?.decimals}if(!f){let t=await a.getParsedAccountInfo(u,"confirmed"),e=t.value?.data;f=e?.parsed?.info?.mint??""}let y=r[f];if(f&&!y){let e=await o.getSplTokenMetadata({mintAddress:f,cluster:t(a.rpcEndpoint)});e&&(y={address:f,symbol:e.symbol,decimals:e.decimals})}let p=y?.symbol??"";c??=y?.decimals??9;let A=B(e.data,1);return{type:"spl-transfer",fromAta:u.toBase58(),fromAccount:d.toBase58(),toAta:l.toBase58(),toAccount:s,value:A,token:{symbol:p,decimals:c,address:f}}}async function b(t,e){let[n,a]=t.accountKeyIndexes.map((t=>e.staticAccountKeys[t]));if(!n||!a)throw Error("Invalid instruction");let o=B(t.data,4);return{type:"sol-transfer",fromAccount:n.toBase58(),toAccount:a.toBase58(),value:o,token:{symbol:"SOL",decimals:9}}}export{s as ASSOCIATED_TOKEN_PROGRAM_ID,a as LAMPORTS_PER_SOL,o as SYSTEM_PROGRAM_ID,i as TOKEN_2022_PROGRAM_ID,r as TOKEN_PROGRAM_ID,p as createSolanaTransactionReceipt,l as getDollarsFromLamport,u as getNativeCurrencyFromLamports,d as getSolanaFormattedAmounts,y as getTransactionFees,m as getWalletPublicKeyFromTransaction,A as hasSufficientFunds,f as isVersionedTransaction,g as parseSolanaTransaction};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useState as n,useMemo as t,useEffect as e}from"react";import{formatUnits as r}from"viem";import{SolanaClient as s}from"@privy-io/js-sdk-core";import{getImportedPrivySolanaWallet as i,getPrivyPrimaryWallet as a,getSolanaSigningAndRootWallet as c,getEntropyDetailsFromAccount as m}from"../../client/user.mjs";import{useAppConfig as l}from"../../configuration/context.mjs";import{sendSolanaTransaction as p}from"../../embedded-wallets/solana/transaction.mjs";import{usePrivyInternal as d}from"../../hooks/internal-context.mjs";import{usePrivyModal as u}from"../../hooks/modal-context.mjs";import{usePrivyContext as h}from"../../hooks/privy-context.mjs";import{useGetSolPrice as f}from"../../hooks/useGetSolPrice.mjs";import{getSolanaNetworkFromRpcEndpoint as j}from"../../lib/solana/index.mjs";import{getNativeCurrencyFromLamports as g,parseSolanaTransaction as y,isVersionedTransaction as b,getDollarsFromLamport as k,createSolanaTransactionReceipt as S}from"../../lib/solana/transaction.mjs";import{ErrorScreenView as w}from"../ErrorScreen.mjs";import{SendSolanaTransactionScreenView as T}from"../SendTransactionScreen/SendTransactionScreenView.mjs";import{TransactionErrorView as v}from"../SendTransactionScreen/TransactionErrorView.mjs";import{ModalScreen as I}from"../index.mjs";import{SolanaTransactionReceiptView as C}from"./SolanaTransactionReceiptView.mjs";import"@ethersproject/address";import"../../config.mjs";import"../../configuration/defaultClientConfig.mjs";import"../../constants.mjs";import"../../configuration/login-methods.mjs";import"../../configuration/wallets.mjs";import"../../connectors/chains/index.mjs";import"../../connectors/chains/arbitrum.mjs";import"../../connectors/chains/arbitrumSepolia.mjs";import"../../connectors/chains/avalanche.mjs";import"../../connectors/chains/avalancheFuji.mjs";import"../../connectors/chains/base.mjs";import"../../connectors/chains/baseSepolia.mjs";import"../../connectors/chains/berachainArtio.mjs";import"../../connectors/chains/celo.mjs";import"../../connectors/chains/celoAlfajores.mjs";import"../../connectors/chains/filecoin.mjs";import"../../connectors/chains/filecoinCalibration.mjs";import"../../connectors/chains/garnetHolesky.mjs";import"../../connectors/chains/holesky.mjs";import"../../connectors/chains/linea.mjs";import"../../connectors/chains/lineaTestnet.mjs";import"../../connectors/chains/lukso.mjs";import"../../connectors/chains/mainnet.mjs";import"../../connectors/chains/optimism.mjs";import"../../connectors/chains/optimismSepolia.mjs";import"../../connectors/chains/polygon.mjs";import"../../connectors/chains/polygonAmoy.mjs";import"../../connectors/chains/redstone.mjs";import"../../connectors/chains/sepolia.mjs";import"../../connectors/chains/zora.mjs";import"../../connectors/chains/zoraSepolia.mjs";import"../../connectors/chains/zoraTestnet.mjs";import"../../connectors/chains/utils.mjs";import"../../theme.mjs";import"tinycolor2";import"../../lib/cybr53.mjs";import"../../utils/buffer/readBigInt64LE.mjs";import"../../hooks/index.mjs";import"../../components/PrefetchedImage.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/PhoneIcon";import"styled-components";import"../../components/Button.mjs";import"../../components/Loader.mjs";import"../../components/CircleBorder.mjs";import"../../components/ModalHeader.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"../../components/layout/StackedContainer.mjs";import"../../embedded-wallets/errors.mjs";import"../../embedded-wallets/types.mjs";import"../../errors.mjs";import"ofetch";import"../../hooks/captcha-context.mjs";import"../../utils/index.mjs";import"@ethersproject/providers";import"../../connectors/get-legacy-injected-providers.mjs";import"../../connectors/is-wallet-installed.mjs";import"../../svg/lock-closed.mjs";import"@heroicons/react/24/outline";import"../../components/ModalFooter.mjs";import"../../svg/protected-by-privy.mjs";import"../../components/ui/layout/Row.mjs";import"../../components/ui/typography/ErrorMessage.mjs";import"../../components/ui/typography/LabelSm.mjs";import"../../components/ui/typography/Subtitle.mjs";import"../../components/ui/typography/Title.mjs";import"../../components/ui/typography/Value.mjs";import"../../components/ui/animation/LoadingSkeleton.mjs";import"../../components/ui/wallet/Address.mjs";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"../../components/ui/wallet/WalletInfoCard.mjs";import"../../components/ui/chips/Chip.mjs";import"../../components/ui/layout/Column.mjs";import"../../components/ui/typography/LabelXs.mjs";import"../../components/ui/wallet/shared.mjs";import"../LandingScreen/styles.mjs";import"../SendTransactionScreen/TransactionDetail.mjs";import"../SendTransactionScreen/useTransactionDetails.mjs";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"../SendTransactionScreen/EthersTransactionError.mjs";import"@ethersproject/logger";import"@heroicons/react/24/outline/CheckCircleIcon";import"../../components/CircleBackground.mjs";import"../../components/Layouts.mjs";import"../../components/ScreenHeader.mjs";import"../../components/embedded-wallets/SolanaTransactionDetails.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";import"../../components/embedded-wallets/PriceDisplay.mjs";import"@ethersproject/units";import"../../lib/ethers.mjs";import"@ethersproject/bignumber";import"../../components/embedded-wallets/WalletLink.mjs";const x=()=>{let{data:x,onUserCloseViaDialogOrKeybindRef:A,setModalData:E,navigate:L}=u(),{client:O,closePrivyModal:D,walletProxy:P}=d(),B=l(),{user:M,getAccessToken:F}=h(),[W,R]=n(x?.sendSolanaTransaction?.transactionRequest),[U,V]=n(),[H,N]=n(),[$,q]=n(0),[z,_]=n({value:0n,isLoading:!1}),[G,X]=n(!1),[K,Q]=n(),[J,Y]=n(),Z=x?.sendSolanaTransaction?.connection,oo=x?.sendSolanaTransaction?.transactingWallet,no=U?.instructions.length??1,to=oo?.imported?i(M):a(M),eo=j(Z?.rpcEndpoint||""),ro="fiat-currency"===B.embeddedWallets.priceDisplay.primary,{solPrice:so,isSolPriceLoading:io}=f({enabled:ro}),ao=t((()=>{let o,n;if(!U)return;let t=U.spender;0===$&&oo?.address===t&&(o=g(U.fee));let e=g(z.value,3,!0),s=U.instructions[$];if(!s)return{fee:o,spender:t,balance:e};if("unknown"===s.type)return{fee:o,spender:t,program:s.program,balance:e};let i=s.fromAccount,a="sol-transfer"===s.type?s.toAccount:s.toAccount||s.toAta,c="spl-transfer"===s.type?s.token.address:void 0;return null!=o&&"SOL"===s.token.symbol&&(n=g(s.value+U.fee)),{fee:o,spender:t,from:i,to:a,tokenAddress:c,amount:`${r(s.value,s.token.decimals)} ${s.token.symbol}`.trim(),total:n,balance:e}}),[U,$,oo?.address,z]),co=t((()=>{let o,n;if(!U||!ro||!so||io)return;function t(...o){return k(o.reduce(((o,n)=>o+n),0n),so??0)}0===$&&oo?.address===U.spender&&(o=t(U.fee));let e=t(z.value),s=U.instructions[$];return s&&"unknown"!==s.type?(null!=o&&"SOL"===s.token.symbol&&(n=t(s.value,U.fee)),{fee:o,amount:"SOL"===s.token.symbol?t(s.value):`${r(s.value,s.token.decimals)} ${s.token.symbol}`.trim(),total:n,balance:e}):{fee:o,balance:e}}),[U,ro,so,io,oo?.address,$,z]),mo=t((()=>{if(!U||z.isLoading||$>0)return!1;let o=U.instructions[$];if(!o)return!1;let n=0n;return oo?.address===U.spender&&(n+=U.fee),"unknown"!==o.type&&oo?.address===o.fromAccount&&"SOL"===o.token.symbol&&(n+=o.value),z.value<n}),[U,z,$]);if(e((()=>{!async function(){if(W&&Z&&O)try{N(void 0);let o=await y({tx:W,connection:Z,client:O});V(o),q(0)}catch(o){console.error("Failed to prepare transaction",o),N(o)}}()}),[W,Z,O]),e((()=>{(async function(){if(!oo||!Z)return;_({value:z.value,isLoading:!0});let o=new s({name:"mainnet-beta",rpcUrl:Z.rpcEndpoint});_({value:await o.getBalance(oo.address).catch((()=>0n))??0n,isLoading:!1})})().catch(console.error)}),[U,Z]),!(W&&x?.sendSolanaTransaction&&oo&&Z)){let n=Error("Invalid transaction request");/*#__PURE__*/return o(w,{error:n,onClick:()=>{x?.sendSolanaTransaction?.onFailure(n),D({shouldCallAuthOnSuccess:!1})}})}let lo=()=>{if(!G)return K?x?.sendSolanaTransaction?.onSuccess(K):(x?.sendSolanaTransaction?.onFailure(J??H??Error("User exited the modal before submitting the transaction")),q(0)),D({shouldCallAuthOnSuccess:!1})};A.current=lo;let po=x.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/o("img",{src:x.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:x.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,uo=!!(x.funding&&x.funding.supportedOptions.length>0),ho=mo&&uo;return K?/*#__PURE__*/o(C,{instructions:U?.instructions.map((o=>"unknown"===o.type?{}:"spl-transfer"===o.type?{from:o.fromAccount,to:o.toAccount||o.toAta,amount:o.value,token:o.token}:{from:o.fromAccount,to:o.toAccount,amount:o.value,token:o.token}))??[],fees:0===$?K.fees:0n,onClose:lo,transactionInfo:x.sendTransaction?.uiOptions.transactionInfo,solPrice:so,receiptHeader:x.sendTransaction?.uiOptions.successHeader,receiptDescription:x.sendTransaction?.uiOptions.successDescription,rpcEndpoint:Z.rpcEndpoint}):J?/*#__PURE__*/o(v,{transactionError:J,connection:Z,onClose:lo,network:"solana",onRetry:async()=>{Y(void 0);let{blockhash:o}=await Z.getLatestBlockhash();b(W)?W.message.recentBlockhash=o:W.recentBlockhash=o,R(W)}}):/*#__PURE__*/o(T,{img:po,title:x.sendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:x.sendTransaction?.uiOptions?.description||`${B.name} wants your permission to approve the following transaction.`,cta:ho?"Add funds":x.sendTransaction?.uiOptions?.buttonText||"Approve",transactionIndex:$,maxIndex:no-1,network:"mainnet-beta"==eo?"Solana":eo,blockExplorerUrl:"https://explorer.solana.com",total:ro?co?.total:ao?.total,amount:ro?co?.amount:ao?.amount,fee:ro?co?.fee:ao?.fee,balance:ro?co?.balance:ao?.balance,from:ao?.from,to:ao?.to,tokenAddress:ao?.tokenAddress,transactingWalletAddress:oo.address,programAddress:ao?.program,disabled:mo&&!uo,isSubmitting:G,isPreparing:!U||z.isLoading,isTokenPriceLoading:ro&&io,isMissingFunds:mo,submitError:J??void 0,parseError:H,onClick:ho?async()=>{if(!oo)return;if(!uo)throw Error("Funding wallet is not enabled");let o=I.FUNDING_METHOD_SELECTION_SCREEN;E({...x,funding:{...x.funding,methodScreen:o}}),L(o)}:async()=>{if($<(U?.instructions.length??1)-1)q($+1);else try{X(!0);let o=await F();if(G||!o||!oo||!P||!M||!to)return;let{rootWallet:n}=c(M,oo.address);if(!n)throw Error("No root wallet for transacting wallet found");let{entropyId:t,entropyIdVerifier:e}=m(n),{signature:r,receipt:s}=await p({tx:W,accessToken:o,connection:Z,walletProxy:P,entropyId:t,entropyIdVerifier:e,transactingWalletAddress:oo.address,transactingWalletIndex:oo.walletIndex??0,transactionOptions:x.sendSolanaTransaction?.transactionOptions});Q(S(r,s))}catch(o){console.warn({transaction:W,error:o}),Y(o)}finally{X(!1)}},onClose:lo,onBack:$>0&&no>1?()=>q($-1):void 0})};export{x as SendSolanaTransactionScreen};
1
+ import{jsx as o}from"react/jsx-runtime";import{useState as n,useMemo as t,useEffect as e}from"react";import{formatUnits as r}from"viem";import{SolanaClient as s}from"@privy-io/js-sdk-core";import{getImportedPrivySolanaWallet as i,getPrivyPrimaryWallet as a,getSolanaSigningAndRootWallet as c,getEntropyDetailsFromAccount as m}from"../../client/user.mjs";import{useAppConfig as l}from"../../configuration/context.mjs";import{sendSolanaTransaction as p}from"../../embedded-wallets/solana/transaction.mjs";import{usePrivyInternal as d}from"../../hooks/internal-context.mjs";import{usePrivyModal as u}from"../../hooks/modal-context.mjs";import{usePrivyContext as h}from"../../hooks/privy-context.mjs";import{useGetSolPrice as f}from"../../hooks/useGetSolPrice.mjs";import{getSolanaNetworkFromRpcEndpoint as j}from"../../lib/solana/index.mjs";import{getNativeCurrencyFromLamports as g,parseSolanaTransaction as y,isVersionedTransaction as k,getDollarsFromLamport as b,createSolanaTransactionReceipt as S}from"../../lib/solana/transaction.mjs";import{ErrorScreenView as w}from"../ErrorScreen.mjs";import{SendSolanaTransactionScreenView as T}from"../SendTransactionScreen/SendTransactionScreenView.mjs";import{TransactionErrorView as v}from"../SendTransactionScreen/TransactionErrorView.mjs";import{ModalScreen as A}from"../index.mjs";import{SolanaTransactionReceiptView as I}from"./SolanaTransactionReceiptView.mjs";import"@ethersproject/address";import"../../config.mjs";import"../../configuration/defaultClientConfig.mjs";import"../../constants.mjs";import"../../configuration/login-methods.mjs";import"../../configuration/wallets.mjs";import"../../connectors/chains/index.mjs";import"../../connectors/chains/arbitrum.mjs";import"../../connectors/chains/arbitrumSepolia.mjs";import"../../connectors/chains/avalanche.mjs";import"../../connectors/chains/avalancheFuji.mjs";import"../../connectors/chains/base.mjs";import"../../connectors/chains/baseSepolia.mjs";import"../../connectors/chains/berachainArtio.mjs";import"../../connectors/chains/celo.mjs";import"../../connectors/chains/celoAlfajores.mjs";import"../../connectors/chains/filecoin.mjs";import"../../connectors/chains/filecoinCalibration.mjs";import"../../connectors/chains/garnetHolesky.mjs";import"../../connectors/chains/holesky.mjs";import"../../connectors/chains/linea.mjs";import"../../connectors/chains/lineaTestnet.mjs";import"../../connectors/chains/lukso.mjs";import"../../connectors/chains/mainnet.mjs";import"../../connectors/chains/optimism.mjs";import"../../connectors/chains/optimismSepolia.mjs";import"../../connectors/chains/polygon.mjs";import"../../connectors/chains/polygonAmoy.mjs";import"../../connectors/chains/redstone.mjs";import"../../connectors/chains/sepolia.mjs";import"../../connectors/chains/zora.mjs";import"../../connectors/chains/zoraSepolia.mjs";import"../../connectors/chains/zoraTestnet.mjs";import"../../connectors/chains/utils.mjs";import"../../theme.mjs";import"tinycolor2";import"../../lib/cybr53.mjs";import"../../utils/buffer/readBigInt64LE.mjs";import"../../hooks/index.mjs";import"../../components/PrefetchedImage.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/PhoneIcon";import"styled-components";import"../../components/Button.mjs";import"../../components/Loader.mjs";import"../../components/CircleBorder.mjs";import"../../components/ModalHeader.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"../../components/layout/StackedContainer.mjs";import"../../embedded-wallets/errors.mjs";import"../../embedded-wallets/types.mjs";import"../../errors.mjs";import"ofetch";import"../../hooks/captcha-context.mjs";import"../../utils/index.mjs";import"@ethersproject/providers";import"../../connectors/get-legacy-injected-providers.mjs";import"../../connectors/is-wallet-installed.mjs";import"../../svg/lock-closed.mjs";import"@heroicons/react/24/outline";import"../../components/ModalFooter.mjs";import"../../svg/protected-by-privy.mjs";import"../../components/ui/layout/Row.mjs";import"../../components/ui/typography/ErrorMessage.mjs";import"../../components/ui/typography/LabelSm.mjs";import"../../components/ui/typography/Subtitle.mjs";import"../../components/ui/typography/Title.mjs";import"../../components/ui/typography/Value.mjs";import"../../components/ui/animation/LoadingSkeleton.mjs";import"../../components/ui/wallet/Address.mjs";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"../../components/ui/wallet/WalletInfoCard.mjs";import"../../components/ui/chips/Chip.mjs";import"../../components/ui/layout/Column.mjs";import"../../components/ui/typography/LabelXs.mjs";import"../../components/ui/wallet/shared.mjs";import"../LandingScreen/styles.mjs";import"../SendTransactionScreen/TransactionDetail.mjs";import"../SendTransactionScreen/useTransactionDetails.mjs";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"../SendTransactionScreen/EthersTransactionError.mjs";import"@ethersproject/logger";import"@heroicons/react/24/outline/CheckCircleIcon";import"../../components/CircleBackground.mjs";import"../../components/Layouts.mjs";import"../../components/ScreenHeader.mjs";import"../../components/embedded-wallets/SolanaTransactionDetails.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";import"../../components/embedded-wallets/PriceDisplay.mjs";import"@ethersproject/units";import"../../lib/ethers.mjs";import"@ethersproject/bignumber";import"../../components/embedded-wallets/WalletLink.mjs";const C=()=>{let{data:C,onUserCloseViaDialogOrKeybindRef:x,setModalData:E,navigate:O}=u(),{client:L,closePrivyModal:D,walletProxy:P}=d(),B=l(),{user:M,getAccessToken:F}=h(),[W,R]=n(C?.sendSolanaTransaction?.transactionRequest),[U,V]=n(),[H,N]=n(),[$,q]=n(0),[z,_]=n({value:0n,isLoading:!1}),[G,X]=n(!1),[K,Q]=n(),[J,Y]=n(),Z=C?.sendSolanaTransaction?.connection,oo=C?.sendSolanaTransaction?.transactingWallet,no=U?.instructions.length??1,to=oo?.imported?i(M):a(M),eo=j(Z?.rpcEndpoint||""),ro="fiat-currency"===B.embeddedWallets.priceDisplay.primary,{solPrice:so,isSolPriceLoading:io}=f({enabled:ro}),ao=t((()=>{let o,n;if(!U)return;let t=U.spender;0===$&&oo?.address===t&&(o=g(U.fee));let e=g(z.value,3,!0),s=U.instructions[$];if(!s)return{fee:o,spender:t,balance:e};if("unknown"===s.type)return{fee:o,spender:t,program:s.program,balance:e};if("ata-creation"===s.type)return{fee:o,spender:t,balance:e,tokenAccountOwner:s.owner,tokenAccount:s.ata,tokenAddress:s.mint};let i=s.fromAccount,a="sol-transfer"===s.type?s.toAccount:s.toAccount||s.toAta,c="spl-transfer"===s.type?s.token.address:void 0;return null!=o&&"SOL"===s.token.symbol&&(n=g(s.value+U.fee)),{fee:o,spender:t,from:i,to:a,tokenAddress:c,amount:`${r(s.value,s.token.decimals)} ${s.token.symbol}`.trim(),total:n,balance:e}}),[U,$,oo?.address,z]),co=t((()=>{let o,n;if(!U||!ro||!so||io)return;function t(...o){return b(o.reduce(((o,n)=>o+n),0n),so??0)}0===$&&oo?.address===U.spender&&(o=t(U.fee));let e=t(z.value),s=U.instructions[$];return s&&"unknown"!==s.type&&"ata-creation"!==s.type?(null!=o&&"SOL"===s.token.symbol&&(n=t(s.value,U.fee)),{fee:o,amount:"SOL"===s.token.symbol?t(s.value):`${r(s.value,s.token.decimals)} ${s.token.symbol}`.trim(),total:n,balance:e}):{fee:o,balance:e}}),[U,ro,so,io,oo?.address,$,z]),mo=t((()=>{if(!U||z.isLoading||$>0)return!1;let o=U.instructions[$];if(!o)return!1;let n=0n;return oo?.address===U.spender&&(n+=U.fee),"value"in o&&oo?.address===o.fromAccount&&"SOL"===o.token.symbol&&(n+=o.value),z.value<n}),[U,z,$]);if(e((()=>{!async function(){if(W&&Z&&L)try{N(void 0);let o=await y({tx:W,connection:Z,client:L});V(o),q(0)}catch(o){console.error("Failed to prepare transaction",o),N(o)}}()}),[W,Z,L]),e((()=>{(async function(){if(!oo||!Z)return;_({value:z.value,isLoading:!0});let o=new s({name:"mainnet-beta",rpcUrl:Z.rpcEndpoint});_({value:await o.getBalance(oo.address).catch((()=>0n))??0n,isLoading:!1})})().catch(console.error)}),[U,Z]),!(W&&C?.sendSolanaTransaction&&oo&&Z)){let n=Error("Invalid transaction request");/*#__PURE__*/return o(w,{error:n,onClick:()=>{C?.sendSolanaTransaction?.onFailure(n),D({shouldCallAuthOnSuccess:!1})}})}let lo=()=>{if(!G)return K?C?.sendSolanaTransaction?.onSuccess(K):(C?.sendSolanaTransaction?.onFailure(J??H??Error("User exited the modal before submitting the transaction")),q(0)),D({shouldCallAuthOnSuccess:!1})};x.current=lo;let po=C.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/o("img",{src:C.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:C.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,uo=!!(C.funding&&C.funding.supportedOptions.length>0),ho=mo&&uo;return K?/*#__PURE__*/o(I,{instructions:U?.instructions.reduce(((o,n)=>("ata-creation"===n.type&&o.push({tokenAccountOwner:n.owner,tokenAccount:n.ata}),"spl-transfer"===n.type&&o.push({from:n.fromAccount,to:n.toAccount||n.toAta,amount:n.value,token:n.token}),"sol-transfer"===n.type&&o.push({from:n.fromAccount,to:n.toAccount,amount:n.value,token:n.token}),o)),[])??[],fees:0===$?K.fees:0n,onClose:lo,transactionInfo:C.sendTransaction?.uiOptions.transactionInfo,solPrice:so,receiptHeader:C.sendTransaction?.uiOptions.successHeader,receiptDescription:C.sendTransaction?.uiOptions.successDescription,rpcEndpoint:Z.rpcEndpoint}):J?/*#__PURE__*/o(v,{transactionError:J,connection:Z,onClose:lo,network:"solana",onRetry:async()=>{Y(void 0);let{blockhash:o}=await Z.getLatestBlockhash();k(W)?W.message.recentBlockhash=o:W.recentBlockhash=o,R(W)}}):/*#__PURE__*/o(T,{img:po,title:C.sendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:C.sendTransaction?.uiOptions?.description||`${B.name} wants your permission to approve the following transaction.`,cta:ho?"Add funds":C.sendTransaction?.uiOptions?.buttonText||"Approve",transactionIndex:$,maxIndex:no-1,network:"mainnet-beta"==eo?"Solana":eo,blockExplorerUrl:"https://explorer.solana.com",total:ro?co?.total:ao?.total,amount:ro?co?.amount:ao?.amount,fee:ro?co?.fee:ao?.fee,balance:ro?co?.balance:ao?.balance,from:ao?.from,to:ao?.to,tokenAccount:ao?.tokenAccount,tokenAccountOwner:ao?.tokenAccountOwner,tokenAddress:ao?.tokenAddress,transactingWalletAddress:oo.address,programAddress:ao?.program,disabled:mo&&!uo,isSubmitting:G,isPreparing:!U||z.isLoading,isTokenPriceLoading:ro&&io,isMissingFunds:mo,submitError:J??void 0,parseError:H,onClick:ho?async()=>{if(!oo)return;if(!uo)throw Error("Funding wallet is not enabled");let o=A.FUNDING_METHOD_SELECTION_SCREEN;E({...C,funding:{...C.funding,methodScreen:o}}),O(o)}:async()=>{if($<(U?.instructions.length??1)-1)q($+1);else try{X(!0);let o=await F();if(G||!o||!oo||!P||!M||!to)return;let{rootWallet:n}=c(M,oo.address);if(!n)throw Error("No root wallet for transacting wallet found");let{entropyId:t,entropyIdVerifier:e}=m(n),{signature:r,receipt:s}=await p({tx:W,accessToken:o,connection:Z,walletProxy:P,entropyId:t,entropyIdVerifier:e,transactingWalletAddress:oo.address,transactingWalletIndex:oo.walletIndex??0,transactionOptions:C.sendSolanaTransaction?.transactionOptions});Q(S(r,s))}catch(o){console.warn({transaction:W,error:o}),Y(o)}finally{X(!1)}},onClose:lo,onBack:$>0&&no>1?()=>q($-1):void 0})};export{C as SendSolanaTransactionScreen};
@@ -1 +1 @@
1
- import{jsxs as o,Fragment as t,jsx as n}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/CheckCircleIcon";import{styled as r}from"styled-components";import{PrimaryButton as s}from"../../components/Button.mjs";import{CircleBackground as e}from"../../components/CircleBackground.mjs";import{RefactorSpacerBottom as m}from"../../components/Layouts.mjs";import{BlobbyFooter as c}from"../../components/ModalFooter.mjs";import{ModalHeader as p}from"../../components/ModalHeader.mjs";import{CenteredScreenHeader as a}from"../../components/ScreenHeader.mjs";import{SolanaTransactionDetails as l}from"../../components/embedded-wallets/SolanaTransactionDetails.mjs";import j from"../../components/layout/StackedContainer.mjs";import{Grow as h}from"../LandingScreen/styles.mjs";import"../../components/Loader.mjs";import"../../svg/protected-by-privy.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"../../configuration/context.mjs";import"react";import"../../config.mjs";import"../../configuration/defaultClientConfig.mjs";import"../../constants.mjs";import"../../configuration/login-methods.mjs";import"../../configuration/wallets.mjs";import"../../connectors/chains/index.mjs";import"../../connectors/chains/arbitrum.mjs";import"../../connectors/chains/arbitrumSepolia.mjs";import"../../connectors/chains/avalanche.mjs";import"../../connectors/chains/avalancheFuji.mjs";import"../../connectors/chains/base.mjs";import"../../connectors/chains/baseSepolia.mjs";import"../../connectors/chains/berachainArtio.mjs";import"../../connectors/chains/celo.mjs";import"../../connectors/chains/celoAlfajores.mjs";import"../../connectors/chains/filecoin.mjs";import"../../connectors/chains/filecoinCalibration.mjs";import"../../connectors/chains/garnetHolesky.mjs";import"../../connectors/chains/holesky.mjs";import"../../connectors/chains/linea.mjs";import"../../connectors/chains/lineaTestnet.mjs";import"../../connectors/chains/lukso.mjs";import"../../connectors/chains/mainnet.mjs";import"../../connectors/chains/optimism.mjs";import"../../connectors/chains/optimismSepolia.mjs";import"../../connectors/chains/polygon.mjs";import"../../connectors/chains/polygonAmoy.mjs";import"../../connectors/chains/redstone.mjs";import"../../connectors/chains/sepolia.mjs";import"../../connectors/chains/zora.mjs";import"../../connectors/chains/zoraSepolia.mjs";import"../../connectors/chains/zoraTestnet.mjs";import"../../connectors/chains/utils.mjs";import"../../lib/solana/index.mjs";import"../../theme.mjs";import"tinycolor2";import"../../lib/cybr53.mjs";import"../../hooks/internal-context.mjs";import"../../hooks/index.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";import"../../components/ui/layout/Row.mjs";import"../../components/ui/typography/LabelSm.mjs";import"../../components/ui/typography/Value.mjs";import"../../components/ui/animation/LoadingSkeleton.mjs";import"../../components/embedded-wallets/PriceDisplay.mjs";import"@ethersproject/units";import"../../lib/ethers.mjs";import"@ethersproject/bignumber";import"@privy-io/js-sdk-core";import"../../utils/index.mjs";import"@ethersproject/providers";import"../../connectors/get-legacy-injected-providers.mjs";import"../../connectors/is-wallet-installed.mjs";import"../../errors.mjs";import"ofetch";import"../../lib/solana/transaction.mjs";import"../../utils/buffer/readBigInt64LE.mjs";import"../../components/embedded-wallets/WalletLink.mjs";const d=({instructions:r,fees:s,onClose:d,receiptHeader:f,receiptDescription:g,transactionInfo:y,solPrice:b,rpcEndpoint:k})=>/*#__PURE__*/o(t,{children:[/*#__PURE__*/n(p,{onClose:d}),/*#__PURE__*/n(j,{style:{marginBottom:"16px"},children:/*#__PURE__*/o("div",{children:[/*#__PURE__*/n(e,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(i,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(a,{title:f??"Transaction completed successfully.",description:g??""}),/*#__PURE__*/n(l,{solPrice:b,instructions:r,fees:s,transactionInfo:y,rpcEndpoint:k}),/*#__PURE__*/n(h,{}),/*#__PURE__*/n(u,{loading:!1,onClick:d,children:"Close"}),/*#__PURE__*/n(m,{}),/*#__PURE__*/n(c,{})]});let u=/*#__PURE__*/r(s).withConfig({displayName:"SubmitButton",componentId:"sc-d56ba196-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);export{d as SolanaTransactionReceiptView};
1
+ import{jsxs as o,Fragment as t,jsx as n}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/CheckCircleIcon";import{styled as r}from"styled-components";import{PrimaryButton as s}from"../../components/Button.mjs";import{CircleBackground as e}from"../../components/CircleBackground.mjs";import{RefactorSpacerBottom as m}from"../../components/Layouts.mjs";import{BlobbyFooter as c}from"../../components/ModalFooter.mjs";import{ModalHeader as p}from"../../components/ModalHeader.mjs";import{CenteredScreenHeader as a}from"../../components/ScreenHeader.mjs";import{SolanaTransactionDetails as l}from"../../components/embedded-wallets/SolanaTransactionDetails.mjs";import j from"../../components/layout/StackedContainer.mjs";import{Grow as h}from"../LandingScreen/styles.mjs";import"../../components/Loader.mjs";import"../../svg/protected-by-privy.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"../../configuration/context.mjs";import"react";import"../../config.mjs";import"../../configuration/defaultClientConfig.mjs";import"../../constants.mjs";import"../../configuration/login-methods.mjs";import"../../configuration/wallets.mjs";import"../../connectors/chains/index.mjs";import"../../connectors/chains/arbitrum.mjs";import"../../connectors/chains/arbitrumSepolia.mjs";import"../../connectors/chains/avalanche.mjs";import"../../connectors/chains/avalancheFuji.mjs";import"../../connectors/chains/base.mjs";import"../../connectors/chains/baseSepolia.mjs";import"../../connectors/chains/berachainArtio.mjs";import"../../connectors/chains/celo.mjs";import"../../connectors/chains/celoAlfajores.mjs";import"../../connectors/chains/filecoin.mjs";import"../../connectors/chains/filecoinCalibration.mjs";import"../../connectors/chains/garnetHolesky.mjs";import"../../connectors/chains/holesky.mjs";import"../../connectors/chains/linea.mjs";import"../../connectors/chains/lineaTestnet.mjs";import"../../connectors/chains/lukso.mjs";import"../../connectors/chains/mainnet.mjs";import"../../connectors/chains/optimism.mjs";import"../../connectors/chains/optimismSepolia.mjs";import"../../connectors/chains/polygon.mjs";import"../../connectors/chains/polygonAmoy.mjs";import"../../connectors/chains/redstone.mjs";import"../../connectors/chains/sepolia.mjs";import"../../connectors/chains/zora.mjs";import"../../connectors/chains/zoraSepolia.mjs";import"../../connectors/chains/zoraTestnet.mjs";import"../../connectors/chains/utils.mjs";import"../../lib/solana/index.mjs";import"../../theme.mjs";import"tinycolor2";import"../../lib/cybr53.mjs";import"../../hooks/internal-context.mjs";import"../../hooks/index.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";import"../../components/ui/layout/Row.mjs";import"../../components/ui/typography/LabelSm.mjs";import"../../components/ui/typography/Value.mjs";import"../../components/ui/animation/LoadingSkeleton.mjs";import"../../components/embedded-wallets/PriceDisplay.mjs";import"@ethersproject/units";import"../../lib/ethers.mjs";import"@ethersproject/bignumber";import"@privy-io/js-sdk-core";import"../../utils/index.mjs";import"@ethersproject/providers";import"../../connectors/get-legacy-injected-providers.mjs";import"../../connectors/is-wallet-installed.mjs";import"../../errors.mjs";import"ofetch";import"../../lib/solana/transaction.mjs";import"../../utils/buffer/readBigInt64LE.mjs";import"../../components/embedded-wallets/WalletLink.mjs";const d=({instructions:r,fees:s,onClose:d,receiptHeader:f,receiptDescription:g,transactionInfo:y,solPrice:b,rpcEndpoint:k})=>/*#__PURE__*/o(t,{children:[/*#__PURE__*/n(p,{onClose:d}),/*#__PURE__*/n(j,{style:{marginBottom:"16px"},children:/*#__PURE__*/o("div",{children:[/*#__PURE__*/n(e,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(i,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(a,{title:f??"Transaction completed successfully.",description:g??""}),/*#__PURE__*/n(l,{solPrice:b,instructions:r,fees:s,transactionInfo:y,rpcEndpoint:k}),/*#__PURE__*/n(h,{}),/*#__PURE__*/n(u,{loading:!1,onClick:d,children:"Close"}),/*#__PURE__*/n(m,{}),/*#__PURE__*/n(c,{})]});let u=/*#__PURE__*/r(s).withConfig({displayName:"SubmitButton",componentId:"sc-2effda18-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);export{d as SolanaTransactionReceiptView};
@@ -1 +1 @@
1
- import{jsxs as o,Fragment as n,jsx as r}from"react/jsx-runtime";import{ChevronDownIcon as e}from"@heroicons/react/24/outline";import{styled as i}from"styled-components";import{PrimaryButton as t}from"../../components/Button.mjs";import{BlobbyFooter as s}from"../../components/ModalFooter.mjs";import{ModalHeader as c}from"../../components/ModalHeader.mjs";import{Rows as a,Row as m}from"../../components/ui/layout/Row.mjs";import{ErrorMessage as l}from"../../components/ui/typography/ErrorMessage.mjs";import{LabelSm as d,LabelSmPrimary as p}from"../../components/ui/typography/LabelSm.mjs";import{Subtitle as h}from"../../components/ui/typography/Subtitle.mjs";import{Title as u}from"../../components/ui/typography/Title.mjs";import{Value as g}from"../../components/ui/typography/Value.mjs";import{Address as j}from"../../components/ui/wallet/Address.mjs";import{WalletInfoCard as f}from"../../components/ui/wallet/WalletInfoCard.mjs";import{Grow as y}from"../LandingScreen/styles.mjs";import{TransactionDetail as b}from"./TransactionDetail.mjs";import{useTransactionDetails as k}from"./useTransactionDetails.mjs";import"../../components/Loader.mjs";import"../../svg/protected-by-privy.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"../../configuration/context.mjs";import"react";import"../../config.mjs";import"../../configuration/defaultClientConfig.mjs";import"../../constants.mjs";import"../../configuration/login-methods.mjs";import"../../configuration/wallets.mjs";import"../../connectors/chains/index.mjs";import"../../connectors/chains/arbitrum.mjs";import"../../connectors/chains/arbitrumSepolia.mjs";import"../../connectors/chains/avalanche.mjs";import"../../connectors/chains/avalancheFuji.mjs";import"../../connectors/chains/base.mjs";import"../../connectors/chains/baseSepolia.mjs";import"../../connectors/chains/berachainArtio.mjs";import"../../connectors/chains/celo.mjs";import"../../connectors/chains/celoAlfajores.mjs";import"../../connectors/chains/filecoin.mjs";import"../../connectors/chains/filecoinCalibration.mjs";import"../../connectors/chains/garnetHolesky.mjs";import"../../connectors/chains/holesky.mjs";import"../../connectors/chains/linea.mjs";import"../../connectors/chains/lineaTestnet.mjs";import"../../connectors/chains/lukso.mjs";import"../../connectors/chains/mainnet.mjs";import"../../connectors/chains/optimism.mjs";import"../../connectors/chains/optimismSepolia.mjs";import"../../connectors/chains/polygon.mjs";import"../../connectors/chains/polygonAmoy.mjs";import"../../connectors/chains/redstone.mjs";import"../../connectors/chains/sepolia.mjs";import"../../connectors/chains/zora.mjs";import"../../connectors/chains/zoraSepolia.mjs";import"../../connectors/chains/zoraTestnet.mjs";import"../../connectors/chains/utils.mjs";import"../../lib/solana/index.mjs";import"../../theme.mjs";import"tinycolor2";import"../../lib/cybr53.mjs";import"../../hooks/internal-context.mjs";import"../../hooks/index.mjs";import"../../components/ui/animation/LoadingSkeleton.mjs";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"../../utils/index.mjs";import"@ethersproject/providers";import"../../connectors/get-legacy-injected-providers.mjs";import"../../connectors/is-wallet-installed.mjs";import"../../errors.mjs";import"ofetch";import"../../components/ui/chips/Chip.mjs";import"../../components/ui/layout/Column.mjs";import"../../components/ui/typography/LabelXs.mjs";import"../../components/ui/wallet/shared.mjs";import"@ethersproject/address";const x=({transactionIndex:o,maxIndex:n})=>"number"!=typeof o||0===n?"":` (${o+1} / ${n+1})`,I=({img:i,submitError:f,prepareError:I,onClose:C,action:L,title:v,subtitle:A,total:E,txValue:M,to:$,tokenAddress:D,network:N,missingFunds:F,fee:P,from:z,cta:B,disabled:W,chain:Y,isSubmitting:q,isPreparing:H,isTokenPriceLoading:R,isTokenContractInfoLoading:V,isSponsored:X,symbol:Q,balance:U,onClick:G,transactionDetails:J,transactionIndex:K,maxIndex:O,onBack:Z,chainName:_})=>{let{showTransactionDetails:oo,setShowTransactionDetails:no,hasMoreDetails:ro,isErc20Ish:eo}=k(J);/*#__PURE__*/return o(n,{children:[/*#__PURE__*/r(c,{onClose:C,backFn:Z}),i&&/*#__PURE__*/r(S,{children:i}),/*#__PURE__*/o(u,{style:{marginTop:i?"1.5rem":0},children:[v,/*#__PURE__*/r(x,{maxIndex:O,transactionIndex:K})]}),/*#__PURE__*/r(h,{children:A}),/*#__PURE__*/o(a,{style:{marginTop:"2rem"},children:[eo&&/*#__PURE__*/o(n,{children:["approve"===L&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Action"}),/*#__PURE__*/r(g,{children:J?.action})]}),/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Amount"}),/*#__PURE__*/o(g,{$isLoading:eo&&V,children:[J?.formattedAmount," ",Q]})]})]}),E&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Total"}),/*#__PURE__*/r(g,{$isLoading:H||R,children:E})]}),J&&"spender"in J&&J?.spender?/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Spender"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:J.spender,url:Y?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,$&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"To"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:$,url:Y?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),D&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Token address"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:D,url:Y?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Network"}),/*#__PURE__*/r(g,{children:N})]}),/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Estimated fee"}),/*#__PURE__*/r(g,{$isLoading:H||R||void 0===X,children:X?"Sponsored":P})]}),ro&&/*#__PURE__*/o(n,{children:[/*#__PURE__*/r(m,{className:"cursor-pointer",onClick:()=>no(!oo),children:/*#__PURE__*/o(p,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/r(e,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:oo?"rotate(180deg)":void 0}})]})}),oo&&J&&/*#__PURE__*/r(b,{action:L,chain:Y,transactionDetails:J,isTokenContractInfoLoading:V,symbol:Q})]})]}),/*#__PURE__*/r(y,{}),f?/*#__PURE__*/r(l,{style:{marginTop:"2rem"},children:f.message}):I?/*#__PURE__*/r(l,{style:{marginTop:"2rem"},children:T}):null,/*#__PURE__*/r(w,{$useSmallMargins:!(!I&&!f),title:Number(M)>0?void 0:!1!==X?"Your wallet":void 0,address:z,balance:U,isLoading:H||R,errMsg:H||I||f||!F?void 0:`Add funds on ${Y?.name??_} to complete transaction.`}),/*#__PURE__*/r(t,{style:{marginTop:"1rem"},loading:q,disabled:W||H,onClick:G,children:B}),/*#__PURE__*/r(s,{})]})},C=({img:e,title:i,subtitle:p,cta:f,network:b,blockExplorerUrl:k,transactionIndex:I,maxIndex:C,isMissingFunds:L,submitError:v,parseError:A,total:E,amount:M,fee:$,balance:D,from:N,to:F,tokenAddress:P,programAddress:z,transactingWalletAddress:B,disabled:W,isSubmitting:Y,isPreparing:q,isTokenPriceLoading:H,onClick:R,onClose:V,onBack:X})=>{let Q=q||H;/*#__PURE__*/return o(n,{children:[/*#__PURE__*/r(c,{onClose:V,backFn:X}),e&&/*#__PURE__*/r(S,{children:e}),/*#__PURE__*/o(u,{style:{marginTop:e?"1.5rem":0},children:[i,/*#__PURE__*/r(x,{maxIndex:C,transactionIndex:I})]}),/*#__PURE__*/r(h,{children:p}),/*#__PURE__*/o(a,{style:{marginTop:"2rem"},children:[(E||Q)&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Total"}),/*#__PURE__*/r(g,{$isLoading:Q,children:E})]}),N&&N!==B&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"From"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:N,url:k,showCopyIcon:!1})})]}),F&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"To"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:F,url:k,showCopyIcon:!1})})]}),P&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Token address"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:P,url:k,showCopyIcon:!1})})]}),z&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Program address"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:z,url:k,showCopyIcon:!1})})]}),b&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Network"}),/*#__PURE__*/r(g,{children:b})]}),(M||Q)&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Amount"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(g,{$isLoading:Q,children:M})})]}),($||Q)&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Estimated fee"}),/*#__PURE__*/r(g,{$isLoading:Q,children:$})]})]}),/*#__PURE__*/r(y,{}),v?/*#__PURE__*/r(l,{style:{marginTop:"2rem"},children:v.message}):A?/*#__PURE__*/r(l,{style:{marginTop:"2rem"},children:T}):null,/*#__PURE__*/r(w,{$useSmallMargins:!(!A&&!v),title:"Your wallet",address:B,balance:D,isLoading:q||H,errMsg:q||A||v||!L?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/r(t,{style:{marginTop:"1rem"},loading:Y,disabled:W||q,onClick:R,children:f}),/*#__PURE__*/r(s,{})]})};let w=/*#__PURE__*/i(f).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-67aab208-0"})(["",""],(o=>o.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),T="There was an error preparing your transaction. Your transaction request will likely fail.",S=/*#__PURE__*/i.div.withConfig({displayName:"ImageContainer",componentId:"sc-67aab208-1"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]);export{C as SendSolanaTransactionScreenView,I as SendTransactionScreenView,x as TransactionIndex};
1
+ import{jsxs as o,Fragment as n,jsx as r}from"react/jsx-runtime";import{ChevronDownIcon as e}from"@heroicons/react/24/outline";import{styled as i}from"styled-components";import{PrimaryButton as t}from"../../components/Button.mjs";import{BlobbyFooter as s}from"../../components/ModalFooter.mjs";import{ModalHeader as c}from"../../components/ModalHeader.mjs";import{Rows as a,Row as m}from"../../components/ui/layout/Row.mjs";import{ErrorMessage as l}from"../../components/ui/typography/ErrorMessage.mjs";import{LabelSm as d,LabelSmPrimary as p}from"../../components/ui/typography/LabelSm.mjs";import{Subtitle as h}from"../../components/ui/typography/Subtitle.mjs";import{Title as u}from"../../components/ui/typography/Title.mjs";import{Value as g}from"../../components/ui/typography/Value.mjs";import{Address as j}from"../../components/ui/wallet/Address.mjs";import{WalletInfoCard as f}from"../../components/ui/wallet/WalletInfoCard.mjs";import{Grow as y}from"../LandingScreen/styles.mjs";import{TransactionDetail as b}from"./TransactionDetail.mjs";import{useTransactionDetails as k}from"./useTransactionDetails.mjs";import"../../components/Loader.mjs";import"../../svg/protected-by-privy.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"../../configuration/context.mjs";import"react";import"../../config.mjs";import"../../configuration/defaultClientConfig.mjs";import"../../constants.mjs";import"../../configuration/login-methods.mjs";import"../../configuration/wallets.mjs";import"../../connectors/chains/index.mjs";import"../../connectors/chains/arbitrum.mjs";import"../../connectors/chains/arbitrumSepolia.mjs";import"../../connectors/chains/avalanche.mjs";import"../../connectors/chains/avalancheFuji.mjs";import"../../connectors/chains/base.mjs";import"../../connectors/chains/baseSepolia.mjs";import"../../connectors/chains/berachainArtio.mjs";import"../../connectors/chains/celo.mjs";import"../../connectors/chains/celoAlfajores.mjs";import"../../connectors/chains/filecoin.mjs";import"../../connectors/chains/filecoinCalibration.mjs";import"../../connectors/chains/garnetHolesky.mjs";import"../../connectors/chains/holesky.mjs";import"../../connectors/chains/linea.mjs";import"../../connectors/chains/lineaTestnet.mjs";import"../../connectors/chains/lukso.mjs";import"../../connectors/chains/mainnet.mjs";import"../../connectors/chains/optimism.mjs";import"../../connectors/chains/optimismSepolia.mjs";import"../../connectors/chains/polygon.mjs";import"../../connectors/chains/polygonAmoy.mjs";import"../../connectors/chains/redstone.mjs";import"../../connectors/chains/sepolia.mjs";import"../../connectors/chains/zora.mjs";import"../../connectors/chains/zoraSepolia.mjs";import"../../connectors/chains/zoraTestnet.mjs";import"../../connectors/chains/utils.mjs";import"../../lib/solana/index.mjs";import"../../theme.mjs";import"tinycolor2";import"../../lib/cybr53.mjs";import"../../hooks/internal-context.mjs";import"../../hooks/index.mjs";import"../../components/ui/animation/LoadingSkeleton.mjs";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"../../utils/index.mjs";import"@ethersproject/providers";import"../../connectors/get-legacy-injected-providers.mjs";import"../../connectors/is-wallet-installed.mjs";import"../../errors.mjs";import"ofetch";import"../../components/ui/chips/Chip.mjs";import"../../components/ui/layout/Column.mjs";import"../../components/ui/typography/LabelXs.mjs";import"../../components/ui/wallet/shared.mjs";import"@ethersproject/address";const w=({transactionIndex:o,maxIndex:n})=>"number"!=typeof o||0===n?"":` (${o+1} / ${n+1})`,x=({img:i,submitError:f,prepareError:x,onClose:I,action:L,title:A,subtitle:v,total:E,txValue:M,to:$,tokenAddress:D,network:N,missingFunds:F,fee:P,from:z,cta:B,disabled:W,chain:Y,isSubmitting:q,isPreparing:H,isTokenPriceLoading:R,isTokenContractInfoLoading:V,isSponsored:X,symbol:O,balance:Q,onClick:U,transactionDetails:G,transactionIndex:J,maxIndex:K,onBack:Z,chainName:_})=>{let{showTransactionDetails:oo,setShowTransactionDetails:no,hasMoreDetails:ro,isErc20Ish:eo}=k(G);/*#__PURE__*/return o(n,{children:[/*#__PURE__*/r(c,{onClose:I,backFn:Z}),i&&/*#__PURE__*/r(S,{children:i}),/*#__PURE__*/o(u,{style:{marginTop:i?"1.5rem":0},children:[A,/*#__PURE__*/r(w,{maxIndex:K,transactionIndex:J})]}),/*#__PURE__*/r(h,{children:v}),/*#__PURE__*/o(a,{style:{marginTop:"2rem"},children:[eo&&/*#__PURE__*/o(n,{children:["approve"===L&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Action"}),/*#__PURE__*/r(g,{children:G?.action})]}),/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Amount"}),/*#__PURE__*/o(g,{$isLoading:eo&&V,children:[G?.formattedAmount," ",O]})]})]}),E&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Total"}),/*#__PURE__*/r(g,{$isLoading:H||R,children:E})]}),G&&"spender"in G&&G?.spender?/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Spender"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:G.spender,url:Y?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,$&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"To"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:$,url:Y?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),D&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Token address"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:D,url:Y?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Network"}),/*#__PURE__*/r(g,{children:N})]}),/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Estimated fee"}),/*#__PURE__*/r(g,{$isLoading:H||R||void 0===X,children:X?"Sponsored":P})]}),ro&&/*#__PURE__*/o(n,{children:[/*#__PURE__*/r(m,{className:"cursor-pointer",onClick:()=>no(!oo),children:/*#__PURE__*/o(p,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/r(e,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:oo?"rotate(180deg)":void 0}})]})}),oo&&G&&/*#__PURE__*/r(b,{action:L,chain:Y,transactionDetails:G,isTokenContractInfoLoading:V,symbol:O})]})]}),/*#__PURE__*/r(y,{}),f?/*#__PURE__*/r(l,{style:{marginTop:"2rem"},children:f.message}):x?/*#__PURE__*/r(l,{style:{marginTop:"2rem"},children:T}):null,/*#__PURE__*/r(C,{$useSmallMargins:!(!x&&!f),title:Number(M)>0?void 0:!1!==X?"Your wallet":void 0,address:z,balance:Q,isLoading:H||R,errMsg:H||x||f||!F?void 0:`Add funds on ${Y?.name??_} to complete transaction.`}),/*#__PURE__*/r(t,{style:{marginTop:"1rem"},loading:q,disabled:W||H,onClick:U,children:B}),/*#__PURE__*/r(s,{})]})},I=({img:e,title:i,subtitle:p,cta:f,network:b,blockExplorerUrl:k,transactionIndex:x,maxIndex:I,isMissingFunds:L,submitError:A,parseError:v,total:E,amount:M,fee:$,balance:D,from:N,to:F,tokenAddress:P,tokenAccount:z,tokenAccountOwner:B,programAddress:W,transactingWalletAddress:Y,disabled:q,isSubmitting:H,isPreparing:R,isTokenPriceLoading:V,onClick:X,onClose:O,onBack:Q})=>{let U=R||V;/*#__PURE__*/return o(n,{children:[/*#__PURE__*/r(c,{onClose:O,backFn:Q}),e&&/*#__PURE__*/r(S,{children:e}),/*#__PURE__*/o(u,{style:{marginTop:e?"1.5rem":0},children:[i,/*#__PURE__*/r(w,{maxIndex:I,transactionIndex:x})]}),/*#__PURE__*/r(h,{children:p}),/*#__PURE__*/o(a,{style:{marginTop:"2rem"},children:[(E||U)&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Total"}),/*#__PURE__*/r(g,{$isLoading:U,children:E})]}),N&&N!==Y&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"From"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:N,url:k,showCopyIcon:!1})})]}),F&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"To"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:F,url:k,showCopyIcon:!1})})]}),B&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Token account owner"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:B,url:k,showCopyIcon:!1})})]}),z&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Token account"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:z,url:k,showCopyIcon:!1})})]}),P&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Token address"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:P,url:k,showCopyIcon:!1})})]}),W&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Program address"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(j,{address:W,url:k,showCopyIcon:!1})})]}),b&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Network"}),/*#__PURE__*/r(g,{children:b})]}),(M||U)&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Amount"}),/*#__PURE__*/r(g,{children:/*#__PURE__*/r(g,{$isLoading:U,children:M})})]}),($||U)&&/*#__PURE__*/o(m,{children:[/*#__PURE__*/r(d,{children:"Estimated fee"}),/*#__PURE__*/r(g,{$isLoading:U,children:$})]})]}),/*#__PURE__*/r(y,{}),A?/*#__PURE__*/r(l,{style:{marginTop:"2rem"},children:A.message}):v?/*#__PURE__*/r(l,{style:{marginTop:"2rem"},children:T}):null,/*#__PURE__*/r(C,{$useSmallMargins:!(!v&&!A),title:"Your wallet",address:Y,balance:D,isLoading:R||V,errMsg:R||v||A||!L?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/r(t,{style:{marginTop:"1rem"},loading:H,disabled:q||R,onClick:X,children:f}),/*#__PURE__*/r(s,{})]})};let C=/*#__PURE__*/i(f).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-bec19fef-0"})(["",""],(o=>o.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),T="There was an error preparing your transaction. Your transaction request will likely fail.",S=/*#__PURE__*/i.div.withConfig({displayName:"ImageContainer",componentId:"sc-bec19fef-1"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]);export{I as SendSolanaTransactionScreenView,x as SendTransactionScreenView,w as TransactionIndex};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/react-auth",
3
- "version": "1.99.1",
3
+ "version": "1.100.0-beta-20250110141708",
4
4
  "description": "React client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",
@@ -143,7 +143,7 @@
143
143
  "@heroicons/react": "^2.1.1",
144
144
  "@marsidev/react-turnstile": "^0.4.1",
145
145
  "@metamask/eth-sig-util": "^6.0.0",
146
- "@privy-io/js-sdk-core": "0.37.1",
146
+ "@privy-io/js-sdk-core": "0.37.1-beta-20250110141708",
147
147
  "@simplewebauthn/browser": "^9.0.1",
148
148
  "@solana/wallet-adapter-base": "^0.9.23",
149
149
  "@solana/wallet-standard-wallet-adapter-base": "^1.1.2",
@@ -184,7 +184,7 @@
184
184
  "@jest/globals": "^29.7.0",
185
185
  "@privy-io/build-config": "*",
186
186
  "@privy-io/eslint-config-custom": "*",
187
- "@privy-io/public-api": "2.15.10",
187
+ "@privy-io/public-api": "2.15.10-beta-20250110141708",
188
188
  "@privy-io/testing": "*",
189
189
  "@rollup/plugin-commonjs": "^26.0.1",
190
190
  "@rollup/plugin-node-resolve": "^15.3.0",