@avalabs/avacloud-waas-react 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/dist/index.d.mts +16 -3
- package/dist/index.d.ts +16 -3
- package/dist/index.js +858 -546
- package/dist/index.mjs +922 -611
- package/package.json +8 -3
- package/dist/_esm-QWLX263D.mjs +0 -3919
- package/dist/ccip-ZGPV4OUI.mjs +0 -14
- package/dist/chunk-CASSC3OP.mjs +0 -67
- package/dist/chunk-G3BBITEG.mjs +0 -367
- package/dist/chunk-H4SP2TEB.mjs +0 -2343
- package/dist/chunk-TMRHATUE.mjs +0 -5868
- package/dist/dejavu-mono-latin-400-normal-IE7EMRRJ.woff2 +0 -0
- package/dist/dejavu-mono-latin-400-normal-MXASKUMG.woff +0 -0
- package/dist/dejavu-mono-latin-700-normal-4E6K55SY.woff +0 -0
- package/dist/dejavu-mono-latin-700-normal-4R4GZIXF.woff2 +0 -0
- package/dist/index.css +0 -473
- package/dist/inter-cyrillic-400-normal-KFLOZ6L3.woff2 +0 -0
- package/dist/inter-cyrillic-400-normal-UGV3X2ZX.woff +0 -0
- package/dist/inter-cyrillic-500-normal-5QURBI26.woff +0 -0
- package/dist/inter-cyrillic-500-normal-MRQZIV3H.woff2 +0 -0
- package/dist/inter-cyrillic-600-normal-EDUIRGIU.woff +0 -0
- package/dist/inter-cyrillic-600-normal-VQSXM56D.woff2 +0 -0
- package/dist/inter-cyrillic-700-normal-6AC775OW.woff2 +0 -0
- package/dist/inter-cyrillic-700-normal-D4IEZ3GW.woff +0 -0
- package/dist/inter-cyrillic-ext-400-normal-JB453SGZ.woff2 +0 -0
- package/dist/inter-cyrillic-ext-400-normal-UT7C7CGZ.woff +0 -0
- package/dist/inter-cyrillic-ext-500-normal-JTQKN4HY.woff2 +0 -0
- package/dist/inter-cyrillic-ext-500-normal-WLOKRQXN.woff +0 -0
- package/dist/inter-cyrillic-ext-600-normal-EFECVKGZ.woff2 +0 -0
- package/dist/inter-cyrillic-ext-600-normal-NBG3W4IU.woff +0 -0
- package/dist/inter-cyrillic-ext-700-normal-4PBXEWDR.woff +0 -0
- package/dist/inter-cyrillic-ext-700-normal-SJP7DRTO.woff2 +0 -0
- package/dist/inter-greek-400-normal-7Y67TOYM.woff +0 -0
- package/dist/inter-greek-400-normal-BRMJUT6T.woff2 +0 -0
- package/dist/inter-greek-500-normal-LCPH243Y.woff +0 -0
- package/dist/inter-greek-500-normal-PQX5SJVP.woff2 +0 -0
- package/dist/inter-greek-600-normal-PKJBTQPQ.woff2 +0 -0
- package/dist/inter-greek-600-normal-UPKYUUFH.woff +0 -0
- package/dist/inter-greek-700-normal-5N2Y4K7P.woff2 +0 -0
- package/dist/inter-greek-700-normal-OE26ANW4.woff +0 -0
- package/dist/inter-greek-ext-400-normal-4HYCVGMS.woff +0 -0
- package/dist/inter-greek-ext-400-normal-QIS4ONLW.woff2 +0 -0
- package/dist/inter-greek-ext-500-normal-AOIZUIP4.woff +0 -0
- package/dist/inter-greek-ext-500-normal-Z2CEJP2K.woff2 +0 -0
- package/dist/inter-greek-ext-600-normal-FQPCNDF3.woff +0 -0
- package/dist/inter-greek-ext-600-normal-KM6XRHAQ.woff2 +0 -0
- package/dist/inter-greek-ext-700-normal-FDEUQJ34.woff +0 -0
- package/dist/inter-greek-ext-700-normal-LWL55ZDD.woff2 +0 -0
- package/dist/inter-latin-400-normal-O6KIPRV2.woff +0 -0
- package/dist/inter-latin-400-normal-VQ3UBCDI.woff2 +0 -0
- package/dist/inter-latin-500-normal-OD7WVACW.woff +0 -0
- package/dist/inter-latin-500-normal-PUEXTTCT.woff2 +0 -0
- package/dist/inter-latin-600-normal-5WVF6G4B.woff +0 -0
- package/dist/inter-latin-600-normal-GQRH5MIF.woff2 +0 -0
- package/dist/inter-latin-700-normal-5OESYTDS.woff2 +0 -0
- package/dist/inter-latin-700-normal-ZQVBARDV.woff +0 -0
- package/dist/inter-latin-ext-400-normal-BTAMM2KL.woff2 +0 -0
- package/dist/inter-latin-ext-400-normal-YUALTDTA.woff +0 -0
- package/dist/inter-latin-ext-500-normal-DV5RJSXI.woff2 +0 -0
- package/dist/inter-latin-ext-500-normal-KJKTVLML.woff +0 -0
- package/dist/inter-latin-ext-600-normal-AOYWYIP3.woff2 +0 -0
- package/dist/inter-latin-ext-600-normal-L5SWE5DY.woff +0 -0
- package/dist/inter-latin-ext-700-normal-2RDPBVFQ.woff2 +0 -0
- package/dist/inter-latin-ext-700-normal-XQIRBHUR.woff +0 -0
- package/dist/inter-vietnamese-400-normal-724F3VTF.woff +0 -0
- package/dist/inter-vietnamese-400-normal-KH5NGGJJ.woff2 +0 -0
- package/dist/inter-vietnamese-500-normal-F77QXW2X.woff2 +0 -0
- package/dist/inter-vietnamese-500-normal-ZTDWBSHR.woff +0 -0
- package/dist/inter-vietnamese-600-normal-47DK6MCQ.woff2 +0 -0
- package/dist/inter-vietnamese-600-normal-M4XR4C4S.woff +0 -0
- package/dist/inter-vietnamese-700-normal-ONTG3SOY.woff +0 -0
- package/dist/inter-vietnamese-700-normal-T2WXKRNY.woff2 +0 -0
- package/dist/mod-LKCIPMBZ.mjs +0 -2628
- package/dist/secp256k1-AYCAE7S6.mjs +0 -16
package/README.md
CHANGED
|
@@ -89,13 +89,36 @@ The main provider component that wraps your application and provides wallet cont
|
|
|
89
89
|
| Prop | Type | Description |
|
|
90
90
|
|------|------|-------------|
|
|
91
91
|
| `orgId` | `string` | **Required** - Your AvaCloud organization ID used to fetch wallet configuration |
|
|
92
|
-
| `env` | `'
|
|
92
|
+
| `env` | `'development' \| 'staging' \| 'production'` | Environment to use (default: `'production'`) |
|
|
93
93
|
| `chainId` | `number` | EVM chain ID (default: `43113` - Avalanche Fuji Testnet) |
|
|
94
94
|
| `darkMode` | `boolean` | Enable dark mode for UI components (default: `false`) |
|
|
95
|
+
| `authServiceUrl` | `string` | Optional custom auth service URL. Overrides default environment-based URLs |
|
|
95
96
|
| `onAuthSuccess` | `(user: Auth0User) => void` | Callback on successful authentication |
|
|
96
97
|
| `onAuthError` | `(error: Error) => void` | Callback on authentication error |
|
|
97
98
|
| `onWalletUpdate` | `(wallet: WalletInfo) => void` | Callback when wallet information updates |
|
|
98
99
|
|
|
100
|
+
#### Configuring Auth Service URL
|
|
101
|
+
|
|
102
|
+
The auth service URL can be configured in three ways (in order of precedence):
|
|
103
|
+
|
|
104
|
+
1. **Direct prop**: Pass `authServiceUrl` directly to the provider
|
|
105
|
+
```tsx
|
|
106
|
+
<AvaCloudWalletProvider
|
|
107
|
+
orgId="your-org-id"
|
|
108
|
+
authServiceUrl="https://your-custom-auth-service.com"
|
|
109
|
+
>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
2. **Environment variable**: Set `NEXT_PUBLIC_AUTH_SERVICE_URL` in your `.env` file
|
|
113
|
+
```bash
|
|
114
|
+
NEXT_PUBLIC_AUTH_SERVICE_URL=https://your-custom-auth-service.com
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
3. **Default URLs**: Falls back to environment-based defaults
|
|
118
|
+
- `development`: `http://localhost:3000`
|
|
119
|
+
- `staging`: `https://ac-auth-service-env-staging-ava-labs.vercel.app`
|
|
120
|
+
- `production`: `https://ac-auth-service.vercel.app`
|
|
121
|
+
|
|
99
122
|
### UI Components
|
|
100
123
|
|
|
101
124
|
- `LoginButton`: Button component for initiating the login flow
|
package/dist/index.d.mts
CHANGED
|
@@ -90,6 +90,8 @@ interface OrgConfig {
|
|
|
90
90
|
SKey?: string;
|
|
91
91
|
/** Organization ID */
|
|
92
92
|
orgID?: string;
|
|
93
|
+
/** Cubist organization ID returned by the auth service */
|
|
94
|
+
cubistOrgId?: string;
|
|
93
95
|
/** Wallet provider organization ID used for Cubist */
|
|
94
96
|
walletProviderOrgID?: string;
|
|
95
97
|
/** Admin portal settings */
|
|
@@ -295,6 +297,7 @@ interface AvaCloudWalletProviderProps {
|
|
|
295
297
|
chainId?: number;
|
|
296
298
|
darkMode?: boolean;
|
|
297
299
|
env?: AvaCloudEnvironment;
|
|
300
|
+
authServiceUrl?: string;
|
|
298
301
|
onAuthSuccess?: (user: UserInfo) => void;
|
|
299
302
|
onAuthError?: (error: Error) => void;
|
|
300
303
|
onWalletUpdate?: (wallet: WalletInfo) => void;
|
|
@@ -312,7 +315,11 @@ interface AvaCloudWalletContextType {
|
|
|
312
315
|
loginWithCubist: (oidcToken?: string) => Promise<void>;
|
|
313
316
|
cubistClient: CubeSignerClient | null;
|
|
314
317
|
cubistError: Error | null;
|
|
315
|
-
login: (
|
|
318
|
+
login: (params?: {
|
|
319
|
+
email?: string;
|
|
320
|
+
password?: string;
|
|
321
|
+
connection?: string;
|
|
322
|
+
}) => void;
|
|
316
323
|
signup: (email: string, password: string) => void;
|
|
317
324
|
addAccount: (accountIndex: number) => Promise<void>;
|
|
318
325
|
queryClient: QueryClient;
|
|
@@ -322,7 +329,7 @@ interface AvaCloudWalletContextType {
|
|
|
322
329
|
environment: AvaCloudEnvironment;
|
|
323
330
|
}
|
|
324
331
|
|
|
325
|
-
declare function AvaCloudWalletProvider({ children, orgId, chainId, darkMode, env, onAuthSuccess, onAuthError, onWalletUpdate, }: AvaCloudWalletProviderProps): react_jsx_runtime.JSX.Element;
|
|
332
|
+
declare function AvaCloudWalletProvider({ children, orgId, chainId, darkMode, env, authServiceUrl: customAuthServiceUrl, onAuthSuccess, onAuthError, onWalletUpdate, }: AvaCloudWalletProviderProps): react_jsx_runtime.JSX.Element;
|
|
326
333
|
declare function useAvaCloudWallet(): AvaCloudWalletContextType;
|
|
327
334
|
|
|
328
335
|
interface ThemeContextType {
|
|
@@ -572,6 +579,11 @@ interface GaslessConfig {
|
|
|
572
579
|
/** Suffix for the request in format "type name" (e.g. "bytes32 XMKUCJONOFSUSFCYHTYHCLX") */
|
|
573
580
|
suffix?: string;
|
|
574
581
|
}
|
|
582
|
+
interface GaslessContextType {
|
|
583
|
+
isLoading: boolean;
|
|
584
|
+
error: Error | null;
|
|
585
|
+
config: GaslessConfig | null;
|
|
586
|
+
}
|
|
575
587
|
interface FetchGaslessConfigParams {
|
|
576
588
|
orgId: string;
|
|
577
589
|
subnetId: string;
|
|
@@ -593,6 +605,7 @@ interface GaslessProviderProps {
|
|
|
593
605
|
* (relayer URL, forwarder address, etc.) to the browser.
|
|
594
606
|
*/
|
|
595
607
|
declare function GaslessProvider({ children, config, fetchParams }: GaslessProviderProps): react_jsx_runtime.JSX.Element;
|
|
608
|
+
declare function useGaslessConfig(): GaslessContextType;
|
|
596
609
|
|
|
597
610
|
interface GaslessTxState {
|
|
598
611
|
isLoading: boolean;
|
|
@@ -619,4 +632,4 @@ interface UseGaslessTransactionOptions {
|
|
|
619
632
|
}
|
|
620
633
|
declare function useGaslessTransaction({ gaslessConfig, contractAddress: defaultContractAddress, abi: defaultAbi }: UseGaslessTransactionOptions): UseGaslessTransactionReturn;
|
|
621
634
|
|
|
622
|
-
export { type AddAccountMessage, type AdminPortalSettings, type Auth0User, type AuthMessage, type AuthMessagePayload, type AuthStateUpdateMessage, type AuthStatusMessage, type AvaCloudEnvironment, type AvaCloudWalletContextType, AvaCloudWalletProvider, type AvaCloudWalletProviderProps, type BaseAuthMessage, type CheckAuthStatusMessage, type CubistWalletInfo, type ErrorMessage, ExportView, GaslessProvider, type GetOidcMessage, type IframeReadyMessage, LoginButton, type LoginRequestMessage, type LogoutRequestMessage, type MessageType, type OrgConfig, type ReceiveOidcMessage, ReceiveView, type RegisterMessage, type RegisterPayload, type RegisterSuccessMessage, SendView, type SignupRequestMessage, ThemeProvider, TokensView, type UserInfo, UserProfile, VM, WalletButton, WalletCard, WalletDisplay, type WalletInfo, type WalletKeysErrorMessage, type WalletKeysUpdateMessage, avaCloudWallet, useAuth, useAvaCloudWallet, useBlockchain, useChainId, useGaslessTransaction, useGlacier, usePostMessage, useSignMessage, useSignTransaction, useThemeMode, useTransferTokens, useUserWallets };
|
|
635
|
+
export { type AddAccountMessage, type AdminPortalSettings, type Auth0User, type AuthMessage, type AuthMessagePayload, type AuthStateUpdateMessage, type AuthStatusMessage, type AvaCloudEnvironment, type AvaCloudWalletContextType, AvaCloudWalletProvider, type AvaCloudWalletProviderProps, type BaseAuthMessage, type CheckAuthStatusMessage, type CubistWalletInfo, type ErrorMessage, ExportView, type FetchGaslessConfigParams, type GaslessConfig, GaslessProvider, type GaslessProviderProps, type GetOidcMessage, type IframeReadyMessage, LoginButton, type LoginRequestMessage, type LogoutRequestMessage, type MessageType, type OrgConfig, type ReceiveOidcMessage, ReceiveView, type RegisterMessage, type RegisterPayload, type RegisterSuccessMessage, SendView, type SignupRequestMessage, ThemeProvider, TokensView, type UseGaslessTransactionOptions, type UserInfo, UserProfile, VM, WalletButton, WalletCard, WalletDisplay, type WalletInfo, type WalletKeysErrorMessage, type WalletKeysUpdateMessage, avaCloudWallet, useAuth, useAvaCloudWallet, useBlockchain, useChainId, useGaslessConfig, useGaslessTransaction, useGlacier, usePostMessage, useSignMessage, useSignTransaction, useThemeMode, useTransferTokens, useUserWallets };
|
package/dist/index.d.ts
CHANGED
|
@@ -90,6 +90,8 @@ interface OrgConfig {
|
|
|
90
90
|
SKey?: string;
|
|
91
91
|
/** Organization ID */
|
|
92
92
|
orgID?: string;
|
|
93
|
+
/** Cubist organization ID returned by the auth service */
|
|
94
|
+
cubistOrgId?: string;
|
|
93
95
|
/** Wallet provider organization ID used for Cubist */
|
|
94
96
|
walletProviderOrgID?: string;
|
|
95
97
|
/** Admin portal settings */
|
|
@@ -295,6 +297,7 @@ interface AvaCloudWalletProviderProps {
|
|
|
295
297
|
chainId?: number;
|
|
296
298
|
darkMode?: boolean;
|
|
297
299
|
env?: AvaCloudEnvironment;
|
|
300
|
+
authServiceUrl?: string;
|
|
298
301
|
onAuthSuccess?: (user: UserInfo) => void;
|
|
299
302
|
onAuthError?: (error: Error) => void;
|
|
300
303
|
onWalletUpdate?: (wallet: WalletInfo) => void;
|
|
@@ -312,7 +315,11 @@ interface AvaCloudWalletContextType {
|
|
|
312
315
|
loginWithCubist: (oidcToken?: string) => Promise<void>;
|
|
313
316
|
cubistClient: CubeSignerClient | null;
|
|
314
317
|
cubistError: Error | null;
|
|
315
|
-
login: (
|
|
318
|
+
login: (params?: {
|
|
319
|
+
email?: string;
|
|
320
|
+
password?: string;
|
|
321
|
+
connection?: string;
|
|
322
|
+
}) => void;
|
|
316
323
|
signup: (email: string, password: string) => void;
|
|
317
324
|
addAccount: (accountIndex: number) => Promise<void>;
|
|
318
325
|
queryClient: QueryClient;
|
|
@@ -322,7 +329,7 @@ interface AvaCloudWalletContextType {
|
|
|
322
329
|
environment: AvaCloudEnvironment;
|
|
323
330
|
}
|
|
324
331
|
|
|
325
|
-
declare function AvaCloudWalletProvider({ children, orgId, chainId, darkMode, env, onAuthSuccess, onAuthError, onWalletUpdate, }: AvaCloudWalletProviderProps): react_jsx_runtime.JSX.Element;
|
|
332
|
+
declare function AvaCloudWalletProvider({ children, orgId, chainId, darkMode, env, authServiceUrl: customAuthServiceUrl, onAuthSuccess, onAuthError, onWalletUpdate, }: AvaCloudWalletProviderProps): react_jsx_runtime.JSX.Element;
|
|
326
333
|
declare function useAvaCloudWallet(): AvaCloudWalletContextType;
|
|
327
334
|
|
|
328
335
|
interface ThemeContextType {
|
|
@@ -572,6 +579,11 @@ interface GaslessConfig {
|
|
|
572
579
|
/** Suffix for the request in format "type name" (e.g. "bytes32 XMKUCJONOFSUSFCYHTYHCLX") */
|
|
573
580
|
suffix?: string;
|
|
574
581
|
}
|
|
582
|
+
interface GaslessContextType {
|
|
583
|
+
isLoading: boolean;
|
|
584
|
+
error: Error | null;
|
|
585
|
+
config: GaslessConfig | null;
|
|
586
|
+
}
|
|
575
587
|
interface FetchGaslessConfigParams {
|
|
576
588
|
orgId: string;
|
|
577
589
|
subnetId: string;
|
|
@@ -593,6 +605,7 @@ interface GaslessProviderProps {
|
|
|
593
605
|
* (relayer URL, forwarder address, etc.) to the browser.
|
|
594
606
|
*/
|
|
595
607
|
declare function GaslessProvider({ children, config, fetchParams }: GaslessProviderProps): react_jsx_runtime.JSX.Element;
|
|
608
|
+
declare function useGaslessConfig(): GaslessContextType;
|
|
596
609
|
|
|
597
610
|
interface GaslessTxState {
|
|
598
611
|
isLoading: boolean;
|
|
@@ -619,4 +632,4 @@ interface UseGaslessTransactionOptions {
|
|
|
619
632
|
}
|
|
620
633
|
declare function useGaslessTransaction({ gaslessConfig, contractAddress: defaultContractAddress, abi: defaultAbi }: UseGaslessTransactionOptions): UseGaslessTransactionReturn;
|
|
621
634
|
|
|
622
|
-
export { type AddAccountMessage, type AdminPortalSettings, type Auth0User, type AuthMessage, type AuthMessagePayload, type AuthStateUpdateMessage, type AuthStatusMessage, type AvaCloudEnvironment, type AvaCloudWalletContextType, AvaCloudWalletProvider, type AvaCloudWalletProviderProps, type BaseAuthMessage, type CheckAuthStatusMessage, type CubistWalletInfo, type ErrorMessage, ExportView, GaslessProvider, type GetOidcMessage, type IframeReadyMessage, LoginButton, type LoginRequestMessage, type LogoutRequestMessage, type MessageType, type OrgConfig, type ReceiveOidcMessage, ReceiveView, type RegisterMessage, type RegisterPayload, type RegisterSuccessMessage, SendView, type SignupRequestMessage, ThemeProvider, TokensView, type UserInfo, UserProfile, VM, WalletButton, WalletCard, WalletDisplay, type WalletInfo, type WalletKeysErrorMessage, type WalletKeysUpdateMessage, avaCloudWallet, useAuth, useAvaCloudWallet, useBlockchain, useChainId, useGaslessTransaction, useGlacier, usePostMessage, useSignMessage, useSignTransaction, useThemeMode, useTransferTokens, useUserWallets };
|
|
635
|
+
export { type AddAccountMessage, type AdminPortalSettings, type Auth0User, type AuthMessage, type AuthMessagePayload, type AuthStateUpdateMessage, type AuthStatusMessage, type AvaCloudEnvironment, type AvaCloudWalletContextType, AvaCloudWalletProvider, type AvaCloudWalletProviderProps, type BaseAuthMessage, type CheckAuthStatusMessage, type CubistWalletInfo, type ErrorMessage, ExportView, type FetchGaslessConfigParams, type GaslessConfig, GaslessProvider, type GaslessProviderProps, type GetOidcMessage, type IframeReadyMessage, LoginButton, type LoginRequestMessage, type LogoutRequestMessage, type MessageType, type OrgConfig, type ReceiveOidcMessage, ReceiveView, type RegisterMessage, type RegisterPayload, type RegisterSuccessMessage, SendView, type SignupRequestMessage, ThemeProvider, TokensView, type UseGaslessTransactionOptions, type UserInfo, UserProfile, VM, WalletButton, WalletCard, WalletDisplay, type WalletInfo, type WalletKeysErrorMessage, type WalletKeysUpdateMessage, avaCloudWallet, useAuth, useAvaCloudWallet, useBlockchain, useChainId, useGaslessConfig, useGaslessTransaction, useGlacier, usePostMessage, useSignMessage, useSignTransaction, useThemeMode, useTransferTokens, useUserWallets };
|