@b3dotfun/sdk 0.0.40-alpha.19 → 0.0.40-alpha.20
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/anyspend/react/components/AnySpendBondKit.js +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +5 -7
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +0 -1
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +5 -7
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +0 -1
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +0 -1
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpendBondKit.tsx +0 -1
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +0 -1
- package/src/anyspend/react/components/AnySpendCustom.tsx +5 -7
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +0 -1
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +0 -1
|
@@ -202,7 +202,6 @@ function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddress, mi
|
|
|
202
202
|
args: [recipientAddress, (0, viem_1.parseEther)(b3Amount), BigInt(minTokensOut)],
|
|
203
203
|
});
|
|
204
204
|
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: supported_1.baseMainnet.id, dstToken: dstToken, dstAmount: (0, viem_1.parseEther)(b3Amount).toString(), contractAddress: contractAddress, encodedData: encodedData, metadata: {
|
|
205
|
-
type: "custom",
|
|
206
205
|
action: "BondKit Buy",
|
|
207
206
|
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
208
207
|
}
|
|
@@ -396,7 +396,6 @@ function AnySpendBuySpin({ loadOrder, mode = "modal", spinwheelContractAddress,
|
|
|
396
396
|
// AnySpend flow for when user needs to swap to B3
|
|
397
397
|
const encodedData = generateEncodedDataForBuyEntriesAndSpin(address || "", userSpinQuantity);
|
|
398
398
|
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: chainId, dstToken: anyspend_1.B3_TOKEN, dstAmount: totalCost.toString(), contractAddress: spinwheelContractAddress, spenderAddress: paymentConfig.entryModule, encodedData: encodedData, metadata: {
|
|
399
|
-
type: "custom",
|
|
400
399
|
action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`,
|
|
401
400
|
}, header: header, onSuccess: txHash => onSuccess?.(txHash), showRecipient: false }));
|
|
402
401
|
}
|
|
@@ -176,8 +176,8 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
176
176
|
dstToken: dstToken,
|
|
177
177
|
dstAmount: dstAmount,
|
|
178
178
|
contractAddress: contractAddress,
|
|
179
|
-
tokenId:
|
|
180
|
-
contractType:
|
|
179
|
+
tokenId: orderType === "mint_nft" ? metadata.nftContract.tokenId : undefined,
|
|
180
|
+
contractType: orderType === "mint_nft" ? metadata.nftContract.type : undefined,
|
|
181
181
|
encodedData: encodedData,
|
|
182
182
|
spenderAddress: spenderAddress,
|
|
183
183
|
});
|
|
@@ -190,7 +190,6 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
190
190
|
encodedData,
|
|
191
191
|
metadata?.nftContract?.tokenId,
|
|
192
192
|
metadata?.nftContract?.type,
|
|
193
|
-
metadata?.type,
|
|
194
193
|
orderType,
|
|
195
194
|
spenderAddress,
|
|
196
195
|
srcChainId,
|
|
@@ -267,7 +266,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
267
266
|
srcAmount: srcAmount.toString(),
|
|
268
267
|
recipientAddress,
|
|
269
268
|
creatorAddress: currentWallet?.wallet?.address,
|
|
270
|
-
nft:
|
|
269
|
+
nft: orderType === "mint_nft"
|
|
271
270
|
? metadata.nftContract.type === "erc1155"
|
|
272
271
|
? {
|
|
273
272
|
type: "erc1155",
|
|
@@ -288,7 +287,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
288
287
|
imageUrl: metadata.nftContract.imageUrl,
|
|
289
288
|
}
|
|
290
289
|
: undefined,
|
|
291
|
-
tournament:
|
|
290
|
+
tournament: orderType === "join_tournament" || orderType === "fund_tournament"
|
|
292
291
|
? {
|
|
293
292
|
...metadata.tournament,
|
|
294
293
|
contractAddress: contractAddress,
|
|
@@ -296,13 +295,12 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
296
295
|
}
|
|
297
296
|
: undefined,
|
|
298
297
|
// only populate payload for custom tx
|
|
299
|
-
payload:
|
|
298
|
+
payload: orderType === "custom"
|
|
300
299
|
? {
|
|
301
300
|
amount: dstAmount,
|
|
302
301
|
data: encodedData,
|
|
303
302
|
spenderAddress: spenderAddress,
|
|
304
303
|
to: contractAddress,
|
|
305
|
-
action: metadata.action,
|
|
306
304
|
}
|
|
307
305
|
: undefined,
|
|
308
306
|
};
|
|
@@ -264,7 +264,6 @@ function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmo
|
|
|
264
264
|
}
|
|
265
265
|
const encodedData = generateEncodedDataForStakingB3(userStakeAmount, recipientAddress);
|
|
266
266
|
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: chains_1.base.id, dstToken: anyspend_1.B3_TOKEN, dstAmount: userStakeAmount, contractAddress: ERC20Staking, encodedData: encodedData, metadata: {
|
|
267
|
-
type: "custom",
|
|
268
267
|
action: "stake B3",
|
|
269
268
|
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
270
269
|
}
|
|
@@ -73,7 +73,6 @@ function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, image
|
|
|
73
73
|
const encodedData = generateEncodedDataForSignatureMint(signatureData);
|
|
74
74
|
const price = (0, viem_1.parseEther)(signatureData.payload.price?.toString() || "0");
|
|
75
75
|
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: signatureData.payload.to, orderType: "custom", dstChainId: signatureData.collection.chainId, dstToken: dstToken, dstAmount: price.toString(), contractAddress: signatureData.collection.address, encodedData: encodedData, metadata: {
|
|
76
|
-
type: "custom",
|
|
77
76
|
action: "Signature Mint",
|
|
78
77
|
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
79
78
|
}
|
|
@@ -199,7 +199,6 @@ export function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddr
|
|
|
199
199
|
args: [recipientAddress, parseEther(b3Amount), BigInt(minTokensOut)],
|
|
200
200
|
});
|
|
201
201
|
return (_jsx(AnySpendCustom, { mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: baseMainnet.id, dstToken: dstToken, dstAmount: parseEther(b3Amount).toString(), contractAddress: contractAddress, encodedData: encodedData, metadata: {
|
|
202
|
-
type: "custom",
|
|
203
202
|
action: "BondKit Buy",
|
|
204
203
|
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
205
204
|
}
|
|
@@ -390,7 +390,6 @@ export function AnySpendBuySpin({ loadOrder, mode = "modal", spinwheelContractAd
|
|
|
390
390
|
// AnySpend flow for when user needs to swap to B3
|
|
391
391
|
const encodedData = generateEncodedDataForBuyEntriesAndSpin(address || "", userSpinQuantity);
|
|
392
392
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: chainId, dstToken: B3_TOKEN, dstAmount: totalCost.toString(), contractAddress: spinwheelContractAddress, spenderAddress: paymentConfig.entryModule, encodedData: encodedData, metadata: {
|
|
393
|
-
type: "custom",
|
|
394
393
|
action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`,
|
|
395
394
|
}, header: header, onSuccess: txHash => onSuccess?.(txHash), showRecipient: false }));
|
|
396
395
|
}
|
|
@@ -170,8 +170,8 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
170
170
|
dstToken: dstToken,
|
|
171
171
|
dstAmount: dstAmount,
|
|
172
172
|
contractAddress: contractAddress,
|
|
173
|
-
tokenId:
|
|
174
|
-
contractType:
|
|
173
|
+
tokenId: orderType === "mint_nft" ? metadata.nftContract.tokenId : undefined,
|
|
174
|
+
contractType: orderType === "mint_nft" ? metadata.nftContract.type : undefined,
|
|
175
175
|
encodedData: encodedData,
|
|
176
176
|
spenderAddress: spenderAddress,
|
|
177
177
|
});
|
|
@@ -184,7 +184,6 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
184
184
|
encodedData,
|
|
185
185
|
metadata?.nftContract?.tokenId,
|
|
186
186
|
metadata?.nftContract?.type,
|
|
187
|
-
metadata?.type,
|
|
188
187
|
orderType,
|
|
189
188
|
spenderAddress,
|
|
190
189
|
srcChainId,
|
|
@@ -261,7 +260,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
261
260
|
srcAmount: srcAmount.toString(),
|
|
262
261
|
recipientAddress,
|
|
263
262
|
creatorAddress: currentWallet?.wallet?.address,
|
|
264
|
-
nft:
|
|
263
|
+
nft: orderType === "mint_nft"
|
|
265
264
|
? metadata.nftContract.type === "erc1155"
|
|
266
265
|
? {
|
|
267
266
|
type: "erc1155",
|
|
@@ -282,7 +281,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
282
281
|
imageUrl: metadata.nftContract.imageUrl,
|
|
283
282
|
}
|
|
284
283
|
: undefined,
|
|
285
|
-
tournament:
|
|
284
|
+
tournament: orderType === "join_tournament" || orderType === "fund_tournament"
|
|
286
285
|
? {
|
|
287
286
|
...metadata.tournament,
|
|
288
287
|
contractAddress: contractAddress,
|
|
@@ -290,13 +289,12 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
290
289
|
}
|
|
291
290
|
: undefined,
|
|
292
291
|
// only populate payload for custom tx
|
|
293
|
-
payload:
|
|
292
|
+
payload: orderType === "custom"
|
|
294
293
|
? {
|
|
295
294
|
amount: dstAmount,
|
|
296
295
|
data: encodedData,
|
|
297
296
|
spenderAddress: spenderAddress,
|
|
298
297
|
to: contractAddress,
|
|
299
|
-
action: metadata.action,
|
|
300
298
|
}
|
|
301
299
|
: undefined,
|
|
302
300
|
};
|
|
@@ -258,7 +258,6 @@ export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, s
|
|
|
258
258
|
}
|
|
259
259
|
const encodedData = generateEncodedDataForStakingB3(userStakeAmount, recipientAddress);
|
|
260
260
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: base.id, dstToken: B3_TOKEN, dstAmount: userStakeAmount, contractAddress: ERC20Staking, encodedData: encodedData, metadata: {
|
|
261
|
-
type: "custom",
|
|
262
261
|
action: "stake B3",
|
|
263
262
|
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
264
263
|
}
|
|
@@ -67,7 +67,6 @@ export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData
|
|
|
67
67
|
const encodedData = generateEncodedDataForSignatureMint(signatureData);
|
|
68
68
|
const price = parseEther(signatureData.payload.price?.toString() || "0");
|
|
69
69
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: signatureData.payload.to, orderType: "custom", dstChainId: signatureData.collection.chainId, dstToken: dstToken, dstAmount: price.toString(), contractAddress: signatureData.collection.address, encodedData: encodedData, metadata: {
|
|
70
|
-
type: "custom",
|
|
71
70
|
action: "Signature Mint",
|
|
72
71
|
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
73
72
|
}
|
package/package.json
CHANGED
|
@@ -675,7 +675,6 @@ export function AnySpendBuySpin({
|
|
|
675
675
|
spenderAddress={paymentConfig.entryModule}
|
|
676
676
|
encodedData={encodedData}
|
|
677
677
|
metadata={{
|
|
678
|
-
type: "custom",
|
|
679
678
|
action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`,
|
|
680
679
|
}}
|
|
681
680
|
header={header}
|
|
@@ -314,8 +314,8 @@ function AnySpendCustomInner({
|
|
|
314
314
|
dstToken: dstToken,
|
|
315
315
|
dstAmount: dstAmount,
|
|
316
316
|
contractAddress: contractAddress,
|
|
317
|
-
tokenId:
|
|
318
|
-
contractType:
|
|
317
|
+
tokenId: orderType === "mint_nft" ? metadata.nftContract.tokenId : undefined,
|
|
318
|
+
contractType: orderType === "mint_nft" ? metadata.nftContract.type : undefined,
|
|
319
319
|
encodedData: encodedData,
|
|
320
320
|
spenderAddress: spenderAddress,
|
|
321
321
|
});
|
|
@@ -328,7 +328,6 @@ function AnySpendCustomInner({
|
|
|
328
328
|
encodedData,
|
|
329
329
|
metadata?.nftContract?.tokenId,
|
|
330
330
|
metadata?.nftContract?.type,
|
|
331
|
-
metadata?.type,
|
|
332
331
|
orderType,
|
|
333
332
|
spenderAddress,
|
|
334
333
|
srcChainId,
|
|
@@ -426,7 +425,7 @@ function AnySpendCustomInner({
|
|
|
426
425
|
recipientAddress,
|
|
427
426
|
creatorAddress: currentWallet?.wallet?.address,
|
|
428
427
|
nft:
|
|
429
|
-
|
|
428
|
+
orderType === "mint_nft"
|
|
430
429
|
? metadata.nftContract.type === "erc1155"
|
|
431
430
|
? {
|
|
432
431
|
type: "erc1155",
|
|
@@ -448,7 +447,7 @@ function AnySpendCustomInner({
|
|
|
448
447
|
}
|
|
449
448
|
: undefined,
|
|
450
449
|
tournament:
|
|
451
|
-
|
|
450
|
+
orderType === "join_tournament" || orderType === "fund_tournament"
|
|
452
451
|
? {
|
|
453
452
|
...metadata.tournament,
|
|
454
453
|
contractAddress: contractAddress,
|
|
@@ -457,13 +456,12 @@ function AnySpendCustomInner({
|
|
|
457
456
|
: undefined,
|
|
458
457
|
// only populate payload for custom tx
|
|
459
458
|
payload:
|
|
460
|
-
|
|
459
|
+
orderType === "custom"
|
|
461
460
|
? {
|
|
462
461
|
amount: dstAmount,
|
|
463
462
|
data: encodedData,
|
|
464
463
|
spenderAddress: spenderAddress,
|
|
465
464
|
to: contractAddress,
|
|
466
|
-
action: metadata.action,
|
|
467
465
|
}
|
|
468
466
|
: undefined,
|
|
469
467
|
} as CreateOrderParams;
|