@vechain/vechain-kit 0.9.1 → 0.10.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/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as React$1 from 'react';
4
4
  import React__default, { ReactElement, ReactNode, ElementType } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { IconType } from 'react-icons';
7
- import { User, WalletListEntry, ConnectedWallet } from '@privy-io/react-auth';
7
+ import { User, WalletListEntry } from '@privy-io/react-auth';
8
8
  export { useCrossAppAccounts, usePrivy } from '@privy-io/react-auth';
9
9
  import { WalletConnectOptions } from '@vechain/dapp-kit-react';
10
10
  export { useConnex } from '@vechain/dapp-kit-react';
@@ -12,10 +12,7 @@ import * as _tanstack_react_query from '@tanstack/react-query';
12
12
  import { ThorClient } from '@vechain/sdk-network';
13
13
  import { WalletSource, LogLevel } from '@vechain/dapp-kit';
14
14
  import { CustomizedStyle, SourceInfo, I18n } from '@vechain/dapp-kit-ui';
15
- import * as abitype from 'abitype';
16
- import * as viem__types_experimental_eip7702_types_authorization from 'viem/_types/experimental/eip7702/types/authorization';
17
- import * as viem from 'viem';
18
- import * as viem_accounts from 'viem/accounts';
15
+ import { Account } from 'viem/accounts';
19
16
 
20
17
  declare const SimpleAccountABI: readonly [{
21
18
  readonly inputs: readonly [];
@@ -768,10 +765,10 @@ interface ConnectionButtonProps {
768
765
  isDark: boolean;
769
766
  onClick: () => void;
770
767
  text?: string;
771
- leftIcon?: ReactElement;
772
768
  icon?: IconType;
769
+ customIcon?: ReactElement;
773
770
  }
774
- declare const ConnectionButton: ({ isDark, onClick, leftIcon, text, icon, }: ConnectionButtonProps) => react_jsx_runtime.JSX.Element | null;
771
+ declare const ConnectionButton: ({ isDark, onClick, text, icon, customIcon, }: ConnectionButtonProps) => react_jsx_runtime.JSX.Element | null;
775
772
 
776
773
  declare const EmailLoginButton: () => react_jsx_runtime.JSX.Element;
777
774
 
@@ -804,7 +801,7 @@ type SmartAccount = Wallet & {
804
801
  isDeployed: boolean;
805
802
  };
806
803
  type ConnectionSource = {
807
- type: 'privy' | 'wallet' | 'privy-cross-app';
804
+ type: 'privy' | 'wallet' | 'privy-cross-app' | 'privy-vechain';
808
805
  displayName: string;
809
806
  };
810
807
  /**
@@ -855,10 +852,19 @@ type EnhancedClause = Connex.VM.Clause & {
855
852
  comment?: string;
856
853
  abi?: object;
857
854
  };
858
- type PrivyAppInfo$1 = {
855
+ type PrivyAppInfo = {
856
+ id: string;
859
857
  name: string;
860
858
  logo_url: string;
861
- description?: string;
859
+ icon_url: string | null;
860
+ terms_and_conditions_url: string;
861
+ privacy_policy_url: string;
862
+ theme: string;
863
+ accent_color: string;
864
+ wallet_auth: boolean;
865
+ email_auth: boolean;
866
+ google_oauth: boolean;
867
+ twitter_oauth: boolean;
862
868
  };
863
869
  type PrivyLoginMethod = 'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'linkedin' | 'spotify' | 'instagram' | 'tiktok' | 'apple' | 'farcaster' | 'telegram';
864
870
 
@@ -1164,20 +1170,6 @@ declare const getVeDelegateBalance: (thor: Connex.Thor, network: NETWORK_TYPE, a
1164
1170
  declare const getVeDelegateBalanceQueryKey: (address?: string) => (string | undefined)[];
1165
1171
  declare const useGetVeDelegateBalance: (address?: string) => _tanstack_react_query.UseQueryResult<string, Error>;
1166
1172
 
1167
- interface PrivyAppInfo {
1168
- id: string;
1169
- name: string;
1170
- logo_url: string;
1171
- icon_url: string | null;
1172
- terms_and_conditions_url: string;
1173
- privacy_policy_url: string;
1174
- theme: string;
1175
- accent_color: string;
1176
- wallet_auth: boolean;
1177
- email_auth: boolean;
1178
- google_oauth: boolean;
1179
- twitter_oauth: boolean;
1180
- }
1181
1173
  declare const fetchPrivyAppInfo: (appId: string) => Promise<PrivyAppInfo>;
1182
1174
  declare const getPrivyAppInfoQueryKey: (appIds: string | string[]) => string[];
1183
1175
  declare const useFetchAppInfo: (appIds: string | string[]) => _tanstack_react_query.UseQueryResult<{
@@ -1253,9 +1245,10 @@ type UseWalletReturnType = {
1253
1245
  privyUser: User | null;
1254
1246
  connection: {
1255
1247
  isConnected: boolean;
1248
+ isConnecting: boolean;
1256
1249
  isConnectedWithPrivy: boolean;
1257
1250
  isConnectedWithDappKit: boolean;
1258
- isConnectedWithCrossAppPrivy: boolean;
1251
+ isConnectedWithCrossApp: boolean;
1259
1252
  isLoadingPrivyConnection: boolean;
1260
1253
  source: ConnectionSource;
1261
1254
  isInAppBrowser: boolean;
@@ -1415,7 +1408,7 @@ declare const useTransferVET: ({ fromAddress, receiverAddress, amount, onSuccess
1415
1408
 
1416
1409
  type Props = {
1417
1410
  children: ReactNode;
1418
- privy: {
1411
+ privy?: {
1419
1412
  appId: string;
1420
1413
  clientId: string;
1421
1414
  appearance: {
@@ -1428,9 +1421,9 @@ type Props = {
1428
1421
  createOnLogin: 'users-without-wallets' | 'all-users' | 'off';
1429
1422
  };
1430
1423
  loginMethods: PrivyLoginMethod[];
1431
- ecosystemAppsID?: string[];
1432
1424
  allowPasskeyLinking?: boolean;
1433
1425
  };
1426
+ privyEcosystemAppIDS: string[];
1434
1427
  feeDelegation: {
1435
1428
  delegatorUrl: string;
1436
1429
  delegateAllTransactions: boolean;
@@ -1464,7 +1457,8 @@ type Props = {
1464
1457
  };
1465
1458
  };
1466
1459
  type VeChainKitConfig = {
1467
- privy: Props['privy'];
1460
+ privy?: Props['privy'];
1461
+ privyEcosystemAppIDS: string[];
1468
1462
  feeDelegation: Props['feeDelegation'];
1469
1463
  dappKit: Props['dappKit'];
1470
1464
  loginModalUI?: Props['loginModalUI'];
@@ -1472,6 +1466,7 @@ type VeChainKitConfig = {
1472
1466
  i18n?: Props['i18n'];
1473
1467
  language?: Props['language'];
1474
1468
  network: Props['network'];
1469
+ privySocialLoginEnabled: boolean;
1475
1470
  openConnectModal: () => void;
1476
1471
  closeConnectModal: () => void;
1477
1472
  isConnectModalOpen: boolean;
@@ -1496,10 +1491,9 @@ declare const useVeChainKitConfig: () => VeChainKitConfig;
1496
1491
  /**
1497
1492
  * Provider to wrap the application with Privy and DAppKit
1498
1493
  */
1499
- declare const VeChainKit: ({ children, privy, feeDelegation, dappKit, loginModalUI, darkMode, i18n, language, network, }: Omit<Props, "queryClient">) => react_jsx_runtime.JSX.Element;
1494
+ declare const VeChainKit: ({ children, privy, feeDelegation, dappKit, loginModalUI, darkMode, i18n, language, network, privyEcosystemAppIDS, }: Omit<Props, "queryClient">) => react_jsx_runtime.JSX.Element;
1500
1495
 
1501
1496
  interface PrivyWalletProviderContextType {
1502
- embeddedWallet?: ConnectedWallet;
1503
1497
  accountFactory: string;
1504
1498
  delegateAllTransactions: boolean;
1505
1499
  sendTransaction: (tx: {
@@ -1539,25 +1533,8 @@ declare const humanDomain: (domain: string, lengthBefore?: number, lengthAfter?:
1539
1533
  declare const getPicassoImage: (address: string, base64?: boolean) => string;
1540
1534
 
1541
1535
  declare const randomTransactionUser: {
1542
- privateKey: `0x${string}`;
1543
- account: {
1544
- address: viem_accounts.Address;
1545
- nonceManager?: viem_accounts.NonceManager | undefined;
1546
- sign: (parameters: {
1547
- hash: viem.Hash;
1548
- }) => Promise<viem.Hex>;
1549
- experimental_signAuthorization: (parameters: viem__types_experimental_eip7702_types_authorization.Authorization) => Promise<viem_accounts.SignAuthorizationReturnType>;
1550
- signMessage: ({ message }: {
1551
- message: viem.SignableMessage;
1552
- }) => Promise<viem.Hex>;
1553
- signTransaction: <serializer extends viem.SerializeTransactionFn<viem.TransactionSerializable> = viem.SerializeTransactionFn<viem.TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
1554
- serializer?: serializer | undefined;
1555
- } | undefined) => Promise<viem.IsNarrowable<viem.TransactionSerialized<viem.GetTransactionType<transaction>>, viem.Hex> extends true ? viem.TransactionSerialized<viem.GetTransactionType<transaction>> : viem.Hex>;
1556
- signTypedData: <const typedData extends abitype.TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: viem.TypedDataDefinition<typedData, primaryType>) => Promise<viem.Hex>;
1557
- publicKey: viem.Hex;
1558
- source: "privateKey";
1559
- type: "local";
1560
- };
1536
+ privateKey: string;
1537
+ account: Account;
1561
1538
  address: string;
1562
1539
  };
1563
1540
 
@@ -1606,4 +1583,4 @@ type AppConfig = {
1606
1583
  };
1607
1584
  declare const getConfig: (env: NETWORK_TYPE) => AppConfig;
1608
1585
 
1609
- export { AccountDetailsButton, AccountMainContent, AccountModal, type AccountModalContentTypes, AccountModalProvider, AccountSelector, AccountsListContent, ActionButton, AddressDisplay, type AppConfig, AssetButton, AssetsSection, BalanceSection, BaseModal, ConnectModal, type ConnectModalContents, ConnectModalProvider, ConnectionButton, type ConnectionSource, EcosystemModal, EmailLoginButton, type EnhancedClause, type ExecuteWithAuthorizationSignData, FadeInView, FadeInViewFromBottom, FadeInViewFromLeft, FadeInViewFromRight, GoogleLogo, LoginLoadingModal, MainContent, ModalBackButton, PRICE_FEED_IDS, type PrivyAppInfo$1 as PrivyAppInfo, type PrivyLoginMethod, PrivyWalletProvider, type PrivyWalletProviderContextType, QuickActionsSection, ReceiveTokenContent, SelectTokenContent, SendTokenContent, SendTokenSummaryContent, SimpleAccountABI, SimpleAccountFactoryABI, type SmartAccount, SmartAccountContent, type SmartAccountReturnType, StickyFooterContainer, StickyHeaderContainer, type SupportedToken, TOKEN_LOGOS, TransactionModal, type TransactionModalProps, TransactionModalProvider, type TransactionStatus, type TransactionStatusErrorType, TransactionToast, TransactionToastProvider, TwitterLogo, type UseSendTransactionReturnValue, type UseWalletReturnType, VECHAIN_PRIVY_APP_ID, VeChainKit, VeChainKitContext, VechainLogo, VechainLogoHorizontal, VersionFooter, type Wallet, WalletButton, WalletSettingsContent, compareAddresses, compareListOfAddresses, fetchPrivyAppInfo, getAccountBalance, getAccountBalanceQueryKey, getB3trBalance, getB3trBalanceQueryKey, getChainId, getChainIdQueryKey, getConfig, getPicassoImage, getPrivyAppInfoQueryKey, getSmartAccount, getSmartAccountQueryKey, getTokenUsdPrice, getTokenUsdPriceQueryKey, getVeDelegateBalance, getVeDelegateBalanceQueryKey, getVetDomainQueryKey, getVot3Balance, getVot3BalanceQueryKey, humanAddress, humanDomain, isValidAddress, leftPadWithZeros, pollForReceipt, randomTransactionUser, regexPattern, useAccountBalance, useAccountModal, useBalances, useCachedVeChainDomain, useConnectModal, useFetchAppInfo, useGetB3trBalance, useGetChainId, useGetNodeUrl, useGetTokenUsdPrice, useGetVeDelegateBalance, useGetVetDomain, useGetVot3Balance, usePrivyWalletProvider, useRefreshBalances, useSendTransaction, useSmartAccount, useTransactionModal, useTransactionToast, useTransferERC20, useTransferVET, useTxReceipt, useVeChainKitConfig, useWallet };
1586
+ export { AccountDetailsButton, AccountMainContent, AccountModal, type AccountModalContentTypes, AccountModalProvider, AccountSelector, AccountsListContent, ActionButton, AddressDisplay, type AppConfig, AssetButton, AssetsSection, BalanceSection, BaseModal, ConnectModal, type ConnectModalContents, ConnectModalProvider, ConnectionButton, type ConnectionSource, EcosystemModal, EmailLoginButton, type EnhancedClause, type ExecuteWithAuthorizationSignData, FadeInView, FadeInViewFromBottom, FadeInViewFromLeft, FadeInViewFromRight, GoogleLogo, LoginLoadingModal, MainContent, ModalBackButton, PRICE_FEED_IDS, type PrivyAppInfo, type PrivyLoginMethod, PrivyWalletProvider, type PrivyWalletProviderContextType, QuickActionsSection, ReceiveTokenContent, SelectTokenContent, SendTokenContent, SendTokenSummaryContent, SimpleAccountABI, SimpleAccountFactoryABI, type SmartAccount, SmartAccountContent, type SmartAccountReturnType, StickyFooterContainer, StickyHeaderContainer, type SupportedToken, TOKEN_LOGOS, TransactionModal, type TransactionModalProps, TransactionModalProvider, type TransactionStatus, type TransactionStatusErrorType, TransactionToast, TransactionToastProvider, TwitterLogo, type UseSendTransactionReturnValue, type UseWalletReturnType, VECHAIN_PRIVY_APP_ID, VeChainKit, VeChainKitContext, VechainLogo, VechainLogoHorizontal, VersionFooter, type Wallet, WalletButton, WalletSettingsContent, compareAddresses, compareListOfAddresses, fetchPrivyAppInfo, getAccountBalance, getAccountBalanceQueryKey, getB3trBalance, getB3trBalanceQueryKey, getChainId, getChainIdQueryKey, getConfig, getPicassoImage, getPrivyAppInfoQueryKey, getSmartAccount, getSmartAccountQueryKey, getTokenUsdPrice, getTokenUsdPriceQueryKey, getVeDelegateBalance, getVeDelegateBalanceQueryKey, getVetDomainQueryKey, getVot3Balance, getVot3BalanceQueryKey, humanAddress, humanDomain, isValidAddress, leftPadWithZeros, pollForReceipt, randomTransactionUser, regexPattern, useAccountBalance, useAccountModal, useBalances, useCachedVeChainDomain, useConnectModal, useFetchAppInfo, useGetB3trBalance, useGetChainId, useGetNodeUrl, useGetTokenUsdPrice, useGetVeDelegateBalance, useGetVetDomain, useGetVot3Balance, usePrivyWalletProvider, useRefreshBalances, useSendTransaction, useSmartAccount, useTransactionModal, useTransactionToast, useTransferERC20, useTransferVET, useTxReceipt, useVeChainKitConfig, useWallet };