@b3dotfun/sdk 0.0.24-alpha.1 → 0.0.24-alpha.2
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.
|
@@ -15,6 +15,11 @@ const thirdweb_2 = require("thirdweb");
|
|
|
15
15
|
const wagmi_1 = require("wagmi");
|
|
16
16
|
const components_1 = require("../components");
|
|
17
17
|
const useAccountWallet_1 = require("./useAccountWallet");
|
|
18
|
+
const partnerId = String(process.env.PUBLIC_THIRDWEB_PARTNER_ID ||
|
|
19
|
+
process.env.NEXT_PUBLIC_THIRDWEB_PARTNER_ID ||
|
|
20
|
+
process.env.PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID ||
|
|
21
|
+
process.env.NEXT_PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID);
|
|
22
|
+
(0, invariant_1.default)(partnerId, "Partner ID is required");
|
|
18
23
|
function useUnifiedChainSwitchAndExecute() {
|
|
19
24
|
const { data: walletClient } = (0, wagmi_1.useWalletClient)();
|
|
20
25
|
const { switchChainAsync } = (0, wagmi_1.useSwitchChain)();
|
|
@@ -110,7 +115,7 @@ function useUnifiedChainSwitchAndExecute() {
|
|
|
110
115
|
// Check if we can use global-accounts-intents, if yes, create an intent.
|
|
111
116
|
try {
|
|
112
117
|
await app_1.default.service("global-accounts-intents").create({
|
|
113
|
-
partnerId:
|
|
118
|
+
partnerId: partnerId,
|
|
114
119
|
chainId: targetChainId,
|
|
115
120
|
to: params.to,
|
|
116
121
|
data: params.data || "0x",
|
|
@@ -9,6 +9,11 @@ import { prepareTransaction, sendTransaction as twSendTransaction } from "thirdw
|
|
|
9
9
|
import { useSwitchChain, useWalletClient } from "wagmi";
|
|
10
10
|
import { useB3 } from "../components/index.js";
|
|
11
11
|
import { useAccountWallet } from "./useAccountWallet.js";
|
|
12
|
+
const partnerId = String(process.env.PUBLIC_THIRDWEB_PARTNER_ID ||
|
|
13
|
+
process.env.NEXT_PUBLIC_THIRDWEB_PARTNER_ID ||
|
|
14
|
+
process.env.PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID ||
|
|
15
|
+
process.env.NEXT_PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID);
|
|
16
|
+
invariant(partnerId, "Partner ID is required");
|
|
12
17
|
export function useUnifiedChainSwitchAndExecute() {
|
|
13
18
|
const { data: walletClient } = useWalletClient();
|
|
14
19
|
const { switchChainAsync } = useSwitchChain();
|
|
@@ -104,7 +109,7 @@ export function useUnifiedChainSwitchAndExecute() {
|
|
|
104
109
|
// Check if we can use global-accounts-intents, if yes, create an intent.
|
|
105
110
|
try {
|
|
106
111
|
await app.service("global-accounts-intents").create({
|
|
107
|
-
partnerId:
|
|
112
|
+
partnerId: partnerId,
|
|
108
113
|
chainId: targetChainId,
|
|
109
114
|
to: params.to,
|
|
110
115
|
data: params.data || "0x",
|
package/package.json
CHANGED
|
@@ -16,6 +16,13 @@ export interface UnifiedTransactionParams {
|
|
|
16
16
|
value: bigint;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
const partnerId =
|
|
20
|
+
String(process.env.PUBLIC_THIRDWEB_PARTNER_ID ||
|
|
21
|
+
process.env.NEXT_PUBLIC_THIRDWEB_PARTNER_ID ||
|
|
22
|
+
process.env.PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID ||
|
|
23
|
+
process.env.NEXT_PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID);
|
|
24
|
+
invariant(partnerId, "Partner ID is required");
|
|
25
|
+
|
|
19
26
|
export function useUnifiedChainSwitchAndExecute() {
|
|
20
27
|
const { data: walletClient } = useWalletClient();
|
|
21
28
|
const { switchChainAsync } = useSwitchChain();
|
|
@@ -130,9 +137,7 @@ export function useUnifiedChainSwitchAndExecute() {
|
|
|
130
137
|
// Check if we can use global-accounts-intents, if yes, create an intent.
|
|
131
138
|
try {
|
|
132
139
|
await app.service("global-accounts-intents").create({
|
|
133
|
-
partnerId:
|
|
134
|
-
process.env.PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID || process.env.NEXT_PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID,
|
|
135
|
-
),
|
|
140
|
+
partnerId: partnerId,
|
|
136
141
|
chainId: targetChainId,
|
|
137
142
|
to: params.to,
|
|
138
143
|
data: params.data || "0x",
|