thirdweb 5.86.7-nightly-f5f8a40320d5d768d5866813f53ee4880bdf7851-20250129000319 → 5.87.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/cjs/exports/react.js +4 -3
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/exports/react.native.js +27 -1
- package/dist/cjs/exports/react.native.js.map +1 -1
- package/dist/cjs/react/{web/ui/prebuilt/Account → core/account}/provider.js +5 -1
- package/dist/cjs/react/core/account/provider.js.map +1 -0
- package/dist/cjs/react/core/utils/account.js +105 -0
- package/dist/cjs/react/core/utils/account.js.map +1 -0
- package/dist/cjs/react/core/utils/walletIcon.js +23 -0
- package/dist/cjs/react/core/utils/walletIcon.js.map +1 -1
- package/dist/cjs/react/core/utils/walletname.js +43 -0
- package/dist/cjs/react/core/utils/walletname.js.map +1 -0
- package/dist/cjs/react/core/wallet/provider.js.map +1 -0
- package/dist/cjs/react/native/ui/prebuilt/Account/address.js +50 -0
- package/dist/cjs/react/native/ui/prebuilt/Account/address.js.map +1 -0
- package/dist/cjs/react/native/ui/prebuilt/Account/avatar.js +151 -0
- package/dist/cjs/react/native/ui/prebuilt/Account/avatar.js.map +1 -0
- package/dist/cjs/react/native/ui/prebuilt/Account/balance.js +130 -0
- package/dist/cjs/react/native/ui/prebuilt/Account/balance.js.map +1 -0
- package/dist/cjs/react/native/ui/prebuilt/Account/blobbie.js +58 -0
- package/dist/cjs/react/native/ui/prebuilt/Account/blobbie.js.map +1 -0
- package/dist/cjs/react/native/ui/prebuilt/Account/name.js +113 -0
- package/dist/cjs/react/native/ui/prebuilt/Account/name.js.map +1 -0
- package/dist/cjs/react/native/ui/prebuilt/Wallet/icon.js +85 -0
- package/dist/cjs/react/native/ui/prebuilt/Wallet/icon.js.map +1 -0
- package/dist/cjs/react/native/ui/prebuilt/Wallet/name.js +66 -0
- package/dist/cjs/react/native/ui/prebuilt/Wallet/name.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/Blobbie.js +2 -18
- package/dist/cjs/react/web/ui/ConnectWallet/Blobbie.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +5 -4
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/address.js +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/address.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/avatar.js +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/avatar.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/balance.js +8 -90
- package/dist/cjs/react/web/ui/prebuilt/Account/balance.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/blobbie.js +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/blobbie.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/name.js +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/name.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Wallet/icon.js +1 -23
- package/dist/cjs/react/web/ui/prebuilt/Wallet/icon.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Wallet/name.js +2 -42
- package/dist/cjs/react/web/ui/prebuilt/Wallet/name.js.map +1 -1
- package/dist/cjs/utils/shortenLargeNumber.js +3 -0
- package/dist/cjs/utils/shortenLargeNumber.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/exports/react.js +3 -3
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/react.native.js +15 -0
- package/dist/esm/exports/react.native.js.map +1 -1
- package/dist/esm/react/{web/ui/prebuilt/Account → core/account}/provider.js +5 -1
- package/dist/esm/react/core/account/provider.js.map +1 -0
- package/dist/esm/react/core/utils/account.js +99 -0
- package/dist/esm/react/core/utils/account.js.map +1 -0
- package/dist/esm/react/core/utils/walletIcon.js +21 -0
- package/dist/esm/react/core/utils/walletIcon.js.map +1 -1
- package/dist/esm/react/core/utils/walletname.js +40 -0
- package/dist/esm/react/core/utils/walletname.js.map +1 -0
- package/dist/esm/react/core/wallet/provider.js.map +1 -0
- package/dist/esm/react/native/ui/prebuilt/Account/address.js +47 -0
- package/dist/esm/react/native/ui/prebuilt/Account/address.js.map +1 -0
- package/dist/esm/react/native/ui/prebuilt/Account/avatar.js +148 -0
- package/dist/esm/react/native/ui/prebuilt/Account/avatar.js.map +1 -0
- package/dist/esm/react/native/ui/prebuilt/Account/balance.js +127 -0
- package/dist/esm/react/native/ui/prebuilt/Account/balance.js.map +1 -0
- package/dist/esm/react/native/ui/prebuilt/Account/blobbie.js +54 -0
- package/dist/esm/react/native/ui/prebuilt/Account/blobbie.js.map +1 -0
- package/dist/esm/react/native/ui/prebuilt/Account/name.js +110 -0
- package/dist/esm/react/native/ui/prebuilt/Account/name.js.map +1 -0
- package/dist/esm/react/native/ui/prebuilt/Wallet/icon.js +81 -0
- package/dist/esm/react/native/ui/prebuilt/Wallet/icon.js.map +1 -0
- package/dist/esm/react/native/ui/prebuilt/Wallet/name.js +63 -0
- package/dist/esm/react/native/ui/prebuilt/Wallet/name.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/Blobbie.js +1 -17
- package/dist/esm/react/web/ui/ConnectWallet/Blobbie.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +3 -2
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/Account/address.js +1 -1
- package/dist/esm/react/web/ui/prebuilt/Account/address.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/Account/avatar.js +1 -1
- package/dist/esm/react/web/ui/prebuilt/Account/avatar.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/Account/balance.js +6 -85
- package/dist/esm/react/web/ui/prebuilt/Account/balance.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/Account/blobbie.js +1 -1
- package/dist/esm/react/web/ui/prebuilt/Account/blobbie.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/Account/name.js +1 -1
- package/dist/esm/react/web/ui/prebuilt/Account/name.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/Wallet/icon.js +1 -22
- package/dist/esm/react/web/ui/prebuilt/Wallet/icon.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/Wallet/name.js +1 -39
- package/dist/esm/react/web/ui/prebuilt/Wallet/name.js.map +1 -1
- package/dist/esm/utils/shortenLargeNumber.js +3 -0
- package/dist/esm/utils/shortenLargeNumber.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/exports/react.d.ts +5 -4
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/react.native.d.ts +15 -0
- package/dist/types/exports/react.native.d.ts.map +1 -1
- package/dist/types/react/{web/ui/prebuilt/Account → core/account}/provider.d.ts +3 -4
- package/dist/types/react/core/account/provider.d.ts.map +1 -0
- package/dist/types/react/core/utils/account.d.ts +46 -0
- package/dist/types/react/core/utils/account.d.ts.map +1 -0
- package/dist/types/react/core/utils/walletIcon.d.ts +14 -0
- package/dist/types/react/core/utils/walletIcon.d.ts.map +1 -1
- package/dist/types/react/core/utils/walletname.d.ts +9 -0
- package/dist/types/react/core/utils/walletname.d.ts.map +1 -0
- package/dist/types/react/{web/ui/prebuilt/Wallet → core/wallet}/provider.d.ts +1 -1
- package/dist/types/react/core/wallet/provider.d.ts.map +1 -0
- package/dist/types/react/native/ui/prebuilt/Account/address.d.ts +54 -0
- package/dist/types/react/native/ui/prebuilt/Account/address.d.ts.map +1 -0
- package/dist/types/react/native/ui/prebuilt/Account/avatar.d.ts +141 -0
- package/dist/types/react/native/ui/prebuilt/Account/avatar.d.ts.map +1 -0
- package/dist/types/react/native/ui/prebuilt/Account/balance.d.ts +144 -0
- package/dist/types/react/native/ui/prebuilt/Account/balance.d.ts.map +1 -0
- package/dist/types/react/native/ui/prebuilt/Account/blobbie.d.ts +34 -0
- package/dist/types/react/native/ui/prebuilt/Account/blobbie.d.ts.map +1 -0
- package/dist/types/react/native/ui/prebuilt/Account/name.d.ts +118 -0
- package/dist/types/react/native/ui/prebuilt/Account/name.d.ts.map +1 -0
- package/dist/types/react/native/ui/prebuilt/Wallet/icon.d.ts +100 -0
- package/dist/types/react/native/ui/prebuilt/Wallet/icon.d.ts.map +1 -0
- package/dist/types/react/native/ui/prebuilt/Wallet/name.d.ts +94 -0
- package/dist/types/react/native/ui/prebuilt/Wallet/name.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/avatar.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/balance.d.ts +1 -42
- package/dist/types/react/web/ui/prebuilt/Account/balance.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/blobbie.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Wallet/icon.d.ts +2 -10
- package/dist/types/react/web/ui/prebuilt/Wallet/icon.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Wallet/name.d.ts +1 -18
- package/dist/types/react/web/ui/prebuilt/Wallet/name.d.ts.map +1 -1
- package/dist/types/utils/shortenLargeNumber.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/exports/react.native.ts +47 -0
- package/src/exports/react.ts +5 -3
- package/src/react/{web/ui/prebuilt/Account → core/account}/provider.test.tsx +1 -1
- package/src/react/{web/ui/prebuilt/Account → core/account}/provider.tsx +7 -5
- package/src/react/core/utils/account.ts +146 -0
- package/src/react/core/utils/walletIcon.ts +28 -0
- package/src/react/core/utils/walletname.ts +53 -0
- package/src/react/{web/ui/prebuilt/Wallet → core/wallet}/provider.tsx +1 -1
- package/src/react/native/ui/prebuilt/Account/address.tsx +65 -0
- package/src/react/native/ui/prebuilt/Account/avatar.tsx +225 -0
- package/src/react/native/ui/prebuilt/Account/balance.tsx +221 -0
- package/src/react/native/ui/prebuilt/Account/blobbie.tsx +94 -0
- package/src/react/native/ui/prebuilt/Account/name.tsx +180 -0
- package/src/react/native/ui/prebuilt/Wallet/icon.tsx +124 -0
- package/src/react/native/ui/prebuilt/Wallet/name.tsx +112 -0
- package/src/react/web/ui/ConnectWallet/Blobbie.tsx +1 -18
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/Details.test.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/Details.tsx +7 -7
- package/src/react/web/ui/prebuilt/Account/address.test.tsx +1 -1
- package/src/react/web/ui/prebuilt/Account/address.tsx +1 -1
- package/src/react/web/ui/prebuilt/Account/avatar.test.tsx +1 -1
- package/src/react/web/ui/prebuilt/Account/avatar.tsx +1 -2
- package/src/react/web/ui/prebuilt/Account/balance.test.tsx +7 -5
- package/src/react/web/ui/prebuilt/Account/balance.tsx +10 -130
- package/src/react/web/ui/prebuilt/Account/blobbie.tsx +1 -1
- package/src/react/web/ui/prebuilt/Account/name.test.tsx +1 -1
- package/src/react/web/ui/prebuilt/Account/name.tsx +1 -1
- package/src/react/web/ui/prebuilt/Wallet/icon.test.tsx +3 -2
- package/src/react/web/ui/prebuilt/Wallet/icon.tsx +6 -30
- package/src/react/web/ui/prebuilt/Wallet/name.test.tsx +6 -2
- package/src/react/web/ui/prebuilt/Wallet/name.tsx +2 -52
- package/src/utils/shortenLargeNumber.ts +3 -0
- package/src/version.ts +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/provider.js.map +0 -1
- package/dist/cjs/react/web/ui/prebuilt/Wallet/provider.js.map +0 -1
- package/dist/esm/react/web/ui/prebuilt/Account/provider.js.map +0 -1
- package/dist/esm/react/web/ui/prebuilt/Wallet/provider.js.map +0 -1
- package/dist/types/react/web/ui/prebuilt/Account/provider.d.ts.map +0 -1
- package/dist/types/react/web/ui/prebuilt/Wallet/provider.d.ts.map +0 -1
- /package/dist/cjs/react/{web/ui/prebuilt/Wallet → core/wallet}/provider.js +0 -0
- /package/dist/esm/react/{web/ui/prebuilt/Wallet → core/wallet}/provider.js +0 -0
- /package/src/react/{web/ui/prebuilt/Wallet → core/wallet}/provider.test.tsx +0 -0
@@ -8,8 +8,8 @@ import { type AppMetadata } from "../../../../wallets/types.js";
|
|
8
8
|
import type { WalletId } from "../../../../wallets/wallet-types.js";
|
9
9
|
import { type Theme } from "../../../core/design-system/index.js";
|
10
10
|
import type { ConnectButtonProps, ConnectButton_connectModalOptions, ConnectButton_detailsButtonOptions, ConnectButton_detailsModalOptions, PayUIOptions } from "../../../core/hooks/connection/ConnectButtonProps.js";
|
11
|
+
import { type AccountBalanceInfo } from "../../../core/utils/account.js";
|
11
12
|
import type { SupportedNFTs, SupportedTokens } from "../../../core/utils/defaultTokens.js";
|
12
|
-
import { type AccountBalanceInfo } from "../prebuilt/Account/balance.js";
|
13
13
|
import type { LocaleId } from "../types.js";
|
14
14
|
import { type NetworkSelectorProps } from "./NetworkSelector.js";
|
15
15
|
import type { ConnectLocale } from "./locale/types.js";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/ConnectWallet/Details.tsx"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,QAAQ,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;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,qBAAqB;kBAQT,4BAA4B;EAgDvD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Account/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,+CAA+C,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Account/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,+CAA+C,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAGpE;;;;GAIG;AACH,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,EAC5D,IAAI,CAAC,kBAAkB,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChD;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAEnC;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC/B;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAEhC;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;CACtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AACH,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,kBAAkB,qDA+DpB"}
|
@@ -1,24 +1,9 @@
|
|
1
1
|
import { type UseQueryOptions } from "@tanstack/react-query";
|
2
|
-
import type { Address } from "abitype";
|
3
2
|
import type React from "react";
|
4
3
|
import type { JSX } from "react";
|
5
4
|
import type { Chain } from "../../../../../chains/types.js";
|
6
|
-
import type { ThirdwebClient } from "../../../../../client/client.js";
|
7
5
|
import type { SupportedFiatCurrency } from "../../../../../pay/convert/type.js";
|
8
|
-
|
9
|
-
* @component
|
10
|
-
* @wallet
|
11
|
-
*/
|
12
|
-
export type AccountBalanceInfo = {
|
13
|
-
/**
|
14
|
-
* Represents either token balance or fiat balance.
|
15
|
-
*/
|
16
|
-
balance: number;
|
17
|
-
/**
|
18
|
-
* Represents either token symbol or fiat symbol
|
19
|
-
*/
|
20
|
-
symbol: string;
|
21
|
-
};
|
6
|
+
import { type AccountBalanceInfo } from "../../../../core/utils/account.js";
|
22
7
|
/**
|
23
8
|
* Props for the AccountBalance component
|
24
9
|
* @component
|
@@ -157,30 +142,4 @@ export interface AccountBalanceProps extends Omit<React.HTMLAttributes<HTMLSpanE
|
|
157
142
|
* @beta
|
158
143
|
*/
|
159
144
|
export declare function AccountBalance({ chain, tokenAddress, loadingComponent, fallbackComponent, queryOptions, formatFn, showBalanceInFiat, ...restProps }: AccountBalanceProps): import("react/jsx-runtime.js").JSX.Element | null;
|
160
|
-
/**
|
161
|
-
* @internal Exported for tests
|
162
|
-
*/
|
163
|
-
export declare function loadAccountBalance(props: {
|
164
|
-
chain?: Chain;
|
165
|
-
client: ThirdwebClient;
|
166
|
-
address: Address;
|
167
|
-
tokenAddress?: Address;
|
168
|
-
showBalanceInFiat?: SupportedFiatCurrency;
|
169
|
-
}): Promise<AccountBalanceInfo>;
|
170
|
-
/**
|
171
|
-
* Format the display balance for both crypto and fiat, in the Details button and Modal
|
172
|
-
* If both crypto balance and fiat balance exist, we have to keep the string very short to avoid UI issues.
|
173
|
-
* @internal
|
174
|
-
* Used internally for the Details button and the Details Modal
|
175
|
-
*/
|
176
|
-
export declare function formatAccountTokenBalance(props: AccountBalanceInfo & {
|
177
|
-
decimals: number;
|
178
|
-
}): string;
|
179
|
-
/**
|
180
|
-
* Used internally for the Details button and Details Modal
|
181
|
-
* @internal
|
182
|
-
*/
|
183
|
-
export declare function formatAccountFiatBalance(props: AccountBalanceInfo & {
|
184
|
-
decimals: number;
|
185
|
-
}): string;
|
186
145
|
//# sourceMappingURL=balance.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Account/balance.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Account/balance.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAIhF,OAAO,EACL,KAAK,kBAAkB,EAGxB,MAAM,mCAAmC,CAAC;AAG3C;;;;GAIG;AACH,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IAC/D;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,MAAM,CAAC;IACjD;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC/B;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CACjB,eAAe,CAAC,kBAAkB,CAAC,EACnC,SAAS,GAAG,UAAU,CACvB,CAAC;IAEF;;OAEG;IACH,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,GAAG,SAAS,EACb,EAAE,mBAAmB,qDAqDrB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"blobbie.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Account/blobbie.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"blobbie.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Account/blobbie.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,8CAGlE"}
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import type { UseQueryOptions } from "@tanstack/react-query";
|
2
2
|
import type { JSX } from "react";
|
3
3
|
import type { AuthOption } from "../../../../../wallets/types.js";
|
4
|
-
import type { WalletId } from "../../../../../wallets/wallet-types.js";
|
5
4
|
export interface WalletIconProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src"> {
|
6
5
|
/**
|
7
6
|
* This component will be shown while the icon of the wallet is being fetched
|
@@ -73,13 +72,7 @@ export interface WalletIconProps extends Omit<React.ImgHTMLAttributes<HTMLImageE
|
|
73
72
|
* @beta
|
74
73
|
*/
|
75
74
|
export declare function WalletIcon({ loadingComponent, fallbackComponent, queryOptions, ...restProps }: WalletIconProps): import("react/jsx-runtime.js").JSX.Element | null;
|
76
|
-
|
77
|
-
* @internal Exported for tests only
|
78
|
-
*/
|
79
|
-
export declare function fetchWalletImage(props: {
|
80
|
-
id: WalletId;
|
81
|
-
}): Promise<string>;
|
82
|
-
interface SocialIconProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src"> {
|
75
|
+
export interface SocialIconProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src"> {
|
83
76
|
provider: AuthOption | string;
|
84
77
|
}
|
85
78
|
/**
|
@@ -103,5 +96,4 @@ interface SocialIconProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>
|
|
103
96
|
* @beta
|
104
97
|
*/
|
105
98
|
export declare function SocialIcon({ provider, ...restProps }: SocialIconProps): import("react/jsx-runtime.js").JSX.Element;
|
106
|
-
export {};
|
107
99
|
//# sourceMappingURL=icon.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Wallet/icon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Wallet/icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAMlE,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC;IAC9D;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC/B;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;CACtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,UAAU,CAAC,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,eAAe,qDASjB;AAED,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC;IAC9D,QAAQ,EAAE,UAAU,GAAG,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,eAAe,8CAGrE"}
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import type { UseQueryOptions } from "@tanstack/react-query";
|
2
2
|
import type { JSX } from "react";
|
3
|
-
import type { WalletId } from "../../../../../wallets/wallet-types.js";
|
4
3
|
/**
|
5
4
|
* Props for the WalletName component
|
6
5
|
* @component
|
@@ -92,20 +91,4 @@ export interface WalletNameProps extends Omit<React.HTMLAttributes<HTMLSpanEleme
|
|
92
91
|
* @wallet
|
93
92
|
*/
|
94
93
|
export declare function WalletName({ loadingComponent, fallbackComponent, queryOptions, formatFn, ...restProps }: WalletNameProps): import("react/jsx-runtime.js").JSX.Element | null;
|
95
|
-
/**
|
96
|
-
* @internal Exported for tests only
|
97
|
-
*/
|
98
|
-
export declare function getQueryKeys(props: {
|
99
|
-
id: WalletId;
|
100
|
-
formatFn?: (str: string) => string;
|
101
|
-
}): readonly ["walletName", WalletId] | readonly ["walletName", WalletId, {
|
102
|
-
readonly resolver: string;
|
103
|
-
}];
|
104
|
-
/**
|
105
|
-
* @internal Exported for tests only
|
106
|
-
*/
|
107
|
-
export declare function fetchWalletName(props: {
|
108
|
-
id: WalletId;
|
109
|
-
formatFn?: (str: string) => string;
|
110
|
-
}): Promise<string>;
|
111
94
|
//# sourceMappingURL=name.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Wallet/name.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Wallet/name.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC;;;;GAIG;AACH,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IAC/D;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC/B;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;IACrE;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,UAAU,CAAC,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,eAAe,qDASjB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"shortenLargeNumber.d.ts","sourceRoot":"","sources":["../../../src/utils/shortenLargeNumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"shortenLargeNumber.d.ts","sourceRoot":"","sources":["../../../src/utils/shortenLargeNumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,UAiB/C"}
|
package/dist/types/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "5.
|
1
|
+
export declare const version = "5.87.0";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
|
package/package.json
CHANGED
@@ -114,3 +114,50 @@ export type {
|
|
114
114
|
FarcasterProfile,
|
115
115
|
LensProfile,
|
116
116
|
} from "../social/types.js";
|
117
|
+
|
118
|
+
/**
|
119
|
+
* Account
|
120
|
+
*/
|
121
|
+
export {
|
122
|
+
Blobbie,
|
123
|
+
AccountBlobbie,
|
124
|
+
type BlobbieProps,
|
125
|
+
} from "../react/native/ui/prebuilt/Account/blobbie.js";
|
126
|
+
export {
|
127
|
+
AccountProvider,
|
128
|
+
type AccountProviderProps,
|
129
|
+
} from "../react/core/account/provider.js";
|
130
|
+
export {
|
131
|
+
AccountBalance,
|
132
|
+
type AccountBalanceProps,
|
133
|
+
} from "../react/native/ui/prebuilt/Account/balance.js";
|
134
|
+
export {
|
135
|
+
AccountAddress,
|
136
|
+
type AccountAddressProps,
|
137
|
+
} from "../react/native/ui/prebuilt/Account/address.js";
|
138
|
+
export {
|
139
|
+
AccountName,
|
140
|
+
type AccountNameProps,
|
141
|
+
} from "../react/native/ui/prebuilt/Account/name.js";
|
142
|
+
export {
|
143
|
+
AccountAvatar,
|
144
|
+
type AccountAvatarProps,
|
145
|
+
} from "../react/native/ui/prebuilt/Account/avatar.js";
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Wallet
|
149
|
+
*/
|
150
|
+
export {
|
151
|
+
WalletProvider,
|
152
|
+
type WalletProviderProps,
|
153
|
+
} from "../react/core/wallet/provider.js";
|
154
|
+
export {
|
155
|
+
WalletIcon,
|
156
|
+
SocialIcon,
|
157
|
+
type WalletIconProps,
|
158
|
+
type SocialIconProps,
|
159
|
+
} from "../react/native/ui/prebuilt/Wallet/icon.js";
|
160
|
+
export {
|
161
|
+
WalletName,
|
162
|
+
type WalletNameProps,
|
163
|
+
} from "../react/native/ui/prebuilt/Wallet/name.js";
|
package/src/exports/react.ts
CHANGED
@@ -223,8 +223,8 @@ export {
|
|
223
223
|
export {
|
224
224
|
AccountBalance,
|
225
225
|
type AccountBalanceProps,
|
226
|
-
type AccountBalanceInfo,
|
227
226
|
} from "../react/web/ui/prebuilt/Account/balance.js";
|
227
|
+
export type { AccountBalanceInfo } from "../react/core/utils/account.js";
|
228
228
|
export {
|
229
229
|
AccountName,
|
230
230
|
type AccountNameProps,
|
@@ -233,7 +233,7 @@ export { AccountBlobbie } from "../react/web/ui/prebuilt/Account/blobbie.js";
|
|
233
233
|
export {
|
234
234
|
AccountProvider,
|
235
235
|
type AccountProviderProps,
|
236
|
-
} from "../react/
|
236
|
+
} from "../react/core/account/provider.js";
|
237
237
|
export {
|
238
238
|
AccountAvatar,
|
239
239
|
type AccountAvatarProps,
|
@@ -278,9 +278,11 @@ export { getLastAuthProvider } from "../react/web/utils/storage.js";
|
|
278
278
|
export {
|
279
279
|
WalletProvider,
|
280
280
|
type WalletProviderProps,
|
281
|
-
} from "../react/
|
281
|
+
} from "../react/core/wallet/provider.js";
|
282
282
|
export {
|
283
283
|
WalletIcon,
|
284
|
+
SocialIcon,
|
285
|
+
type SocialIconProps,
|
284
286
|
type WalletIconProps,
|
285
287
|
} from "../react/web/ui/prebuilt/Wallet/icon.js";
|
286
288
|
export {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
2
2
|
import { render, screen } from "~test/react-render.js";
|
3
3
|
import { TEST_CLIENT } from "~test/test-clients.js";
|
4
|
-
import { AccountAddress } from "
|
4
|
+
import { AccountAddress } from "../../web/ui/prebuilt/Account/address.js";
|
5
5
|
import { AccountProvider } from "./provider.js";
|
6
6
|
|
7
7
|
describe.runIf(process.env.TW_SECRET_KEY)("AccountProvider component", () => {
|
@@ -1,10 +1,9 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
|
-
import type { Address } from "abitype";
|
4
3
|
import type React from "react";
|
5
4
|
import { createContext, useContext } from "react";
|
6
|
-
import type { ThirdwebClient } from "
|
7
|
-
|
5
|
+
import type { ThirdwebClient } from "../../../client/client.js";
|
6
|
+
import { isAddress } from "../../../utils/address.js";
|
8
7
|
/**
|
9
8
|
* Props for the <AccountProvider /> component
|
10
9
|
* @component
|
@@ -14,7 +13,7 @@ export type AccountProviderProps = {
|
|
14
13
|
/**
|
15
14
|
* The user's wallet address
|
16
15
|
*/
|
17
|
-
address:
|
16
|
+
address: string;
|
18
17
|
/**
|
19
18
|
* thirdweb Client
|
20
19
|
*/
|
@@ -35,7 +34,7 @@ const AccountProviderContext = /* @__PURE__ */ createContext<
|
|
35
34
|
* ```tsx
|
36
35
|
* import { AccountProvider, AccountAvatar, AccountName, AccountAddress } from "thirdweb/react";
|
37
36
|
*
|
38
|
-
* <AccountProvider>
|
37
|
+
* <AccountProvider address="0x..." client={client}>
|
39
38
|
* <AccountAvatar />
|
40
39
|
* <AccountName />
|
41
40
|
* <AccountAddress />
|
@@ -54,6 +53,9 @@ export function AccountProvider(
|
|
54
53
|
"AccountProvider: No address passed. Ensure an address is always provided to the AccountProvider",
|
55
54
|
);
|
56
55
|
}
|
56
|
+
if (!isAddress(props.address)) {
|
57
|
+
throw new Error(`AccountProvider: Invalid address: ${props.address}`);
|
58
|
+
}
|
57
59
|
return (
|
58
60
|
<AccountProviderContext.Provider value={props}>
|
59
61
|
{props.children}
|
@@ -0,0 +1,146 @@
|
|
1
|
+
import type { Chain } from "../../../chains/types.js";
|
2
|
+
import type { ThirdwebClient } from "../../../client/client.js";
|
3
|
+
import { NATIVE_TOKEN_ADDRESS } from "../../../constants/addresses.js";
|
4
|
+
import { convertCryptoToFiat } from "../../../pay/convert/cryptoToFiat.js";
|
5
|
+
import type { SupportedFiatCurrency } from "../../../pay/convert/type.js";
|
6
|
+
import { type Address, isAddress } from "../../../utils/address.js";
|
7
|
+
import { formatNumber } from "../../../utils/formatNumber.js";
|
8
|
+
import { shortenLargeNumber } from "../../../utils/shortenLargeNumber.js";
|
9
|
+
import { getWalletBalance } from "../../../wallets/utils/getWalletBalance.js";
|
10
|
+
|
11
|
+
export const COLOR_OPTIONS = [
|
12
|
+
["#fca5a5", "#b91c1c"],
|
13
|
+
["#fdba74", "#c2410c"],
|
14
|
+
["#fcd34d", "#b45309"],
|
15
|
+
["#fde047", "#a16207"],
|
16
|
+
["#a3e635", "#4d7c0f"],
|
17
|
+
["#86efac", "#15803d"],
|
18
|
+
["#67e8f9", "#0e7490"],
|
19
|
+
["#7dd3fc", "#0369a1"],
|
20
|
+
["#93c5fd", "#1d4ed8"],
|
21
|
+
["#a5b4fc", "#4338ca"],
|
22
|
+
["#c4b5fd", "#6d28d9"],
|
23
|
+
["#d8b4fe", "#7e22ce"],
|
24
|
+
["#f0abfc", "#a21caf"],
|
25
|
+
["#f9a8d4", "#be185d"],
|
26
|
+
["#fda4af", "#be123c"],
|
27
|
+
];
|
28
|
+
|
29
|
+
/**
|
30
|
+
* @component
|
31
|
+
* @wallet
|
32
|
+
*/
|
33
|
+
export type AccountBalanceInfo = {
|
34
|
+
/**
|
35
|
+
* Represents either token balance or fiat balance.
|
36
|
+
*/
|
37
|
+
balance: number;
|
38
|
+
/**
|
39
|
+
* Represents either token symbol or fiat symbol
|
40
|
+
*/
|
41
|
+
symbol: string;
|
42
|
+
};
|
43
|
+
|
44
|
+
/**
|
45
|
+
* @internal Exported for tests
|
46
|
+
*/
|
47
|
+
export async function loadAccountBalance(props: {
|
48
|
+
chain?: Chain;
|
49
|
+
client: ThirdwebClient;
|
50
|
+
address: Address;
|
51
|
+
tokenAddress?: Address;
|
52
|
+
showBalanceInFiat?: SupportedFiatCurrency;
|
53
|
+
}): Promise<AccountBalanceInfo> {
|
54
|
+
const { chain, client, address, tokenAddress, showBalanceInFiat } = props;
|
55
|
+
if (!chain) {
|
56
|
+
throw new Error("chain is required");
|
57
|
+
}
|
58
|
+
|
59
|
+
if (
|
60
|
+
tokenAddress &&
|
61
|
+
tokenAddress?.toLowerCase() === NATIVE_TOKEN_ADDRESS.toLowerCase()
|
62
|
+
) {
|
63
|
+
throw new Error(`Invalid tokenAddress - cannot be ${NATIVE_TOKEN_ADDRESS}`);
|
64
|
+
}
|
65
|
+
|
66
|
+
if (!isAddress(address)) {
|
67
|
+
throw new Error("Invalid wallet address. Expected an EVM address");
|
68
|
+
}
|
69
|
+
|
70
|
+
if (tokenAddress && !isAddress(tokenAddress)) {
|
71
|
+
throw new Error("Invalid tokenAddress. Expected an EVM contract address");
|
72
|
+
}
|
73
|
+
|
74
|
+
const tokenBalanceData = await getWalletBalance({
|
75
|
+
chain,
|
76
|
+
client,
|
77
|
+
address,
|
78
|
+
tokenAddress,
|
79
|
+
}).catch(() => undefined);
|
80
|
+
|
81
|
+
if (!tokenBalanceData) {
|
82
|
+
throw new Error(
|
83
|
+
`Failed to retrieve ${tokenAddress ? `token: ${tokenAddress}` : "native token"} balance for address: ${address} on chainId:${chain.id}`,
|
84
|
+
);
|
85
|
+
}
|
86
|
+
|
87
|
+
if (showBalanceInFiat) {
|
88
|
+
const fiatData = await convertCryptoToFiat({
|
89
|
+
fromAmount: Number(tokenBalanceData.displayValue),
|
90
|
+
fromTokenAddress: tokenAddress || NATIVE_TOKEN_ADDRESS,
|
91
|
+
to: showBalanceInFiat,
|
92
|
+
chain,
|
93
|
+
client,
|
94
|
+
}).catch(() => undefined);
|
95
|
+
|
96
|
+
if (fiatData === undefined) {
|
97
|
+
throw new Error(
|
98
|
+
`Failed to resolve fiat value for ${tokenAddress ? `token: ${tokenAddress}` : "native token"} on chainId: ${chain.id}`,
|
99
|
+
);
|
100
|
+
}
|
101
|
+
const result = {
|
102
|
+
balance: fiatData?.result,
|
103
|
+
symbol: getFiatSymbol(showBalanceInFiat),
|
104
|
+
};
|
105
|
+
|
106
|
+
return result;
|
107
|
+
}
|
108
|
+
|
109
|
+
return {
|
110
|
+
balance: Number(tokenBalanceData.displayValue),
|
111
|
+
symbol: tokenBalanceData.symbol,
|
112
|
+
};
|
113
|
+
}
|
114
|
+
|
115
|
+
function getFiatSymbol(showBalanceInFiat: SupportedFiatCurrency) {
|
116
|
+
switch (showBalanceInFiat) {
|
117
|
+
case "USD":
|
118
|
+
return "$";
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Format the display balance for both crypto and fiat, in the Details button and Modal
|
124
|
+
* If both crypto balance and fiat balance exist, we have to keep the string very short to avoid UI issues.
|
125
|
+
* @internal
|
126
|
+
* Used internally for the Details button and the Details Modal
|
127
|
+
*/
|
128
|
+
export function formatAccountTokenBalance(
|
129
|
+
props: AccountBalanceInfo & { decimals: number },
|
130
|
+
): string {
|
131
|
+
const formattedTokenBalance = formatNumber(props.balance, props.decimals);
|
132
|
+
return `${formattedTokenBalance} ${props.symbol}`;
|
133
|
+
}
|
134
|
+
|
135
|
+
/**
|
136
|
+
* Used internally for the Details button and Details Modal
|
137
|
+
* @internal
|
138
|
+
*/
|
139
|
+
export function formatAccountFiatBalance(
|
140
|
+
props: AccountBalanceInfo & { decimals: number },
|
141
|
+
) {
|
142
|
+
const num = formatNumber(props.balance, props.decimals);
|
143
|
+
// Need to keep them short to avoid UI overflow issues
|
144
|
+
const formattedFiatBalance = shortenLargeNumber(num);
|
145
|
+
return `${props.symbol}${formattedFiatBalance}`;
|
146
|
+
}
|
@@ -1,4 +1,8 @@
|
|
1
|
+
import { type UseQueryOptions, useQuery } from "@tanstack/react-query";
|
2
|
+
import { getWalletInfo } from "../../../wallets/__generated__/getWalletInfo.js";
|
1
3
|
import type { AuthOption } from "../../../wallets/types.js";
|
4
|
+
import type { WalletId } from "../../../wallets/wallet-types.js";
|
5
|
+
import { useWalletContext } from "../wallet/provider.js";
|
2
6
|
|
3
7
|
// TODO make the social icons usable in RN too
|
4
8
|
const googleIconUri =
|
@@ -106,3 +110,27 @@ export function getSocialIcon(provider: AuthOption | ({} & string)): string {
|
|
106
110
|
return genericWalletIcon;
|
107
111
|
}
|
108
112
|
}
|
113
|
+
|
114
|
+
/**
|
115
|
+
* @internal
|
116
|
+
*/
|
117
|
+
export function useWalletIcon(props: {
|
118
|
+
queryOptions?: Omit<UseQueryOptions<string>, "queryFn" | "queryKey">;
|
119
|
+
}) {
|
120
|
+
const { id } = useWalletContext();
|
121
|
+
const imageQuery = useQuery({
|
122
|
+
queryKey: ["walletIcon", id],
|
123
|
+
queryFn: async () => fetchWalletImage({ id }),
|
124
|
+
...props.queryOptions,
|
125
|
+
});
|
126
|
+
return imageQuery;
|
127
|
+
}
|
128
|
+
|
129
|
+
/**
|
130
|
+
* @internal Exported for tests only
|
131
|
+
*/
|
132
|
+
export async function fetchWalletImage(props: {
|
133
|
+
id: WalletId;
|
134
|
+
}) {
|
135
|
+
return getWalletInfo(props.id, true);
|
136
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { useQuery } from "@tanstack/react-query";
|
2
|
+
import type { UseQueryOptions } from "@tanstack/react-query";
|
3
|
+
import { getFunctionId } from "../../../utils/function-id.js";
|
4
|
+
import { getWalletInfo } from "../../../wallets/__generated__/getWalletInfo.js";
|
5
|
+
import type { WalletId } from "../../../wallets/wallet-types.js";
|
6
|
+
import { useWalletContext } from "../wallet/provider.js";
|
7
|
+
|
8
|
+
/**
|
9
|
+
* @internal
|
10
|
+
*/
|
11
|
+
export function useWalletName(props: {
|
12
|
+
formatFn?: (str: string) => string;
|
13
|
+
queryOptions?: Omit<UseQueryOptions<string>, "queryFn" | "queryKey">;
|
14
|
+
}) {
|
15
|
+
const { id } = useWalletContext();
|
16
|
+
const nameQuery = useQuery({
|
17
|
+
queryKey: getQueryKeys({ id, formatFn: props.formatFn }),
|
18
|
+
queryFn: async () => fetchWalletName({ id, formatFn: props.formatFn }),
|
19
|
+
...props.queryOptions,
|
20
|
+
});
|
21
|
+
return nameQuery;
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @internal Exported for tests only
|
26
|
+
*/
|
27
|
+
function getQueryKeys(props: {
|
28
|
+
id: WalletId;
|
29
|
+
formatFn?: (str: string) => string;
|
30
|
+
}) {
|
31
|
+
if (typeof props.formatFn === "function") {
|
32
|
+
return [
|
33
|
+
"walletName",
|
34
|
+
props.id,
|
35
|
+
{ resolver: getFunctionId(props.formatFn) },
|
36
|
+
] as const;
|
37
|
+
}
|
38
|
+
return ["walletName", props.id] as const;
|
39
|
+
}
|
40
|
+
|
41
|
+
/**
|
42
|
+
* @internal Exported for tests only
|
43
|
+
*/
|
44
|
+
async function fetchWalletName(props: {
|
45
|
+
id: WalletId;
|
46
|
+
formatFn?: (str: string) => string;
|
47
|
+
}) {
|
48
|
+
const info = await getWalletInfo(props.id);
|
49
|
+
if (typeof props.formatFn === "function") {
|
50
|
+
return props.formatFn(info.name);
|
51
|
+
}
|
52
|
+
return info.name;
|
53
|
+
}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
import type React from "react";
|
4
4
|
import { createContext, useContext } from "react";
|
5
|
-
import type { WalletId } from "
|
5
|
+
import type { WalletId } from "../../../wallets/wallet-types.js";
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Props for the WalletProvider component
|