thirdweb 5.47.0-nightly-f0d6e343eea28cd49863ba4794b89d6b070c52b2-20240818000714 → 5.47.1-nightly-574ff0295dcbb39f2ddd753c9e8a264498aae99e-20240819000344
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/extensions/lens.js +4 -1
- package/dist/cjs/exports/extensions/lens.js.map +1 -1
- package/dist/cjs/exports/utils.js +7 -5
- package/dist/cjs/exports/utils.js.map +1 -1
- package/dist/cjs/extensions/lens/read/getFullProfile.js.map +1 -1
- package/dist/cjs/extensions/lens/read/getHandleFromProfileId.js.map +1 -1
- package/dist/cjs/extensions/lens/read/getProfileMetadata.js.map +1 -1
- package/dist/cjs/extensions/lens/read/resolveAddress.js +74 -0
- package/dist/cjs/extensions/lens/read/resolveAddress.js.map +1 -0
- package/dist/cjs/extensions/vote/read/getProposalVoteCounts.js +4 -3
- package/dist/cjs/extensions/vote/read/getProposalVoteCounts.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendAndConfirmTransaction.js +16 -1
- package/dist/cjs/react/core/hooks/transaction/useSendAndConfirmTransaction.js.map +1 -1
- package/dist/cjs/react/native/hooks/transaction/useSendTransaction.js +11 -0
- package/dist/cjs/react/native/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/index.js +22 -6
- package/dist/cjs/react/web/ui/TransactionButton/index.js.map +1 -1
- package/dist/cjs/transaction/actions/send-and-confirm-transaction.js +15 -0
- package/dist/cjs/transaction/actions/send-and-confirm-transaction.js.map +1 -1
- package/dist/cjs/transaction/actions/send-transaction.js +13 -0
- package/dist/cjs/transaction/actions/send-transaction.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/exports/extensions/lens.js +2 -0
- package/dist/esm/exports/extensions/lens.js.map +1 -1
- package/dist/esm/exports/utils.js +1 -0
- package/dist/esm/exports/utils.js.map +1 -1
- package/dist/esm/extensions/lens/read/getFullProfile.js.map +1 -1
- package/dist/esm/extensions/lens/read/getHandleFromProfileId.js.map +1 -1
- package/dist/esm/extensions/lens/read/getProfileMetadata.js.map +1 -1
- package/dist/esm/extensions/lens/read/resolveAddress.js +71 -0
- package/dist/esm/extensions/lens/read/resolveAddress.js.map +1 -0
- package/dist/esm/extensions/vote/read/getProposalVoteCounts.js +4 -3
- package/dist/esm/extensions/vote/read/getProposalVoteCounts.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendAndConfirmTransaction.js +16 -1
- package/dist/esm/react/core/hooks/transaction/useSendAndConfirmTransaction.js.map +1 -1
- package/dist/esm/react/native/hooks/transaction/useSendTransaction.js +11 -0
- package/dist/esm/react/native/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/index.js +22 -6
- package/dist/esm/react/web/ui/TransactionButton/index.js.map +1 -1
- package/dist/esm/transaction/actions/send-and-confirm-transaction.js +15 -0
- package/dist/esm/transaction/actions/send-and-confirm-transaction.js.map +1 -1
- package/dist/esm/transaction/actions/send-transaction.js +13 -0
- package/dist/esm/transaction/actions/send-transaction.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/exports/extensions/lens.d.ts +1 -0
- package/dist/types/exports/extensions/lens.d.ts.map +1 -1
- package/dist/types/exports/utils.d.ts +1 -0
- package/dist/types/exports/utils.d.ts.map +1 -1
- package/dist/types/extensions/lens/read/getFullProfile.d.ts +16 -4
- package/dist/types/extensions/lens/read/getFullProfile.d.ts.map +1 -1
- package/dist/types/extensions/lens/read/getHandleFromProfileId.d.ts +12 -3
- package/dist/types/extensions/lens/read/getHandleFromProfileId.d.ts.map +1 -1
- package/dist/types/extensions/lens/read/getProfileMetadata.d.ts +4 -2
- package/dist/types/extensions/lens/read/getProfileMetadata.d.ts.map +1 -1
- package/dist/types/extensions/lens/read/resolveAddress.d.ts +47 -0
- package/dist/types/extensions/lens/read/resolveAddress.d.ts.map +1 -0
- package/dist/types/extensions/vote/read/getAll.d.ts +1 -1
- package/dist/types/extensions/vote/read/getProposalVoteCounts.d.ts +4 -3
- package/dist/types/extensions/vote/read/getProposalVoteCounts.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendAndConfirmTransaction.d.ts +25 -1
- package/dist/types/react/core/hooks/transaction/useSendAndConfirmTransaction.d.ts.map +1 -1
- package/dist/types/react/native/hooks/transaction/useSendTransaction.d.ts +11 -0
- package/dist/types/react/native/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/index.d.ts +22 -6
- package/dist/types/react/web/ui/TransactionButton/index.d.ts.map +1 -1
- package/dist/types/transaction/actions/send-and-confirm-transaction.d.ts +15 -0
- package/dist/types/transaction/actions/send-and-confirm-transaction.d.ts.map +1 -1
- package/dist/types/transaction/actions/send-transaction.d.ts +13 -0
- package/dist/types/transaction/actions/send-transaction.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/exports/extensions/lens.ts +6 -0
- package/src/exports/utils.ts +2 -0
- package/src/extensions/lens/read/getFullProfile.ts +16 -4
- package/src/extensions/lens/read/getHandleFromProfileId.ts +12 -3
- package/src/extensions/lens/read/getProfileMetadata.ts +4 -2
- package/src/extensions/lens/read/resolveAddress.test.ts +23 -0
- package/src/extensions/lens/read/resolveAddress.ts +121 -0
- package/src/extensions/vote/read/getAll.ts +1 -1
- package/src/extensions/vote/read/getProposalVoteCounts.ts +4 -3
- package/src/react/core/hooks/transaction/useSendAndConfirmTransaction.ts +30 -5
- package/src/react/native/hooks/transaction/useSendTransaction.tsx +11 -0
- package/src/react/web/ui/ConnectWallet/Details.tsx +1 -0
- package/src/react/web/ui/TransactionButton/index.tsx +22 -6
- package/src/transaction/actions/send-and-confirm-transaction.ts +15 -0
- package/src/transaction/actions/send-transaction.ts +13 -0
- package/src/version.ts +1 -1
@@ -1,15 +1,24 @@
|
|
1
1
|
import type { Chain } from "../../../chains/types.js";
|
2
2
|
import type { ThirdwebClient } from "../../../client/client.js";
|
3
|
-
import type { Hex } from "../../../utils/encoding/hex.js";
|
4
3
|
/**
|
5
4
|
* @extension LENS
|
6
5
|
*/
|
7
6
|
export type GetHandleFromProfileIdParams = {
|
8
7
|
profileId: bigint;
|
9
8
|
client: ThirdwebClient;
|
9
|
+
/**
|
10
|
+
* Override variables for LensHandle contract and TokenHandleRegistry contract
|
11
|
+
* Make sure both of them have to be on the same network
|
12
|
+
*/
|
10
13
|
overrides?: {
|
11
|
-
|
12
|
-
|
14
|
+
/**
|
15
|
+
* Contract address for the LensHandle contract
|
16
|
+
*/
|
17
|
+
lensHandleAddress?: string;
|
18
|
+
/**
|
19
|
+
* Contract address for the TokenHandleRegistry contract
|
20
|
+
*/
|
21
|
+
tokenHandleRegistryAddress?: string;
|
13
22
|
chain?: Chain;
|
14
23
|
};
|
15
24
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getHandleFromProfileId.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/lens/read/getHandleFromProfileId.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
1
|
+
{"version":3,"file":"getHandleFromProfileId.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/lens/read/getHandleFromProfileId.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAShE;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE;QACV;;WAEG;QACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B;;WAEG;QACH,0BAA0B,CAAC,EAAE,MAAM,CAAC;QACpC,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,4BAA4B,0BA6BtC"}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { Chain } from "../../../chains/types.js";
|
2
2
|
import type { ThirdwebClient } from "../../../client/client.js";
|
3
|
-
import type { Hex } from "../../../utils/encoding/hex.js";
|
4
3
|
import type { LensProfileSchema } from "./type.js";
|
5
4
|
/**
|
6
5
|
* @extension LENS
|
@@ -9,7 +8,10 @@ export type GetProfileMetadataParams = {
|
|
9
8
|
profileId: bigint;
|
10
9
|
client: ThirdwebClient;
|
11
10
|
overrides?: {
|
12
|
-
|
11
|
+
/**
|
12
|
+
* Contract address for the LensHub contract
|
13
|
+
*/
|
14
|
+
lensHubAddress?: string;
|
13
15
|
chain?: Chain;
|
14
16
|
};
|
15
17
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getProfileMetadata.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/lens/read/getProfileMetadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
1
|
+
{"version":3,"file":"getProfileMetadata.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/lens/read/getProfileMetadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE;QACV;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAwBnC"}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import type { Chain } from "../../../chains/types.js";
|
2
|
+
import type { ThirdwebClient } from "../../../client/client.js";
|
3
|
+
/**
|
4
|
+
* @extension LENS
|
5
|
+
*/
|
6
|
+
export type ResolveLensAddressParams = {
|
7
|
+
/**
|
8
|
+
* Either a full lens handle, or a lens localName
|
9
|
+
* Examples:
|
10
|
+
* 1. Full handle: "lens/vitalik"
|
11
|
+
* 2. Just local name: "vitalik"
|
12
|
+
*/
|
13
|
+
name: string;
|
14
|
+
/**
|
15
|
+
* a [`ThirdwebClient`](https://portal.thirdweb.com/references/typescript/v5/ThirdwebClient)
|
16
|
+
*/
|
17
|
+
client: ThirdwebClient;
|
18
|
+
/**
|
19
|
+
* Override parameters for Lens contract, defaults to LensHandle contract on Polygon
|
20
|
+
*/
|
21
|
+
overrides?: {
|
22
|
+
/**
|
23
|
+
* The contract address of the [`LensHandle contract`](https://www.lens.xyz/docs/resources/smart-contracts)
|
24
|
+
*/
|
25
|
+
lensHandleContractAddress?: string;
|
26
|
+
/**
|
27
|
+
* The chain which `lensHandleContractAddress` is deployed on
|
28
|
+
*/
|
29
|
+
chain?: Chain;
|
30
|
+
};
|
31
|
+
};
|
32
|
+
/**
|
33
|
+
* Take in a Lens handle or local-name and return the wallet address behind that handle/local-name.
|
34
|
+
* For example, "lens/vitalik" is a handle, with "lens" being the namespace and "vitalik" being the local name
|
35
|
+
* @extension LENS
|
36
|
+
* @example
|
37
|
+
* ```ts
|
38
|
+
* import { resolveAddress } from "thirdweb/extensions/lens";
|
39
|
+
*
|
40
|
+
* const walletAddress = await resolveAddress({
|
41
|
+
* name: "vitalik",
|
42
|
+
* client,
|
43
|
+
* });
|
44
|
+
* ```
|
45
|
+
*/
|
46
|
+
export declare function resolveAddress(options: ResolveLensAddressParams): Promise<string>;
|
47
|
+
//# sourceMappingURL=resolveAddress.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"resolveAddress.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/lens/read/resolveAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAKhE;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE;QACV;;WAEG;QACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;QACnC;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,CAoEjB"}
|
@@ -35,7 +35,7 @@ export type ProposalItem = {
|
|
35
35
|
*/
|
36
36
|
stateLabel: string | undefined;
|
37
37
|
/**
|
38
|
-
* The current vote info. See type ProposalVoteInfo for more context
|
38
|
+
* The current vote info. See type [`ProposalVoteInfo`](https://portal.thirdweb.com/references/typescript/v5/ProposalItem) for more context
|
39
39
|
*/
|
40
40
|
votes: ProposalVoteInfo;
|
41
41
|
/**
|
@@ -8,6 +8,7 @@ export type ProposalVoteInfo = {
|
|
8
8
|
* Get the info about Against, For and Abstain votes of a proposal
|
9
9
|
* @param options
|
10
10
|
* @returns the object containing the info about Against, For and Abstain votes of a proposal
|
11
|
+
* Note: the count is displayed in "wei"
|
11
12
|
* @extension VOTE
|
12
13
|
* @example
|
13
14
|
* ```ts
|
@@ -17,9 +18,9 @@ export type ProposalVoteInfo = {
|
|
17
18
|
*
|
18
19
|
* // Example result
|
19
20
|
* {
|
20
|
-
*
|
21
|
-
*
|
22
|
-
* abstain:
|
21
|
+
* for: 12000000000000000000n, // 12 tokens (with a decimals of 18) were used to vote "for"
|
22
|
+
* against: 7000000000000000000n, // 7 tokens (with a decimals of 18) were used to vote "against"
|
23
|
+
* abstain: 0n, // no user has voted abstain on this proposal
|
23
24
|
* }
|
24
25
|
* ```
|
25
26
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getProposalVoteCounts.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/vote/read/getProposalVoteCounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,MAAM,gBAAgB,GAAG;KAAG,CAAC,IAAI,MAAM,OAAO,QAAQ,GAAG,MAAM;CAAE,CAAC;AAExE
|
1
|
+
{"version":3,"file":"getProposalVoteCounts.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/vote/read/getProposalVoteCounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,MAAM,gBAAgB,GAAG;KAAG,CAAC,IAAI,MAAM,OAAO,QAAQ,GAAG,MAAM;CAAE,CAAC;AAExE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,GACnD,OAAO,CAAC,gBAAgB,CAAC,CAO3B"}
|
@@ -1,6 +1,17 @@
|
|
1
1
|
import { type UseMutationResult } from "@tanstack/react-query";
|
2
|
+
import type { GaslessOptions } from "../../../../transaction/actions/gasless/types.js";
|
2
3
|
import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js";
|
3
4
|
import type { TransactionReceipt } from "../../../../transaction/types.js";
|
5
|
+
/**
|
6
|
+
* Configuration for the `useSendTransaction` hook.
|
7
|
+
*/
|
8
|
+
export type SendAndConfirmTransactionConfig = {
|
9
|
+
/**
|
10
|
+
* Configuration for gasless transactions.
|
11
|
+
* Refer to [`GaslessOptions`](https://portal.thirdweb.com/references/typescript/v5/GaslessOptions) for more details.
|
12
|
+
*/
|
13
|
+
gasless?: GaslessOptions;
|
14
|
+
};
|
4
15
|
/**
|
5
16
|
* A hook to send a transaction.
|
6
17
|
* @returns A mutation object to send a transaction.
|
@@ -12,7 +23,20 @@ import type { TransactionReceipt } from "../../../../transaction/types.js";
|
|
12
23
|
* // later
|
13
24
|
* sendAndConfirmTx(tx);
|
14
25
|
* ```
|
26
|
+
*
|
27
|
+
*
|
28
|
+
* ### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)
|
29
|
+
* ```tsx
|
30
|
+
* import { useSendAndConfirmTransaction } from "thirdweb/react";
|
31
|
+
* const mutation = useSendAndConfirmTransaction({
|
32
|
+
* gasless: {
|
33
|
+
* provider: "engine",
|
34
|
+
* relayerUrl: "https://thirdweb.engine-***.thirdweb.com/relayer/***",
|
35
|
+
* relayerForwarderAddress: "0x...",
|
36
|
+
* }
|
37
|
+
* });
|
38
|
+
* ```
|
15
39
|
* @transaction
|
16
40
|
*/
|
17
|
-
export declare function useSendAndConfirmTransaction(): UseMutationResult<TransactionReceipt, Error, PreparedTransaction>;
|
41
|
+
export declare function useSendAndConfirmTransaction(config?: SendAndConfirmTransactionConfig): UseMutationResult<TransactionReceipt, Error, PreparedTransaction>;
|
18
42
|
//# sourceMappingURL=useSendAndConfirmTransaction.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSendAndConfirmTransaction.d.ts","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/transaction/useSendAndConfirmTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAe,MAAM,uBAAuB,CAAC;
|
1
|
+
{"version":3,"file":"useSendAndConfirmTransaction.d.ts","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/transaction/useSendAndConfirmTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAe,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAEvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG3E;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,GAAE,+BAAoC,GAC3C,iBAAiB,CAAC,kBAAkB,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAenE"}
|
@@ -13,6 +13,17 @@ import { type SendTransactionConfig } from "../../../core/hooks/transaction/useS
|
|
13
13
|
* sendTx(tx);
|
14
14
|
* ```
|
15
15
|
*
|
16
|
+
* ### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)
|
17
|
+
* ```tsx
|
18
|
+
* import { useSendTransaction } from "thirdweb/react";
|
19
|
+
* const mutation = useSendTransaction({
|
20
|
+
* gasless: {
|
21
|
+
* provider: "engine",
|
22
|
+
* relayerUrl: "https://thirdweb.engine-***.thirdweb.com/relayer/***",
|
23
|
+
* relayerForwarderAddress: "0x...",
|
24
|
+
* }
|
25
|
+
* });
|
26
|
+
* ```
|
16
27
|
* @transaction
|
17
28
|
*/
|
18
29
|
export declare function useSendTransaction(config?: SendTransactionConfig): import("@tanstack/react-query").UseMutationResult<{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSendTransaction.d.ts","sourceRoot":"","sources":["../../../../../../src/react/native/hooks/transaction/useSendTransaction.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,uDAAuD,CAAC;AAI/D
|
1
|
+
{"version":3,"file":"useSendTransaction.d.ts","sourceRoot":"","sources":["../../../../../../src/react/native/hooks/transaction/useSendTransaction.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,uDAAuD,CAAC;AAI/D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,qBAA0B;;;;;wFAQpE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/ConnectWallet/Details.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE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ACf,OAAO,EAAE,OAAO,CAAC;KAClB,KAAK,IAAI,CAAC;IAEX;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,GAAG,CAAC,OAAO,CAAC;IAEvD;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,YAAY,EAAE;QAAE,IAAI,CAAC,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;IAE7D;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7C;;OAEG;IACH,cAAc,CAAC,EAAE,0BAA0B,CAAC;CAC7C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,qBAAqB;kBAQT,4BAA4B;EAwCvD"}
|
@@ -5,6 +5,8 @@ import { type TransactionButtonProps } from "../../../core/hooks/transaction/tra
|
|
5
5
|
* @param props - The props for this component.
|
6
6
|
* Refer to [TransactionButtonProps](https://portal.thirdweb.com/references/typescript/v5/TransactionButtonProps) for details.
|
7
7
|
* @example
|
8
|
+
*
|
9
|
+
* ### Basic usage
|
8
10
|
* ```tsx
|
9
11
|
* <TransactionButton
|
10
12
|
* transaction={() => {}}
|
@@ -14,7 +16,8 @@ import { type TransactionButtonProps } from "../../../core/hooks/transaction/tra
|
|
14
16
|
* Confirm Transaction
|
15
17
|
* </TransactionButton>
|
16
18
|
* ```
|
17
|
-
*
|
19
|
+
*
|
20
|
+
* ### Customize the styling by passing the `unstyled` prop and your inline styles and/or classes:
|
18
21
|
* ```tsx
|
19
22
|
* <TransactionButton
|
20
23
|
* transaction={() => {}}
|
@@ -25,7 +28,7 @@ import { type TransactionButtonProps } from "../../../core/hooks/transaction/tra
|
|
25
28
|
* </TransactionButton>
|
26
29
|
* ```
|
27
30
|
*
|
28
|
-
* Handle errors
|
31
|
+
* ### Handle errors
|
29
32
|
* ```tsx
|
30
33
|
* <TransactionButton
|
31
34
|
* transaction={() => ...}
|
@@ -38,7 +41,7 @@ import { type TransactionButtonProps } from "../../../core/hooks/transaction/tra
|
|
38
41
|
* </TransactionButton>
|
39
42
|
* ```
|
40
43
|
*
|
41
|
-
* Alert when a transaction is sent
|
44
|
+
* ### Alert when a transaction is sent
|
42
45
|
* ```tsx
|
43
46
|
* <TransactionButton
|
44
47
|
* transaction={() => ...}
|
@@ -51,7 +54,7 @@ import { type TransactionButtonProps } from "../../../core/hooks/transaction/tra
|
|
51
54
|
* </TransactionButton>
|
52
55
|
* ```
|
53
56
|
*
|
54
|
-
* Alert when a transaction is completed
|
57
|
+
* ### Alert when a transaction is completed
|
55
58
|
* ```tsx
|
56
59
|
* <TransactionButton
|
57
60
|
* transaction={() => ...}
|
@@ -65,7 +68,7 @@ import { type TransactionButtonProps } from "../../../core/hooks/transaction/tra
|
|
65
68
|
* </TransactionButton>
|
66
69
|
* ```
|
67
70
|
*
|
68
|
-
* The onClick prop, if provided, will be called before the transaction is sent.
|
71
|
+
* ### The onClick prop, if provided, will be called before the transaction is sent.
|
69
72
|
* ```tsx
|
70
73
|
* <TransactionButton
|
71
74
|
* onClick={() => alert("Transaction is about to be sent")}
|
@@ -75,7 +78,7 @@ import { type TransactionButtonProps } from "../../../core/hooks/transaction/tra
|
|
75
78
|
* </TransactionButton>
|
76
79
|
* ```
|
77
80
|
*
|
78
|
-
* Attach custom Pay metadata
|
81
|
+
* ### Attach custom Pay metadata
|
79
82
|
* ```tsx
|
80
83
|
* <TransactionButton
|
81
84
|
* payModal={{
|
@@ -89,6 +92,19 @@ import { type TransactionButtonProps } from "../../../core/hooks/transaction/tra
|
|
89
92
|
* ...
|
90
93
|
* </TransactionButton>
|
91
94
|
* ```
|
95
|
+
*
|
96
|
+
* ### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)
|
97
|
+
* ```tsx
|
98
|
+
* <TransactionButton
|
99
|
+
* gasless={{
|
100
|
+
* provider: "engine",
|
101
|
+
* relayerUrl: "https://thirdweb.engine-***.thirdweb.com/relayer/***",
|
102
|
+
* relayerForwarderAddress: "0x...",
|
103
|
+
* }}
|
104
|
+
* >
|
105
|
+
* ...
|
106
|
+
* </TransactionButton>
|
107
|
+
* ```
|
92
108
|
* @component
|
93
109
|
*/
|
94
110
|
export declare function TransactionButton(props: TransactionButtonProps): import("react/jsx-runtime.js").JSX.Element;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,6DAA6D,CAAC;AAMrE
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,6DAA6D,CAAC;AAMrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2GG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,8CAkE9D"}
|
@@ -7,6 +7,8 @@ import { type SendTransactionOptions } from "./send-transaction.js";
|
|
7
7
|
* @throws An error if the wallet is not connected.
|
8
8
|
* @transaction
|
9
9
|
* @example
|
10
|
+
*
|
11
|
+
* ### Basic usage
|
10
12
|
* ```ts
|
11
13
|
* import { sendAndConfirmTransaction } from "thirdweb";
|
12
14
|
*
|
@@ -15,6 +17,19 @@ import { type SendTransactionOptions } from "./send-transaction.js";
|
|
15
17
|
* transaction
|
16
18
|
* });
|
17
19
|
* ```
|
20
|
+
*
|
21
|
+
* ### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)
|
22
|
+
* ```ts
|
23
|
+
* const transactionReceipt = await sendAndConfirmTransaction({
|
24
|
+
* account,
|
25
|
+
* transaction,
|
26
|
+
* gasless: {
|
27
|
+
* provider: "engine",
|
28
|
+
* relayerUrl: "https://thirdweb.engine-***.thirdweb.com/relayer/***",
|
29
|
+
* relayerForwarderAddress: "0x...",
|
30
|
+
* }
|
31
|
+
* });
|
32
|
+
* ```
|
18
33
|
*/
|
19
34
|
export declare function sendAndConfirmTransaction(options: SendTransactionOptions): Promise<TransactionReceipt>;
|
20
35
|
//# sourceMappingURL=send-and-confirm-transaction.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"send-and-confirm-transaction.d.ts","sourceRoot":"","sources":["../../../../src/transaction/actions/send-and-confirm-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,uBAAuB,CAAC;AAG/B
|
1
|
+
{"version":3,"file":"send-and-confirm-transaction.d.ts","sourceRoot":"","sources":["../../../../src/transaction/actions/send-and-confirm-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,kBAAkB,CAAC,CAG7B"}
|
@@ -93,6 +93,19 @@ export type SendTransactionOptions = {
|
|
93
93
|
* transaction,
|
94
94
|
* });
|
95
95
|
* ```
|
96
|
+
*
|
97
|
+
* ### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)
|
98
|
+
* ```ts
|
99
|
+
* const { transactionHash } = await sendTransaction({
|
100
|
+
* account,
|
101
|
+
* transaction,
|
102
|
+
* gasless: {
|
103
|
+
* provider: "engine",
|
104
|
+
* relayerUrl: "https://thirdweb.engine-***.thirdweb.com/relayer/***",
|
105
|
+
* relayerForwarderAddress: "0x...",
|
106
|
+
* }
|
107
|
+
* });
|
108
|
+
* ```
|
96
109
|
*/
|
97
110
|
export declare function sendTransaction(options: SendTransactionOptions): Promise<WaitForReceiptOptions>;
|
98
111
|
//# sourceMappingURL=send-transaction.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"send-transaction.d.ts","sourceRoot":"","sources":["../../../../src/transaction/actions/send-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IAGjB,WAAW,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF
|
1
|
+
{"version":3,"file":"send-transaction.d.ts","sourceRoot":"","sources":["../../../../src/transaction/actions/send-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IAGjB,WAAW,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAkChC"}
|
package/dist/types/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "5.47.
|
1
|
+
export declare const version = "5.47.1-nightly-574ff0295dcbb39f2ddd753c9e8a264498aae99e-20240819000344";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "thirdweb",
|
3
|
-
"version": "5.47.
|
3
|
+
"version": "5.47.1-nightly-574ff0295dcbb39f2ddd753c9e8a264498aae99e-20240819000344",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/thirdweb-dev/js.git#main"
|
@@ -119,6 +119,8 @@ export {
|
|
119
119
|
/**
|
120
120
|
* Custom extension
|
121
121
|
*/
|
122
|
+
|
123
|
+
// Read
|
122
124
|
export {
|
123
125
|
getHandleFromProfileId,
|
124
126
|
type GetHandleFromProfileIdParams,
|
@@ -133,6 +135,10 @@ export {
|
|
133
135
|
type GetFullProfileParams,
|
134
136
|
type FullProfileResponse,
|
135
137
|
} from "../../extensions/lens/read/getFullProfile.js";
|
138
|
+
export {
|
139
|
+
resolveAddress,
|
140
|
+
type ResolveLensAddressParams,
|
141
|
+
} from "../../extensions/lens/read/resolveAddress.js";
|
136
142
|
|
137
143
|
/**
|
138
144
|
* Contract addresses
|
package/src/exports/utils.ts
CHANGED
@@ -2,7 +2,6 @@ import { polygon } from "../../../chains/chain-definitions/polygon.js";
|
|
2
2
|
import type { Chain } from "../../../chains/types.js";
|
3
3
|
import type { ThirdwebClient } from "../../../client/client.js";
|
4
4
|
import { getContract } from "../../../contract/contract.js";
|
5
|
-
import type { Hex } from "../../../utils/encoding/hex.js";
|
6
5
|
import { getProfile } from "../__generated__/LensHub/read/getProfile.js";
|
7
6
|
import { getDefaultHandle } from "../__generated__/TokenHandleRegistry/read/getDefaultHandle.js";
|
8
7
|
import {
|
@@ -19,10 +18,23 @@ export type GetFullProfileParams = {
|
|
19
18
|
profileId: bigint;
|
20
19
|
client: ThirdwebClient;
|
21
20
|
includeJoinDate?: boolean;
|
21
|
+
/**
|
22
|
+
* Override variables for Lens smart contracts
|
23
|
+
* Make sure all of them have to be on the same network
|
24
|
+
*/
|
22
25
|
overrides?: {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
+
/**
|
27
|
+
* Contract address for the LensHub contract
|
28
|
+
*/
|
29
|
+
lensHubAddress?: string;
|
30
|
+
/**
|
31
|
+
* Contract address for the LensHandle contract
|
32
|
+
*/
|
33
|
+
lensHandleAddress?: string;
|
34
|
+
/**
|
35
|
+
* Contract address for the TokenHandleRegistry contract
|
36
|
+
*/
|
37
|
+
tokenHandleRegistryAddress?: string;
|
26
38
|
chain?: Chain;
|
27
39
|
};
|
28
40
|
};
|
@@ -2,7 +2,6 @@ import { polygon } from "../../../chains/chain-definitions/polygon.js";
|
|
2
2
|
import type { Chain } from "../../../chains/types.js";
|
3
3
|
import type { ThirdwebClient } from "../../../client/client.js";
|
4
4
|
import { getContract } from "../../../contract/contract.js";
|
5
|
-
import type { Hex } from "../../../utils/encoding/hex.js";
|
6
5
|
import { getHandle } from "../__generated__/LensHandle/read/getHandle.js";
|
7
6
|
import { getDefaultHandle } from "../__generated__/TokenHandleRegistry/read/getDefaultHandle.js";
|
8
7
|
import {
|
@@ -16,9 +15,19 @@ import {
|
|
16
15
|
export type GetHandleFromProfileIdParams = {
|
17
16
|
profileId: bigint;
|
18
17
|
client: ThirdwebClient;
|
18
|
+
/**
|
19
|
+
* Override variables for LensHandle contract and TokenHandleRegistry contract
|
20
|
+
* Make sure both of them have to be on the same network
|
21
|
+
*/
|
19
22
|
overrides?: {
|
20
|
-
|
21
|
-
|
23
|
+
/**
|
24
|
+
* Contract address for the LensHandle contract
|
25
|
+
*/
|
26
|
+
lensHandleAddress?: string;
|
27
|
+
/**
|
28
|
+
* Contract address for the TokenHandleRegistry contract
|
29
|
+
*/
|
30
|
+
tokenHandleRegistryAddress?: string;
|
22
31
|
chain?: Chain;
|
23
32
|
};
|
24
33
|
};
|
@@ -2,7 +2,6 @@ import { polygon } from "../../../chains/chain-definitions/polygon.js";
|
|
2
2
|
import type { Chain } from "../../../chains/types.js";
|
3
3
|
import type { ThirdwebClient } from "../../../client/client.js";
|
4
4
|
import { getContract } from "../../../contract/contract.js";
|
5
|
-
import type { Hex } from "../../../utils/encoding/hex.js";
|
6
5
|
import { getProfile } from "../__generated__/LensHub/read/getProfile.js";
|
7
6
|
import { LENS_HUB_ADDRESS } from "../consts.js";
|
8
7
|
import type { LensProfileSchema } from "./type.js";
|
@@ -14,7 +13,10 @@ export type GetProfileMetadataParams = {
|
|
14
13
|
profileId: bigint;
|
15
14
|
client: ThirdwebClient;
|
16
15
|
overrides?: {
|
17
|
-
|
16
|
+
/**
|
17
|
+
* Contract address for the LensHub contract
|
18
|
+
*/
|
19
|
+
lensHubAddress?: string;
|
18
20
|
chain?: Chain;
|
19
21
|
};
|
20
22
|
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
2
|
+
import { TEST_CLIENT } from "~test/test-clients.js";
|
3
|
+
import { isAddress } from "../../../utils/address.js";
|
4
|
+
import { resolveAddress } from "./resolveAddress.js";
|
5
|
+
|
6
|
+
describe("resolve lens address", () => {
|
7
|
+
it("should resolve to correct address", async () => {
|
8
|
+
const address = await resolveAddress({
|
9
|
+
client: TEST_CLIENT,
|
10
|
+
name: "captain_jack",
|
11
|
+
});
|
12
|
+
// "captain_jack" is a valid localname so it should definitely resolve to a valid address
|
13
|
+
expect(isAddress(address)).toBe(true);
|
14
|
+
});
|
15
|
+
|
16
|
+
it("should throw if passed an invalid lens handle", async () => {
|
17
|
+
await expect(() =>
|
18
|
+
resolveAddress({ client: TEST_CLIENT, name: "vitalik.eth" }),
|
19
|
+
).rejects.toThrowError(
|
20
|
+
"Could not fetch the wallet address for lens handle: vitalik.eth",
|
21
|
+
);
|
22
|
+
});
|
23
|
+
});
|