superstack-wallet-sdk 0.4.8 → 0.4.10

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,2 +1,2 @@
1
- import t from"axios";import{Network as e,WalletType as a,isVersionedTransaction as r}from"./types.js";import{Storage as n}from"./storage.js";import{Connection as o,PublicKey as i,LAMPORTS_PER_SOL as s}from"@solana/web3.js";import l from"bs58";import{PhantomWalletAdapter as d}from"./adapters/phantom.js";import{v4 as h}from"uuid";import{getOnrampBuyUrl as u}from"./utils/coinbaseUtils.js";import{Buffer as c}from"../_virtual/_polyfill-node.buffer.js";import"./polyfills.js";import{createPublicClient as w}from"../node_modules/.pnpm/viem@2.37.8_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10/node_modules/viem/_esm/clients/createPublicClient.js";import{http as m}from"../node_modules/.pnpm/viem@2.37.8_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10/node_modules/viem/_esm/clients/transports/http.js";import{serializeSignature as p}from"../node_modules/.pnpm/viem@2.37.8_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10/node_modules/viem/_esm/utils/signature/serializeSignature.js";import{formatEther as f}from"../node_modules/.pnpm/ethers@6.15.0_bufferutil@4.0.9_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/utils/units.js";class g{constructor(a){this.selectedWalletId=null,this.solanaConnection=null,this.ethereumProvider=null,this.walletInfo=null,this.phantomAdapter=null,this.walletType="embedded",this.ethereumNetwork=null,this.defaultNetwork=e.Solana,this.api=t.create({baseURL:a.baseURL,headers:{"Content-Type":"application/json"}}),this.middleAccountApi=t.create({baseURL:a.middleAccountBaseURL||"https://yeezy-payment-service-sit-a0dchfccbufeh5bx.z03.azurefd.net",headers:{"Content-Type":"application/json"}}),this.solanaCluster=a.solanaCluster,this.solanaConnection=new o(a.solanaCluster.rpcUrl),a.ethereumNetwork&&(this.ethereumNetwork={...a.ethereumNetwork,chainId:Number(a.ethereumNetwork.chainId)},this.ethereumProvider=w({transport:m(a.ethereumNetwork.rpcUrl)})),this.defaultNetwork=a.defaultNetwork||e.Solana}setWallet(t){this.walletInfo=t}setWalletType(t){this.walletType=t,n.saveWalletType(t)}getWallet(){return this.walletInfo}getPhantomAdapter(){return this.phantomAdapter}getWalletType(){return this.walletType}get wallet(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(t=>t.network===this.defaultNetwork))||null}get address(){var t;return(null===(t=this.wallet)||void 0===t?void 0:t.address)||null}get network(){var t;return(null===(t=this.wallet)||void 0===t?void 0:t.network)||null}get ethereumWallet(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(t=>t.network===e.Ethereum&&"Main"===t.wallet_set))||null}get ethereumAddress(){var t;return(null===(t=this.ethereumWallet)||void 0===t?void 0:t.address)||null}get solanaWallet(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(t=>t.network===e.Solana&&"Main"===t.wallet_set))||null}get forwardSolanaWallet(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(t=>t.network===e.Solana&&"Forward-0"===t.wallet_set))||null}get forwardSolanaAddress(){var t;return(null===(t=this.forwardSolanaWallet)||void 0===t?void 0:t.address)||null}get forwardEthereumWallet(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(t=>t.network===e.Ethereum&&"Forward-0"===t.wallet_set))||null}get forwardEthereumAddress(){var t;return(null===(t=this.forwardEthereumWallet)||void 0===t?void 0:t.address)||null}get solanaAddress(){var t;return(null===(t=this.solanaWallet)||void 0===t?void 0:t.address)||null}get id(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.id)||null}get social_links(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.social_links)||null}async reconnect(){try{if("phantom"===n.getWalletType())return await this.connectPhantom();{const t=await this.getSession();return this.setWallet(t),t}}catch(t){return null}}async connectPhantom(){try{if(this.phantomAdapter||(this.phantomAdapter=new d),await this.phantomAdapter.connect(),!this.phantomAdapter.publicKey)throw new Error("Failed to connect to Phantom wallet");const t=this.phantomAdapter.publicKey.toString(),r={id:h(),is_exported:!1,address:t,network:e.Solana,type:a.Phantom,wallets:[{id:t,address:t,network:e.Solana,wallet_type:a.Phantom,wallet_set:"Main"}],social_links:[],social_infos:[],account_info:{name:null}};return this.setWallet(r),this.setWalletType("phantom"),r}catch(t){throw console.error("Phantom connect error:",t),new Error(t instanceof Error?t.message:"Failed to connect to Phantom wallet")}}async updateAccountName(t){if(!this.walletInfo)throw new Error("No wallet info");const e=await this.api.post("/account/update",{name:t},{withCredentials:!0});return this.walletInfo.account_info.name=t,e.data}async signSolanaTransaction(t){try{if(!this.walletInfo)throw new Error("No wallet info");if(!this.solanaConnection)throw new Error("No rpc connection");const{blockhash:a}=await this.solanaConnection.getLatestBlockhash();if(r(t)?t.message.recentBlockhash=a:t.recentBlockhash=a,this.phantomAdapter&&this.phantomAdapter.publicKey)return await this.phantomAdapter.signTransaction(t);const n=this.solanaWallet;if(!n)throw new Error("No solana wallet available");const o={user_id:this.walletInfo.id,address:n.address,network:e.Solana,tx:{Solana:l.encode(r(t)?t.message.serialize():t.serializeMessage())}},s=await this.api.post("/sign2",o,{withCredentials:!0}),{signature:d}=s.data;return t.addSignature(new i(n.address),c.from(l.decode(d))),t}catch(t){throw new Error(t instanceof Error?t.message:"Failed to sign transaction")}}async signEthereumEip712(t){if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const a={user_id:this.walletInfo.id,address:this.ethereumAddress,network:e.Ethereum,tx:{EthereumEip712:t}},r=await this.api.post("/sign2",a,{withCredentials:!0}),{signature:n}=r.data;return n}async sendSolanaTransaction(t){if(!this.solanaConnection)throw new Error("No rpc connection");try{return await this.solanaConnection.sendRawTransaction(t,{maxRetries:3,skipPreflight:!1})}catch(t){throw t}}async sendEthereumTransaction(t){if(!this.ethereumProvider)throw new Error("No Ethereum provider");try{return await this.ethereumProvider.sendRawTransaction({serializedTransaction:t})}catch(t){throw t}}async sendEmailVerificationCode(t){await this.api.post("/send_verification",{email:t})}async sendPhoneVerificationCode(t){t.startsWith("+")||(t=`+${t}`),await this.api.post("/send_verification",{phone:t,type:"phone"})}async verifyEmailVerificationCode({email:t,code:e}){const a={type:"Email",data:{network:this.defaultNetwork,email:t,code:e}},r=(await this.api.post("/login",a,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async verifyPhoneVerificationCode({phone:t,code:e}){const a={type:"Phone",data:{network:this.defaultNetwork,phone:t,code:e}},r=(await this.api.post("/login",a,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async twitterLogin(t){const e={type:"TwitterOAuth",data:{network:this.defaultNetwork,...t}},a=(await this.api.post("/login",e,{withCredentials:!0})).data;return this.setWallet(a),this.setWalletType("embedded"),a}async googleLogin(t){const e={type:"GoogleOAuth",data:{network:this.defaultNetwork,...t}},a=(await this.api.post("/login",e,{withCredentials:!0})).data;return this.setWallet(a),this.setWalletType("embedded"),a}async oauthLogin(t,e){const a={type:t,data:{network:e.network||this.defaultNetwork,...e}},r=(await this.api.post("/login",a,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async loginWithChallenge(t,e){const a={type:t,data:{network:e.network||this.defaultNetwork,...e}},r=(await this.api.post("/login",a,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async oauthInit(t){return(await this.api.post("/oauth/init",t)).data}async getSignChallenge(t){return(await this.api.get(`/challenge?method=${t.method}&id=${t.id}`)).data}async getSession(){const t=(await this.api.get("/session",{withCredentials:!0})).data,{access_token:e,...a}=t;return e&&n.saveAccessToken(e),t}async logout(){this.phantomAdapter?(this.phantomAdapter.disconnect(),this.phantomAdapter=null):await this.api.post("/logout",{},{withCredentials:!0}),this.setWallet(null),n.clear()}async getOAuth2ClientId(t){return(await this.api.get(`/oauth_id/${t}`)).data.client_id}setSelectedWallet(t){this.selectedWalletId=t}getSelectedWallet(){return this.selectedWalletId}async getSolanaBalance(){if(!this.solanaConnection||!this.solanaAddress)throw new Error("Solana connection not available");return(await this.solanaConnection.getBalance(new i(this.solanaAddress))/s).toString()}async getEthereumBalance(){if(!this.ethereumProvider||!this.ethereumAddress)throw new Error("Ethereum provider not available");const t=await this.ethereumProvider.getBalance({address:this.ethereumAddress});return f(t)}async fetchCoinbaseToken(t,e="solana"){return(await this.api.post("/ramp/coinbase",{addresses:[{address:t,blockchains:[e]}],assets:["solana"===e?"SOL":"ETH"]})).data.token}viemSignerAdapter(){return{signTypedData:async t=>{if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const a={user_id:this.walletInfo.id,address:this.ethereumAddress,network:e.Ethereum,tx:{EthereumEip712:t}},r=await this.api.post("/sign2",a,{withCredentials:!0}),{signature:n}=r.data,o=l.decode(n),i=o[64];return p({r:`0x${c.from(o.slice(0,32)).toString("hex")}`,s:`0x${c.from(o.slice(32,64)).toString("hex")}`,v:BigInt(i+27)})}}}async createMiddleAccount(t){try{return(await this.middleAccountApi.post("/create",t)).data}catch(t){throw new Error(t instanceof Error?t.message:"Failed to create middle account")}}async getCoinbaseOnrampUrlForMiddleAccount(t){try{const a={sessionToken:await this.fetchCoinbaseToken(t.middleAccountAddress,t.network===e.Solana?"solana":"ethereum"),presetCryptoAmount:Number(t.amount),redirectUrl:t.redirectUrl||window.location.href};return u(a)}catch(t){throw new Error(t instanceof Error?t.message:"Failed to get Coinbase onramp URL")}}async getOrderState(t){try{return(await this.middleAccountApi.get(`/order/${t}`)).data}catch(t){throw new Error(t instanceof Error?t.message:"Failed to get order status")}}}export{g as WalletClient};
1
+ import t from"axios";import{Network as e,WalletType as a,isVersionedTransaction as r}from"./types.js";import{Storage as n}from"./storage.js";import{Connection as o,PublicKey as i,LAMPORTS_PER_SOL as s}from"@solana/web3.js";import l from"bs58";import{PhantomWalletAdapter as d}from"./adapters/phantom.js";import{v4 as h}from"uuid";import{getOnrampBuyUrl as u}from"./utils/coinbaseUtils.js";import{Buffer as c}from"../_virtual/_polyfill-node.buffer.js";import"./polyfills.js";import{createPublicClient as w}from"../node_modules/.pnpm/viem@2.37.8_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10/node_modules/viem/_esm/clients/createPublicClient.js";import{http as m}from"../node_modules/.pnpm/viem@2.37.8_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10/node_modules/viem/_esm/clients/transports/http.js";import{serializeSignature as p}from"../node_modules/.pnpm/viem@2.37.8_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10/node_modules/viem/_esm/utils/signature/serializeSignature.js";import{formatEther as f}from"../node_modules/.pnpm/ethers@6.15.0_bufferutil@4.0.9_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/utils/units.js";class g{constructor(a){this.selectedWalletId=null,this.solanaConnection=null,this.ethereumProvider=null,this.walletInfo=null,this.phantomAdapter=null,this.walletType="embedded",this.ethereumNetwork=null,this.defaultNetwork=e.Solana,this.api=t.create({baseURL:a.baseURL,headers:{"Content-Type":"application/json"}}),this.middleAccountApi=t.create({baseURL:a.middleAccountBaseURL||"https://yeezy-payment-service-sit-a0dchfccbufeh5bx.z03.azurefd.net",headers:{"Content-Type":"application/json"}}),this.solanaCluster=a.solanaCluster,this.solanaConnection=new o(a.solanaCluster.rpcUrl),a.ethereumNetwork&&(this.ethereumNetwork={...a.ethereumNetwork,chainId:Number(a.ethereumNetwork.chainId)},this.ethereumProvider=w({transport:m(a.ethereumNetwork.rpcUrl)})),this.defaultNetwork=a.defaultNetwork||e.Solana}setWallet(t){this.walletInfo=t}setWalletType(t){this.walletType=t,n.saveWalletType(t)}getWallet(){return this.walletInfo}getPhantomAdapter(){return this.phantomAdapter}getWalletType(){return this.walletType}get wallet(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(t=>t.network===this.defaultNetwork))||null}get address(){var t;return(null===(t=this.wallet)||void 0===t?void 0:t.address)||null}get network(){var t;return(null===(t=this.wallet)||void 0===t?void 0:t.network)||null}get ethereumWallet(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(t=>t.network===e.Ethereum&&"Main"===t.wallet_set))||null}get ethereumAddress(){var t;return(null===(t=this.ethereumWallet)||void 0===t?void 0:t.address)||null}get solanaWallet(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(t=>t.network===e.Solana&&"Main"===t.wallet_set))||null}get forwardSolanaWallet(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(t=>t.network===e.Solana&&"Forward-0"===t.wallet_set))||null}get forwardSolanaAddress(){var t;return(null===(t=this.forwardSolanaWallet)||void 0===t?void 0:t.address)||null}get forwardEthereumWallet(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(t=>t.network===e.Ethereum&&"Forward-0"===t.wallet_set))||null}get forwardEthereumAddress(){var t;return(null===(t=this.forwardEthereumWallet)||void 0===t?void 0:t.address)||null}get solanaAddress(){var t;return(null===(t=this.solanaWallet)||void 0===t?void 0:t.address)||null}get id(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.id)||null}get social_links(){var t;return(null===(t=this.walletInfo)||void 0===t?void 0:t.social_links)||null}async reconnect(){try{if("phantom"===n.getWalletType())return await this.connectPhantom();{const t=await this.getSession();return this.setWallet(t),t}}catch(t){return null}}async connectPhantom(){try{if(this.phantomAdapter||(this.phantomAdapter=new d),await this.phantomAdapter.connect(),!this.phantomAdapter.publicKey)throw new Error("Failed to connect to Phantom wallet");const t=this.phantomAdapter.publicKey.toString(),r={id:h(),is_exported:!1,address:t,network:e.Solana,type:a.Phantom,wallets:[{id:t,address:t,network:e.Solana,wallet_type:a.Phantom,wallet_set:"Main"}],social_links:[],social_infos:[],account_info:{name:null}};return this.setWallet(r),this.setWalletType("phantom"),r}catch(t){throw console.error("Phantom connect error:",t),new Error(t instanceof Error?t.message:"Failed to connect to Phantom wallet")}}async updateAccountName(t){if(!this.walletInfo)throw new Error("No wallet info");const e=await this.api.post("/account/update",{name:t},{withCredentials:!0});return this.walletInfo.account_info.name=t,e.data}async signSolanaTransaction(t){try{if(!this.walletInfo)throw new Error("No wallet info");if(!this.solanaConnection)throw new Error("No rpc connection");const{blockhash:a}=await this.solanaConnection.getLatestBlockhash();if(r(t)?t.message.recentBlockhash=a:t.recentBlockhash=a,this.phantomAdapter&&this.phantomAdapter.publicKey)return await this.phantomAdapter.signTransaction(t);const n=this.solanaWallet;if(!n)throw new Error("No solana wallet available");const o={user_id:this.walletInfo.id,address:n.address,network:e.Solana,tx:{Solana:l.encode(r(t)?t.message.serialize():t.serializeMessage())}},s=await this.api.post("/sign2",o,{withCredentials:!0}),{signature:d}=s.data;return t.addSignature(new i(n.address),c.from(l.decode(d))),t}catch(t){throw new Error(t instanceof Error?t.message:"Failed to sign transaction")}}async signEthereumEip712(t){if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const a={user_id:this.walletInfo.id,address:this.ethereumAddress,network:e.Ethereum,tx:{EthereumEip712:t}},r=await this.api.post("/sign2",a,{withCredentials:!0}),{signature:n}=r.data;return n}async sendSolanaTransaction(t){if(!this.solanaConnection)throw new Error("No rpc connection");try{return await this.solanaConnection.sendRawTransaction(t,{maxRetries:3,skipPreflight:!1})}catch(t){throw t}}async sendEthereumTransaction(t){if(!this.ethereumProvider)throw new Error("No Ethereum provider");try{return await this.ethereumProvider.sendRawTransaction({serializedTransaction:t})}catch(t){throw t}}async sendEmailVerificationCode(t){await this.api.post("/send_verification",{email:t})}async sendPhoneVerificationCode(t){t.startsWith("+")||(t=`+${t}`),await this.api.post("/send_verification",{phone:t,type:"phone"})}async verifyEmailVerificationCode({email:t,code:e}){const a={type:"Email",data:{network:this.defaultNetwork,email:t,code:e}},r=(await this.api.post("/login",a,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async verifyPhoneVerificationCode({phone:t,code:e}){const a={type:"Phone",data:{network:this.defaultNetwork,phone:t,code:e}},r=(await this.api.post("/login",a,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async twitterLogin(t){const e={type:"TwitterOAuth",data:{network:this.defaultNetwork,...t}},a=(await this.api.post("/login",e,{withCredentials:!0})).data;return this.setWallet(a),this.setWalletType("embedded"),a}async googleLogin(t){const e={type:"GoogleOAuth",data:{network:this.defaultNetwork,...t}},a=(await this.api.post("/login",e,{withCredentials:!0})).data;return this.setWallet(a),this.setWalletType("embedded"),a}async oauthLogin(t,e){const a={type:t,data:{network:e.network||this.defaultNetwork,...e}},r=(await this.api.post("/login",a,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async loginWithChallenge(t,e){const a={type:t,data:{network:e.network||this.defaultNetwork,...e}},r=(await this.api.post("/login",a,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async oauthInit(t){return(await this.api.post("/oauth/init",t)).data}async getSignChallenge(t){return(await this.api.get(`/challenge?method=${t.method}&id=${t.id}`)).data}async getSession(){const t=(await this.api.get("/session",{withCredentials:!0})).data,{access_token:e,...a}=t;return e&&n.saveAccessToken(e),t}async logout(){this.phantomAdapter?(this.phantomAdapter.disconnect(),this.phantomAdapter=null):await this.api.post("/logout",{},{withCredentials:!0}),this.setWallet(null),n.clear()}async getOAuth2ClientId(t){return(await this.api.get(`/oauth_id/${t}`)).data.client_id}setSelectedWallet(t){this.selectedWalletId=t}getSelectedWallet(){return this.selectedWalletId}async getSolanaBalance(){if(!this.solanaConnection||!this.solanaAddress)throw new Error("Solana connection not available");return(await this.solanaConnection.getBalance(new i(this.solanaAddress))/s).toString()}async getEthereumBalance(){if(!this.ethereumProvider||!this.ethereumAddress)throw new Error("Ethereum provider not available");const t=await this.ethereumProvider.getBalance({address:this.ethereumAddress});return f(t)}async fetchCoinbaseToken(t,e="solana"){return(await this.api.post("/ramp/coinbase",{addresses:[{address:t,blockchains:[e]}],assets:["solana"===e?"SOL":"ETH"]})).data.token}viemSignerAdapter(){return{signTypedData:async t=>{if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const a={user_id:this.walletInfo.id,address:this.ethereumAddress,network:e.Ethereum,tx:{EthereumEip712:t}},r=await this.api.post("/sign2",a,{withCredentials:!0}),{signature:n}=r.data,o=l.decode(n),i=o[64];return p({r:`0x${c.from(o.slice(0,32)).toString("hex")}`,s:`0x${c.from(o.slice(32,64)).toString("hex")}`,v:BigInt(i+27)})}}}async createMiddleAccount(t){try{return(await this.middleAccountApi.post("/create",t)).data}catch(t){throw new Error(t instanceof Error?t.message:"Failed to create middle account")}}async getCoinbaseOnrampUrlForMiddleAccount(t){try{const a={sessionToken:await this.fetchCoinbaseToken(t.middleAccountAddress,t.network===e.Solana?"solana":"ethereum"),presetCryptoAmount:Number(t.amount),redirectUrl:t.redirectUrl||window.location.href};return u(a)}catch(t){throw new Error(t instanceof Error?t.message:"Failed to get Coinbase onramp URL")}}async getOrderState(t){try{return(await this.middleAccountApi.get(`/order/${t}`)).data}catch(t){throw new Error(t instanceof Error?t.message:"Failed to get order status")}}async transfer(t){var e,a;if(!this.walletInfo)throw new Error("No wallet info available");const r={user_id:this.walletInfo.id,from:t.from,to:t.to,amount:t.amount,decimals:t.decimals,token:t.token,network:t.network,chain_id:t.chain_id};try{return(await this.api.post("/transfer",r,{withCredentials:!0})).data.tx_hash}catch(t){if(null===(a=null===(e=t.response)||void 0===e?void 0:e.data)||void 0===a?void 0:a.error)throw new Error(t.response.data.error);throw new Error(t instanceof Error?t.message:"Transfer failed")}}async transferEthereum(t){if(!this.ethereumAddress)throw new Error("No Ethereum address available");const a={from:this.ethereumAddress,to:t.to,amount:t.amount,decimals:t.decimals,token:t.token,network:e.Ethereum,chain_id:t.chain_id};return this.transfer(a)}}export{g as WalletClient};
2
2
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sources":["../../../../src/client.ts"],"sourcesContent":[null],"names":["WalletClient","constructor","config","this","selectedWalletId","solanaConnection","ethereumProvider","walletInfo","phantomAdapter","walletType","ethereumNetwork","defaultNetwork","Network","Solana","api","axios","create","baseURL","headers","middleAccountApi","middleAccountBaseURL","solanaCluster","Connection","rpcUrl","chainId","Number","createPublicClient","transport","http","setWallet","wallet","setWalletType","type","Storage","saveWalletType","getWallet","getPhantomAdapter","getWalletType","_a","wallets","find","network","address","ethereumWallet","Ethereum","wallet_set","ethereumAddress","solanaWallet","forwardSolanaWallet","forwardSolanaAddress","forwardEthereumWallet","forwardEthereumAddress","solanaAddress","id","social_links","reconnect","connectPhantom","getSession","error","PhantomWalletAdapter","connect","publicKey","Error","toString","uuidv4","is_exported","WalletType","Phantom","wallet_type","social_infos","account_info","name","console","message","updateAccountName","response","post","withCredentials","data","signSolanaTransaction","transaction","blockhash","getLatestBlockhash","isVersionedTransaction","recentBlockhash","signTransaction","signRequest","user_id","tx","bs58","encode","serialize","serializeMessage","signature","addSignature","PublicKey","Buffer","from","decode","signEthereumEip712","params","EthereumEip712","sendSolanaTransaction","sendRawTransaction","maxRetries","skipPreflight","sendEthereumTransaction","signedTransaction","serializedTransaction","sendEmailVerificationCode","email","sendPhoneVerificationCode","phone","startsWith","verifyEmailVerificationCode","code","verifyPhoneVerificationCode","twitterLogin","googleLogin","oauthLogin","loginWithChallenge","oauthInit","getSignChallenge","get","method","access_token","rest","saveAccessToken","logout","disconnect","clear","getOAuth2ClientId","provider","client_id","setSelectedWallet","walletId","getSelectedWallet","getSolanaBalance","getBalance","LAMPORTS_PER_SOL","getEthereumBalance","balance","ethers.formatEther","fetchCoinbaseToken","blockchain","addresses","blockchains","assets","token","viemSignerAdapter","signTypedData","async","signatureBytes","recId","signatureToHex","r","slice","s","v","BigInt","createMiddleAccount","request","getCoinbaseOnrampUrlForMiddleAccount","sessionToken","middleAccountAddress","presetCryptoAmount","amount","redirectUrl","window","location","href","getOnrampBuyUrl","getOrderState","orderId"],"mappings":"uoCA2EaA,EAcX,WAAAC,CAAYC,GAXJC,KAAAC,iBAAkC,KAClCD,KAAAE,iBAAsC,KAEtCF,KAAAG,iBAAwC,KACxCH,KAAAI,WAAgC,KAChCJ,KAAAK,eAA8C,KAC9CL,KAAAM,WAAqC,WAErCN,KAAAO,gBAA0C,KAC1CP,KAAAQ,eAA0BC,EAAQC,OAGxCV,KAAKW,IAAMC,EAAMC,OAAO,CACtBC,QAASf,EAAOe,QAChBC,QAAS,CACP,eAAgB,sBAIpBf,KAAKgB,iBAAmBJ,EAAMC,OAAO,CACnCC,QACEf,EAAOkB,sBACP,qEACFF,QAAS,CACP,eAAgB,sBAepBf,KAAKkB,cAAgBnB,EAAOmB,cAC5BlB,KAAKE,iBAAmB,IAAIiB,EAAWpB,EAAOmB,cAAcE,QAExDrB,EAAOQ,kBAETP,KAAKO,gBAAkB,IAClBR,EAAOQ,gBACVc,QAASC,OAAOvB,EAAOQ,gBAAgBc,UAOzCrB,KAAKG,iBAAmBoB,EAAmB,CACzCC,UAAWC,EAAK1B,EAAOQ,gBAAgBa,WAI3CpB,KAAKQ,eAAiBT,EAAOS,gBAAkBC,EAAQC,MACzD,CAEQ,SAAAgB,CAAUC,GAChB3B,KAAKI,WAAauB,CACpB,CAEQ,aAAAC,CAAcC,GACpB7B,KAAKM,WAAauB,EAClBC,EAAQC,eAAeF,EACzB,CAEA,SAAAG,GACE,OAAOhC,KAAKI,UACd,CAEA,iBAAA6B,GACE,OAAOjC,KAAKK,cACd,CAEA,aAAA6B,GACE,OAAOlC,KAAKM,UACd,CAEA,UAA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AE,MAAOpB,GACP,MAAM,IAAII,MACRJ,aAAiBI,MAAQJ,EAAMe,QAAU,6BAE7C,CACF"}
1
+ {"version":3,"file":"client.js","sources":["../../../../src/client.ts"],"sourcesContent":[null],"names":["WalletClient","constructor","config","this","selectedWalletId","solanaConnection","ethereumProvider","walletInfo","phantomAdapter","walletType","ethereumNetwork","defaultNetwork","Network","Solana","api","axios","create","baseURL","headers","middleAccountApi","middleAccountBaseURL","solanaCluster","Connection","rpcUrl","chainId","Number","createPublicClient","transport","http","setWallet","wallet","setWalletType","type","Storage","saveWalletType","getWallet","getPhantomAdapter","getWalletType","_a","wallets","find","network","address","ethereumWallet","Ethereum","wallet_set","ethereumAddress","solanaWallet","forwardSolanaWallet","forwardSolanaAddress","forwardEthereumWallet","forwardEthereumAddress","solanaAddress","id","social_links","reconnect","connectPhantom","getSession","error","PhantomWalletAdapter","connect","publicKey","Error","toString","uuidv4","is_exported","WalletType","Phantom","wallet_type","social_infos","account_info","name","console","message","updateAccountName","response","post","withCredentials","data","signSolanaTransaction","transaction","blockhash","getLatestBlockhash","isVersionedTransaction","recentBlockhash","signTransaction","signRequest","user_id","tx","bs58","encode","serialize","serializeMessage","signature","addSignature","PublicKey","Buffer","from","decode","signEthereumEip712","params","EthereumEip712","sendSolanaTransaction","sendRawTransaction","maxRetries","skipPreflight","sendEthereumTransaction","signedTransaction","serializedTransaction","sendEmailVerificationCode","email","sendPhoneVerificationCode","phone","startsWith","verifyEmailVerificationCode","code","verifyPhoneVerificationCode","twitterLogin","googleLogin","oauthLogin","loginWithChallenge","oauthInit","getSignChallenge","get","method","access_token","rest","saveAccessToken","logout","disconnect","clear","getOAuth2ClientId","provider","client_id","setSelectedWallet","walletId","getSelectedWallet","getSolanaBalance","getBalance","LAMPORTS_PER_SOL","getEthereumBalance","balance","ethers.formatEther","fetchCoinbaseToken","blockchain","addresses","blockchains","assets","token","viemSignerAdapter","signTypedData","async","signatureBytes","recId","signatureToHex","r","slice","s","v","BigInt","createMiddleAccount","request","getCoinbaseOnrampUrlForMiddleAccount","sessionToken","middleAccountAddress","presetCryptoAmount","amount","redirectUrl","window","location","href","getOnrampBuyUrl","getOrderState","orderId","transfer","transferRequest","to","decimals","chain_id","tx_hash","_b","transferEthereum","transferParams"],"mappings":"uoCA6EaA,EAcX,WAAAC,CAAYC,GAXJC,KAAAC,iBAAkC,KAClCD,KAAAE,iBAAsC,KAEtCF,KAAAG,iBAAwC,KACxCH,KAAAI,WAAgC,KAChCJ,KAAAK,eAA8C,KAC9CL,KAAAM,WAAqC,WAErCN,KAAAO,gBAA0C,KAC1CP,KAAAQ,eAA0BC,EAAQC,OAGxCV,KAAKW,IAAMC,EAAMC,OAAO,CACtBC,QAASf,EAAOe,QAChBC,QAAS,CACP,eAAgB,sBAIpBf,KAAKgB,iBAAmBJ,EAAMC,OAAO,CACnCC,QACEf,EAAOkB,sBACP,qEACFF,QAAS,CACP,eAAgB,sBAepBf,KAAKkB,cAAgBnB,EAAOmB,cAC5BlB,KAAKE,iBAAmB,IAAIiB,EAAWpB,EAAOmB,cAAcE,QAExDrB,EAAOQ,kBAETP,KAAKO,gBAAkB,IAClBR,EAAOQ,gBACVc,QAASC,OAAOvB,EAAOQ,gBAAgBc,UAOzCrB,KAAKG,iBAAmBoB,EAAmB,CACzCC,UAAWC,EAAK1B,EAAOQ,gBAAgBa,WAI3CpB,KAAKQ,eAAiBT,EAAOS,gBAAkBC,EAAQC,MACzD,CAEQ,SAAAgB,CAAUC,GAChB3B,KAAKI,WAAauB,CACpB,CAEQ,aAAAC,CAAcC,GACpB7B,KAAKM,WAAauB,EAClBC,EAAQC,eAAeF,EACzB,CAEA,SAAAG,GACE,OAAOhC,KAAKI,UACd,CAEA,iBAAA6B,GACE,OAAOjC,KAAKK,cACd,CAEA,aAAA6B,GACE,OAAOlC,KAAKM,UACd,CAEA,UAAIqB,SACF,OACiB,QAAfQ,EAAAnC,KAAKI,kBAAU,IAAA+B,OAAA,EAAAA,EAAEC,QAAQC,KACtBV,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qG,CAAS1E,WASb,IAAKjG,KAAKI,WACR,MAAM,IAAIuD,MAAM,4BAGlB,MAAMiH,EAAmC,CACvCxF,QAASpF,KAAKI,WAAW8C,GACzB4C,KAAMG,EAAOH,KACb+E,GAAI5E,EAAO4E,GACXV,OAAQlE,EAAOkE,OACfW,SAAU7E,EAAO6E,SACjB7B,MAAOhD,EAAOgD,MACd3G,QAAS2D,EAAO3D,QAChByI,SAAU9E,EAAO8E,UAGnB,IASE,aARuB/K,KAAKW,IAAI8D,KAC9B,YACAmG,EACA,CACElG,iBAAiB,KAILC,KAAKqG,OACvB,CAAE,MAAOzH,GAEP,GAAwB,QAApB0H,UAAA9I,EAAAoB,EAAMiB,+BAAUG,YAAI,IAAAsG,OAAA,EAAAA,EAAE1H,MACxB,MAAM,IAAII,MAAMJ,EAAMiB,SAASG,KAAKpB,OAEtC,MAAM,IAAII,MACRJ,aAAiBI,MAAQJ,EAAMe,QAAU,kBAE7C,CACF,CAOA,sBAAM4G,CAAiBjF,GAOrB,IAAKjG,KAAK2C,gBACR,MAAM,IAAIgB,MAAM,iCAGlB,MAAMwH,EAAiB,CACrBrF,KAAM9F,KAAK2C,gBACXkI,GAAI5E,EAAO4E,GACXV,OAAQlE,EAAOkE,OACfW,SAAU7E,EAAO6E,SACjB7B,MAAOhD,EAAOgD,MACd3G,QAAS7B,EAAQgC,SACjBsI,SAAU9E,EAAO8E,UAGnB,OAAO/K,KAAK2K,SAASQ,EACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../src/types.ts"],"sourcesContent":[null],"names":["isVersionedTransaction","transaction","Network","WalletType","SocialType"],"mappings":"AAkBM,SAAUA,EACdC,GAEA,MAAO,YAAaA,CACtB,KAeYC,EAKAC,EAKAC,GAVZ,SAAYF,GACVA,EAAA,OAAA,SACAA,EAAA,SAAA,UACD,CAHD,CAAYA,IAAAA,EAAO,CAAA,IAKnB,SAAYC,GACVA,EAAA,QAAA,UACAA,EAAA,SAAA,UACD,CAHD,CAAYA,IAAAA,EAAU,CAAA,IAKtB,SAAYC,GACVA,EAAA,MAAA,QACAA,EAAA,OAAA,SACAA,EAAA,QAAA,UACAA,EAAA,QAAA,UACAA,EAAA,MAAA,QACAA,EAAA,IAAA,KACD,CAPD,CAAYA,IAAAA,EAAU,CAAA"}
1
+ {"version":3,"file":"types.js","sources":["../../../../src/types.ts"],"sourcesContent":[null],"names":["isVersionedTransaction","transaction","Network","WalletType","SocialType"],"mappings":"AAkBM,SAAUA,EACdC,GAEA,MAAO,YAAaA,CACtB,KAgBYC,EAKAC,EAKAC,GAVZ,SAAYF,GACVA,EAAA,OAAA,SACAA,EAAA,SAAA,UACD,CAHD,CAAYA,IAAAA,EAAO,CAAA,IAKnB,SAAYC,GACVA,EAAA,QAAA,UACAA,EAAA,SAAA,UACD,CAHD,CAAYA,IAAAA,EAAU,CAAA,IAKtB,SAAYC,GACVA,EAAA,MAAA,QACAA,EAAA,OAAA,SACAA,EAAA,QAAA,UACAA,EAAA,QAAA,UACAA,EAAA,MAAA,QACAA,EAAA,IAAA,KACD,CAPD,CAAYA,IAAAA,EAAU,CAAA"}
@@ -116,7 +116,7 @@ export declare class WalletClient {
116
116
  client_id: string;
117
117
  }>;
118
118
  getSignChallenge(params: {
119
- method: "phantom" | "metamask" | "rabby" | "coinbase";
119
+ method: "phantom" | "metamask" | "rabby" | "coinbase" | "walletconnect";
120
120
  id: string;
121
121
  }): Promise<{
122
122
  challenge: string;
@@ -165,6 +165,32 @@ export declare class WalletClient {
165
165
  * @returns order status
166
166
  */
167
167
  getOrderState(orderId: string): Promise<OrderState>;
168
+ /**
169
+ * Transfer tokens using the server-side transfer API
170
+ * @param params Transfer parameters
171
+ * @returns Transaction hash
172
+ */
173
+ transfer(params: {
174
+ from: string;
175
+ to: string;
176
+ amount: string;
177
+ decimals: number;
178
+ token: string;
179
+ network: Network;
180
+ chain_id: number;
181
+ }): Promise<string>;
182
+ /**
183
+ * Transfer Ethereum tokens (ERC-20 or native ETH)
184
+ * @param params Transfer parameters
185
+ * @returns Transaction hash
186
+ */
187
+ transferEthereum(params: {
188
+ to: string;
189
+ amount: string;
190
+ decimals: number;
191
+ token: string;
192
+ chain_id: number;
193
+ }): Promise<string>;
168
194
  }
169
195
  export type SignTransactionReturnType<serializer extends viem.SerializeTransactionFn<viem.TransactionSerializable> = viem.SerializeTransactionFn<viem.TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]> = viem.TransactionSerialized<viem.GetTransactionType<transaction>>;
170
196
  export {};
@@ -33,7 +33,7 @@ export declare function useLoginModal({ client, isOpen, onClose, onLogin, isLoad
33
33
  handleCodeSubmit: (code?: string, emailInput?: string) => Promise<void>;
34
34
  handlePhoneCodeSubmit: (code?: string, phoneInput?: string) => Promise<void>;
35
35
  handleSendPhoneVerificationCode: (phoneInput?: string) => Promise<void>;
36
- handleGetChallenge: (address: string, method?: "metamask" | "phantom" | "rabby" | "coinbase") => Promise<{
36
+ handleGetChallenge: (address: string, method?: "metamask" | "phantom" | "rabby" | "coinbase" | "walletconnect") => Promise<{
37
37
  challenge: string;
38
38
  nonce: string;
39
39
  expires_at: number;
@@ -3,7 +3,7 @@ import { WalletClient } from "./client";
3
3
  export type SupportedTransactionVersions = ReadonlySet<TransactionVersion> | null | undefined;
4
4
  export type TransactionOrVersionedTransaction<S extends SupportedTransactionVersions> = S extends null | undefined ? Transaction : Transaction | VersionedTransaction;
5
5
  export declare function isVersionedTransaction(transaction: Transaction | VersionedTransaction): transaction is VersionedTransaction;
6
- export type LoginType = "TwitterOAuth" | "GoogleOAuth" | "Phantom" | "Okx" | "Email" | "Phone" | "Telegram" | "TelegramOAuth" | "MetaMask" | "Rabby" | "Coinbase";
6
+ export type LoginType = "TwitterOAuth" | "GoogleOAuth" | "Phantom" | "Okx" | "Email" | "Phone" | "Telegram" | "TelegramOAuth" | "MetaMask" | "Rabby" | "Coinbase" | "WalletConnect";
7
7
  export declare enum Network {
8
8
  Solana = "Solana",
9
9
  Ethereum = "Ethereum"
@@ -131,3 +131,16 @@ export interface OrderState {
131
131
  payment_address: string;
132
132
  received: number;
133
133
  }
134
+ export interface TransferRequest {
135
+ user_id: string;
136
+ from: string;
137
+ to: string;
138
+ amount: string;
139
+ decimals: number;
140
+ token: string;
141
+ network: Network;
142
+ chain_id: number;
143
+ }
144
+ export interface TransferResponse {
145
+ tx_hash: string;
146
+ }