@spicenet-io/spiceflow-ui 3.0.0 → 3.0.2

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.
Files changed (43) hide show
  1. package/dist/{auth-dynamic-C-_mXQTw.js → auth-dynamic-CG0Ou9V1.js} +1 -1
  2. package/dist/{auth-dynamic-te0UmMBN.js → auth-dynamic-CaSspPic.js} +1 -1
  3. package/dist/auth-dynamic.cjs.js +1 -1
  4. package/dist/auth-dynamic.js +1 -1
  5. package/dist/auth-privy.js +1 -1
  6. package/dist/auth-starknet.cjs.js +1 -1
  7. package/dist/auth-starknet.js +1 -1
  8. package/dist/components/AccountDisplay/AccountActions.d.ts +1 -1
  9. package/dist/components/SpiceDeposit/DepositRecoveryPrompt.d.ts +0 -1
  10. package/dist/components/SpiceWithdraw/SpiceWithdraw.d.ts +0 -7
  11. package/dist/components/ui/SpiceModalShell.d.ts +0 -1
  12. package/dist/errors.d.ts +1 -1
  13. package/dist/hooks/index.d.ts +0 -1
  14. package/dist/hooks/useGaslessExecution/index.d.ts +7 -1
  15. package/dist/hooks/useSupplyAssets.d.ts +3 -0
  16. package/dist/index-BOMLw4PF.js +2 -0
  17. package/dist/index-DFMaR3pe.js +2 -0
  18. package/dist/index.cjs.js +11 -11
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +13 -13
  21. package/dist/providers/SpiceFlowProvider.d.ts +0 -2
  22. package/dist/types/account.d.ts +0 -3
  23. package/dist/types/assets.d.ts +0 -11
  24. package/dist/types/authorization.d.ts +0 -1
  25. package/dist/types/index.d.ts +0 -1
  26. package/dist/types/supply.d.ts +1 -7
  27. package/dist/useSpiceBrand-Dk9KS_yU.js +2 -0
  28. package/dist/useSpiceBrand-QbPbGjw5.js +2 -0
  29. package/dist/utils/chains/index.d.ts +0 -2
  30. package/dist/utils/logos.d.ts +0 -2
  31. package/dist/utils/relayer/index.d.ts +14 -8
  32. package/package.json +2 -2
  33. package/dist/hooks/useSmartWallet.d.ts +0 -1
  34. package/dist/index-CmpsCAqC.js +0 -2
  35. package/dist/index-Uh1tWOql.js +0 -2
  36. package/dist/types/rollup.d.ts +0 -50
  37. package/dist/useSpiceBrand-CIwsc5dY.js +0 -2
  38. package/dist/useSpiceBrand-DAo6xoE2.js +0 -2
  39. package/dist/utils/abis/spicenet.d.ts +0 -49
  40. package/dist/utils/abis/spicenetWalletManager.d.ts +0 -566
  41. package/dist/utils/assetDisplay.d.ts +0 -4
  42. package/dist/utils/rollupBalances.d.ts +0 -14
  43. /package/dist/{Button-CaguAr48.js → Button-DjsYc4v4.js} +0 -0
@@ -15,7 +15,6 @@ export declare const SpiceFlowProviderContext: React.Context<{
15
15
  nativeChainId?: number;
16
16
  appName?: string;
17
17
  apiUrl?: string;
18
- rpcOverrides?: Record<number, string>;
19
18
  } | null>;
20
19
  export interface SpiceFlowProviderProps {
21
20
  children: React.ReactNode;
@@ -33,6 +32,5 @@ export interface SpiceFlowProviderProps {
33
32
  appName?: string;
34
33
  apiUrl?: string;
35
34
  theme?: SpiceTheme;
36
- rpcOverrides?: Record<number, string>;
37
35
  }
38
36
  export declare const SpiceFlowProvider: React.FC<SpiceFlowProviderProps>;
@@ -15,11 +15,8 @@ export interface CustomSection {
15
15
  export interface SpiceAsset {
16
16
  tokenAddress: string;
17
17
  tokenSymbol: string;
18
- tokenDisplaySymbol?: string;
19
- tokenDisplayName?: string;
20
18
  tokenDecimals: number;
21
19
  chainId: number;
22
- chainDisplayName?: string;
23
20
  balance: string;
24
21
  balanceFormatted: number;
25
22
  usdValue: number;
@@ -11,17 +11,6 @@ export interface Asset {
11
11
  balanceUsd: number;
12
12
  isNative: boolean;
13
13
  logoURI?: string;
14
- displaySymbol?: string;
15
- displayName?: string;
16
- displayChainName?: string;
17
- receiptTokenId?: string;
18
- receiptTokenName?: string;
19
- receiptTokenDecimals?: number;
20
- chainTokens?: Record<string, {
21
- name?: string;
22
- decimals?: number;
23
- }>;
24
- isUniversal?: boolean;
25
14
  }
26
15
  export interface SelectedAsset {
27
16
  asset: Asset;
@@ -14,7 +14,6 @@ export interface ChainBatch {
14
14
  chainId: number;
15
15
  calls: Call[];
16
16
  tokenTransfers?: TokenTransferConfig[];
17
- domain?: "evm" | "spicenet";
18
17
  }
19
18
  export interface IntentAuthorization {
20
19
  signature: string;
@@ -7,4 +7,3 @@ export type { Authorization, ChainBatch, IntentAuthorization, } from "./authoriz
7
7
  export * from "./wallet";
8
8
  export * from "./balance";
9
9
  export * from "./unified";
10
- export * from "./rollup";
@@ -1,6 +1,6 @@
1
1
  import type React from "react";
2
2
  import type { Address } from "viem";
3
- import type { Call, ChainBatch } from "./authorization";
3
+ import type { Call } from "./authorization";
4
4
  import type { CustomStyles } from "./theme";
5
5
  export interface DestinationTokenConfig {
6
6
  address: Address;
@@ -19,12 +19,6 @@ export interface SpiceSupplyProps {
19
19
  onClose: () => void;
20
20
  destinationToken: DestinationTokenConfig;
21
21
  buildActionCalls: (amount: bigint, ctx: BuildActionCallsContext) => Call[];
22
- buildSpicenetBatch?: (params: {
23
- userAddress: Address;
24
- destinationChainId: number;
25
- deliveryToken: Address;
26
- deliveryAmount: bigint;
27
- }) => ChainBatch | null;
28
22
  actionLabel: string;
29
23
  amountDirection?: "input" | "output";
30
24
  swapDescription?: string;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";const l=require("react"),g=require("react/jsx-runtime"),I=require("@spicenet-io/spiceflow-core"),P=require("./index-BOMLw4PF.js"),v=require("./Button-B_UpyUH-.js");class d extends Error{constructor(e,s,r={}){super(s),this.code=e,this.context=r,this.name="SpiceflowError",Error.captureStackTrace&&Error.captureStackTrace(this,d)}}function k(a){return a instanceof d}const B=typeof process<"u"&&process.env?.NEXT_PUBLIC_RELAYER_API_URL||"https://tx-submission-api-dev.spicenet.io";class R{constructor(){this.baseUrl=B}setBaseUrl(e){this.baseUrl=e}async createAction(e){const s=await fetch(`${this.baseUrl}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o)});if(!s.ok){const r=await s.text();throw new d("RELAYER_ERROR",`Relayer API error: ${s.status} - ${r}`,{httpStatus:s.status,responseBody:r,endpoint:"/actions"})}return s.json()}async executeStep(e,s,r,o){const t=await fetch(`${this.baseUrl}/actions/${e}/intents/${s}/steps/${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!t.ok){const n=await t.text();throw new d("RELAYER_EXECUTE_ERROR",`Execute step error: ${t.status} - ${n}`,{httpStatus:t.status,responseBody:n,endpoint:`/actions/${e}/intents/${s}/steps/${r}`,actionId:e})}return{success:!0,transactionHash:(await t.json()).transactionHash}}async checkStepStatus(e,s){const r=e.split("/");let o="";if(r.length>=2){const i=r[0],c=r[1];o=`${this.baseUrl}/actions/${i}/intents/${c}/steps/${s}`}else o=`${this.baseUrl}/actions/${e}/intents/0/steps/${s}`;const t=await fetch(o);if(!t.ok)throw new d("RELAYER_STATUS_ERROR",`Intent step status check failed: ${t.status}`,{httpStatus:t.status,endpoint:o,intentId:e});const n=await t.json();return{success:!0,data:{status:n.status==="error"?"reverted":n.status,transactionHash:n.txid}}}async submitSpiceDeposit(e){const s=e.isDeposit?"deposit":"withdrawal";try{const r=await fetch(`${this.baseUrl}/spicedeposit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await r.json();return!r.ok||!o.success?(console.error(`Failed to submit ${s} request to API:`,o.error?.message),{success:!1,error:o.error}):o}catch(r){return console.error(`Error submitting ${s} request to API:`,r),{success:!1,error:{message:r instanceof Error?r.message:"Unknown error"}}}}async requestAirdrop(e){try{const s=await fetch(`${this.baseUrl}/airdrop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:e.tag||"default",airdrops:[{chainId:e.chainId,tokenId:e.tokenId,wallet:e.wallet,amount:e.amount||"0.0001"}]})}),r=await s.json().catch(()=>({}));if(!s.ok){const t=r?.message||r?.errors?.[0]?.error||"Failed to request airdrop";return{success:!1,errorMessage:String(t)}}const o=r?.airdrops?.[e.chainId]?.[e.tokenId]?.txHash;return r.errors&&r.errors.length>0?{success:!1,errorMessage:r.errors[0].error}:{success:!0,txHash:o}}catch(s){return{success:!1,errorMessage:s?.message&&typeof s.message=="string"?s.message:"Failed to request airdrop"}}}}const x=new R,C=(a,e)=>{const s=o=>e?e(o):P.getChainName(o),r=[];return a.forEach((o,t)=>{const n=o.calls&&o.calls.length>0,i=o.tokenTransfers&&o.tokenTransfers.length>0;if(n||i){const c={stepId:t,status:t===0?"processing":"pending",chainId:o.chainId,chainName:s(o.chainId),description:"Processing transaction"};r.push(c)}}),r},b=l.createContext(null),m=l.createContext(null),$=({children:a,provider:e,supportedChainIds:s,network:r="testnet",mode:o="7702",skipFlow:t=[],nativeChainId:n,appName:i="Spicenet",apiUrl:c,theme:u})=>{c&&x.setBaseUrl(c);const h=s??I.getChainIdsByNetwork(r),f=u??null,[w,S]=l.useState(o),T=l.useCallback(E=>S(E),[]);return g.jsx(b.Provider,{value:f,children:g.jsx(m.Provider,{value:{provider:e,supportedChainIds:h,skipFlow:t,mode:w,setMode:T,network:r,nativeChainId:n,appName:i,apiUrl:c},children:a})})};function p(a,e){const s=a.replace("#",""),r=Math.max(0,Math.round(parseInt(s.substring(0,2),16)*(1-e))),o=Math.max(0,Math.round(parseInt(s.substring(2,4),16)*(1-e))),t=Math.max(0,Math.round(parseInt(s.substring(4,6),16)*(1-e)));return`#${r.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}`}function U(a,e){return{shell:e?.shell??"#141414",shellBorder:e?.shellBorder??p(e?.shell??"#141414",.35),shellInnerBorder:e?.shellInnerBorder??p(e?.shell??"#141414",.55),cardBg:e?.cardBg??"#1e1e1e",inputBg:e?.inputBg??"#171717",hoverBg:e?.hoverBg??"#2a2a2a",textPrimary:e?.textPrimary??"#ffffff",textSecondary:e?.textSecondary??"#888888",inputText:e?.inputText??"#e0e0e0",inputPlaceholder:e?.inputPlaceholder??"#555555",cardBorder:e?.cardBorder??"rgba(255,255,255,0.08)",inputBorder:e?.inputBorder??"rgba(255,255,255,0.10)",buttonBorder:e?.buttonBorder??"rgba(255,255,255,0.12)",successBg:e?.successBg??"#0a1f18",successBorder:e?.successBorder??"#1a4a3a",successText:e?.successText??"#6ee7b7",warningBg:e?.warningBg??"#1f1a0d",warningBorder:e?.warningBorder??"#4a3820",warningText:e?.warningText??"#fbbf24",errorBg:e?.errorBg??"#1f0d0d",errorBorder:e?.errorBorder??"#4a2020",errorText:e?.errorText??"#f87171",infoBg:e?.infoBg??"#0d1325",infoBorder:e?.infoBorder??"#2a3a5a",infoText:e?.infoText??"#60a5fa"}}function A(a){return{shell:"#ffffff",shellBorder:"#E9E9E9",shellInnerBorder:"#D5D5D5",cardBg:"#f9fafb",inputBg:"#ffffff",hoverBg:"#f3f4f6",textPrimary:"#111827",textSecondary:"#6b7280",inputText:"#111827",inputPlaceholder:"#9ca3af",cardBorder:"#E0E0E0",inputBorder:"#d1d5db",buttonBorder:"#0e0d0b",successBg:"#d1fae5",successBorder:"#6ee7b7",successText:"#065f46",warningBg:"#fef3c7",warningBorder:"#fcd34d",warningText:"#92400e",errorBg:"#fee2e2",errorBorder:"#fca5a5",errorText:"#dc2626",infoBg:"#dbeafe",infoBorder:"#93c5fd",infoText:"#1e40af"}}function y(a,e){const s=e?{...a,...e}:a,r=s.dark??!1,o=s.primaryColor,t=s.shell??(r?"#141414":"#ffffff");return{primaryColor:o,dark:r,fontFamily:s.fontFamily??'"Helvetica Neue", sans-serif',appName:s.appName??"Spicenet",logo:s.logo,borderRadius:s.borderRadius??"8px",shell:t,shellBorder:p(t,r?.35:.085),shellInnerBorder:p(t,r?.55:.165),card:s.card??(r?"#1e1e1e":"#f9fafb"),input:r?"#171717":"#ffffff",hover:r?"#2a2a2a":"#f3f4f6",text:s.text??(r?"#ffffff":"#111827"),textMuted:s.textMuted??(r?"#888888":"#6b7280"),inputText:r?"#e0e0e0":"#111827",inputPlaceholder:r?"#555555":"#9ca3af",border:s.border??(r?"rgba(255,255,255,0.08)":"#E0E0E0"),inputBorder:r?"rgba(255,255,255,0.10)":"#d1d5db",buttonBorder:r?"rgba(255,255,255,0.12)":"#0e0d0b",successBg:r?"#0a1f18":"#d1fae5",successBorder:r?"#1a4a3a":"#6ee7b7",successText:r?"#6ee7b7":"#065f46",warningBg:r?"#1f1a0d":"#fef3c7",warningBorder:r?"#4a3820":"#fcd34d",warningText:r?"#fbbf24":"#92400e",errorBg:r?"#1f0d0d":"#fee2e2",errorBorder:r?"#4a2020":"#fca5a5",errorText:r?"#f87171":"#dc2626",infoBg:r?"#0d1325":"#dbeafe",infoBorder:r?"#2a3a5a":"#93c5fd",infoText:r?"#60a5fa":"#1e40af"}}function F(a,e){const s=l.useContext(b)??void 0;return l.useMemo(()=>{const r=s??{primaryColor:"#EA4B4B"},o={...a?.primaryColor?{primaryColor:a.primaryColor}:{},...a?.fontFamily?{fontFamily:a.fontFamily}:{},...e!==void 0?{dark:e}:{}},t=y(r,o),{dark:n,primaryColor:i,appName:c}=t,u=v.createTheme(n?"dark":"light"),h={...u,colors:{...u.colors,primary:i,primaryHover:`${i}dd`},typography:{...u.typography,fontFamily:t.fontFamily}},f={shell:t.shell,shellBorder:t.shellBorder,shellInnerBorder:t.shellInnerBorder,cardBg:t.card,inputBg:t.input,hoverBg:t.hover,textPrimary:t.text,textSecondary:t.textMuted,inputText:t.inputText,inputPlaceholder:t.inputPlaceholder,cardBorder:t.border,inputBorder:t.inputBorder,buttonBorder:t.buttonBorder,successBg:t.successBg,successBorder:t.successBorder,successText:t.successText,warningBg:t.warningBg,warningBorder:t.warningBorder,warningText:t.warningText,errorBg:t.errorBg,errorBorder:t.errorBorder,errorText:t.errorText,infoBg:t.infoBg,infoBorder:t.infoBorder,infoText:t.infoText};return{brand:s,theme:h,dark:n,appName:c,primaryColor:i,dk:f,palette:f}},[s,a,e])}exports.RELAYER_API_URL=B,exports.SpiceFlowProvider=$,exports.SpiceFlowProviderContext=m,exports.SpiceflowError=d,exports.buildDarkPalette=U,exports.buildLightPalette=A,exports.createInitialSteps=C,exports.isSpiceflowError=k,exports.relayerService=x,exports.resolveTheme=y,exports.useSpiceBrand=F;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{createContext as h,useState as I,useCallback as k,useContext as $,useMemo as v}from"react";import{jsx as g}from"react/jsx-runtime";import{getChainIdsByNetwork as P}from"@spicenet-io/spiceflow-core";import{g as R}from"./index-DFMaR3pe.js";import{c as C}from"./Button-DjsYc4v4.js";class d extends Error{constructor(e,s,r={}){super(s),this.code=e,this.context=r,this.name="SpiceflowError",Error.captureStackTrace&&Error.captureStackTrace(this,d)}}function U(o){return o instanceof d}const B=typeof process<"u"&&process.env?.NEXT_PUBLIC_RELAYER_API_URL||"https://tx-submission-api-dev.spicenet.io";class N{constructor(){this.baseUrl=B}setBaseUrl(e){this.baseUrl=e}async createAction(e){const s=await fetch(`${this.baseUrl}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(r,a)=>typeof a=="bigint"?a.toString():a)});if(!s.ok){const r=await s.text();throw new d("RELAYER_ERROR",`Relayer API error: ${s.status} - ${r}`,{httpStatus:s.status,responseBody:r,endpoint:"/actions"})}return s.json()}async executeStep(e,s,r,a){const t=await fetch(`${this.baseUrl}/actions/${e}/intents/${s}/steps/${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!t.ok){const n=await t.text();throw new d("RELAYER_EXECUTE_ERROR",`Execute step error: ${t.status} - ${n}`,{httpStatus:t.status,responseBody:n,endpoint:`/actions/${e}/intents/${s}/steps/${r}`,actionId:e})}return{success:!0,transactionHash:(await t.json()).transactionHash}}async checkStepStatus(e,s){const r=e.split("/");let a="";if(r.length>=2){const i=r[0],c=r[1];a=`${this.baseUrl}/actions/${i}/intents/${c}/steps/${s}`}else a=`${this.baseUrl}/actions/${e}/intents/0/steps/${s}`;const t=await fetch(a);if(!t.ok)throw new d("RELAYER_STATUS_ERROR",`Intent step status check failed: ${t.status}`,{httpStatus:t.status,endpoint:a,intentId:e});const n=await t.json();return{success:!0,data:{status:n.status==="error"?"reverted":n.status,transactionHash:n.txid}}}async submitSpiceDeposit(e){const s=e.isDeposit?"deposit":"withdrawal";try{const r=await fetch(`${this.baseUrl}/spicedeposit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await r.json();return!r.ok||!a.success?(console.error(`Failed to submit ${s} request to API:`,a.error?.message),{success:!1,error:a.error}):a}catch(r){return console.error(`Error submitting ${s} request to API:`,r),{success:!1,error:{message:r instanceof Error?r.message:"Unknown error"}}}}async requestAirdrop(e){try{const s=await fetch(`${this.baseUrl}/airdrop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:e.tag||"default",airdrops:[{chainId:e.chainId,tokenId:e.tokenId,wallet:e.wallet,amount:e.amount||"0.0001"}]})}),r=await s.json().catch(()=>({}));if(!s.ok){const t=r?.message||r?.errors?.[0]?.error||"Failed to request airdrop";return{success:!1,errorMessage:String(t)}}const a=r?.airdrops?.[e.chainId]?.[e.tokenId]?.txHash;return r.errors&&r.errors.length>0?{success:!1,errorMessage:r.errors[0].error}:{success:!0,txHash:a}}catch(s){return{success:!1,errorMessage:s?.message&&typeof s.message=="string"?s.message:"Failed to request airdrop"}}}}const m=new N,A=(o,e)=>{const s=a=>e?e(a):R(a),r=[];return o.forEach((a,t)=>{const n=a.calls&&a.calls.length>0,i=a.tokenTransfers&&a.tokenTransfers.length>0;if(n||i){const c={stepId:t,status:t===0?"processing":"pending",chainId:a.chainId,chainName:s(a.chainId),description:"Processing transaction"};r.push(c)}}),r},x=h(null),b=h(null),F=({children:o,provider:e,supportedChainIds:s,network:r="testnet",mode:a="7702",skipFlow:t=[],nativeChainId:n,appName:i="Spicenet",apiUrl:c,theme:f})=>{c&&m.setBaseUrl(c);const p=s??P(r),l=f??null,[w,T]=I(a),S=k(E=>T(E),[]);return g(x.Provider,{value:l,children:g(b.Provider,{value:{provider:e,supportedChainIds:p,skipFlow:t,mode:w,setMode:S,network:r,nativeChainId:n,appName:i,apiUrl:c},children:o})})};function u(o,e){const s=o.replace("#",""),r=Math.max(0,Math.round(parseInt(s.substring(0,2),16)*(1-e))),a=Math.max(0,Math.round(parseInt(s.substring(2,4),16)*(1-e))),t=Math.max(0,Math.round(parseInt(s.substring(4,6),16)*(1-e)));return`#${r.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}`}function M(o,e){return{shell:e?.shell??"#141414",shellBorder:e?.shellBorder??u(e?.shell??"#141414",.35),shellInnerBorder:e?.shellInnerBorder??u(e?.shell??"#141414",.55),cardBg:e?.cardBg??"#1e1e1e",inputBg:e?.inputBg??"#171717",hoverBg:e?.hoverBg??"#2a2a2a",textPrimary:e?.textPrimary??"#ffffff",textSecondary:e?.textSecondary??"#888888",inputText:e?.inputText??"#e0e0e0",inputPlaceholder:e?.inputPlaceholder??"#555555",cardBorder:e?.cardBorder??"rgba(255,255,255,0.08)",inputBorder:e?.inputBorder??"rgba(255,255,255,0.10)",buttonBorder:e?.buttonBorder??"rgba(255,255,255,0.12)",successBg:e?.successBg??"#0a1f18",successBorder:e?.successBorder??"#1a4a3a",successText:e?.successText??"#6ee7b7",warningBg:e?.warningBg??"#1f1a0d",warningBorder:e?.warningBorder??"#4a3820",warningText:e?.warningText??"#fbbf24",errorBg:e?.errorBg??"#1f0d0d",errorBorder:e?.errorBorder??"#4a2020",errorText:e?.errorText??"#f87171",infoBg:e?.infoBg??"#0d1325",infoBorder:e?.infoBorder??"#2a3a5a",infoText:e?.infoText??"#60a5fa"}}function O(o){return{shell:"#ffffff",shellBorder:"#E9E9E9",shellInnerBorder:"#D5D5D5",cardBg:"#f9fafb",inputBg:"#ffffff",hoverBg:"#f3f4f6",textPrimary:"#111827",textSecondary:"#6b7280",inputText:"#111827",inputPlaceholder:"#9ca3af",cardBorder:"#E0E0E0",inputBorder:"#d1d5db",buttonBorder:"#0e0d0b",successBg:"#d1fae5",successBorder:"#6ee7b7",successText:"#065f46",warningBg:"#fef3c7",warningBorder:"#fcd34d",warningText:"#92400e",errorBg:"#fee2e2",errorBorder:"#fca5a5",errorText:"#dc2626",infoBg:"#dbeafe",infoBorder:"#93c5fd",infoText:"#1e40af"}}function y(o,e){const s=e?{...o,...e}:o,r=s.dark??!1,a=s.primaryColor,t=s.shell??(r?"#141414":"#ffffff");return{primaryColor:a,dark:r,fontFamily:s.fontFamily??'"Helvetica Neue", sans-serif',appName:s.appName??"Spicenet",logo:s.logo,borderRadius:s.borderRadius??"8px",shell:t,shellBorder:u(t,r?.35:.085),shellInnerBorder:u(t,r?.55:.165),card:s.card??(r?"#1e1e1e":"#f9fafb"),input:r?"#171717":"#ffffff",hover:r?"#2a2a2a":"#f3f4f6",text:s.text??(r?"#ffffff":"#111827"),textMuted:s.textMuted??(r?"#888888":"#6b7280"),inputText:r?"#e0e0e0":"#111827",inputPlaceholder:r?"#555555":"#9ca3af",border:s.border??(r?"rgba(255,255,255,0.08)":"#E0E0E0"),inputBorder:r?"rgba(255,255,255,0.10)":"#d1d5db",buttonBorder:r?"rgba(255,255,255,0.12)":"#0e0d0b",successBg:r?"#0a1f18":"#d1fae5",successBorder:r?"#1a4a3a":"#6ee7b7",successText:r?"#6ee7b7":"#065f46",warningBg:r?"#1f1a0d":"#fef3c7",warningBorder:r?"#4a3820":"#fcd34d",warningText:r?"#fbbf24":"#92400e",errorBg:r?"#1f0d0d":"#fee2e2",errorBorder:r?"#4a2020":"#fca5a5",errorText:r?"#f87171":"#dc2626",infoBg:r?"#0d1325":"#dbeafe",infoBorder:r?"#2a3a5a":"#93c5fd",infoText:r?"#60a5fa":"#1e40af"}}function j(o,e){const s=$(x)??void 0;return v(()=>{const r=s??{primaryColor:"#EA4B4B"},a={...o?.primaryColor?{primaryColor:o.primaryColor}:{},...o?.fontFamily?{fontFamily:o.fontFamily}:{},...e!==void 0?{dark:e}:{}},t=y(r,a),{dark:n,primaryColor:i,appName:c}=t,f=C(n?"dark":"light"),p={...f,colors:{...f.colors,primary:i,primaryHover:`${i}dd`},typography:{...f.typography,fontFamily:t.fontFamily}},l={shell:t.shell,shellBorder:t.shellBorder,shellInnerBorder:t.shellInnerBorder,cardBg:t.card,inputBg:t.input,hoverBg:t.hover,textPrimary:t.text,textSecondary:t.textMuted,inputText:t.inputText,inputPlaceholder:t.inputPlaceholder,cardBorder:t.border,inputBorder:t.inputBorder,buttonBorder:t.buttonBorder,successBg:t.successBg,successBorder:t.successBorder,successText:t.successText,warningBg:t.warningBg,warningBorder:t.warningBorder,warningText:t.warningText,errorBg:t.errorBg,errorBorder:t.errorBorder,errorText:t.errorText,infoBg:t.infoBg,infoBorder:t.infoBorder,infoText:t.infoText};return{brand:s,theme:p,dark:n,appName:c,primaryColor:i,dk:l,palette:l}},[s,o,e])}export{B as R,b as S,O as a,M as b,A as c,d,F as e,y as f,U as i,m as r,j as u};
@@ -5,8 +5,6 @@ export type { UIChainConfig as ChainConfig } from "./chainData";
5
5
  export declare const CHAIN_CONFIGS: {
6
6
  [chainId: number]: UIChainConfig;
7
7
  };
8
- export declare const setRpcOverrides: (overrides?: Record<number, string>) => void;
9
- export declare const getRpcUrlForChain: (chainId: number) => string | undefined;
10
8
  export declare const getChainConfig: (chainId: number) => UIChainConfig | undefined;
11
9
  export declare const getChainName: (chainId: number) => string;
12
10
  export declare const getDelegateContractAddress: (chainId: number) => string;
@@ -1,13 +1,11 @@
1
1
  import metamaskLogo from "../assets/icons/metamask.png";
2
2
  import rabbyLogo from "../assets/icons/rabby.png";
3
3
  import phantomLogo from "../assets/icons/phantom.png";
4
- import spicenetLogo from "../assets/icons/spicenet-mark.svg";
5
4
  export { metamaskLogo, rabbyLogo, phantomLogo };
6
5
  export declare const ethLogo: string;
7
6
  export declare const arbLogo: string;
8
7
  export declare const usdcLogo: string;
9
8
  export declare const wbtcLogo: string;
10
- export { spicenetLogo };
11
9
  export declare const chainLogoMap: {
12
10
  [key: number]: string;
13
11
  };
@@ -1,14 +1,11 @@
1
1
  import { CreateActionRequest, CreateActionResponse, ExecuteStepRequest } from "../../types/unified";
2
2
  import { SwapStep } from "../../types/status";
3
3
  import { ChainBatch } from "../../types/authorization";
4
- import { CreateWalletRequest, WalletInfo, CreateWithdrawalRequest, CreateWithdrawalResponse, WithdrawalStatus, RollupTimestamp } from "../../types/rollup";
5
4
  export declare const RELAYER_API_URL: string;
6
5
  export declare class RelayerService {
7
6
  private baseUrl;
8
7
  constructor();
9
8
  setBaseUrl(url: string): void;
10
- getBaseUrl(): string;
11
- private getEffectiveBaseUrl;
12
9
  createAction(request: CreateActionRequest): Promise<CreateActionResponse>;
13
10
  executeStep(actionId: string, intentIndex: number, stepIndex: number, request: ExecuteStepRequest): Promise<{
14
11
  success: true;
@@ -21,6 +18,20 @@ export declare class RelayerService {
21
18
  transactionHash?: string;
22
19
  };
23
20
  }>;
21
+ submitSpiceDeposit(request: {
22
+ user: string;
23
+ txHash: string;
24
+ sender: string;
25
+ tokenAddress: string;
26
+ chainId: number;
27
+ amount: string;
28
+ isDeposit?: boolean;
29
+ }): Promise<{
30
+ success: boolean;
31
+ error?: {
32
+ message: string;
33
+ };
34
+ }>;
24
35
  requestAirdrop(params: {
25
36
  chainId: number;
26
37
  tokenId: string;
@@ -32,11 +43,6 @@ export declare class RelayerService {
32
43
  txHash?: string;
33
44
  errorMessage?: string;
34
45
  }>;
35
- createWallet(address: string, request: CreateWalletRequest): Promise<WalletInfo>;
36
- getWallet(address: string): Promise<WalletInfo>;
37
- createWithdrawal(request: CreateWithdrawalRequest): Promise<CreateWithdrawalResponse>;
38
- getWithdrawal(idempotenceKey: string): Promise<WithdrawalStatus>;
39
- getRollupTimestamp(): Promise<RollupTimestamp>;
40
46
  }
41
47
  export declare const relayerService: RelayerService;
42
48
  export declare const createInitialSteps: (chainBatches: ChainBatch[], customGetChainName?: (chainId: number) => string) => SwapStep[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicenet-io/spiceflow-ui",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Spiceflow UI SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
@@ -65,7 +65,7 @@
65
65
  "author": "",
66
66
  "license": "MIT",
67
67
  "dependencies": {
68
- "@spicenet-io/spiceflow-core": "^0.3.5",
68
+ "@spicenet-io/spiceflow-core": "^0.3.4",
69
69
  "lucide-react": "^0.562.0",
70
70
  "tslib": "^2.8.1"
71
71
  },
@@ -1 +0,0 @@
1
- export declare function useSmartWallet(): void;
@@ -1,2 +0,0 @@
1
- "use client";
2
- "use strict";const l=require("viem"),C=require("viem/actions"),o=require("@spicenet-io/spiceflow-core"),y=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],h="0xcA11bde05977b3631167028862bE2a173976CA11";function g(e){return l.defineChain({id:e.id,name:e.name,nativeCurrency:e.nativeCurrency,rpcUrls:{default:{http:[e.rpcUrl]}},blockExplorers:{default:{name:e.displayName,url:e.blockExplorer}},testnet:e.network==="testnet",contracts:{multicall3:{address:h}}})}const v=[1,8453,42161,4114,11155111,421614,84532,5115,123420001114,688688,688689],u=Object.fromEntries(v.map(e=>o.getChainMeta(e)).filter(e=>e!=null).map(e=>[e.id,{...e,viemChain:g(e),supportedTokens:o.getTokensForChain(e.id)}])),w=u;let f={};const p=new Map,N=e=>{f={...e||{}},p.clear()},d=e=>{const t=f[e];return t&&typeof t=="string"&&t.length>0?t:u[e]?.rpcUrl},c=e=>u[e],I=e=>{const t=o.getChainMeta(e);return t?.displayName||t?.name||`Chain ${e}`},E=e=>{const t=o.getDelegateContract(e);if(!t)throw new Error(`Unsupported chain ID: ${e}`);return t},k=(e,t,a)=>{const s=c(e);return s?.blockExplorer?`${s.blockExplorer}/tx/${t}`:"#"},b=e=>{const t=c(e);if(!t)throw new Error(`Unsupported chain ID: ${e}`);const a=d(e);if(!a)throw new Error(`No RPC URL configured for chain ID: ${e}`);const s=`${e}:${a}`,r=p.get(s);if(r)return r;const n=l.createPublicClient({chain:t.viemChain,transport:l.http(a)});return p.set(s,n),n},A=()=>{const e={};return Object.values(u).forEach(t=>{e[t.id]={name:t.name,moralisName:t.moralisId||"",chain:t.viemChain,rpcUrl:d(t.id)||t.rpcUrl}}),e},U=(e,t=[])=>{const a=c(e);if(!a)return[];const s=[];if(![11155111,421614,84532,688689].includes(e)){const n=t.find(i=>i.chainId===e&&i.isNative);n?s.push(n):s.push({address:o.ZERO_ADDRESS,name:a.nativeCurrency.name,symbol:a.nativeCurrency.symbol,decimals:a.nativeCurrency.decimals,balance:BigInt(0),balanceFormatted:0,balanceUsd:0,logoURI:void 0,isNative:!0,chainId:e})}if(!a.supportedTokens)return s;const r=s.some(n=>n.isNative);return a.supportedTokens.forEach(n=>{if(r&&o.isNativeToken(n.address))return;const i=t.find(m=>m.chainId===e&&m.address.toLowerCase()===n.address.toLowerCase());i?s.push(i):s.push({address:n.address,name:n.name,symbol:n.symbol,decimals:n.decimals,balance:BigInt(0),balanceFormatted:0,balanceUsd:0,logoURI:n.logo,isNative:!1,chainId:e})}),s},F=async(e,t)=>{const a=c(e);if(!a)throw new Error(`Unsupported chain ID: ${e}`);const s=t.toLowerCase();if(o.isNativeToken(s)){if(!a.nativeCurrency?.decimals)throw new Error(`Native currency decimals not configured for chain ${e}`);return a.nativeCurrency.decimals}if(a.supportedTokens){const r=a.supportedTokens.find(n=>n.address.toLowerCase()===s);if(r)return r.decimals}try{if(!l.isAddress(t,{strict:!1}))throw new Error(`Invalid token address: ${t}`);const r=l.getAddress(t),n=b(e),i=await C.readContract(n,{address:r,abi:y,functionName:"decimals"});return Number(i)}catch{throw new Error(`Could not determine decimals for token ${t} on chain ${e}`)}};exports.CHAIN_CONFIGS=w,exports.T=y,exports.getAllAssetsForChain=U,exports.getChainConfig=c,exports.getChainName=I,exports.getChainsForAssets=A,exports.getClientForChain=b,exports.getDelegateContractAddress=E,exports.getExplorerUrl=k,exports.getRpcUrlForChain=d,exports.getTokenDecimals=F,exports.setRpcOverrides=N;
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{defineChain as h,createPublicClient as C,http as v,isAddress as w,getAddress as g}from"viem";import{readContract as E}from"viem/actions";import{getChainMeta as d,getTokensForChain as I,getDelegateContract as N,ZERO_ADDRESS as k,isNativeToken as m}from"@spicenet-io/spiceflow-core";const y=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],U="0xcA11bde05977b3631167028862bE2a173976CA11";function x(e){return h({id:e.id,name:e.name,nativeCurrency:e.nativeCurrency,rpcUrls:{default:{http:[e.rpcUrl]}},blockExplorers:{default:{name:e.displayName,url:e.blockExplorer}},testnet:e.network==="testnet",contracts:{multicall3:{address:U}}})}const $=[1,8453,42161,4114,11155111,421614,84532,5115,123420001114,688688,688689],l=Object.fromEntries($.map(e=>d(e)).filter(e=>e!=null).map(e=>[e.id,{...e,viemChain:x(e),supportedTokens:I(e.id)}])),_=l;let f={};const u=new Map,A=e=>{f={...e||{}},u.clear()},p=e=>{const t=f[e];return t&&typeof t=="string"&&t.length>0?t:l[e]?.rpcUrl},i=e=>l[e],M=e=>{const t=d(e);return t?.displayName||t?.name||`Chain ${e}`},F=e=>{const t=N(e);if(!t)throw new Error(`Unsupported chain ID: ${e}`);return t},T=(e,t,n)=>{const s=i(e);return s?.blockExplorer?`${s.blockExplorer}/tx/${t}`:"#"},b=e=>{const t=i(e);if(!t)throw new Error(`Unsupported chain ID: ${e}`);const n=p(e);if(!n)throw new Error(`No RPC URL configured for chain ID: ${e}`);const s=`${e}:${n}`,r=u.get(s);if(r)return r;const a=C({chain:t.viemChain,transport:v(n)});return u.set(s,a),a},D=()=>{const e={};return Object.values(l).forEach(t=>{e[t.id]={name:t.name,moralisName:t.moralisId||"",chain:t.viemChain,rpcUrl:p(t.id)||t.rpcUrl}}),e},R=(e,t=[])=>{const n=i(e);if(!n)return[];const s=[];if(![11155111,421614,84532,688689].includes(e)){const a=t.find(o=>o.chainId===e&&o.isNative);a?s.push(a):s.push({address:k,name:n.nativeCurrency.name,symbol:n.nativeCurrency.symbol,decimals:n.nativeCurrency.decimals,balance:BigInt(0),balanceFormatted:0,balanceUsd:0,logoURI:void 0,isNative:!0,chainId:e})}if(!n.supportedTokens)return s;const r=s.some(a=>a.isNative);return n.supportedTokens.forEach(a=>{if(r&&m(a.address))return;const o=t.find(c=>c.chainId===e&&c.address.toLowerCase()===a.address.toLowerCase());o?s.push(o):s.push({address:a.address,name:a.name,symbol:a.symbol,decimals:a.decimals,balance:BigInt(0),balanceFormatted:0,balanceUsd:0,logoURI:a.logo,isNative:!1,chainId:e})}),s},O=async(e,t)=>{const n=i(e);if(!n)throw new Error(`Unsupported chain ID: ${e}`);const s=t.toLowerCase();if(m(s)){if(!n.nativeCurrency?.decimals)throw new Error(`Native currency decimals not configured for chain ${e}`);return n.nativeCurrency.decimals}if(n.supportedTokens){const r=n.supportedTokens.find(a=>a.address.toLowerCase()===s);if(r)return r.decimals}try{if(!w(t,{strict:!1}))throw new Error(`Invalid token address: ${t}`);const r=g(t),a=b(e),o=await E(a,{address:r,abi:y,functionName:"decimals"});return Number(o)}catch{throw new Error(`Could not determine decimals for token ${t} on chain ${e}`)}};export{_ as C,y as T,b as a,i as b,T as c,F as d,D as e,R as f,M as g,p as h,O as i,A as s};
@@ -1,50 +0,0 @@
1
- import type { Address, Hex } from "viem";
2
- export interface CreateWalletRequest {
3
- timestamp: number;
4
- signature: Hex;
5
- }
6
- export interface WalletInfo {
7
- address: string;
8
- [key: string]: unknown;
9
- }
10
- export interface WithdrawalIntent {
11
- chainId: string;
12
- signatureType: "ecdsa";
13
- signature: Hex;
14
- nbf: number;
15
- exp: number;
16
- chainBatches: Array<{
17
- hash: Hex;
18
- chainId: number;
19
- calls: Array<{
20
- to: Address;
21
- value: bigint;
22
- data: Hex;
23
- }>;
24
- }>;
25
- }
26
- export interface CreateWithdrawalRequest {
27
- user?: Address;
28
- intent: WithdrawalIntent;
29
- }
30
- export interface CreateWithdrawalResponse {
31
- txHash?: string;
32
- requestId?: string;
33
- }
34
- export interface WithdrawalStatus {
35
- state: "created" | "successful" | "failed" | "cancelled" | string;
36
- idempotenceKey: string;
37
- chain: string;
38
- forUser: string;
39
- reason?: string;
40
- error?: string;
41
- transfers: Array<{
42
- tokenIn: string;
43
- tokenOut: string;
44
- recipient: string;
45
- amount: number;
46
- }>;
47
- }
48
- export interface RollupTimestamp {
49
- unix_timestamp: number;
50
- }
@@ -1,2 +0,0 @@
1
- "use client";
2
- "use strict";const l=require("react"),E=require("react/jsx-runtime"),I=require("@spicenet-io/spiceflow-core"),w=require("./index-CmpsCAqC.js"),C=require("./Button-B_UpyUH-.js");class c extends Error{constructor(e,r,t={}){super(r),this.code=e,this.context=t,this.name="SpiceflowError",Error.captureStackTrace&&Error.captureStackTrace(this,c)}}function P(o){return o instanceof c}const x=typeof process<"u"&&process.env?.NEXT_PUBLIC_RELAYER_API_URL||"https://tx-api-devserver.spicenet.io",y="__SPICEFLOW_RELAYER_API_URL__";function U(){if(typeof globalThis>"u")return;const o=globalThis[y];return typeof o=="string"&&o.length>0?o:void 0}class k{constructor(){this.baseUrl=x}setBaseUrl(e){this.baseUrl=e,typeof globalThis<"u"&&(globalThis[y]=e)}getBaseUrl(){return this.getEffectiveBaseUrl()}getEffectiveBaseUrl(){return U()||this.baseUrl}async createAction(e){console.log("[SpiceRelayer] createAction:start",{baseUrl:this.getEffectiveBaseUrl(),intentCount:e.intents.length,chainAuthorizationCount:e.chainAuthorizations?.length??0});const r=await fetch(`${this.getEffectiveBaseUrl()}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(a,s)=>typeof s=="bigint"?s.toString():s)});if(!r.ok){const a=await r.text();throw console.log("[SpiceRelayer] createAction:error",{baseUrl:this.getEffectiveBaseUrl(),status:r.status,errorText:a}),new c("RELAYER_ERROR",`Relayer API error: ${r.status} - ${a}`,{httpStatus:r.status,responseBody:a,endpoint:"/actions"})}const t=await r.json();return console.log("[SpiceRelayer] createAction:success",{intentIds:t.intentIds}),t}async executeStep(e,r,t,a){const s=`${this.getEffectiveBaseUrl()}/actions/${e}/intents/${r}/steps/${t}`,d=fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});let n;try{n=await Promise.race([d,new Promise((i,f)=>setTimeout(()=>f(new c("RELAYER_EXECUTE_ERROR",`Execute step request timed out after ${1e4/1e3}s`,{actionId:e,intentIndex:r,stepIndex:t,endpoint:`/actions/${e}/intents/${r}/steps/${t}`})),1e4))])}catch(i){throw i}if(!n.ok){const i=await n.text();throw new c("RELAYER_EXECUTE_ERROR",`Execute step error: ${n.status} - ${i}`,{httpStatus:n.status,responseBody:i,endpoint:`/actions/${e}/intents/${r}/steps/${t}`,actionId:e})}return{success:!0,transactionHash:(await n.json()).transactionHash}}async checkStepStatus(e,r){const t=e.split("/");let a="";if(t.length>=2){const n=t[0],i=t[1];a=`${this.getEffectiveBaseUrl()}/actions/${n}/intents/${i}/steps/${r}`}else a=`${this.getEffectiveBaseUrl()}/actions/${e}/intents/0/steps/${r}`;const s=await fetch(a);if(!s.ok)throw new c("RELAYER_STATUS_ERROR",`Intent step status check failed: ${s.status}`,{httpStatus:s.status,endpoint:a,intentId:e});const d=await s.json();return{success:!0,data:{status:d.status==="error"?"reverted":d.status,transactionHash:d.txid}}}async requestAirdrop(e){try{const r=await fetch(`${this.getEffectiveBaseUrl()}/airdrop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:e.tag||"default",airdrops:[{chainId:e.chainId,tokenId:e.tokenId,wallet:e.wallet,amount:e.amount||"0.0001"}]})}),t=await r.json().catch(()=>({}));if(!r.ok){const s=t?.message||t?.errors?.[0]?.error||"Failed to request airdrop";return{success:!1,errorMessage:String(s)}}const a=t?.airdrops?.[e.chainId]?.[e.tokenId]?.txHash;return t.errors&&t.errors.length>0?{success:!1,errorMessage:t.errors[0].error}:{success:!0,txHash:a}}catch(r){return{success:!1,errorMessage:r?.message&&typeof r.message=="string"?r.message:"Failed to request airdrop"}}}async createWallet(e,r){const t=await fetch(`${this.getEffectiveBaseUrl()}/wallets/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!t.ok){const a=await t.text();throw new c("RELAYER_ERROR",`Create wallet error: ${t.status} - ${a}`,{httpStatus:t.status,endpoint:`/wallets/${e}`})}return t.json()}async getWallet(e){const r=await fetch(`${this.getEffectiveBaseUrl()}/wallets/${e}`);if(!r.ok){const t=await r.text();throw new c("RELAYER_ERROR",`Get wallet error: ${r.status} - ${t}`,{httpStatus:r.status,endpoint:`/wallets/${e}`})}return r.json()}async createWithdrawal(e){const r=await fetch(`${this.getEffectiveBaseUrl()}/withdrawals`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(t,a)=>typeof a=="bigint"?a.toString():a)});if(!r.ok){const t=await r.text();throw new c("RELAYER_ERROR",`Create withdrawal error: ${r.status} - ${t}`,{httpStatus:r.status,endpoint:"/withdrawals"})}return r.json()}async getWithdrawal(e){const r=await fetch(`${this.getEffectiveBaseUrl()}/withdrawals/${e}`);if(!r.ok){const t=await r.text();throw new c("RELAYER_ERROR",`Get withdrawal error: ${r.status} - ${t}`,{httpStatus:r.status,endpoint:`/withdrawals/${e}`})}return r.json()}async getRollupTimestamp(){const e=await fetch(`${this.getEffectiveBaseUrl()}/time`);if(!e.ok)throw new c("RELAYER_ERROR",`Get rollup timestamp error: ${e.status}`,{httpStatus:e.status,endpoint:"/time"});return e.json()}}const h=new k,A=(o,e)=>{const r=a=>e?e(a):w.getChainName(a),t=[];return o.forEach((a,s)=>{const d=a.calls&&a.calls.length>0,n=a.tokenTransfers&&a.tokenTransfers.length>0;if(d||n){const i={stepId:s,status:s===0?"processing":"pending",chainId:a.chainId,chainName:r(a.chainId),description:"Processing transaction"};t.push(i)}}),t},R=l.createContext(null),m=l.createContext(null),_=({children:o,provider:e,supportedChainIds:r,network:t="testnet",mode:a="7702",skipFlow:s=[],nativeChainId:d,appName:n="Spicenet",apiUrl:i,theme:f,rpcOverrides:u})=>{l.useEffect(()=>{if(!i)return;const B=h.getBaseUrl();return h.setBaseUrl(i),()=>h.setBaseUrl(B)},[i]),l.useEffect(()=>(w.setRpcOverrides(u),()=>w.setRpcOverrides(void 0)),[u]);const p=r??I.getChainIdsByNetwork(t),S=f??null,[T,v]=l.useState(a),$=l.useCallback(B=>v(B),[]);return E.jsx(R.Provider,{value:S,children:E.jsx(m.Provider,{value:{provider:e,supportedChainIds:p,skipFlow:s,mode:T,setMode:$,network:t,nativeChainId:d,appName:n,apiUrl:i,rpcOverrides:u},children:o})})};function g(o,e){const r=o.replace("#",""),t=Math.max(0,Math.round(parseInt(r.substring(0,2),16)*(1-e))),a=Math.max(0,Math.round(parseInt(r.substring(2,4),16)*(1-e))),s=Math.max(0,Math.round(parseInt(r.substring(4,6),16)*(1-e)));return`#${t.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}function O(o,e){return{shell:e?.shell??"#141414",shellBorder:e?.shellBorder??g(e?.shell??"#141414",.35),shellInnerBorder:e?.shellInnerBorder??g(e?.shell??"#141414",.55),cardBg:e?.cardBg??"#1e1e1e",inputBg:e?.inputBg??"#171717",hoverBg:e?.hoverBg??"#2a2a2a",textPrimary:e?.textPrimary??"#ffffff",textSecondary:e?.textSecondary??"#888888",inputText:e?.inputText??"#e0e0e0",inputPlaceholder:e?.inputPlaceholder??"#555555",cardBorder:e?.cardBorder??"rgba(255,255,255,0.08)",inputBorder:e?.inputBorder??"rgba(255,255,255,0.10)",buttonBorder:e?.buttonBorder??"rgba(255,255,255,0.12)",successBg:e?.successBg??"#0a1f18",successBorder:e?.successBorder??"#1a4a3a",successText:e?.successText??"#6ee7b7",warningBg:e?.warningBg??"#1f1a0d",warningBorder:e?.warningBorder??"#4a3820",warningText:e?.warningText??"#fbbf24",errorBg:e?.errorBg??"#1f0d0d",errorBorder:e?.errorBorder??"#4a2020",errorText:e?.errorText??"#f87171",infoBg:e?.infoBg??"#0d1325",infoBorder:e?.infoBorder??"#2a3a5a",infoText:e?.infoText??"#60a5fa"}}function L(o){return{shell:"#ffffff",shellBorder:"#E9E9E9",shellInnerBorder:"#D5D5D5",cardBg:"#f9fafb",inputBg:"#ffffff",hoverBg:"#f3f4f6",textPrimary:"#111827",textSecondary:"#6b7280",inputText:"#111827",inputPlaceholder:"#9ca3af",cardBorder:"#E0E0E0",inputBorder:"#d1d5db",buttonBorder:"#0e0d0b",successBg:"#d1fae5",successBorder:"#6ee7b7",successText:"#065f46",warningBg:"#fef3c7",warningBorder:"#fcd34d",warningText:"#92400e",errorBg:"#fee2e2",errorBorder:"#fca5a5",errorText:"#dc2626",infoBg:"#dbeafe",infoBorder:"#93c5fd",infoText:"#1e40af"}}function b(o,e){const r=e?{...o,...e}:o,t=r.dark??!1,a=r.primaryColor,s=r.shell??(t?"#141414":"#ffffff");return{primaryColor:a,dark:t,fontFamily:r.fontFamily??'"Helvetica Neue", sans-serif',appName:r.appName??"Spicenet",logo:r.logo,borderRadius:r.borderRadius??"8px",shell:s,shellBorder:g(s,t?.35:.085),shellInnerBorder:g(s,t?.55:.165),card:r.card??(t?"#1e1e1e":"#f9fafb"),input:t?"#171717":"#ffffff",hover:t?"#2a2a2a":"#f3f4f6",text:r.text??(t?"#ffffff":"#111827"),textMuted:r.textMuted??(t?"#888888":"#6b7280"),inputText:t?"#e0e0e0":"#111827",inputPlaceholder:t?"#555555":"#9ca3af",border:r.border??(t?"rgba(255,255,255,0.08)":"#E0E0E0"),inputBorder:t?"rgba(255,255,255,0.10)":"#d1d5db",buttonBorder:t?"rgba(255,255,255,0.12)":"#0e0d0b",successBg:t?"#0a1f18":"#d1fae5",successBorder:t?"#1a4a3a":"#6ee7b7",successText:t?"#6ee7b7":"#065f46",warningBg:t?"#1f1a0d":"#fef3c7",warningBorder:t?"#4a3820":"#fcd34d",warningText:t?"#fbbf24":"#92400e",errorBg:t?"#1f0d0d":"#fee2e2",errorBorder:t?"#4a2020":"#fca5a5",errorText:t?"#f87171":"#dc2626",infoBg:t?"#0d1325":"#dbeafe",infoBorder:t?"#2a3a5a":"#93c5fd",infoText:t?"#60a5fa":"#1e40af"}}function j(o,e){const r=l.useContext(R)??void 0;return l.useMemo(()=>{const t=r??{primaryColor:"#EA4B4B"},a={...o?.primaryColor?{primaryColor:o.primaryColor}:{},...o?.fontFamily?{fontFamily:o.fontFamily}:{},...e!==void 0?{dark:e}:{}},s=b(t,a),{dark:d,primaryColor:n,appName:i}=s,f=C.createTheme(d?"dark":"light"),u={...f,colors:{...f.colors,primary:n,primaryHover:`${n}dd`},typography:{...f.typography,fontFamily:s.fontFamily}},p={shell:s.shell,shellBorder:s.shellBorder,shellInnerBorder:s.shellInnerBorder,cardBg:s.card,inputBg:s.input,hoverBg:s.hover,textPrimary:s.text,textSecondary:s.textMuted,inputText:s.inputText,inputPlaceholder:s.inputPlaceholder,cardBorder:s.border,inputBorder:s.inputBorder,buttonBorder:s.buttonBorder,successBg:s.successBg,successBorder:s.successBorder,successText:s.successText,warningBg:s.warningBg,warningBorder:s.warningBorder,warningText:s.warningText,errorBg:s.errorBg,errorBorder:s.errorBorder,errorText:s.errorText,infoBg:s.infoBg,infoBorder:s.infoBorder,infoText:s.infoText};return{brand:r,theme:u,dark:d,appName:i,primaryColor:n,dk:p,palette:p}},[r,o,e])}exports.RELAYER_API_URL=x,exports.SpiceFlowProvider=_,exports.SpiceFlowProviderContext=m,exports.SpiceflowError=c,exports.buildDarkPalette=O,exports.buildLightPalette=L,exports.createInitialSteps=A,exports.isSpiceflowError=P,exports.relayerService=h,exports.resolveTheme=b,exports.useSpiceBrand=j;
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{createContext as B,useEffect as w,useState as U,useCallback as C,useContext as k,useMemo as P}from"react";import{jsx as E}from"react/jsx-runtime";import{getChainIdsByNetwork as A}from"@spicenet-io/spiceflow-core";import{g as _,s as m}from"./index-Uh1tWOql.js";import{c as O}from"./Button-CaguAr48.js";class c extends Error{constructor(e,r,t={}){super(r),this.code=e,this.context=t,this.name="SpiceflowError",Error.captureStackTrace&&Error.captureStackTrace(this,c)}}function L(o){return o instanceof c}const x=typeof process<"u"&&process.env?.NEXT_PUBLIC_RELAYER_API_URL||"https://tx-api-devserver.spicenet.io",y="__SPICEFLOW_RELAYER_API_URL__";function N(){if(typeof globalThis>"u")return;const o=globalThis[y];return typeof o=="string"&&o.length>0?o:void 0}class j{constructor(){this.baseUrl=x}setBaseUrl(e){this.baseUrl=e,typeof globalThis<"u"&&(globalThis[y]=e)}getBaseUrl(){return this.getEffectiveBaseUrl()}getEffectiveBaseUrl(){return N()||this.baseUrl}async createAction(e){console.log("[SpiceRelayer] createAction:start",{baseUrl:this.getEffectiveBaseUrl(),intentCount:e.intents.length,chainAuthorizationCount:e.chainAuthorizations?.length??0});const r=await fetch(`${this.getEffectiveBaseUrl()}/actions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(a,s)=>typeof s=="bigint"?s.toString():s)});if(!r.ok){const a=await r.text();throw console.log("[SpiceRelayer] createAction:error",{baseUrl:this.getEffectiveBaseUrl(),status:r.status,errorText:a}),new c("RELAYER_ERROR",`Relayer API error: ${r.status} - ${a}`,{httpStatus:r.status,responseBody:a,endpoint:"/actions"})}const t=await r.json();return console.log("[SpiceRelayer] createAction:success",{intentIds:t.intentIds}),t}async executeStep(e,r,t,a){const s=`${this.getEffectiveBaseUrl()}/actions/${e}/intents/${r}/steps/${t}`,d=fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});let n;try{n=await Promise.race([d,new Promise((i,l)=>setTimeout(()=>l(new c("RELAYER_EXECUTE_ERROR",`Execute step request timed out after ${1e4/1e3}s`,{actionId:e,intentIndex:r,stepIndex:t,endpoint:`/actions/${e}/intents/${r}/steps/${t}`})),1e4))])}catch(i){throw i}if(!n.ok){const i=await n.text();throw new c("RELAYER_EXECUTE_ERROR",`Execute step error: ${n.status} - ${i}`,{httpStatus:n.status,responseBody:i,endpoint:`/actions/${e}/intents/${r}/steps/${t}`,actionId:e})}return{success:!0,transactionHash:(await n.json()).transactionHash}}async checkStepStatus(e,r){const t=e.split("/");let a="";if(t.length>=2){const n=t[0],i=t[1];a=`${this.getEffectiveBaseUrl()}/actions/${n}/intents/${i}/steps/${r}`}else a=`${this.getEffectiveBaseUrl()}/actions/${e}/intents/0/steps/${r}`;const s=await fetch(a);if(!s.ok)throw new c("RELAYER_STATUS_ERROR",`Intent step status check failed: ${s.status}`,{httpStatus:s.status,endpoint:a,intentId:e});const d=await s.json();return{success:!0,data:{status:d.status==="error"?"reverted":d.status,transactionHash:d.txid}}}async requestAirdrop(e){try{const r=await fetch(`${this.getEffectiveBaseUrl()}/airdrop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:e.tag||"default",airdrops:[{chainId:e.chainId,tokenId:e.tokenId,wallet:e.wallet,amount:e.amount||"0.0001"}]})}),t=await r.json().catch(()=>({}));if(!r.ok){const s=t?.message||t?.errors?.[0]?.error||"Failed to request airdrop";return{success:!1,errorMessage:String(s)}}const a=t?.airdrops?.[e.chainId]?.[e.tokenId]?.txHash;return t.errors&&t.errors.length>0?{success:!1,errorMessage:t.errors[0].error}:{success:!0,txHash:a}}catch(r){return{success:!1,errorMessage:r?.message&&typeof r.message=="string"?r.message:"Failed to request airdrop"}}}async createWallet(e,r){const t=await fetch(`${this.getEffectiveBaseUrl()}/wallets/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!t.ok){const a=await t.text();throw new c("RELAYER_ERROR",`Create wallet error: ${t.status} - ${a}`,{httpStatus:t.status,endpoint:`/wallets/${e}`})}return t.json()}async getWallet(e){const r=await fetch(`${this.getEffectiveBaseUrl()}/wallets/${e}`);if(!r.ok){const t=await r.text();throw new c("RELAYER_ERROR",`Get wallet error: ${r.status} - ${t}`,{httpStatus:r.status,endpoint:`/wallets/${e}`})}return r.json()}async createWithdrawal(e){const r=await fetch(`${this.getEffectiveBaseUrl()}/withdrawals`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(t,a)=>typeof a=="bigint"?a.toString():a)});if(!r.ok){const t=await r.text();throw new c("RELAYER_ERROR",`Create withdrawal error: ${r.status} - ${t}`,{httpStatus:r.status,endpoint:"/withdrawals"})}return r.json()}async getWithdrawal(e){const r=await fetch(`${this.getEffectiveBaseUrl()}/withdrawals/${e}`);if(!r.ok){const t=await r.text();throw new c("RELAYER_ERROR",`Get withdrawal error: ${r.status} - ${t}`,{httpStatus:r.status,endpoint:`/withdrawals/${e}`})}return r.json()}async getRollupTimestamp(){const e=await fetch(`${this.getEffectiveBaseUrl()}/time`);if(!e.ok)throw new c("RELAYER_ERROR",`Get rollup timestamp error: ${e.status}`,{httpStatus:e.status,endpoint:"/time"});return e.json()}}const p=new j,F=(o,e)=>{const r=a=>e?e(a):_(a),t=[];return o.forEach((a,s)=>{const d=a.calls&&a.calls.length>0,n=a.tokenTransfers&&a.tokenTransfers.length>0;if(d||n){const i={stepId:s,status:s===0?"processing":"pending",chainId:a.chainId,chainName:r(a.chainId),description:"Processing transaction"};t.push(i)}}),t},R=B(null),b=B(null),M=({children:o,provider:e,supportedChainIds:r,network:t="testnet",mode:a="7702",skipFlow:s=[],nativeChainId:d,appName:n="Spicenet",apiUrl:i,theme:l,rpcOverrides:f})=>{w(()=>{if(!i)return;const g=p.getBaseUrl();return p.setBaseUrl(i),()=>p.setBaseUrl(g)},[i]),w(()=>(m(f),()=>m(void 0)),[f]);const u=r??A(t),S=l??null,[$,v]=U(a),I=C(g=>v(g),[]);return E(R.Provider,{value:S,children:E(b.Provider,{value:{provider:e,supportedChainIds:u,skipFlow:s,mode:$,setMode:I,network:t,nativeChainId:d,appName:n,apiUrl:i,rpcOverrides:f},children:o})})};function h(o,e){const r=o.replace("#",""),t=Math.max(0,Math.round(parseInt(r.substring(0,2),16)*(1-e))),a=Math.max(0,Math.round(parseInt(r.substring(2,4),16)*(1-e))),s=Math.max(0,Math.round(parseInt(r.substring(4,6),16)*(1-e)));return`#${t.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}function Y(o,e){return{shell:e?.shell??"#141414",shellBorder:e?.shellBorder??h(e?.shell??"#141414",.35),shellInnerBorder:e?.shellInnerBorder??h(e?.shell??"#141414",.55),cardBg:e?.cardBg??"#1e1e1e",inputBg:e?.inputBg??"#171717",hoverBg:e?.hoverBg??"#2a2a2a",textPrimary:e?.textPrimary??"#ffffff",textSecondary:e?.textSecondary??"#888888",inputText:e?.inputText??"#e0e0e0",inputPlaceholder:e?.inputPlaceholder??"#555555",cardBorder:e?.cardBorder??"rgba(255,255,255,0.08)",inputBorder:e?.inputBorder??"rgba(255,255,255,0.10)",buttonBorder:e?.buttonBorder??"rgba(255,255,255,0.12)",successBg:e?.successBg??"#0a1f18",successBorder:e?.successBorder??"#1a4a3a",successText:e?.successText??"#6ee7b7",warningBg:e?.warningBg??"#1f1a0d",warningBorder:e?.warningBorder??"#4a3820",warningText:e?.warningText??"#fbbf24",errorBg:e?.errorBg??"#1f0d0d",errorBorder:e?.errorBorder??"#4a2020",errorText:e?.errorText??"#f87171",infoBg:e?.infoBg??"#0d1325",infoBorder:e?.infoBorder??"#2a3a5a",infoText:e?.infoText??"#60a5fa"}}function H(o){return{shell:"#ffffff",shellBorder:"#E9E9E9",shellInnerBorder:"#D5D5D5",cardBg:"#f9fafb",inputBg:"#ffffff",hoverBg:"#f3f4f6",textPrimary:"#111827",textSecondary:"#6b7280",inputText:"#111827",inputPlaceholder:"#9ca3af",cardBorder:"#E0E0E0",inputBorder:"#d1d5db",buttonBorder:"#0e0d0b",successBg:"#d1fae5",successBorder:"#6ee7b7",successText:"#065f46",warningBg:"#fef3c7",warningBorder:"#fcd34d",warningText:"#92400e",errorBg:"#fee2e2",errorBorder:"#fca5a5",errorText:"#dc2626",infoBg:"#dbeafe",infoBorder:"#93c5fd",infoText:"#1e40af"}}function T(o,e){const r=e?{...o,...e}:o,t=r.dark??!1,a=r.primaryColor,s=r.shell??(t?"#141414":"#ffffff");return{primaryColor:a,dark:t,fontFamily:r.fontFamily??'"Helvetica Neue", sans-serif',appName:r.appName??"Spicenet",logo:r.logo,borderRadius:r.borderRadius??"8px",shell:s,shellBorder:h(s,t?.35:.085),shellInnerBorder:h(s,t?.55:.165),card:r.card??(t?"#1e1e1e":"#f9fafb"),input:t?"#171717":"#ffffff",hover:t?"#2a2a2a":"#f3f4f6",text:r.text??(t?"#ffffff":"#111827"),textMuted:r.textMuted??(t?"#888888":"#6b7280"),inputText:t?"#e0e0e0":"#111827",inputPlaceholder:t?"#555555":"#9ca3af",border:r.border??(t?"rgba(255,255,255,0.08)":"#E0E0E0"),inputBorder:t?"rgba(255,255,255,0.10)":"#d1d5db",buttonBorder:t?"rgba(255,255,255,0.12)":"#0e0d0b",successBg:t?"#0a1f18":"#d1fae5",successBorder:t?"#1a4a3a":"#6ee7b7",successText:t?"#6ee7b7":"#065f46",warningBg:t?"#1f1a0d":"#fef3c7",warningBorder:t?"#4a3820":"#fcd34d",warningText:t?"#fbbf24":"#92400e",errorBg:t?"#1f0d0d":"#fee2e2",errorBorder:t?"#4a2020":"#fca5a5",errorText:t?"#f87171":"#dc2626",infoBg:t?"#0d1325":"#dbeafe",infoBorder:t?"#2a3a5a":"#93c5fd",infoText:t?"#60a5fa":"#1e40af"}}function J(o,e){const r=k(R)??void 0;return P(()=>{const t=r??{primaryColor:"#EA4B4B"},a={...o?.primaryColor?{primaryColor:o.primaryColor}:{},...o?.fontFamily?{fontFamily:o.fontFamily}:{},...e!==void 0?{dark:e}:{}},s=T(t,a),{dark:d,primaryColor:n,appName:i}=s,l=O(d?"dark":"light"),f={...l,colors:{...l.colors,primary:n,primaryHover:`${n}dd`},typography:{...l.typography,fontFamily:s.fontFamily}},u={shell:s.shell,shellBorder:s.shellBorder,shellInnerBorder:s.shellInnerBorder,cardBg:s.card,inputBg:s.input,hoverBg:s.hover,textPrimary:s.text,textSecondary:s.textMuted,inputText:s.inputText,inputPlaceholder:s.inputPlaceholder,cardBorder:s.border,inputBorder:s.inputBorder,buttonBorder:s.buttonBorder,successBg:s.successBg,successBorder:s.successBorder,successText:s.successText,warningBg:s.warningBg,warningBorder:s.warningBorder,warningText:s.warningText,errorBg:s.errorBg,errorBorder:s.errorBorder,errorText:s.errorText,infoBg:s.infoBg,infoBorder:s.infoBorder,infoText:s.infoText};return{brand:r,theme:f,dark:d,appName:i,primaryColor:n,dk:u,palette:u}},[r,o,e])}export{x as R,b as S,H as a,Y as b,F as c,c as d,M as e,T as f,L as i,p as r,J as u};
@@ -1,49 +0,0 @@
1
- export declare const spicenetAbi: readonly [{
2
- readonly type: "function";
3
- readonly name: "createWithdrawalRequest";
4
- readonly inputs: readonly [{
5
- readonly name: "request";
6
- readonly type: "tuple";
7
- readonly internalType: "struct Spicenet.CreateWithdrawalRequestArgs";
8
- readonly components: readonly [{
9
- readonly name: "chainId";
10
- readonly type: "string";
11
- readonly internalType: "string";
12
- }, {
13
- readonly name: "idempotenceKey";
14
- readonly type: "bytes32";
15
- readonly internalType: "bytes32";
16
- }, {
17
- readonly name: "nbf";
18
- readonly type: "uint256";
19
- readonly internalType: "uint256";
20
- }, {
21
- readonly name: "exp";
22
- readonly type: "uint256";
23
- readonly internalType: "uint256";
24
- }, {
25
- readonly name: "metadata";
26
- readonly type: "string";
27
- readonly internalType: "string";
28
- }, {
29
- readonly name: "transfers";
30
- readonly type: "tuple[]";
31
- readonly internalType: "struct Spicenet.CreateTokenTransfer[]";
32
- readonly components: readonly [{
33
- readonly name: "token";
34
- readonly type: "string";
35
- readonly internalType: "string";
36
- }, {
37
- readonly name: "to";
38
- readonly type: "string";
39
- readonly internalType: "string";
40
- }, {
41
- readonly name: "amount";
42
- readonly type: "uint256";
43
- readonly internalType: "uint256";
44
- }];
45
- }];
46
- }];
47
- readonly outputs: readonly [];
48
- readonly stateMutability: "nonpayable";
49
- }];