thirdweb 5.47.0 → 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/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/cjs/version.js.map +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/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/esm/version.js.map +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/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/dist/types/version.d.ts.map +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/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
@@ -0,0 +1,71 @@
|
|
1
|
+
import { ZERO_ADDRESS } from "../../../constants/addresses.js";
|
2
|
+
import { getAddress, isAddress } from "../../../utils/address.js";
|
3
|
+
import { withCache } from "../../../utils/promise/withCache.js";
|
4
|
+
/**
|
5
|
+
* Take in a Lens handle or local-name and return the wallet address behind that handle/local-name.
|
6
|
+
* For example, "lens/vitalik" is a handle, with "lens" being the namespace and "vitalik" being the local name
|
7
|
+
* @extension LENS
|
8
|
+
* @example
|
9
|
+
* ```ts
|
10
|
+
* import { resolveAddress } from "thirdweb/extensions/lens";
|
11
|
+
*
|
12
|
+
* const walletAddress = await resolveAddress({
|
13
|
+
* name: "vitalik",
|
14
|
+
* client,
|
15
|
+
* });
|
16
|
+
* ```
|
17
|
+
*/
|
18
|
+
export async function resolveAddress(options) {
|
19
|
+
const { name, overrides, client } = options;
|
20
|
+
if (isAddress(name)) {
|
21
|
+
return getAddress(name);
|
22
|
+
}
|
23
|
+
return withCache(async () => {
|
24
|
+
const [{ getContract }, { getTokenId }, { ownerOf }, { polygon }, { LENS_HANDLE_ADDRESS },] = await Promise.all([
|
25
|
+
import("../../../contract/contract.js"),
|
26
|
+
import("../__generated__/LensHandle/read/getTokenId.js"),
|
27
|
+
import("../../erc721/__generated__/IERC721A/read/ownerOf.js"),
|
28
|
+
import("../../../chains/chain-definitions/polygon.js"),
|
29
|
+
import("../consts.js"),
|
30
|
+
]);
|
31
|
+
const contract = getContract({
|
32
|
+
address: overrides?.lensHandleContractAddress || LENS_HANDLE_ADDRESS,
|
33
|
+
chain: overrides?.chain || polygon,
|
34
|
+
client,
|
35
|
+
});
|
36
|
+
/**
|
37
|
+
* For better UX, we accept both handle and local name
|
38
|
+
* The difference: handle = <namespace>/<local-name>
|
39
|
+
* For example, "lens/vitalik" is a handle, with "lens" being the namespace and "vitalik" being the local name
|
40
|
+
* Currently there's only 1 namespace called "lens" but we should make sure the code can scale when there are more
|
41
|
+
*
|
42
|
+
* Since lens does not allow "/" in the name,
|
43
|
+
* if the string contains "/", it is either invalid, or it definitely contains the namespace
|
44
|
+
* In that case we remove the possible namespace because the `getTokenId` method only accepts localName
|
45
|
+
*/
|
46
|
+
const isPossibleHandle = name.includes("/");
|
47
|
+
const localName = isPossibleHandle ? name.split("/")[1] : name;
|
48
|
+
if (!localName) {
|
49
|
+
throw new Error(`missing local name from ${name}`);
|
50
|
+
}
|
51
|
+
const tokenId = await getTokenId({ contract, localName });
|
52
|
+
if (!tokenId) {
|
53
|
+
throw new Error(`Could not retrieve tokenId from localName: ${localName}`);
|
54
|
+
}
|
55
|
+
/**
|
56
|
+
* Another thing to note is that even if you enter an invalid localName,
|
57
|
+
* `getTokenId` still returns you a tokenId - so never rely on the result alone.
|
58
|
+
* Check if the tokenId truly exists using `exists` or in this case, `ownerOf`
|
59
|
+
*/
|
60
|
+
const address = await ownerOf({ contract, tokenId }).catch(() => ZERO_ADDRESS);
|
61
|
+
if (address === ZERO_ADDRESS) {
|
62
|
+
throw new Error(`Could not fetch the wallet address for lens handle: ${name}`);
|
63
|
+
}
|
64
|
+
return address;
|
65
|
+
}, {
|
66
|
+
cacheKey: `lens:addr:${name}`,
|
67
|
+
// 1min cache
|
68
|
+
cacheTime: 60 * 1000,
|
69
|
+
});
|
70
|
+
}
|
71
|
+
//# sourceMappingURL=resolveAddress.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"resolveAddress.js","sourceRoot":"","sources":["../../../../../src/extensions/lens/read/resolveAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAgChE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAiC;IAEjC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC5C,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,OAAO,U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AAK,CACxD,GAAG,EAAE,CAAC,YAAY,CACnB,CAAC;QACF,IAAI,OAAO,KAAK,YAAY,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACb,uDAAuD,IAAI,EAAE,CAC9D,CAAC;QACJ,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,EACD;QACE,QAAQ,EAAE,aAAa,IAAI,EAAE;QAC7B,aAAa;QACb,SAAS,EAAE,EAAE,GAAG,IAAI;KACrB,CACF,CAAC;AACJ,CAAC"}
|
@@ -3,6 +3,7 @@ import { proposalVotes, } from "../__generated__/Vote/read/proposalVotes.js";
|
|
3
3
|
* Get the info about Against, For and Abstain votes of a proposal
|
4
4
|
* @param options
|
5
5
|
* @returns the object containing the info about Against, For and Abstain votes of a proposal
|
6
|
+
* Note: the count is displayed in "wei"
|
6
7
|
* @extension VOTE
|
7
8
|
* @example
|
8
9
|
* ```ts
|
@@ -12,9 +13,9 @@ import { proposalVotes, } from "../__generated__/Vote/read/proposalVotes.js";
|
|
12
13
|
*
|
13
14
|
* // Example result
|
14
15
|
* {
|
15
|
-
*
|
16
|
-
*
|
17
|
-
* abstain:
|
16
|
+
* for: 12000000000000000000n, // 12 tokens (with a decimals of 18) were used to vote "for"
|
17
|
+
* against: 7000000000000000000n, // 7 tokens (with a decimals of 18) were used to vote "against"
|
18
|
+
* abstain: 0n, // no user has voted abstain on this proposal
|
18
19
|
* }
|
19
20
|
* ```
|
20
21
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getProposalVoteCounts.js","sourceRoot":"","sources":["../../../../../src/extensions/vote/read/getProposalVoteCounts.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,GACd,MAAM,6CAA6C,CAAC;AAMrD
|
1
|
+
{"version":3,"file":"getProposalVoteCounts.js","sourceRoot":"","sources":["../../../../../src/extensions/vote/read/getProposalVoteCounts.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,GACd,MAAM,6CAA6C,CAAC;AAMrD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAAoD;IAEpD,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;QACjB,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;QACb,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;KAClB,CAAC;AACJ,CAAC"}
|
@@ -12,10 +12,24 @@ import { useActiveAccount } from "../wallets/useActiveAccount.js";
|
|
12
12
|
* // later
|
13
13
|
* sendAndConfirmTx(tx);
|
14
14
|
* ```
|
15
|
+
*
|
16
|
+
*
|
17
|
+
* ### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)
|
18
|
+
* ```tsx
|
19
|
+
* import { useSendAndConfirmTransaction } from "thirdweb/react";
|
20
|
+
* const mutation = useSendAndConfirmTransaction({
|
21
|
+
* gasless: {
|
22
|
+
* provider: "engine",
|
23
|
+
* relayerUrl: "https://thirdweb.engine-***.thirdweb.com/relayer/***",
|
24
|
+
* relayerForwarderAddress: "0x...",
|
25
|
+
* }
|
26
|
+
* });
|
27
|
+
* ```
|
15
28
|
* @transaction
|
16
29
|
*/
|
17
|
-
export function useSendAndConfirmTransaction() {
|
30
|
+
export function useSendAndConfirmTransaction(config = {}) {
|
18
31
|
const account = useActiveAccount();
|
32
|
+
const { gasless } = config;
|
19
33
|
return useMutation({
|
20
34
|
mutationFn: async (transaction) => {
|
21
35
|
if (!account) {
|
@@ -24,6 +38,7 @@ export function useSendAndConfirmTransaction() {
|
|
24
38
|
return await sendAndConfirmTransaction({
|
25
39
|
transaction,
|
26
40
|
account,
|
41
|
+
gasless,
|
27
42
|
});
|
28
43
|
},
|
29
44
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSendAndConfirmTransaction.js","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/transaction/useSendAndConfirmTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
1
|
+
{"version":3,"file":"useSendAndConfirmTransaction.js","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/transaction/useSendAndConfirmTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAG5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAalE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,4BAA4B,CAC1C,SAA0C,EAAE;IAE5C,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IACnC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAC3B,OAAO,WAAW,CAAC;QACjB,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE;YAChC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACvC,CAAC;YACD,OAAO,MAAM,yBAAyB,CAAC;gBACrC,WAAW;gBACX,OAAO;gBACP,OAAO;aACR,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
@@ -15,6 +15,17 @@ import { useSwitchActiveWalletChain } from "../../../core/hooks/wallets/useSwitc
|
|
15
15
|
* sendTx(tx);
|
16
16
|
* ```
|
17
17
|
*
|
18
|
+
* ### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)
|
19
|
+
* ```tsx
|
20
|
+
* import { useSendTransaction } from "thirdweb/react";
|
21
|
+
* const mutation = useSendTransaction({
|
22
|
+
* gasless: {
|
23
|
+
* provider: "engine",
|
24
|
+
* relayerUrl: "https://thirdweb.engine-***.thirdweb.com/relayer/***",
|
25
|
+
* relayerForwarderAddress: "0x...",
|
26
|
+
* }
|
27
|
+
* });
|
28
|
+
* ```
|
18
29
|
* @transaction
|
19
30
|
*/
|
20
31
|
export function useSendTransaction(config = {}) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSendTransaction.js","sourceRoot":"","sources":["../../../../../../src/react/native/hooks/transaction/useSendTransaction.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,GACvB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,2DAA2D,CAAC;AAEvG
|
1
|
+
{"version":3,"file":"useSendTransaction.js","sourceRoot":"","sources":["../../../../../../src/react/native/hooks/transaction/useSendTransaction.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,GACvB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,2DAA2D,CAAC;AAEvG;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAgC,EAAE;IACnE,KAAK,MAAM,CAAC,CAAC,wBAAwB;IACrC,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;IACjC,MAAM,WAAW,GAAG,0BAA0B,EAAE,CAAC;IACjD,OAAO,sBAAsB,CAAC;QAC5B,MAAM;QACN,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
|
@@ -12,6 +12,8 @@ import { Button } from "../components/buttons.js";
|
|
12
12
|
* @param props - The props for this component.
|
13
13
|
* Refer to [TransactionButtonProps](https://portal.thirdweb.com/references/typescript/v5/TransactionButtonProps) for details.
|
14
14
|
* @example
|
15
|
+
*
|
16
|
+
* ### Basic usage
|
15
17
|
* ```tsx
|
16
18
|
* <TransactionButton
|
17
19
|
* transaction={() => {}}
|
@@ -21,7 +23,8 @@ import { Button } from "../components/buttons.js";
|
|
21
23
|
* Confirm Transaction
|
22
24
|
* </TransactionButton>
|
23
25
|
* ```
|
24
|
-
*
|
26
|
+
*
|
27
|
+
* ### Customize the styling by passing the `unstyled` prop and your inline styles and/or classes:
|
25
28
|
* ```tsx
|
26
29
|
* <TransactionButton
|
27
30
|
* transaction={() => {}}
|
@@ -32,7 +35,7 @@ import { Button } from "../components/buttons.js";
|
|
32
35
|
* </TransactionButton>
|
33
36
|
* ```
|
34
37
|
*
|
35
|
-
* Handle errors
|
38
|
+
* ### Handle errors
|
36
39
|
* ```tsx
|
37
40
|
* <TransactionButton
|
38
41
|
* transaction={() => ...}
|
@@ -45,7 +48,7 @@ import { Button } from "../components/buttons.js";
|
|
45
48
|
* </TransactionButton>
|
46
49
|
* ```
|
47
50
|
*
|
48
|
-
* Alert when a transaction is sent
|
51
|
+
* ### Alert when a transaction is sent
|
49
52
|
* ```tsx
|
50
53
|
* <TransactionButton
|
51
54
|
* transaction={() => ...}
|
@@ -58,7 +61,7 @@ import { Button } from "../components/buttons.js";
|
|
58
61
|
* </TransactionButton>
|
59
62
|
* ```
|
60
63
|
*
|
61
|
-
* Alert when a transaction is completed
|
64
|
+
* ### Alert when a transaction is completed
|
62
65
|
* ```tsx
|
63
66
|
* <TransactionButton
|
64
67
|
* transaction={() => ...}
|
@@ -72,7 +75,7 @@ import { Button } from "../components/buttons.js";
|
|
72
75
|
* </TransactionButton>
|
73
76
|
* ```
|
74
77
|
*
|
75
|
-
* The onClick prop, if provided, will be called before the transaction is sent.
|
78
|
+
* ### The onClick prop, if provided, will be called before the transaction is sent.
|
76
79
|
* ```tsx
|
77
80
|
* <TransactionButton
|
78
81
|
* onClick={() => alert("Transaction is about to be sent")}
|
@@ -82,7 +85,7 @@ import { Button } from "../components/buttons.js";
|
|
82
85
|
* </TransactionButton>
|
83
86
|
* ```
|
84
87
|
*
|
85
|
-
* Attach custom Pay metadata
|
88
|
+
* ### Attach custom Pay metadata
|
86
89
|
* ```tsx
|
87
90
|
* <TransactionButton
|
88
91
|
* payModal={{
|
@@ -96,6 +99,19 @@ import { Button } from "../components/buttons.js";
|
|
96
99
|
* ...
|
97
100
|
* </TransactionButton>
|
98
101
|
* ```
|
102
|
+
*
|
103
|
+
* ### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)
|
104
|
+
* ```tsx
|
105
|
+
* <TransactionButton
|
106
|
+
* gasless={{
|
107
|
+
* provider: "engine",
|
108
|
+
* relayerUrl: "https://thirdweb.engine-***.thirdweb.com/relayer/***",
|
109
|
+
* relayerForwarderAddress: "0x...",
|
110
|
+
* }}
|
111
|
+
* >
|
112
|
+
* ...
|
113
|
+
* </TransactionButton>
|
114
|
+
* ```
|
99
115
|
* @component
|
100
116
|
*/
|
101
117
|
export function TransactionButton(props) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AACzF,OAAO,EAEL,4BAA4B,GAC7B,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AACzF,OAAO,EAEL,4BAA4B,GAC7B,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC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C;oBACE,QAAQ,EAAE,UAAU;oBACpB,GAAG,WAAW,CAAC,KAAK;iBACrB,aAGP,eAAM,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,YAC1D,QAAQ,GACJ,EACN,SAAS,IAAI,CACZ,cACE,KAAK,EAAE;wBACL,QAAQ,EAAE,UAAU;wBACpB,OAAO,EAAE,MAAM;wBACf,UAAU,EAAE,QAAQ;wBACpB,MAAM,EAAE,MAAM;wBACd,GAAG,EAAE,CAAC;wBACN,MAAM,EAAE,CAAC;wBACT,MAAM,EAAE,MAAM;qBACf,YAED,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,mBAAmB,GAAG,GAC3C,CACP,IACM,GACW,CACvB,CAAC;AACJ,CAAC"}
|
@@ -7,6 +7,8 @@ import { waitForReceipt } from "./wait-for-tx-receipt.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 { waitForReceipt } from "./wait-for-tx-receipt.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 async function sendAndConfirmTransaction(options) {
|
20
35
|
const submittedTx = await sendTransaction(options);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"send-and-confirm-transaction.js","sourceRoot":"","sources":["../../../../src/transaction/actions/send-and-confirm-transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D
|
1
|
+
{"version":3,"file":"send-and-confirm-transaction.js","sourceRoot":"","sources":["../../../../src/transaction/actions/send-and-confirm-transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,OAA+B;IAE/B,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC;IACnD,OAAO,cAAc,CAAC,WAAW,CAAC,CAAC;AACrC,CAAC"}
|
@@ -86,6 +86,19 @@ import { toSerializableTransaction } from "./to-serializable-transaction.js";
|
|
86
86
|
* transaction,
|
87
87
|
* });
|
88
88
|
* ```
|
89
|
+
*
|
90
|
+
* ### Gasless usage with [thirdweb Engine](https://portal.thirdweb.com/engine)
|
91
|
+
* ```ts
|
92
|
+
* const { transactionHash } = await sendTransaction({
|
93
|
+
* account,
|
94
|
+
* transaction,
|
95
|
+
* gasless: {
|
96
|
+
* provider: "engine",
|
97
|
+
* relayerUrl: "https://thirdweb.engine-***.thirdweb.com/relayer/***",
|
98
|
+
* relayerForwarderAddress: "0x...",
|
99
|
+
* }
|
100
|
+
* });
|
101
|
+
* ```
|
89
102
|
*/
|
90
103
|
export async function sendTransaction(options) {
|
91
104
|
const { account, transaction, gasless } = options;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"send-transaction.js","sourceRoot":"","sources":["../../../../src/transaction/actions/send-transaction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAW7E
|
1
|
+
{"version":3,"file":"send-transaction.js","sourceRoot":"","sources":["../../../../src/transaction/actions/send-transaction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAW7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAA+B;IAE/B,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAElD,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACnC,MAAM,OAAO,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,uBAAuB,GAAG,MAAM,yBAAyB,CAAC;QAC9D,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,OAAO,CAAC,OAAO;KACtB,CAAC,CAAC;IAEH,kCAAkC;IAClC,IAAI,OAAO,EAAE,CAAC;QACZ,sFAAsF;QACtF,MAAM,EAAE,sBAAsB,EAAE,GAAG,MAAM,MAAM,CAC7C,uCAAuC,CACxC,CAAC;QACF,OAAO,sBAAsB,CAAC;YAC5B,OAAO;YACP,WAAW;YACX,uBAAuB;YACvB,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC;IACtE,wBAAwB;IACxB,qBAAqB,CAAC;QACpB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE;KAC9B,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;AAC7E,CAAC"}
|
package/dist/esm/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const version = "5.47.
|
1
|
+
export const version = "5.47.1-nightly-574ff0295dcbb39f2ddd753c9e8a264498aae99e-20240819000344";
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/esm/version.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,wEAAwE,CAAC"}
|
@@ -46,6 +46,7 @@ export { getHandleFromProfileId, type GetHandleFromProfileIdParams, } from "../.
|
|
46
46
|
export { getProfileMetadata, type GetProfileMetadataParams, } from "../../extensions/lens/read/getProfileMetadata.js";
|
47
47
|
export type { LensProfileSchema } from "../../extensions/lens/read/type.js";
|
48
48
|
export { getFullProfile, type GetFullProfileParams, type FullProfileResponse, } from "../../extensions/lens/read/getFullProfile.js";
|
49
|
+
export { resolveAddress, type ResolveLensAddressParams, } from "../../extensions/lens/read/resolveAddress.js";
|
49
50
|
/**
|
50
51
|
* Contract addresses
|
51
52
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lens.d.ts","sourceRoot":"","sources":["../../../../src/exports/extensions/lens.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,UAAU,EACV,KAAK,gBAAgB,GACtB,MAAM,gEAAgE,CAAC;AACxE,OAAO,EACL,MAAM,EACN,KAAK,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,GAC7D,MAAM,uEAAuE,CAAC;AAE/E;;GAEG;AACH,OAAO,EACL,gBAAgB,EAChB,KAAK,sBAAsB,GAC5B,MAAM,kFAAkF,CAAC;AAC1F,OAAO,EACL,MAAM,EACN,KAAK,YAAY,GAClB,MAAM,wEAAwE,CAAC;AAChF,OAAO,EACL,OAAO,EACP,KAAK,aAAa,GACnB,MAAM,yEAAyE,CAAC;AAEjF;;GAEG;AACH,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,2EAA2E,CAAC;AACnF,OAAO,EACL,yBAAyB,EACzB,KAAK,+BAA+B,GACrC,MAAM,sFAAsF,CAAC;AAC9F,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,GAC9B,MAAM,+EAA+E,CAAC;AACvF,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,GAChC,MAAM,iFAAiF,CAAC;AAEzF;;GAEG;
|
1
|
+
{"version":3,"file":"lens.d.ts","sourceRoot":"","sources":["../../../../src/exports/extensions/lens.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,UAAU,EACV,KAAK,gBAAgB,GACtB,MAAM,gEAAgE,CAAC;AACxE,OAAO,EACL,MAAM,EACN,KAAK,YAAY,GAClB,MAAM,4DAA4D,CAAC;AACpE,OAAO,EACL,aAAa,EACb,KAAK,mBAAmB,GACzB,MAAM,mEAAmE,CAAC;AAC3E,OAAO,EACL,wBAAwB,EACxB,KAAK,8BAA8B,GACpC,MAAM,8EAA8E,CAAC;AACtF,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,oEAAoE,CAAC;AAC5E,OAAO,EACL,WAAW,EACX,KAAK,iBAAiB,GACvB,MAAM,iEAAiE,CAAC;AACzE,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,GAC3B,MAAM,qEAAqE,CAAC;AAE7E;;GAEG;AACH,OAAO,EACL,SAAS,EACT,KAAK,eAAe,GACrB,MAAM,kEAAkE,CAAC;AAC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AA+E,CAAC;AACvF,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,GAChC,MAAM,iFAAiF,CAAC;AAEzF;;GAEG;AAGH,OAAO,EACL,sBAAsB,EACtB,KAAK,4BAA4B,GAClC,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,GAC9B,MAAM,kDAAkD,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,cAAc,EACd,KAAK,wBAAwB,GAC9B,MAAM,8CAA8C,CAAC;AAEtD;;GAEG;AACH,OAAO,EAEL,gBAAgB,EAChB,mBAAmB,EACnB,kCAAkC,EAClC,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAE5B,wBAAwB,EACxB,2BAA2B,EAC3B,0CAA0C,EAC1C,+BAA+B,EAC/B,gCAAgC,EAChC,oCAAoC,GACrC,MAAM,iCAAiC,CAAC"}
|
@@ -26,6 +26,7 @@ export { keccak256 } from "../utils/hashing/keccak256.js";
|
|
26
26
|
export { sha256 } from "../utils/hashing/sha256.js";
|
27
27
|
export { hashMessage } from "../utils/hashing/hashMessage.js";
|
28
28
|
export { checksumAddress, getAddress, isAddress, shortenAddress, shortenHex, type Address, type AddressInput, } from "../utils/address.js";
|
29
|
+
export { isBytes } from "viem";
|
29
30
|
export { encodeAbiParameters } from "../utils/abi/encodeAbiParameters.js";
|
30
31
|
/**
|
31
32
|
* @utils
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/exports/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,wCAAwC,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AAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,OAAO,EACL,WAAW,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,OAAO,EACP,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,SAAS,EACT,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,iCAAiC,CAAC;AAOzC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG1D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAK9D,OAAO,EACL,eAAe,EACf,UAAU,EACV,SAAS,EACT,cAAc,EACd,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/exports/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,8DAA8D,CAAC;AACxH,OAAO,EAAE,k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EAAE,MAAM,kBAAkB,CAAC;AAK7C,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAKlC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAChF,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKxD,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,GAC3B,MAAM,+CAA+C,CAAC;AAEvD,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC"}
|
@@ -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,10 +8,23 @@ export type GetFullProfileParams = {
|
|
9
8
|
profileId: bigint;
|
10
9
|
client: ThirdwebClient;
|
11
10
|
includeJoinDate?: boolean;
|
11
|
+
/**
|
12
|
+
* Override variables for Lens smart contracts
|
13
|
+
* Make sure all of them have to be on the same network
|
14
|
+
*/
|
12
15
|
overrides?: {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
/**
|
17
|
+
* Contract address for the LensHub contract
|
18
|
+
*/
|
19
|
+
lensHubAddress?: string;
|
20
|
+
/**
|
21
|
+
* Contract address for the LensHandle contract
|
22
|
+
*/
|
23
|
+
lensHandleAddress?: string;
|
24
|
+
/**
|
25
|
+
* Contract address for the TokenHandleRegistry contract
|
26
|
+
*/
|
27
|
+
tokenHandleRegistryAddress?: string;
|
16
28
|
chain?: Chain;
|
17
29
|
};
|
18
30
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getFullProfile.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/lens/read/getFullProfile.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":"getFullProfile.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/lens/read/getFullProfile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAShE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE;QACV;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB;;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;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACvC,GAAG,IAAI,CAAC;AAET;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAuD9B"}
|
@@ -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"}
|