@vechain/vechain-kit 0.8.1 → 0.9.1
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/_esm-6CXN4N54.js +8 -0
- package/dist/_esm-6CXN4N54.js.map +1 -0
- package/dist/index.d.ts +549 -443
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/_esm-PNNCDNTB.js +0 -10
- package/dist/_esm-PNNCDNTB.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { BoxProps, IconProps, ImageProps, IconButtonProps, StackProps } from '@chakra-ui/react';
|
|
1
|
+
import { BoxProps, IconProps, ImageProps, IconButtonProps, StackProps, ButtonProps } from '@chakra-ui/react';
|
|
2
2
|
export { useColorMode as useDAppKitPrivyColorMode } from '@chakra-ui/react';
|
|
3
3
|
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,
|
|
7
|
+
import { User, WalletListEntry, ConnectedWallet } from '@privy-io/react-auth';
|
|
8
8
|
export { useCrossAppAccounts, usePrivy } from '@privy-io/react-auth';
|
|
9
|
-
import {
|
|
9
|
+
import { WalletConnectOptions } from '@vechain/dapp-kit-react';
|
|
10
10
|
export { useConnex } from '@vechain/dapp-kit-react';
|
|
11
|
-
import { ThorClient } from '@vechain/sdk-network';
|
|
12
11
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
12
|
+
import { ThorClient } from '@vechain/sdk-network';
|
|
13
|
+
import { WalletSource, LogLevel } from '@vechain/dapp-kit';
|
|
14
|
+
import { CustomizedStyle, SourceInfo, I18n } from '@vechain/dapp-kit-ui';
|
|
13
15
|
import * as abitype from 'abitype';
|
|
14
16
|
import * as viem__types_experimental_eip7702_types_authorization from 'viem/_types/experimental/eip7702/types/authorization';
|
|
15
17
|
import * as viem from 'viem';
|
|
@@ -752,23 +754,15 @@ declare const VechainLogoHorizontal: React__default.FC<Props$n>;
|
|
|
752
754
|
type Props$m = {
|
|
753
755
|
isOpen: boolean;
|
|
754
756
|
onClose: () => void;
|
|
755
|
-
logo?: string;
|
|
756
757
|
};
|
|
757
|
-
type ConnectModalContents = 'main' | '
|
|
758
|
-
declare const ConnectModal: ({ isOpen, onClose
|
|
758
|
+
type ConnectModalContents = 'main' | 'email-verification';
|
|
759
|
+
declare const ConnectModal: ({ isOpen, onClose }: Props$m) => react_jsx_runtime.JSX.Element;
|
|
759
760
|
|
|
760
761
|
type Props$l = {
|
|
761
|
-
setCurrentContent: React.Dispatch<React.SetStateAction<ConnectModalContents>>;
|
|
762
|
-
onClose: () => void;
|
|
763
|
-
};
|
|
764
|
-
declare const EcosystemContent: ({ setCurrentContent, onClose }: Props$l) => react_jsx_runtime.JSX.Element;
|
|
765
|
-
|
|
766
|
-
type Props$k = {
|
|
767
762
|
setCurrentContent: React__default.Dispatch<React__default.SetStateAction<ConnectModalContents>>;
|
|
768
763
|
onClose: () => void;
|
|
769
|
-
logo?: string;
|
|
770
764
|
};
|
|
771
|
-
declare const MainContent: ({
|
|
765
|
+
declare const MainContent: ({ onClose }: Props$l) => react_jsx_runtime.JSX.Element;
|
|
772
766
|
|
|
773
767
|
interface ConnectionButtonProps {
|
|
774
768
|
isDark: boolean;
|
|
@@ -801,6 +795,18 @@ type TransactionModalProps = {
|
|
|
801
795
|
};
|
|
802
796
|
declare const TransactionModal: ({ isOpen, onClose, status, pendingTitle, confirmationTitle, errorTitle, errorDescription, successTitle, showSocialButtons, socialDescriptionEncoded, showTryAgainButton, onTryAgain, showExplorerButton, txId, }: TransactionModalProps) => react_jsx_runtime.JSX.Element | null;
|
|
803
797
|
|
|
798
|
+
type Wallet = {
|
|
799
|
+
address: string | null;
|
|
800
|
+
domain?: string;
|
|
801
|
+
image?: string;
|
|
802
|
+
};
|
|
803
|
+
type SmartAccount = Wallet & {
|
|
804
|
+
isDeployed: boolean;
|
|
805
|
+
};
|
|
806
|
+
type ConnectionSource = {
|
|
807
|
+
type: 'privy' | 'wallet' | 'privy-cross-app';
|
|
808
|
+
displayName: string;
|
|
809
|
+
};
|
|
804
810
|
/**
|
|
805
811
|
* Data that the Privy user must sign in order to execute a transaction
|
|
806
812
|
* by authorizing the Smart Account contract
|
|
@@ -854,82 +860,8 @@ type PrivyAppInfo$1 = {
|
|
|
854
860
|
logo_url: string;
|
|
855
861
|
description?: string;
|
|
856
862
|
};
|
|
857
|
-
type SocialInfo = {
|
|
858
|
-
code: string;
|
|
859
|
-
name: string;
|
|
860
|
-
logo_url: string;
|
|
861
|
-
description?: string;
|
|
862
|
-
};
|
|
863
863
|
type PrivyLoginMethod = 'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'linkedin' | 'spotify' | 'instagram' | 'tiktok' | 'apple' | 'farcaster' | 'telegram';
|
|
864
864
|
|
|
865
|
-
/**
|
|
866
|
-
* Network URL.
|
|
867
|
-
* Defaults to mainnet.
|
|
868
|
-
*/
|
|
869
|
-
declare const NETWORK_URL: string;
|
|
870
|
-
/**
|
|
871
|
-
* Thor client instance
|
|
872
|
-
*/
|
|
873
|
-
declare const THOR_CLIENT: ThorClient;
|
|
874
|
-
/**
|
|
875
|
-
* Delegator url for the account abstraction factory contract
|
|
876
|
-
*/
|
|
877
|
-
declare const DELEGATOR_URL: string;
|
|
878
|
-
|
|
879
|
-
declare const ACCOUNT_FACTORY_ADDRESSES: {
|
|
880
|
-
readonly '14018334920824264832118464179726739019961432051877733167310318607178': "0xC06Ad8573022e2BE416CA89DA47E8c592971679A";
|
|
881
|
-
readonly '1176455790972829965191905223412607679856028701100105089447013101863': "0x7EABA81B4F3741Ac381af7e025f3B6e0428F05Fb";
|
|
882
|
-
};
|
|
883
|
-
declare const TOKEN_LOGOS: Record<string, string>;
|
|
884
|
-
declare const EXPLORER_URL: {
|
|
885
|
-
readonly '14018334920824264832118464179726739019961432051877733167310318607178': "https://vechainstats.com/transaction";
|
|
886
|
-
readonly '1176455790972829965191905223412607679856028701100105089447013101863': "https://explore-testnet.vechain.org/transactions";
|
|
887
|
-
};
|
|
888
|
-
declare const VECHAIN_PRIVY_APP_ID = "cm4wxxujb022fyujl7g0thb21";
|
|
889
|
-
declare const WALLET_INFOS: SocialInfo[];
|
|
890
|
-
declare const SOCIAL_INFOS: SocialInfo[];
|
|
891
|
-
|
|
892
|
-
declare const humanAddress: (address: string, charAtStart?: number, charAtEnd?: number) => string;
|
|
893
|
-
declare const humanDomain: (domain: string, lengthBefore?: number, lengthAfter?: number) => string;
|
|
894
|
-
declare const getPicassoImage: (address: string, base64?: boolean) => string;
|
|
895
|
-
|
|
896
|
-
declare const randomTransactionUser: {
|
|
897
|
-
privateKey: `0x${string}`;
|
|
898
|
-
account: {
|
|
899
|
-
address: viem_accounts.Address;
|
|
900
|
-
nonceManager?: viem_accounts.NonceManager | undefined;
|
|
901
|
-
sign: (parameters: {
|
|
902
|
-
hash: viem.Hash;
|
|
903
|
-
}) => Promise<viem.Hex>;
|
|
904
|
-
experimental_signAuthorization: (parameters: viem__types_experimental_eip7702_types_authorization.Authorization) => Promise<viem_accounts.SignAuthorizationReturnType>;
|
|
905
|
-
signMessage: ({ message }: {
|
|
906
|
-
message: viem.SignableMessage;
|
|
907
|
-
}) => Promise<viem.Hex>;
|
|
908
|
-
signTransaction: <serializer extends viem.SerializeTransactionFn<viem.TransactionSerializable> = viem.SerializeTransactionFn<viem.TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
|
|
909
|
-
serializer?: serializer | undefined;
|
|
910
|
-
} | undefined) => Promise<viem.IsNarrowable<viem.TransactionSerialized<viem.GetTransactionType<transaction>>, viem.Hex> extends true ? viem.TransactionSerialized<viem.GetTransactionType<transaction>> : viem.Hex>;
|
|
911
|
-
signTypedData: <const typedData extends abitype.TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: viem.TypedDataDefinition<typedData, primaryType>) => Promise<viem.Hex>;
|
|
912
|
-
publicKey: viem.Hex;
|
|
913
|
-
source: "privateKey";
|
|
914
|
-
type: "local";
|
|
915
|
-
};
|
|
916
|
-
address: string;
|
|
917
|
-
};
|
|
918
|
-
|
|
919
|
-
/**
|
|
920
|
-
* Checks if two addresses are equal. Returns true if both values are strings AND:
|
|
921
|
-
* - The two values are equal OR
|
|
922
|
-
* - The checksumed addresses are equal
|
|
923
|
-
*
|
|
924
|
-
* @param address1
|
|
925
|
-
* @param address2
|
|
926
|
-
*/
|
|
927
|
-
declare const compareAddresses: (address1?: string, address2?: string) => boolean;
|
|
928
|
-
declare const compareListOfAddresses: (add1: string[], add2: string[]) => boolean;
|
|
929
|
-
declare const regexPattern: () => RegExp;
|
|
930
|
-
declare const isValidAddress: (addr: string | undefined | null) => boolean;
|
|
931
|
-
declare const leftPadWithZeros: (str: string, length: number) => string;
|
|
932
|
-
|
|
933
865
|
type TransactionToastProps = {
|
|
934
866
|
isOpen: boolean;
|
|
935
867
|
onClose: () => void;
|
|
@@ -940,169 +872,295 @@ type TransactionToastProps = {
|
|
|
940
872
|
};
|
|
941
873
|
declare const TransactionToast: ({ isOpen, onClose, status, txReceipt, error, resetStatus, }: TransactionToastProps) => react_jsx_runtime.JSX.Element | null;
|
|
942
874
|
|
|
943
|
-
type Props$
|
|
875
|
+
type Props$k = {
|
|
944
876
|
isOpen: boolean;
|
|
945
877
|
onClose: () => void;
|
|
946
878
|
};
|
|
947
|
-
declare const AccountModal: ({ isOpen, onClose }: Props$
|
|
879
|
+
declare const AccountModal: ({ isOpen, onClose }: Props$k) => react_jsx_runtime.JSX.Element;
|
|
948
880
|
|
|
949
|
-
type
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
881
|
+
type AccountModalContentTypes = 'main' | 'settings' | 'smart-account' | 'accounts' | 'send-token' | 'receive-token' | {
|
|
882
|
+
type: 'send-token-summary';
|
|
883
|
+
props: {
|
|
884
|
+
toAddressOrDomain: string;
|
|
885
|
+
resolvedDomain?: string;
|
|
886
|
+
resolvedAddress?: string;
|
|
887
|
+
amount: string;
|
|
888
|
+
selectedToken: {
|
|
889
|
+
symbol: string;
|
|
890
|
+
balance: string;
|
|
891
|
+
address: string;
|
|
892
|
+
numericBalance: number;
|
|
893
|
+
price: number;
|
|
894
|
+
};
|
|
895
|
+
onSend: (address: string, amount: string) => void;
|
|
896
|
+
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
897
|
+
};
|
|
953
898
|
};
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
899
|
+
|
|
900
|
+
type Props$j = {
|
|
901
|
+
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
902
|
+
onClose: () => void;
|
|
903
|
+
wallet: Wallet;
|
|
957
904
|
};
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
905
|
+
declare const AccountMainContent: ({ setCurrentContent, wallet }: Props$j) => react_jsx_runtime.JSX.Element;
|
|
906
|
+
|
|
907
|
+
type Props$i = {
|
|
908
|
+
setCurrentContent: React__default.Dispatch<React__default.SetStateAction<AccountModalContentTypes>>;
|
|
909
|
+
onClose: () => void;
|
|
910
|
+
wallet?: Wallet;
|
|
961
911
|
};
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
smartAccount: SmartAccount;
|
|
967
|
-
selectedAccount: Wallet;
|
|
968
|
-
connectedWallet: Wallet;
|
|
969
|
-
privyUser: User | null;
|
|
970
|
-
connection: {
|
|
971
|
-
isConnected: boolean;
|
|
972
|
-
isConnectedWithPrivy: boolean;
|
|
973
|
-
isConnectedWithDappKit: boolean;
|
|
974
|
-
isConnectedWithCrossAppPrivy: boolean;
|
|
975
|
-
isLoadingPrivyConnection: boolean;
|
|
976
|
-
source: ConnectionSource;
|
|
977
|
-
isInAppBrowser: boolean;
|
|
978
|
-
};
|
|
979
|
-
disconnect: () => Promise<void>;
|
|
912
|
+
declare const AccountsListContent: ({ setCurrentContent, onClose }: Props$i) => react_jsx_runtime.JSX.Element;
|
|
913
|
+
|
|
914
|
+
type Props$h = {
|
|
915
|
+
setCurrentContent: React__default.Dispatch<React__default.SetStateAction<AccountModalContentTypes>>;
|
|
980
916
|
};
|
|
981
|
-
declare const
|
|
917
|
+
declare const SmartAccountContent: ({ setCurrentContent }: Props$h) => react_jsx_runtime.JSX.Element;
|
|
982
918
|
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
* @param id Transaction id
|
|
987
|
-
* @param blocksTimeout Number of blocks to wait for the receipt
|
|
988
|
-
* @returns Transaction receipt
|
|
989
|
-
*/
|
|
990
|
-
declare const pollForReceipt: (thor: Connex.Thor, id?: string, blocksTimeout?: number) => Promise<Connex.Thor.Transaction.Receipt>;
|
|
991
|
-
/**
|
|
992
|
-
* Get the tx receipt of a tx id with a block timeout to wait for the receipt
|
|
993
|
-
* @param txId The tx id to get the receipt
|
|
994
|
-
* @param blockTimeout The block timeout to wait for the receipt
|
|
995
|
-
* @returns The tx receipt
|
|
996
|
-
*/
|
|
997
|
-
declare const useTxReceipt: (txId?: string, blockTimeout?: number) => {
|
|
998
|
-
data: Connex.Thor.Transaction.Receipt | null | undefined;
|
|
999
|
-
error: Error | null;
|
|
1000
|
-
isLoading: boolean;
|
|
919
|
+
type Props$g = {
|
|
920
|
+
setCurrentContent: (content: AccountModalContentTypes) => void;
|
|
921
|
+
onLogoutSuccess: () => void;
|
|
1001
922
|
};
|
|
923
|
+
declare const WalletSettingsContent: ({ setCurrentContent, onLogoutSuccess, }: Props$g) => react_jsx_runtime.JSX.Element;
|
|
1002
924
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
sendTransaction: (tx: {
|
|
1009
|
-
txClauses: Connex.VM.Clause[];
|
|
1010
|
-
title?: string;
|
|
1011
|
-
description?: string;
|
|
1012
|
-
buttonText?: string;
|
|
1013
|
-
}) => Promise<string>;
|
|
1014
|
-
exportWallet: () => Promise<void>;
|
|
1015
|
-
thor: ThorClient;
|
|
1016
|
-
nodeUrl: string;
|
|
1017
|
-
delegatorUrl: string;
|
|
1018
|
-
accountFactory: string;
|
|
1019
|
-
delegateAllTransactions: boolean;
|
|
1020
|
-
chainId: string;
|
|
1021
|
-
}
|
|
1022
|
-
/**
|
|
1023
|
-
* This provider is responsible for retrieving the smart account address
|
|
1024
|
-
* of a Privy wallet and providing the necessary context for the smart account.
|
|
1025
|
-
* Upon initialization this provider will execute a few useEffect hooks to:
|
|
1026
|
-
* - retrieve the smart account address of the embedded wallet
|
|
1027
|
-
* - retrieve the chain id
|
|
1028
|
-
* - check if the smart account is deployed
|
|
1029
|
-
*
|
|
1030
|
-
* It also provides a function to send transactions on vechain by asking the privy wallet
|
|
1031
|
-
* to sign the transaction and then forwarding the transaction to the node api.
|
|
1032
|
-
* When sending a transaction this provider will check if the smart account is deployed and if not,
|
|
1033
|
-
* it will deploy it.
|
|
1034
|
-
*/
|
|
1035
|
-
declare const SmartAccountProvider: ({ children, nodeUrl, delegatorUrl, delegateAllTransactions, }: {
|
|
1036
|
-
children: React__default.ReactNode;
|
|
1037
|
-
nodeUrl: string;
|
|
1038
|
-
delegatorUrl: string;
|
|
1039
|
-
delegateAllTransactions: boolean;
|
|
1040
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
1041
|
-
declare const useSmartAccount: () => SmartAccountContextType;
|
|
925
|
+
type Props$f = {
|
|
926
|
+
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
927
|
+
onSend: (address: string, amount: string) => void;
|
|
928
|
+
};
|
|
929
|
+
declare const SendTokenContent: ({ setCurrentContent, onSend }: Props$f) => react_jsx_runtime.JSX.Element;
|
|
1042
930
|
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
931
|
+
type Props$e = {
|
|
932
|
+
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
933
|
+
onSend: (address: string, amount: string) => void;
|
|
934
|
+
toAddressOrDomain: string;
|
|
935
|
+
resolvedDomain?: string;
|
|
936
|
+
resolvedAddress?: string;
|
|
937
|
+
amount: string;
|
|
938
|
+
selectedToken: {
|
|
939
|
+
symbol: string;
|
|
940
|
+
balance: string;
|
|
941
|
+
address: string;
|
|
942
|
+
numericBalance: number;
|
|
943
|
+
price: number;
|
|
944
|
+
};
|
|
945
|
+
};
|
|
946
|
+
declare const SendTokenSummaryContent: ({ setCurrentContent, toAddressOrDomain, resolvedDomain, resolvedAddress, amount, selectedToken, }: Props$e) => react_jsx_runtime.JSX.Element;
|
|
1054
947
|
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
energy: string;
|
|
1058
|
-
}>;
|
|
1059
|
-
declare const getAccountBalanceQueryKey: (address?: string) => (string | undefined)[];
|
|
1060
|
-
/**
|
|
1061
|
-
* Get the account balance for the given address
|
|
1062
|
-
* @param address The address of the account to get the balance for
|
|
1063
|
-
* @returns The account balance
|
|
1064
|
-
*/
|
|
1065
|
-
declare const useAccountBalance: (address?: string) => _tanstack_react_query.UseQueryResult<{
|
|
948
|
+
type Token = {
|
|
949
|
+
symbol: string;
|
|
1066
950
|
balance: string;
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
declare const PRICE_FEED_IDS: {
|
|
1071
|
-
readonly B3TR: "0x623374722d757364000000000000000000000000000000000000000000000000";
|
|
1072
|
-
readonly VET: "0x7665742d75736400000000000000000000000000000000000000000000000000";
|
|
1073
|
-
readonly VTHO: "0x7674686f2d757364000000000000000000000000000000000000000000000000";
|
|
951
|
+
address: string;
|
|
952
|
+
numericBalance: number;
|
|
953
|
+
price: number;
|
|
1074
954
|
};
|
|
1075
|
-
type
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
955
|
+
type Props$d = {
|
|
956
|
+
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
957
|
+
onSelectToken: (token: Token) => void;
|
|
958
|
+
onBack: () => void;
|
|
959
|
+
};
|
|
960
|
+
declare const SelectTokenContent: ({ onSelectToken, onBack }: Props$d) => react_jsx_runtime.JSX.Element;
|
|
1079
961
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
962
|
+
type Props$c = {
|
|
963
|
+
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
964
|
+
};
|
|
965
|
+
declare const ReceiveTokenContent: ({ setCurrentContent }: Props$c) => react_jsx_runtime.JSX.Element;
|
|
1083
966
|
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
967
|
+
interface AccountDetailsButtonProps {
|
|
968
|
+
title: string;
|
|
969
|
+
address: string;
|
|
970
|
+
onClick: () => void;
|
|
971
|
+
leftIcon?: ElementType;
|
|
972
|
+
rightIcon?: ElementType;
|
|
973
|
+
leftImage?: string;
|
|
974
|
+
backgroundColor?: string;
|
|
975
|
+
border?: string;
|
|
976
|
+
isActive?: boolean;
|
|
977
|
+
}
|
|
978
|
+
declare const AccountDetailsButton: ({ leftIcon, rightIcon, title, address, onClick, leftImage, isActive, }: AccountDetailsButtonProps) => react_jsx_runtime.JSX.Element;
|
|
1087
979
|
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
980
|
+
interface ActionButtonProps {
|
|
981
|
+
title: string;
|
|
982
|
+
description: string;
|
|
983
|
+
onClick: () => void;
|
|
984
|
+
leftIcon?: ElementType;
|
|
985
|
+
rightIcon?: ElementType;
|
|
986
|
+
leftImage?: string;
|
|
987
|
+
backgroundColor?: string;
|
|
988
|
+
border?: string;
|
|
989
|
+
hide?: boolean;
|
|
990
|
+
_hover?: object;
|
|
991
|
+
showComingSoon?: boolean;
|
|
992
|
+
}
|
|
993
|
+
declare const ActionButton: ({ leftIcon, rightIcon, title, description, onClick, leftImage, hide, showComingSoon, backgroundColor, _hover, }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
|
|
994
|
+
|
|
995
|
+
type Props$b = {
|
|
996
|
+
wallet: Wallet;
|
|
997
|
+
size?: string;
|
|
998
|
+
onClick?: () => void;
|
|
999
|
+
};
|
|
1000
|
+
declare const AccountSelector: ({ wallet, size, onClick }: Props$b) => react_jsx_runtime.JSX.Element;
|
|
1001
|
+
|
|
1002
|
+
declare const BalanceSection: ({ mb }: {
|
|
1003
|
+
mb?: number;
|
|
1004
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1005
|
+
|
|
1006
|
+
declare const AssetsSection: () => react_jsx_runtime.JSX.Element;
|
|
1007
|
+
|
|
1008
|
+
type Props$a = {
|
|
1009
|
+
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
1010
|
+
};
|
|
1011
|
+
declare const QuickActionsSection: ({ setCurrentContent }: Props$a) => react_jsx_runtime.JSX.Element;
|
|
1012
|
+
|
|
1013
|
+
type Props$9 = {
|
|
1014
|
+
children: ReactNode;
|
|
1015
|
+
};
|
|
1016
|
+
declare const FadeInView: ({ children }: Props$9) => react_jsx_runtime.JSX.Element;
|
|
1017
|
+
|
|
1018
|
+
type Props$8 = {
|
|
1019
|
+
children: ReactNode;
|
|
1020
|
+
};
|
|
1021
|
+
declare const FadeInViewFromBottom: ({ children }: Props$8) => react_jsx_runtime.JSX.Element;
|
|
1022
|
+
|
|
1023
|
+
type Props$7 = {
|
|
1024
|
+
children: ReactNode;
|
|
1025
|
+
};
|
|
1026
|
+
declare const FadeInViewFromLeft: ({ children }: Props$7) => react_jsx_runtime.JSX.Element;
|
|
1027
|
+
|
|
1028
|
+
type Props$6 = {
|
|
1029
|
+
children: ReactNode;
|
|
1030
|
+
};
|
|
1031
|
+
declare const FadeInViewFromRight: ({ children }: Props$6) => react_jsx_runtime.JSX.Element;
|
|
1032
|
+
|
|
1033
|
+
type BackButtonProps = {
|
|
1034
|
+
onClick: () => void;
|
|
1035
|
+
} & Partial<IconButtonProps>;
|
|
1036
|
+
declare const ModalBackButton: ({ onClick, ...props }: BackButtonProps) => react_jsx_runtime.JSX.Element;
|
|
1037
|
+
|
|
1038
|
+
type Props$5 = {
|
|
1039
|
+
wallet: Wallet;
|
|
1040
|
+
label?: string;
|
|
1041
|
+
size?: string;
|
|
1042
|
+
};
|
|
1043
|
+
declare const AddressDisplay: ({ wallet, label, size }: Props$5) => react_jsx_runtime.JSX.Element;
|
|
1044
|
+
|
|
1045
|
+
type Props$4 = {} & Omit<StackProps, 'dangerouslySetInnerHTML'>;
|
|
1046
|
+
declare const VersionFooter: ({ ...props }: Props$4) => react_jsx_runtime.JSX.Element;
|
|
1047
|
+
|
|
1048
|
+
type Props$3 = {
|
|
1049
|
+
children: React.ReactNode;
|
|
1050
|
+
};
|
|
1051
|
+
declare const StickyHeaderContainer: ({ children }: Props$3) => react_jsx_runtime.JSX.Element;
|
|
1052
|
+
|
|
1053
|
+
type Props$2 = {
|
|
1054
|
+
children: React.ReactNode;
|
|
1055
|
+
};
|
|
1056
|
+
declare const StickyFooterContainer: ({ children }: Props$2) => react_jsx_runtime.JSX.Element;
|
|
1057
|
+
|
|
1058
|
+
type BaseModalProps = {
|
|
1059
|
+
isOpen: boolean;
|
|
1060
|
+
onClose: () => void;
|
|
1061
|
+
children: ReactNode;
|
|
1062
|
+
size?: string;
|
|
1063
|
+
isCentered?: boolean;
|
|
1064
|
+
motionPreset?: 'slideInBottom' | 'none';
|
|
1065
|
+
trapFocus?: boolean;
|
|
1066
|
+
closeOnOverlayClick?: boolean;
|
|
1067
|
+
blockScrollOnMount?: boolean;
|
|
1068
|
+
autoFocus?: boolean;
|
|
1069
|
+
};
|
|
1070
|
+
declare const BaseModal: ({ isOpen, onClose, children, size, isCentered, motionPreset, trapFocus, closeOnOverlayClick, blockScrollOnMount, autoFocus, }: BaseModalProps) => react_jsx_runtime.JSX.Element;
|
|
1071
|
+
|
|
1072
|
+
type AssetButtonProps = ButtonProps & {
|
|
1073
|
+
symbol: string;
|
|
1074
|
+
amount: number;
|
|
1075
|
+
usdValue: number;
|
|
1076
|
+
isDisabled?: boolean;
|
|
1077
|
+
};
|
|
1078
|
+
declare const AssetButton: ({ symbol, amount, usdValue, isDisabled, ...buttonProps }: AssetButtonProps) => react_jsx_runtime.JSX.Element;
|
|
1079
|
+
|
|
1080
|
+
type LoginLoadingModalProps = {
|
|
1081
|
+
isOpen: boolean;
|
|
1082
|
+
onClose: () => void;
|
|
1083
|
+
};
|
|
1084
|
+
declare const LoginLoadingModal: ({ isOpen, onClose, }: LoginLoadingModalProps) => react_jsx_runtime.JSX.Element;
|
|
1085
|
+
|
|
1086
|
+
type Props$1 = {
|
|
1087
|
+
isOpen: boolean;
|
|
1088
|
+
onClose: () => void;
|
|
1089
|
+
};
|
|
1090
|
+
declare const EcosystemModal: ({ isOpen, onClose }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
1091
|
+
|
|
1092
|
+
/**
|
|
1093
|
+
* Poll the chain for a transaction receipt until it is found (or timeout after 5 blocks)
|
|
1094
|
+
* @param thor Thor instance
|
|
1095
|
+
* @param id Transaction id
|
|
1096
|
+
* @param blocksTimeout Number of blocks to wait for the receipt
|
|
1097
|
+
* @returns Transaction receipt
|
|
1098
|
+
*/
|
|
1099
|
+
declare const pollForReceipt: (thor: Connex.Thor, id?: string, blocksTimeout?: number) => Promise<Connex.Thor.Transaction.Receipt>;
|
|
1100
|
+
/**
|
|
1101
|
+
* Get the tx receipt of a tx id with a block timeout to wait for the receipt
|
|
1102
|
+
* @param txId The tx id to get the receipt
|
|
1103
|
+
* @param blockTimeout The block timeout to wait for the receipt
|
|
1104
|
+
* @returns The tx receipt
|
|
1105
|
+
*/
|
|
1106
|
+
declare const useTxReceipt: (txId?: string, blockTimeout?: number) => {
|
|
1107
|
+
data: Connex.Thor.Transaction.Receipt | null | undefined;
|
|
1108
|
+
error: Error | null;
|
|
1109
|
+
isLoading: boolean;
|
|
1103
1110
|
};
|
|
1104
1111
|
|
|
1105
|
-
|
|
1112
|
+
/**
|
|
1113
|
+
* The type of network that we are connected to (indentified by the genesis block)
|
|
1114
|
+
* */
|
|
1115
|
+
type NETWORK_TYPE = 'main' | 'test' | 'solo';
|
|
1116
|
+
/**
|
|
1117
|
+
* A model for the VechainThor network that we are connected to
|
|
1118
|
+
* @field `id` - Unique ID for this network
|
|
1119
|
+
* @field `defaultNet` - If the network is a default network
|
|
1120
|
+
* @field `name` - A name for this network
|
|
1121
|
+
* @field `type` - What type of network is it? `main, test, solo or custom`
|
|
1122
|
+
* @field `urls` - A list of URLs for this network
|
|
1123
|
+
* @field `currentUrl` - The current URL that we are connected to
|
|
1124
|
+
* @field `explorerUrl` - The explorer URL for this network
|
|
1125
|
+
* @field `genesis` - The genesis block for the network
|
|
1126
|
+
* @field `blockTime` - The time it takes to mine a block in milliseconds
|
|
1127
|
+
*/
|
|
1128
|
+
type Network = {
|
|
1129
|
+
id: string;
|
|
1130
|
+
defaultNet: boolean;
|
|
1131
|
+
name: string;
|
|
1132
|
+
type: NETWORK_TYPE;
|
|
1133
|
+
urls: string[];
|
|
1134
|
+
explorerUrl?: string;
|
|
1135
|
+
genesis: typeof genesises.main;
|
|
1136
|
+
blockTime: number;
|
|
1137
|
+
};
|
|
1138
|
+
declare const genesises: {
|
|
1139
|
+
readonly main: Connex.Thor.Block;
|
|
1140
|
+
readonly test: Connex.Thor.Block;
|
|
1141
|
+
readonly solo: Connex.Thor.Block;
|
|
1142
|
+
which(gid: string): "main" | "solo" | "test" | undefined;
|
|
1143
|
+
};
|
|
1144
|
+
|
|
1145
|
+
declare const PRICE_FEED_IDS: {
|
|
1146
|
+
readonly B3TR: "0x623374722d757364000000000000000000000000000000000000000000000000";
|
|
1147
|
+
readonly VET: "0x7665742d75736400000000000000000000000000000000000000000000000000";
|
|
1148
|
+
readonly VTHO: "0x7674686f2d757364000000000000000000000000000000000000000000000000";
|
|
1149
|
+
};
|
|
1150
|
+
type SupportedToken = keyof typeof PRICE_FEED_IDS;
|
|
1151
|
+
declare const getTokenUsdPrice: (thor: Connex.Thor, token: SupportedToken, network: NETWORK_TYPE) => Promise<number>;
|
|
1152
|
+
declare const getTokenUsdPriceQueryKey: (token: SupportedToken) => string[];
|
|
1153
|
+
declare const useGetTokenUsdPrice: (token: SupportedToken) => _tanstack_react_query.UseQueryResult<number, Error>;
|
|
1154
|
+
|
|
1155
|
+
declare const getB3trBalance: (thor: Connex.Thor, network: NETWORK_TYPE, address?: string) => Promise<string>;
|
|
1156
|
+
declare const getB3trBalanceQueryKey: (address?: string) => (string | undefined)[];
|
|
1157
|
+
declare const useGetB3trBalance: (address?: string) => _tanstack_react_query.UseQueryResult<string, Error>;
|
|
1158
|
+
|
|
1159
|
+
declare const getVot3Balance: (thor: Connex.Thor, network: NETWORK_TYPE, address?: string) => Promise<string>;
|
|
1160
|
+
declare const getVot3BalanceQueryKey: (address?: string) => (string | undefined)[];
|
|
1161
|
+
declare const useGetVot3Balance: (address?: string) => _tanstack_react_query.UseQueryResult<string, Error>;
|
|
1162
|
+
|
|
1163
|
+
declare const getVeDelegateBalance: (thor: Connex.Thor, network: NETWORK_TYPE, address?: string) => Promise<string>;
|
|
1106
1164
|
declare const getVeDelegateBalanceQueryKey: (address?: string) => (string | undefined)[];
|
|
1107
1165
|
declare const useGetVeDelegateBalance: (address?: string) => _tanstack_react_query.UseQueryResult<string, Error>;
|
|
1108
1166
|
|
|
@@ -1148,6 +1206,98 @@ interface CachedVeChainDomainResult {
|
|
|
1148
1206
|
}
|
|
1149
1207
|
declare const useCachedVeChainDomain: (address: string) => CachedVeChainDomainResult;
|
|
1150
1208
|
|
|
1209
|
+
interface SmartAccountReturnType {
|
|
1210
|
+
address: string | undefined;
|
|
1211
|
+
isDeployed: boolean;
|
|
1212
|
+
}
|
|
1213
|
+
declare const getSmartAccount: (thor: ThorClient, network: NETWORK_TYPE, ownerAddress?: string) => Promise<{
|
|
1214
|
+
address: undefined;
|
|
1215
|
+
isDeployed?: undefined;
|
|
1216
|
+
} | {
|
|
1217
|
+
address: string;
|
|
1218
|
+
isDeployed: boolean;
|
|
1219
|
+
}>;
|
|
1220
|
+
declare const getSmartAccountQueryKey: (ownerAddress?: string) => (string | undefined)[];
|
|
1221
|
+
declare const useSmartAccount: (ownerAddress?: string) => _tanstack_react_query.UseQueryResult<{
|
|
1222
|
+
address: undefined;
|
|
1223
|
+
isDeployed?: undefined;
|
|
1224
|
+
} | {
|
|
1225
|
+
address: string;
|
|
1226
|
+
isDeployed: boolean;
|
|
1227
|
+
}, Error>;
|
|
1228
|
+
|
|
1229
|
+
declare const useBalances: () => {
|
|
1230
|
+
isLoading: boolean;
|
|
1231
|
+
balances: {
|
|
1232
|
+
vet: number;
|
|
1233
|
+
vtho: number;
|
|
1234
|
+
b3tr: number;
|
|
1235
|
+
vot3: number;
|
|
1236
|
+
veDelegate: number;
|
|
1237
|
+
};
|
|
1238
|
+
prices: {
|
|
1239
|
+
vet: number;
|
|
1240
|
+
vtho: number;
|
|
1241
|
+
b3tr: number;
|
|
1242
|
+
};
|
|
1243
|
+
totalBalance: number;
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
type UseWalletReturnType = {
|
|
1247
|
+
account: Wallet;
|
|
1248
|
+
connectedWallet: Wallet;
|
|
1249
|
+
smartAccount: SmartAccount;
|
|
1250
|
+
dappKitWallet?: Wallet;
|
|
1251
|
+
embeddedWallet?: Wallet;
|
|
1252
|
+
crossAppWallet?: Wallet;
|
|
1253
|
+
privyUser: User | null;
|
|
1254
|
+
connection: {
|
|
1255
|
+
isConnected: boolean;
|
|
1256
|
+
isConnectedWithPrivy: boolean;
|
|
1257
|
+
isConnectedWithDappKit: boolean;
|
|
1258
|
+
isConnectedWithCrossAppPrivy: boolean;
|
|
1259
|
+
isLoadingPrivyConnection: boolean;
|
|
1260
|
+
source: ConnectionSource;
|
|
1261
|
+
isInAppBrowser: boolean;
|
|
1262
|
+
nodeUrl: string;
|
|
1263
|
+
delegatorUrl: string;
|
|
1264
|
+
chainId?: string;
|
|
1265
|
+
network: NETWORK_TYPE;
|
|
1266
|
+
};
|
|
1267
|
+
disconnect: () => Promise<void>;
|
|
1268
|
+
};
|
|
1269
|
+
declare const useWallet: () => UseWalletReturnType;
|
|
1270
|
+
|
|
1271
|
+
declare const useRefreshBalances: () => {
|
|
1272
|
+
refresh: () => Promise<void>;
|
|
1273
|
+
};
|
|
1274
|
+
|
|
1275
|
+
declare const getAccountBalance: (thor: Connex.Thor, address?: string) => Promise<{
|
|
1276
|
+
balance: string;
|
|
1277
|
+
energy: string;
|
|
1278
|
+
}>;
|
|
1279
|
+
declare const getAccountBalanceQueryKey: (address?: string) => (string | undefined)[];
|
|
1280
|
+
/**
|
|
1281
|
+
* Get the account balance for the given address
|
|
1282
|
+
* @param address The address of the account to get the balance for
|
|
1283
|
+
* @returns The account balance
|
|
1284
|
+
*/
|
|
1285
|
+
declare const useAccountBalance: (address?: string) => _tanstack_react_query.UseQueryResult<{
|
|
1286
|
+
balance: string;
|
|
1287
|
+
energy: string;
|
|
1288
|
+
}, Error>;
|
|
1289
|
+
|
|
1290
|
+
declare const getChainId: (thor: ThorClient) => Promise<string>;
|
|
1291
|
+
declare const getChainIdQueryKey: () => string[];
|
|
1292
|
+
/**
|
|
1293
|
+
* Get the account balance for the given address
|
|
1294
|
+
* @param address The address of the account to get the balance for
|
|
1295
|
+
* @returns The account balance
|
|
1296
|
+
*/
|
|
1297
|
+
declare const useGetChainId: () => _tanstack_react_query.UseQueryResult<string, Error>;
|
|
1298
|
+
|
|
1299
|
+
declare const useGetNodeUrl: () => string;
|
|
1300
|
+
|
|
1151
1301
|
declare const useConnectModal: () => {
|
|
1152
1302
|
open: () => void;
|
|
1153
1303
|
close: () => void;
|
|
@@ -1166,6 +1316,24 @@ declare const AccountModalProvider: ({ children }: {
|
|
|
1166
1316
|
children: ReactNode;
|
|
1167
1317
|
}) => react_jsx_runtime.JSX.Element;
|
|
1168
1318
|
|
|
1319
|
+
declare const useTransactionModal: () => {
|
|
1320
|
+
open: () => void;
|
|
1321
|
+
close: () => void;
|
|
1322
|
+
isOpen: boolean;
|
|
1323
|
+
};
|
|
1324
|
+
declare const TransactionModalProvider: ({ children, }: {
|
|
1325
|
+
children: ReactNode;
|
|
1326
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1327
|
+
|
|
1328
|
+
declare const useTransactionToast: () => {
|
|
1329
|
+
open: () => void;
|
|
1330
|
+
close: () => void;
|
|
1331
|
+
isOpen: boolean;
|
|
1332
|
+
};
|
|
1333
|
+
declare const TransactionToastProvider: ({ children, }: {
|
|
1334
|
+
children: ReactNode;
|
|
1335
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1336
|
+
|
|
1169
1337
|
/**
|
|
1170
1338
|
* Props for the {@link useSendTransaction} hook
|
|
1171
1339
|
* @param signerAccountAddress the signer account to use
|
|
@@ -1245,214 +1413,13 @@ type useTransferVETReturnValue = {
|
|
|
1245
1413
|
} & Omit<UseSendTransactionReturnValue, 'sendTransaction'>;
|
|
1246
1414
|
declare const useTransferVET: ({ fromAddress, receiverAddress, amount, onSuccess, }: useTransferVETProps) => useTransferVETReturnValue;
|
|
1247
1415
|
|
|
1248
|
-
declare const useRefreshBalances: () => {
|
|
1249
|
-
refresh: () => Promise<void>;
|
|
1250
|
-
};
|
|
1251
|
-
|
|
1252
|
-
type AccountModalContentTypes = 'main' | 'settings' | 'smart-account' | 'accounts' | 'send-token' | 'receive-token' | {
|
|
1253
|
-
type: 'send-token-summary';
|
|
1254
|
-
props: {
|
|
1255
|
-
toAddressOrDomain: string;
|
|
1256
|
-
resolvedDomain?: string;
|
|
1257
|
-
resolvedAddress?: string;
|
|
1258
|
-
amount: string;
|
|
1259
|
-
selectedToken: {
|
|
1260
|
-
symbol: string;
|
|
1261
|
-
balance: string;
|
|
1262
|
-
address: string;
|
|
1263
|
-
numericBalance: number;
|
|
1264
|
-
price: number;
|
|
1265
|
-
};
|
|
1266
|
-
onSend: (address: string, amount: string) => void;
|
|
1267
|
-
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
1268
|
-
};
|
|
1269
|
-
};
|
|
1270
|
-
|
|
1271
|
-
type Props$i = {
|
|
1272
|
-
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
1273
|
-
onClose: () => void;
|
|
1274
|
-
wallet: Wallet;
|
|
1275
|
-
};
|
|
1276
|
-
declare const AccountMainContent: ({ setCurrentContent, wallet }: Props$i) => react_jsx_runtime.JSX.Element;
|
|
1277
|
-
|
|
1278
|
-
type Props$h = {
|
|
1279
|
-
setCurrentContent: React__default.Dispatch<React__default.SetStateAction<AccountModalContentTypes>>;
|
|
1280
|
-
onClose: () => void;
|
|
1281
|
-
wallet?: Wallet;
|
|
1282
|
-
};
|
|
1283
|
-
declare const AccountsListContent: ({ setCurrentContent, onClose }: Props$h) => react_jsx_runtime.JSX.Element;
|
|
1284
|
-
|
|
1285
|
-
type Props$g = {
|
|
1286
|
-
setCurrentContent: React__default.Dispatch<React__default.SetStateAction<AccountModalContentTypes>>;
|
|
1287
|
-
};
|
|
1288
|
-
declare const SmartAccountContent: ({ setCurrentContent }: Props$g) => react_jsx_runtime.JSX.Element;
|
|
1289
|
-
|
|
1290
|
-
type Props$f = {
|
|
1291
|
-
setCurrentContent: (content: AccountModalContentTypes) => void;
|
|
1292
|
-
onLogoutSuccess: () => void;
|
|
1293
|
-
};
|
|
1294
|
-
declare const WalletSettingsContent: ({ setCurrentContent, onLogoutSuccess, }: Props$f) => react_jsx_runtime.JSX.Element;
|
|
1295
|
-
|
|
1296
|
-
type Props$e = {
|
|
1297
|
-
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
1298
|
-
onSend: (address: string, amount: string) => void;
|
|
1299
|
-
};
|
|
1300
|
-
declare const SendTokenContent: ({ setCurrentContent, onSend }: Props$e) => react_jsx_runtime.JSX.Element;
|
|
1301
|
-
|
|
1302
|
-
type Props$d = {
|
|
1303
|
-
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
1304
|
-
onSend: (address: string, amount: string) => void;
|
|
1305
|
-
toAddressOrDomain: string;
|
|
1306
|
-
resolvedDomain?: string;
|
|
1307
|
-
resolvedAddress?: string;
|
|
1308
|
-
amount: string;
|
|
1309
|
-
selectedToken: {
|
|
1310
|
-
symbol: string;
|
|
1311
|
-
balance: string;
|
|
1312
|
-
address: string;
|
|
1313
|
-
numericBalance: number;
|
|
1314
|
-
price: number;
|
|
1315
|
-
};
|
|
1316
|
-
};
|
|
1317
|
-
declare const SendTokenSummaryContent: ({ setCurrentContent, toAddressOrDomain, resolvedDomain, resolvedAddress, amount, selectedToken, }: Props$d) => react_jsx_runtime.JSX.Element;
|
|
1318
|
-
|
|
1319
|
-
type Token = {
|
|
1320
|
-
symbol: string;
|
|
1321
|
-
balance: string;
|
|
1322
|
-
address: string;
|
|
1323
|
-
numericBalance: number;
|
|
1324
|
-
price: number;
|
|
1325
|
-
};
|
|
1326
|
-
type Props$c = {
|
|
1327
|
-
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
1328
|
-
onSelectToken: (token: Token) => void;
|
|
1329
|
-
onBack: () => void;
|
|
1330
|
-
};
|
|
1331
|
-
declare const SelectTokenContent: ({ onSelectToken, onBack }: Props$c) => react_jsx_runtime.JSX.Element;
|
|
1332
|
-
|
|
1333
|
-
type Props$b = {
|
|
1334
|
-
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
1335
|
-
};
|
|
1336
|
-
declare const ReceiveTokenContent: ({ setCurrentContent }: Props$b) => react_jsx_runtime.JSX.Element;
|
|
1337
|
-
|
|
1338
|
-
interface AccountDetailsButtonProps {
|
|
1339
|
-
title: string;
|
|
1340
|
-
address: string;
|
|
1341
|
-
onClick: () => void;
|
|
1342
|
-
leftIcon?: ElementType;
|
|
1343
|
-
rightIcon?: ElementType;
|
|
1344
|
-
leftImage?: string;
|
|
1345
|
-
backgroundColor?: string;
|
|
1346
|
-
border?: string;
|
|
1347
|
-
isActive?: boolean;
|
|
1348
|
-
}
|
|
1349
|
-
declare const AccountDetailsButton: ({ leftIcon, rightIcon, title, address, onClick, leftImage, isActive, }: AccountDetailsButtonProps) => react_jsx_runtime.JSX.Element;
|
|
1350
|
-
|
|
1351
|
-
interface ActionButtonProps {
|
|
1352
|
-
title: string;
|
|
1353
|
-
description: string;
|
|
1354
|
-
onClick: () => void;
|
|
1355
|
-
leftIcon?: ElementType;
|
|
1356
|
-
rightIcon?: ElementType;
|
|
1357
|
-
leftImage?: string;
|
|
1358
|
-
backgroundColor?: string;
|
|
1359
|
-
border?: string;
|
|
1360
|
-
hide?: boolean;
|
|
1361
|
-
showComingSoon?: boolean;
|
|
1362
|
-
}
|
|
1363
|
-
declare const ActionButton: ({ leftIcon, rightIcon, title, description, onClick, leftImage, hide, showComingSoon, backgroundColor, }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
|
|
1364
|
-
|
|
1365
|
-
type Props$a = {
|
|
1366
|
-
wallet: Wallet;
|
|
1367
|
-
size?: string;
|
|
1368
|
-
onClick?: () => void;
|
|
1369
|
-
};
|
|
1370
|
-
declare const AccountSelector: ({ wallet, size, onClick }: Props$a) => react_jsx_runtime.JSX.Element;
|
|
1371
|
-
|
|
1372
|
-
declare const BalanceSection: ({ mb }: {
|
|
1373
|
-
mb?: number;
|
|
1374
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
1375
|
-
|
|
1376
|
-
declare const AssetsSection: () => react_jsx_runtime.JSX.Element;
|
|
1377
|
-
|
|
1378
|
-
type Props$9 = {
|
|
1379
|
-
setCurrentContent: React.Dispatch<React.SetStateAction<AccountModalContentTypes>>;
|
|
1380
|
-
};
|
|
1381
|
-
declare const QuickActionsSection: ({ setCurrentContent }: Props$9) => react_jsx_runtime.JSX.Element;
|
|
1382
|
-
|
|
1383
|
-
type Props$8 = {
|
|
1384
|
-
children: ReactNode;
|
|
1385
|
-
};
|
|
1386
|
-
declare const FadeInView: ({ children }: Props$8) => react_jsx_runtime.JSX.Element;
|
|
1387
|
-
|
|
1388
|
-
type Props$7 = {
|
|
1389
|
-
children: ReactNode;
|
|
1390
|
-
};
|
|
1391
|
-
declare const FadeInViewFromBottom: ({ children }: Props$7) => react_jsx_runtime.JSX.Element;
|
|
1392
|
-
|
|
1393
|
-
type Props$6 = {
|
|
1394
|
-
children: ReactNode;
|
|
1395
|
-
};
|
|
1396
|
-
declare const FadeInViewFromLeft: ({ children }: Props$6) => react_jsx_runtime.JSX.Element;
|
|
1397
|
-
|
|
1398
|
-
type Props$5 = {
|
|
1399
|
-
children: ReactNode;
|
|
1400
|
-
};
|
|
1401
|
-
declare const FadeInViewFromRight: ({ children }: Props$5) => react_jsx_runtime.JSX.Element;
|
|
1402
|
-
|
|
1403
|
-
type BackButtonProps = {
|
|
1404
|
-
onClick: () => void;
|
|
1405
|
-
} & Partial<IconButtonProps>;
|
|
1406
|
-
declare const ModalBackButton: ({ onClick, ...props }: BackButtonProps) => react_jsx_runtime.JSX.Element;
|
|
1407
|
-
|
|
1408
|
-
type Props$4 = {
|
|
1409
|
-
wallet: Wallet;
|
|
1410
|
-
label?: string;
|
|
1411
|
-
size?: string;
|
|
1412
|
-
};
|
|
1413
|
-
declare const AddressDisplay: ({ wallet, label, size }: Props$4) => react_jsx_runtime.JSX.Element;
|
|
1414
|
-
|
|
1415
|
-
type Props$3 = {} & Omit<StackProps, 'dangerouslySetInnerHTML'>;
|
|
1416
|
-
declare const VersionFooter: ({ ...props }: Props$3) => react_jsx_runtime.JSX.Element;
|
|
1417
|
-
|
|
1418
|
-
type Props$2 = {
|
|
1419
|
-
children: React.ReactNode;
|
|
1420
|
-
};
|
|
1421
|
-
declare const StickyHeaderContainer: ({ children }: Props$2) => react_jsx_runtime.JSX.Element;
|
|
1422
|
-
|
|
1423
|
-
type Props$1 = {
|
|
1424
|
-
children: React.ReactNode;
|
|
1425
|
-
};
|
|
1426
|
-
declare const StickyFooterContainer: ({ children }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
1427
|
-
|
|
1428
|
-
type BaseModalProps = {
|
|
1429
|
-
isOpen: boolean;
|
|
1430
|
-
onClose: () => void;
|
|
1431
|
-
children: ReactNode;
|
|
1432
|
-
size?: string;
|
|
1433
|
-
isCentered?: boolean;
|
|
1434
|
-
motionPreset?: 'slideInBottom' | 'none';
|
|
1435
|
-
trapFocus?: boolean;
|
|
1436
|
-
closeOnOverlayClick?: boolean;
|
|
1437
|
-
blockScrollOnMount?: boolean;
|
|
1438
|
-
autoFocus?: boolean;
|
|
1439
|
-
};
|
|
1440
|
-
declare const BaseModal: ({ isOpen, onClose, children, size, isCentered, motionPreset, trapFocus, closeOnOverlayClick, blockScrollOnMount, autoFocus, }: BaseModalProps) => react_jsx_runtime.JSX.Element;
|
|
1441
|
-
|
|
1442
|
-
type LoginLoadingModalProps = {
|
|
1443
|
-
isOpen: boolean;
|
|
1444
|
-
onClose: () => void;
|
|
1445
|
-
};
|
|
1446
|
-
declare const LoginLoadingModal: ({ isOpen, onClose, }: LoginLoadingModalProps) => react_jsx_runtime.JSX.Element;
|
|
1447
|
-
|
|
1448
1416
|
type Props = {
|
|
1449
1417
|
children: ReactNode;
|
|
1450
|
-
|
|
1418
|
+
privy: {
|
|
1451
1419
|
appId: string;
|
|
1452
1420
|
clientId: string;
|
|
1453
1421
|
appearance: {
|
|
1454
1422
|
walletList: WalletListEntry[];
|
|
1455
|
-
theme: 'dark' | 'light';
|
|
1456
1423
|
accentColor: `#${string}`;
|
|
1457
1424
|
loginMessage: string;
|
|
1458
1425
|
logo: string;
|
|
@@ -1464,28 +1431,59 @@ type Props = {
|
|
|
1464
1431
|
ecosystemAppsID?: string[];
|
|
1465
1432
|
allowPasskeyLinking?: boolean;
|
|
1466
1433
|
};
|
|
1467
|
-
|
|
1434
|
+
feeDelegation: {
|
|
1468
1435
|
delegatorUrl: string;
|
|
1469
1436
|
delegateAllTransactions: boolean;
|
|
1470
1437
|
};
|
|
1471
|
-
|
|
1472
|
-
|
|
1438
|
+
dappKit: {
|
|
1439
|
+
allowedWallets?: WalletSource[];
|
|
1440
|
+
walletConnectOptions?: WalletConnectOptions;
|
|
1441
|
+
usePersistence?: boolean;
|
|
1442
|
+
useFirstDetectedSource?: boolean;
|
|
1443
|
+
logLevel?: LogLevel;
|
|
1444
|
+
themeVariables?: CustomizedStyle;
|
|
1445
|
+
modalParent?: HTMLElement;
|
|
1446
|
+
onSourceClick?: (source?: SourceInfo) => void;
|
|
1447
|
+
};
|
|
1448
|
+
loginModalUI?: {
|
|
1473
1449
|
logo?: string;
|
|
1474
1450
|
description?: string;
|
|
1475
1451
|
preferredLoginMethods?: Array<'email' | 'google'>;
|
|
1476
1452
|
};
|
|
1453
|
+
darkMode?: boolean;
|
|
1454
|
+
i18n?: I18n;
|
|
1455
|
+
language?: string;
|
|
1456
|
+
network: {
|
|
1457
|
+
type: NETWORK_TYPE;
|
|
1458
|
+
nodeUrl?: string;
|
|
1459
|
+
requireCertificate?: boolean;
|
|
1460
|
+
connectionCertificate?: {
|
|
1461
|
+
message?: Connex.Vendor.CertMessage;
|
|
1462
|
+
options?: Connex.Signer.CertOptions;
|
|
1463
|
+
};
|
|
1464
|
+
};
|
|
1477
1465
|
};
|
|
1478
1466
|
type VeChainKitConfig = {
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1467
|
+
privy: Props['privy'];
|
|
1468
|
+
feeDelegation: Props['feeDelegation'];
|
|
1469
|
+
dappKit: Props['dappKit'];
|
|
1470
|
+
loginModalUI?: Props['loginModalUI'];
|
|
1471
|
+
darkMode?: Props['darkMode'];
|
|
1472
|
+
i18n?: Props['i18n'];
|
|
1473
|
+
language?: Props['language'];
|
|
1474
|
+
network: Props['network'];
|
|
1483
1475
|
openConnectModal: () => void;
|
|
1484
1476
|
closeConnectModal: () => void;
|
|
1485
1477
|
isConnectModalOpen: boolean;
|
|
1486
1478
|
openAccountModal: () => void;
|
|
1487
1479
|
closeAccountModal: () => void;
|
|
1488
1480
|
isAccountModalOpen: boolean;
|
|
1481
|
+
openTransactionModal: () => void;
|
|
1482
|
+
closeTransactionModal: () => void;
|
|
1483
|
+
isTransactionModalOpen: boolean;
|
|
1484
|
+
openTransactionToast: () => void;
|
|
1485
|
+
closeTransactionToast: () => void;
|
|
1486
|
+
isTransactionToastOpen: boolean;
|
|
1489
1487
|
};
|
|
1490
1488
|
/**
|
|
1491
1489
|
* Context to store the Privy and DAppKit configs so that they can be used by the hooks/components
|
|
@@ -1498,6 +1496,114 @@ declare const useVeChainKitConfig: () => VeChainKitConfig;
|
|
|
1498
1496
|
/**
|
|
1499
1497
|
* Provider to wrap the application with Privy and DAppKit
|
|
1500
1498
|
*/
|
|
1501
|
-
declare const VeChainKit: ({ children,
|
|
1499
|
+
declare const VeChainKit: ({ children, privy, feeDelegation, dappKit, loginModalUI, darkMode, i18n, language, network, }: Omit<Props, "queryClient">) => react_jsx_runtime.JSX.Element;
|
|
1500
|
+
|
|
1501
|
+
interface PrivyWalletProviderContextType {
|
|
1502
|
+
embeddedWallet?: ConnectedWallet;
|
|
1503
|
+
accountFactory: string;
|
|
1504
|
+
delegateAllTransactions: boolean;
|
|
1505
|
+
sendTransaction: (tx: {
|
|
1506
|
+
txClauses: Connex.VM.Clause[];
|
|
1507
|
+
title?: string;
|
|
1508
|
+
description?: string;
|
|
1509
|
+
buttonText?: string;
|
|
1510
|
+
}) => Promise<string>;
|
|
1511
|
+
exportWallet: () => Promise<void>;
|
|
1512
|
+
}
|
|
1513
|
+
/**
|
|
1514
|
+
* This provider is responsible for retrieving the smart account address
|
|
1515
|
+
* of a Privy wallet and providing the necessary context for the smart account.
|
|
1516
|
+
* Upon initialization this provider will execute a few useEffect hooks to:
|
|
1517
|
+
* - retrieve the smart account address of the embedded wallet
|
|
1518
|
+
* - retrieve the chain id
|
|
1519
|
+
* - check if the smart account is deployed
|
|
1520
|
+
*
|
|
1521
|
+
* It also provides a function to send transactions on vechain by asking the privy wallet
|
|
1522
|
+
* to sign the transaction and then forwarding the transaction to the node api.
|
|
1523
|
+
* When sending a transaction this provider will check if the smart account is deployed and if not,
|
|
1524
|
+
* it will deploy it.
|
|
1525
|
+
*/
|
|
1526
|
+
declare const PrivyWalletProvider: ({ children, nodeUrl, delegatorUrl, delegateAllTransactions, }: {
|
|
1527
|
+
children: React__default.ReactNode;
|
|
1528
|
+
nodeUrl: string;
|
|
1529
|
+
delegatorUrl: string;
|
|
1530
|
+
delegateAllTransactions: boolean;
|
|
1531
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1532
|
+
declare const usePrivyWalletProvider: () => PrivyWalletProviderContextType;
|
|
1533
|
+
|
|
1534
|
+
declare const TOKEN_LOGOS: Record<string, string>;
|
|
1535
|
+
declare const VECHAIN_PRIVY_APP_ID = "cm4wxxujb022fyujl7g0thb21";
|
|
1536
|
+
|
|
1537
|
+
declare const humanAddress: (address: string, charAtStart?: number, charAtEnd?: number) => string;
|
|
1538
|
+
declare const humanDomain: (domain: string, lengthBefore?: number, lengthAfter?: number) => string;
|
|
1539
|
+
declare const getPicassoImage: (address: string, base64?: boolean) => string;
|
|
1540
|
+
|
|
1541
|
+
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
|
+
};
|
|
1561
|
+
address: string;
|
|
1562
|
+
};
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* Checks if two addresses are equal. Returns true if both values are strings AND:
|
|
1566
|
+
* - The two values are equal OR
|
|
1567
|
+
* - The checksumed addresses are equal
|
|
1568
|
+
*
|
|
1569
|
+
* @param address1
|
|
1570
|
+
* @param address2
|
|
1571
|
+
*/
|
|
1572
|
+
declare const compareAddresses: (address1?: string, address2?: string) => boolean;
|
|
1573
|
+
declare const compareListOfAddresses: (add1: string[], add2: string[]) => boolean;
|
|
1574
|
+
declare const regexPattern: () => RegExp;
|
|
1575
|
+
declare const isValidAddress: (addr: string | undefined | null) => boolean;
|
|
1576
|
+
declare const leftPadWithZeros: (str: string, length: number) => string;
|
|
1577
|
+
|
|
1578
|
+
type AppConfig = {
|
|
1579
|
+
ipfsFetchingService: string;
|
|
1580
|
+
b3trContractAddress: string;
|
|
1581
|
+
vot3ContractAddress: string;
|
|
1582
|
+
b3trGovernorAddress: string;
|
|
1583
|
+
timelockContractAddress: string;
|
|
1584
|
+
xAllocationPoolContractAddress: string;
|
|
1585
|
+
xAllocationVotingContractAddress: string;
|
|
1586
|
+
emissionsContractAddress: string;
|
|
1587
|
+
voterRewardsContractAddress: string;
|
|
1588
|
+
galaxyMemberContractAddress: string;
|
|
1589
|
+
treasuryContractAddress: string;
|
|
1590
|
+
x2EarnAppsContractAddress: string;
|
|
1591
|
+
x2EarnCreatorContractAddress: string;
|
|
1592
|
+
x2EarnRewardsPoolContractAddress: string;
|
|
1593
|
+
nodeManagementContractAddress: string;
|
|
1594
|
+
veBetterPassportContractAddress: string;
|
|
1595
|
+
veDelegate: string;
|
|
1596
|
+
veDelegateVotes: string;
|
|
1597
|
+
veDelegateTokenContractAddress: string;
|
|
1598
|
+
oracleContractAddress: string;
|
|
1599
|
+
accountFactoryAddress: string;
|
|
1600
|
+
cleanifyCampaignsContractAddress: string;
|
|
1601
|
+
cleanifyChallengesContractAddress: string;
|
|
1602
|
+
nodeUrl: string;
|
|
1603
|
+
indexerUrl?: string;
|
|
1604
|
+
network: Network;
|
|
1605
|
+
explorerUrl: string;
|
|
1606
|
+
};
|
|
1607
|
+
declare const getConfig: (env: NETWORK_TYPE) => AppConfig;
|
|
1502
1608
|
|
|
1503
|
-
export {
|
|
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 };
|