@openfort/react 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/chains.d.ts +0 -3
- package/build/assets/icons.d.ts +19 -0
- package/build/assets/logos.d.ts +6 -0
- package/build/components/Common/Button/types.d.ts +2 -0
- package/build/components/Common/CopyToClipboard/CopyButton.d.ts +7 -0
- package/build/components/Common/CopyToClipboard/CopyIcon.d.ts +8 -0
- package/build/components/Common/CopyToClipboard/CopyIconButton.d.ts +5 -0
- package/build/components/Common/CopyToClipboard/CopyText.d.ts +10 -0
- package/build/components/Common/FitText/index.d.ts +2 -1
- package/build/components/Openfort/context.d.ts +19 -3
- package/build/components/Openfort/types.d.ts +46 -8
- package/build/components/Pages/AssetInventory/index.d.ts +1 -0
- package/build/components/Pages/Buy/coinbaseApi.d.ts +31 -0
- package/build/components/Pages/Buy/index.d.ts +2 -0
- package/build/components/Pages/Buy/onrampApi.d.ts +28 -0
- package/build/components/Pages/Buy/providers.d.ts +20 -0
- package/build/components/Pages/Buy/stripeApi.d.ts +27 -0
- package/build/components/Pages/Buy/styles.d.ts +29 -0
- package/build/components/Pages/Buy/utils.d.ts +12 -0
- package/build/components/Pages/BuyComplete/index.d.ts +2 -0
- package/build/components/Pages/BuyProcessing/index.d.ts +2 -0
- package/build/components/Pages/BuyProviderSelect/index.d.ts +2 -0
- package/build/components/Pages/BuyProviderSelect/styles.d.ts +19 -0
- package/build/components/Pages/BuySelectProvider/index.d.ts +2 -0
- package/build/components/Pages/LinkedProviders/index.d.ts +2 -0
- package/build/components/Pages/LinkedProviders/styles.d.ts +1 -0
- package/build/components/Pages/NoAssetsAvailable/index.d.ts +1 -0
- package/build/components/Pages/NoAssetsAvailable/styles.d.ts +1 -0
- package/build/components/Pages/Profile/LinkedProviders.d.ts +5 -1
- package/build/components/Pages/Profile/index.d.ts +1 -4
- package/build/components/Pages/Profile/styles.d.ts +6 -2
- package/build/components/Pages/Receive/index.d.ts +2 -0
- package/build/components/Pages/Receive/styles.d.ts +6 -0
- package/build/components/Pages/SelectToken/index.d.ts +4 -0
- package/build/components/Pages/SelectToken/styles.d.ts +14 -0
- package/build/components/Pages/Send/index.d.ts +2 -0
- package/build/components/Pages/Send/styles.d.ts +14 -0
- package/build/components/Pages/Send/utils.d.ts +8 -0
- package/build/components/Pages/SendConfirmation/EstimatedFees.d.ts +13 -0
- package/build/components/Pages/SendConfirmation/index.d.ts +2 -0
- package/build/components/Pages/SendConfirmation/styles.d.ts +18 -0
- package/build/constants/erc20.d.ts +42 -0
- package/build/hooks/openfort/useGrantPermissions.d.ts +1 -1
- package/build/hooks/openfort/useUI.d.ts +1 -1
- package/build/hooks/openfort/useWalletAssets.d.ts +15 -0
- package/build/hooks/useCopyToClipboard.d.ts +4 -0
- package/build/index.d.ts +1 -0
- package/build/index.es.js +5961 -3091
- package/build/index.es.js.map +1 -1
- package/build/localizations/index.d.ts +13 -0
- package/build/localizations/locales/en-US.d.ts +13 -0
- package/build/types.d.ts +2 -1
- package/build/utils/errorHandling.d.ts +10 -0
- package/build/version.d.ts +1 -1
- package/package.json +2 -2
- package/build/assets/wallet.d.ts +0 -4
- package/build/components/Common/CopyToClipboard/CopyToClipboardIcon.d.ts +0 -5
- package/build/components/Common/CopyToClipboard/index.d.ts +0 -7
- package/build/hooks/openfort/useExtendedWalletClient.d.ts +0 -389
package/build/assets/chains.d.ts
CHANGED
|
@@ -40,9 +40,6 @@ declare const _default: {
|
|
|
40
40
|
Canto: ({ testnet, ...props }: {
|
|
41
41
|
testnet?: boolean;
|
|
42
42
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
-
Fantom: ({ testnet, ...props }: {
|
|
44
|
-
testnet?: boolean;
|
|
45
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
46
43
|
Filecoin: ({ testnet, ...props }: {
|
|
47
44
|
testnet?: boolean;
|
|
48
45
|
}) => import("react/jsx-runtime").JSX.Element;
|
package/build/assets/icons.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
export declare const SendIcon: ({ ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const ReceiveIcon: ({ ...props }: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const BuyIcon: ({ ...props }: {
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const DollarIcon: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const WalletIcon: ({ ...props }: {
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const ExternalLinkIcon: ({ ...props }: {
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
1
17
|
export declare const AlertIcon: ({ ...props }: {
|
|
2
18
|
[x: string]: any;
|
|
3
19
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -43,3 +59,6 @@ export declare const FingerPrintIcon: ({ ...props }: {
|
|
|
43
59
|
export declare const PlusIcon: ({ ...props }: {
|
|
44
60
|
[x: string]: any;
|
|
45
61
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export declare const UserRoundIcon: ({ ...props }: {
|
|
63
|
+
[x: string]: any;
|
|
64
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
package/build/assets/logos.d.ts
CHANGED
|
@@ -119,5 +119,11 @@ declare const _default: {
|
|
|
119
119
|
Openfort: ({ ...props }: {
|
|
120
120
|
[x: string]: any;
|
|
121
121
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
122
|
+
Stripe: ({ ...props }: {
|
|
123
|
+
[x: string]: any;
|
|
124
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
125
|
+
CoinbasePay: ({ ...props }: {
|
|
126
|
+
[x: string]: any;
|
|
127
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
122
128
|
};
|
|
123
129
|
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type MotionStyle } from 'framer-motion';
|
|
2
|
+
interface CopyIconProps {
|
|
3
|
+
copied?: boolean;
|
|
4
|
+
size?: MotionStyle['width'];
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const CopyIcon: ({ copied, size, className }: CopyIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import { CopyIcon } from './CopyIcon';
|
|
4
|
+
interface CopyTextProps {
|
|
5
|
+
value: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
size?: ComponentProps<typeof CopyIcon>['size'];
|
|
8
|
+
}
|
|
9
|
+
export declare const CopyText: ({ value, children, size }: CopyTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const FitText: {
|
|
3
|
-
({ children, maxFontSize, minFontSize, }: {
|
|
3
|
+
({ children, maxFontSize, minFontSize, justifyContent, }: {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
maxFontSize?: number;
|
|
6
6
|
minFontSize?: number;
|
|
7
|
+
justifyContent?: "center" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly";
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
displayName: string;
|
|
9
10
|
};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import type { SDKOverrides, ThirdPartyAuthConfiguration } from '@openfort/openfort-js';
|
|
1
|
+
import type { OAuthProvider, SDKOverrides, ThirdPartyAuthConfiguration } from '@openfort/openfort-js';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { useConnectCallbackProps } from '../../hooks/useConnectCallback';
|
|
4
4
|
import type { CustomTheme, Languages, Mode, Theme } from '../../types';
|
|
5
|
-
import type {
|
|
5
|
+
import type { BuyFormState, DebugModeOptions, OpenfortUIOptionsExtended, OpenfortWalletConfig, RouteOptions, SendFormState, SetRouteOptions } from './types';
|
|
6
|
+
type Connector = {
|
|
7
|
+
id: string;
|
|
8
|
+
type?: 'wallet';
|
|
9
|
+
} | {
|
|
10
|
+
id: OAuthProvider;
|
|
11
|
+
type: 'oauth';
|
|
12
|
+
};
|
|
13
|
+
type ErrorMessage = string | React.ReactNode | null;
|
|
6
14
|
export type ContextValue = {
|
|
7
15
|
setTheme: React.Dispatch<React.SetStateAction<Theme>>;
|
|
8
16
|
mode: Mode;
|
|
@@ -11,11 +19,13 @@ export type ContextValue = {
|
|
|
11
19
|
lang: Languages;
|
|
12
20
|
setLang: React.Dispatch<React.SetStateAction<Languages>>;
|
|
13
21
|
open: boolean;
|
|
14
|
-
setOpen:
|
|
22
|
+
setOpen: (value: boolean) => void;
|
|
15
23
|
route: RouteOptions;
|
|
16
24
|
setRoute: (options: SetRouteOptions) => void;
|
|
17
25
|
onBack: (() => void) | null;
|
|
18
26
|
setOnBack: React.Dispatch<React.SetStateAction<(() => void) | null>>;
|
|
27
|
+
headerLeftSlot: React.ReactNode | null;
|
|
28
|
+
setHeaderLeftSlot: React.Dispatch<React.SetStateAction<React.ReactNode | null>>;
|
|
19
29
|
previousRoute: RouteOptions | null;
|
|
20
30
|
setPreviousRoute: () => void;
|
|
21
31
|
routeHistory: RouteOptions[];
|
|
@@ -26,11 +36,17 @@ export type ContextValue = {
|
|
|
26
36
|
debugMode: Required<DebugModeOptions>;
|
|
27
37
|
resize: number;
|
|
28
38
|
triggerResize: () => void;
|
|
39
|
+
publishableKey: string;
|
|
29
40
|
uiConfig: OpenfortUIOptionsExtended;
|
|
30
41
|
walletConfig?: OpenfortWalletConfig;
|
|
31
42
|
overrides?: SDKOverrides;
|
|
32
43
|
thirdPartyAuth?: ThirdPartyAuthConfiguration;
|
|
33
44
|
emailInput: string;
|
|
34
45
|
setEmailInput: React.Dispatch<React.SetStateAction<string>>;
|
|
46
|
+
sendForm: SendFormState;
|
|
47
|
+
setSendForm: React.Dispatch<React.SetStateAction<SendFormState>>;
|
|
48
|
+
buyForm: BuyFormState;
|
|
49
|
+
setBuyForm: React.Dispatch<React.SetStateAction<BuyFormState>>;
|
|
35
50
|
} & useConnectCallbackProps;
|
|
36
51
|
export declare const Openfortcontext: React.Context<ContextValue | null>;
|
|
52
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { AccountTypeEnum,
|
|
1
|
+
import type { AccountTypeEnum, RecoveryMethod } from '@openfort/openfort-js';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
|
+
import type { Hex } from 'viem';
|
|
5
|
+
import type { getAssets } from 'viem/_types/experimental/erc7811/actions/getAssets';
|
|
4
6
|
import type { UserWallet } from '../../hooks/openfort/useWallets';
|
|
5
7
|
import type { CustomAvatarProps, CustomTheme, Languages, Mode, Theme } from '../../types';
|
|
6
8
|
export declare const routes: {
|
|
@@ -25,7 +27,20 @@ export declare const routes: {
|
|
|
25
27
|
readonly CONNECT: "connect";
|
|
26
28
|
readonly DOWNLOAD: "download";
|
|
27
29
|
readonly PROFILE: "profile";
|
|
30
|
+
readonly LINKED_PROVIDERS: "linkedProviders";
|
|
28
31
|
readonly SWITCHNETWORKS: "switchNetworks";
|
|
32
|
+
readonly NO_ASSETS_AVAILABLE: "noAssetsAvailable";
|
|
33
|
+
readonly ASSET_INVENTORY: "assetInventory";
|
|
34
|
+
readonly SEND: "send";
|
|
35
|
+
readonly SEND_TOKEN_SELECT: "sendTokenSelect";
|
|
36
|
+
readonly SEND_CONFIRMATION: "sendConfirmation";
|
|
37
|
+
readonly RECEIVE: "receive";
|
|
38
|
+
readonly BUY: "buy";
|
|
39
|
+
readonly BUY_TOKEN_SELECT: "buyTokenSelect";
|
|
40
|
+
readonly BUY_SELECT_PROVIDER: "buySelectProvider";
|
|
41
|
+
readonly BUY_PROCESSING: "buyProcessing";
|
|
42
|
+
readonly BUY_COMPLETE: "buyComplete";
|
|
43
|
+
readonly BUY_PROVIDER_SELECT: "buyProviderSelect";
|
|
29
44
|
};
|
|
30
45
|
type AllRoutes = (typeof routes)[keyof typeof routes];
|
|
31
46
|
export declare const notStoredInHistoryRoutes: AllRoutes[];
|
|
@@ -48,13 +63,6 @@ export type RoutesWithoutOptions = {
|
|
|
48
63
|
};
|
|
49
64
|
export type RouteOptions = RoutesWithoutOptions | RoutesWithOptions;
|
|
50
65
|
export type SetRouteOptions = RouteOptions | RoutesWithoutOptions['route'];
|
|
51
|
-
export type Connector = {
|
|
52
|
-
id: string;
|
|
53
|
-
type?: 'wallet';
|
|
54
|
-
} | {
|
|
55
|
-
id: OAuthProvider;
|
|
56
|
-
type: 'oauth';
|
|
57
|
-
};
|
|
58
66
|
export declare enum UIAuthProvider {
|
|
59
67
|
GOOGLE = "google",
|
|
60
68
|
TWITTER = "twitter",
|
|
@@ -73,6 +81,12 @@ export declare enum LinkWalletOnSignUpOption {
|
|
|
73
81
|
DISABLED = "disabled"
|
|
74
82
|
}
|
|
75
83
|
type PolicyConfig = string | Record<number, string>;
|
|
84
|
+
interface AssetConfig {
|
|
85
|
+
address: Hex;
|
|
86
|
+
symbol?: string;
|
|
87
|
+
name?: string;
|
|
88
|
+
decimals?: number;
|
|
89
|
+
}
|
|
76
90
|
type CommonWalletConfig = {
|
|
77
91
|
/** Publishable key for the Shield API. */
|
|
78
92
|
shieldPublishableKey: string;
|
|
@@ -82,6 +96,9 @@ type CommonWalletConfig = {
|
|
|
82
96
|
/** @deprecated Use `debugMode` prop instead. */
|
|
83
97
|
debug?: boolean;
|
|
84
98
|
recoverWalletAutomaticallyAfterAuth?: boolean;
|
|
99
|
+
assets?: {
|
|
100
|
+
[chainId: number]: AssetConfig[];
|
|
101
|
+
};
|
|
85
102
|
};
|
|
86
103
|
type EncryptionSession = {
|
|
87
104
|
/** Function to retrieve an encryption session using a session ID. */
|
|
@@ -142,6 +159,9 @@ export type ConnectUIOptions = {
|
|
|
142
159
|
/** Blur intensity applied to the background when the modal is open. */
|
|
143
160
|
overlayBlur?: number;
|
|
144
161
|
walletRecovery?: WalletRecoveryOptions;
|
|
162
|
+
buyWithCardUrl?: string;
|
|
163
|
+
buyFromExchangeUrl?: string;
|
|
164
|
+
buyTroubleshootingUrl?: string;
|
|
145
165
|
} & Partial<OpenfortUIOptions>;
|
|
146
166
|
type WalletRecoveryOptionsExtended = {
|
|
147
167
|
allowedMethods: RecoveryMethod[];
|
|
@@ -176,6 +196,24 @@ export type OpenfortUIOptionsExtended = {
|
|
|
176
196
|
disableSiweRedirect?: boolean;
|
|
177
197
|
/** Blur intensity applied to the background when the modal is open. */
|
|
178
198
|
overlayBlur?: number;
|
|
199
|
+
buyWithCardUrl?: string;
|
|
200
|
+
buyFromExchangeUrl?: string;
|
|
201
|
+
buyTroubleshootingUrl?: string;
|
|
179
202
|
walletRecovery: WalletRecoveryOptionsExtended;
|
|
180
203
|
} & OpenfortUIOptions;
|
|
204
|
+
export type Asset = getAssets.Asset<false>;
|
|
205
|
+
export type SendFormState = {
|
|
206
|
+
recipient: string;
|
|
207
|
+
amount: string;
|
|
208
|
+
asset: Asset;
|
|
209
|
+
};
|
|
210
|
+
export declare const defaultSendFormState: SendFormState;
|
|
211
|
+
export type BuyProviderId = 'moonpay' | 'coinbase' | 'stripe';
|
|
212
|
+
export type BuyFormState = {
|
|
213
|
+
amount: string;
|
|
214
|
+
currency: string;
|
|
215
|
+
asset: Asset;
|
|
216
|
+
providerId: BuyProviderId;
|
|
217
|
+
};
|
|
218
|
+
export declare const defaultBuyFormState: BuyFormState;
|
|
181
219
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AssetInventory: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Asset } from '../../Openfort/types';
|
|
2
|
+
type CoinbaseOnrampResponse = {
|
|
3
|
+
provider: string;
|
|
4
|
+
onrampUrl: string;
|
|
5
|
+
};
|
|
6
|
+
type CreateCoinbaseSessionParams = {
|
|
7
|
+
destinationCurrency: string;
|
|
8
|
+
destinationNetwork: string;
|
|
9
|
+
destinationAddress: string;
|
|
10
|
+
sourceAmount?: string;
|
|
11
|
+
sourceCurrency?: string;
|
|
12
|
+
paymentMethod?: 'CARD' | 'ACH' | 'APPLE_PAY' | 'PAYPAL' | 'FIAT_WALLET' | 'CRYPTO_WALLET';
|
|
13
|
+
country?: string;
|
|
14
|
+
subdivision?: string;
|
|
15
|
+
redirectUrl?: string;
|
|
16
|
+
clientIp?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const isCoinbaseSupported: (token: Asset) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Create a Coinbase onramp session
|
|
21
|
+
* Supports three use cases based on provided parameters:
|
|
22
|
+
* 1. Basic session: Only required params (destinationAddress, destinationCurrency, destinationNetwork)
|
|
23
|
+
* 2. One-click URL: Required + sourceAmount + sourceCurrency
|
|
24
|
+
* 3. One-click with quote: One-click + paymentMethod + country (+ subdivision for US)
|
|
25
|
+
*/
|
|
26
|
+
export declare const createCoinbaseSession: (params: Omit<CreateCoinbaseSessionParams, "destinationCurrency" | "destinationNetwork"> & {
|
|
27
|
+
token: Asset;
|
|
28
|
+
chainId: number;
|
|
29
|
+
publishableKey: string;
|
|
30
|
+
}) => Promise<CoinbaseOnrampResponse>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Asset } from '../../Openfort/types';
|
|
2
|
+
export type OnrampQuote = {
|
|
3
|
+
provider: string;
|
|
4
|
+
sourceAmount: string;
|
|
5
|
+
sourceCurrency: string;
|
|
6
|
+
destinationAmount: string;
|
|
7
|
+
destinationCurrency: string;
|
|
8
|
+
destinationNetwork: string;
|
|
9
|
+
fees: Array<{
|
|
10
|
+
amount: string;
|
|
11
|
+
currency: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}>;
|
|
14
|
+
exchangeRate: string;
|
|
15
|
+
};
|
|
16
|
+
type GetAllQuotesParams = {
|
|
17
|
+
token: Asset;
|
|
18
|
+
chainId: number;
|
|
19
|
+
publishableKey: string;
|
|
20
|
+
sourceCurrency: string;
|
|
21
|
+
sourceAmount: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Get quotes from all available providers
|
|
25
|
+
* Calls the backend without specifying a provider to get quotes from all providers
|
|
26
|
+
*/
|
|
27
|
+
export declare const getAllQuotes: (params: GetAllQuotesParams) => Promise<OnrampQuote[]>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BuyProviderId } from '../../Openfort/types';
|
|
2
|
+
type ProviderDefinition = {
|
|
3
|
+
id: BuyProviderId;
|
|
4
|
+
name: string;
|
|
5
|
+
feeBps: number;
|
|
6
|
+
highlight?: 'best' | 'fast';
|
|
7
|
+
url?: string;
|
|
8
|
+
};
|
|
9
|
+
type ProviderQuote = {
|
|
10
|
+
provider: ProviderDefinition;
|
|
11
|
+
netAmount: number | null;
|
|
12
|
+
feeAmount: number | null;
|
|
13
|
+
onrampUrl?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const getProviders: () => ProviderDefinition[];
|
|
16
|
+
/**
|
|
17
|
+
* Get provider quotes - for now returns mock data until real quote is fetched
|
|
18
|
+
*/
|
|
19
|
+
export declare const getProviderQuotes: (amount: number | null) => ProviderQuote[];
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Asset } from '../../Openfort/types';
|
|
2
|
+
type StripeOnrampResponse = {
|
|
3
|
+
provider: string;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
clientSecret: string;
|
|
6
|
+
status: string;
|
|
7
|
+
onrampUrl: string;
|
|
8
|
+
};
|
|
9
|
+
type CreateStripeSessionParams = {
|
|
10
|
+
destinationCurrency: string;
|
|
11
|
+
destinationNetwork: string;
|
|
12
|
+
destinationAddress: string;
|
|
13
|
+
sourceAmount?: string;
|
|
14
|
+
sourceCurrency?: string;
|
|
15
|
+
redirectUrl?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const isStripeSupported: (token: Asset) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Create a Stripe onramp session
|
|
20
|
+
* Calls backend API to create a prefilled session with wallet addresses and amounts
|
|
21
|
+
*/
|
|
22
|
+
export declare const createStripeSession: (params: Omit<CreateStripeSessionParams, "destinationCurrency" | "destinationNetwork"> & {
|
|
23
|
+
token: Asset;
|
|
24
|
+
chainId: number;
|
|
25
|
+
publishableKey: string;
|
|
26
|
+
}) => Promise<StripeOnrampResponse>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const Section: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const SectionLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
|
+
export declare const AmountCard: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const CurrencySymbol: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
5
|
+
export declare const AmountInput: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
6
|
+
export declare const PresetList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const PresetButton: import("styled-components").StyledComponent<"button", any, {
|
|
8
|
+
$active?: boolean;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const SelectorButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
11
|
+
export declare const SelectorContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const SelectorTitle: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
13
|
+
export declare const SelectorSubtitle: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
14
|
+
export declare const SelectorRight: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
+
export declare const ContinueButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
+
export declare const StackedButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
+
export declare const ProviderList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
+
export declare const ProviderButton: import("styled-components").StyledComponent<"button", any, {
|
|
19
|
+
$active?: boolean;
|
|
20
|
+
}, never>;
|
|
21
|
+
export declare const ProviderInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
|
+
export declare const ProviderNameRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
|
+
export declare const ProviderName: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
24
|
+
export declare const ProviderBadge: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
25
|
+
export declare const ProviderMeta: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
26
|
+
export declare const ProviderRight: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
27
|
+
export declare const ProviderQuote: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
28
|
+
export declare const ProviderFiat: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
29
|
+
export declare const PendingContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const createCurrencyFormatter: (currency: string) => Intl.NumberFormat;
|
|
2
|
+
export declare const getCurrencySymbol: (currency: string) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Formats a number with dynamic decimal places between 2 and 6
|
|
5
|
+
* Removes trailing zeros but ensures at least 2 decimals
|
|
6
|
+
*/
|
|
7
|
+
export declare const formatWithDynamicDecimals: (amount: number) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Formats a token amount with appropriate decimal places
|
|
10
|
+
* Handles special cases: 0 shows as "0", values less than 0.000001 show as "<0.000001"
|
|
11
|
+
*/
|
|
12
|
+
export declare const formatTokenAmount: (amount: number, includeSymbol?: string) => string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const ProviderSelectContent: import("styled-components").StyledComponent<({ children, width, onBack, logoutOnBack }: {
|
|
2
|
+
children?: React.ReactNode;
|
|
3
|
+
width?: number | string;
|
|
4
|
+
onBack?: import("../../PageContent").SetOnBackFunction;
|
|
5
|
+
logoutOnBack?: boolean;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
|
|
7
|
+
export declare const ProviderList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const ProviderButton: import("styled-components").StyledComponent<"button", any, {
|
|
9
|
+
$active?: boolean;
|
|
10
|
+
}, never>;
|
|
11
|
+
export declare const ProviderInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const ProviderNameRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const ProviderName: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
14
|
+
export declare const ProviderBadge: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
15
|
+
export declare const ProviderMeta: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
16
|
+
export declare const ProviderRight: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
+
export declare const ProviderQuote: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
18
|
+
export declare const ProviderFiat: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
19
|
+
export declare const EmptyState: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LinkedProvidersCard: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NoAssetsAvailable: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ButtonsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -5,6 +5,10 @@ export declare const BalanceContainer: import("styled-components").StyledCompone
|
|
|
5
5
|
export declare const Balance: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {}, never>;
|
|
6
6
|
export declare const LoadingBalance: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {}, never>;
|
|
7
7
|
export declare const Unsupported: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {}, never>;
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const ActionButtonsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
+
export declare const ActionButton: import("styled-components").StyledComponent<import("react").FC<import("../../Common/Button/types").ButtonProps>, any, {}, never>;
|
|
10
|
+
export declare const DisconnectButton: import("styled-components").StyledComponent<import("react").FC<import("../../Common/Button/types").ButtonProps>, any, {}, never>;
|
|
11
|
+
export declare const ProvidersHeader: import("styled-components").StyledComponent<"h3", any, {}, never>;
|
|
12
|
+
export declare const LinkedProviderContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
13
|
export declare const LinkedProviderButton: import("styled-components").StyledComponent<import("react").FC<import("../../Common/Button/types").ButtonProps>, any, {}, never>;
|
|
10
|
-
export declare const
|
|
14
|
+
export declare const LinkedProvidersToggle: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const QRWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const AddressSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const Label: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
4
|
+
export declare const AddressRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const AddressField: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const NetworkInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const SelectTokenContent: import("styled-components").StyledComponent<({ children, width, onBack, logoutOnBack }: {
|
|
2
|
+
children?: React.ReactNode;
|
|
3
|
+
width?: number | string;
|
|
4
|
+
onBack?: import("../../PageContent").SetOnBackFunction;
|
|
5
|
+
logoutOnBack?: boolean;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
|
|
7
|
+
export declare const TokenList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const TokenButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
9
|
+
export declare const TokenContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export declare const TokenInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export declare const TokenSymbol: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
12
|
+
export declare const TokenName: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
13
|
+
export declare const TokenBalance: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
14
|
+
export declare const EmptyState: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const Form: import("styled-components").StyledComponent<"form", any, {}, never>;
|
|
2
|
+
export declare const Field: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const FieldLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
4
|
+
export declare const TokenSelectorButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
5
|
+
export declare const TokenSelectorContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const TokenSelectorValue: import("styled-components").StyledComponent<"span", any, {
|
|
7
|
+
$primary?: boolean;
|
|
8
|
+
$muted?: boolean;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const TokenSelectorRight: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export declare const AmountInputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const MaxButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
13
|
+
export declare const HelperText: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
14
|
+
export declare const ErrorText: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Asset } from '../../Openfort/types';
|
|
2
|
+
export declare const sanitizeAmountInput: (value: string) => string;
|
|
3
|
+
export declare const sanitizeForParsing: (value: string) => string | null;
|
|
4
|
+
export declare const formatBalance: (value: bigint | undefined, decimals: number) => string;
|
|
5
|
+
export declare const formatBalanceWithSymbol: (value: bigint | undefined, decimals: number, symbol: string) => string;
|
|
6
|
+
export declare const isSameToken: (a: Asset, b: Asset) => boolean;
|
|
7
|
+
export declare const getAssetSymbol: (asset: Asset) => string;
|
|
8
|
+
export declare const getAssetDecimals: (asset: Asset) => number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
type EstimatedFeesProps = {
|
|
3
|
+
account: Address | undefined;
|
|
4
|
+
to: Address | undefined;
|
|
5
|
+
value: bigint | undefined;
|
|
6
|
+
data: `0x${string}` | undefined;
|
|
7
|
+
chainId: number | undefined;
|
|
8
|
+
nativeSymbol: string;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
hideInfoIcon?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const EstimatedFees: ({ account, to, value, data, chainId, nativeSymbol, enabled, hideInfoIcon, }: EstimatedFeesProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const SummaryList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const SummaryItem: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const SummaryLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
4
|
+
export declare const AmountValue: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
5
|
+
export declare const AddressValue: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
6
|
+
export declare const FeesValue: import("styled-components").StyledComponent<"span", any, {
|
|
7
|
+
$completed?: boolean;
|
|
8
|
+
}, never>;
|
|
9
|
+
export declare const CheckIconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
10
|
+
export declare const InfoIconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
11
|
+
export declare const ButtonRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const StatusMessage: import("styled-components").StyledComponent<"div", any, {
|
|
13
|
+
$status: "idle" | "success" | "error";
|
|
14
|
+
}, never>;
|
|
15
|
+
export declare const ErrorContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
+
export declare const ErrorTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
+
export declare const ErrorMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
+
export declare const ErrorAction: import("styled-components").StyledComponent<"div", any, {}, never>;
|