@b3dotfun/sdk 0.0.40-alpha.22 → 0.0.40-alpha.24
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/hooks/useAnyspendFlow.js +1 -2
- package/dist/cjs/anyspend/types/api.d.ts +10 -0
- package/dist/cjs/anyspend/utils/orderPayload.js +2 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +1 -2
- package/dist/esm/anyspend/types/api.d.ts +10 -0
- package/dist/esm/anyspend/utils/orderPayload.js +2 -0
- package/dist/types/anyspend/types/api.d.ts +10 -0
- package/package.json +1 -1
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +1 -2
- package/src/anyspend/types/api.ts +10 -0
- package/src/anyspend/utils/orderPayload.ts +2 -0
|
@@ -117,8 +117,7 @@ function useAnyspendFlow({ paymentType = "crypto", recipientAddress, loadOrder,
|
|
|
117
117
|
dstChain: isDepositMode ? chains_1.base.id : selectedDstChainId, // For deposits, always Base; for swaps, use selected destination
|
|
118
118
|
srcTokenAddress: paymentType === "fiat" ? anyspend_1.USDC_BASE.address : selectedSrcToken.address,
|
|
119
119
|
dstTokenAddress: isDepositMode ? anyspend_1.B3_TOKEN.address : selectedSrcToken.address, // For deposits, always B3
|
|
120
|
-
type: "
|
|
121
|
-
tradeType: "EXACT_INPUT",
|
|
120
|
+
type: "hype_duel",
|
|
122
121
|
amount: activeInputAmountInWei,
|
|
123
122
|
recipientAddress: selectedRecipientAddress,
|
|
124
123
|
onrampVendor: paymentType === "fiat" ? getOnrampVendor(selectedFiatPaymentMethod) : undefined,
|
|
@@ -1117,6 +1117,11 @@ export interface components {
|
|
|
1117
1117
|
* @example 990000
|
|
1118
1118
|
*/
|
|
1119
1119
|
actualDstAmount: string | null;
|
|
1120
|
+
/**
|
|
1121
|
+
* @description Amount in after fee
|
|
1122
|
+
* @example 990000
|
|
1123
|
+
*/
|
|
1124
|
+
amountInAfterFee: string | null;
|
|
1120
1125
|
};
|
|
1121
1126
|
/** @description HypeDuel-specific payload */
|
|
1122
1127
|
HypeDuelPayload: {
|
|
@@ -1130,6 +1135,11 @@ export interface components {
|
|
|
1130
1135
|
* @example 990000
|
|
1131
1136
|
*/
|
|
1132
1137
|
actualDstAmount: string | null;
|
|
1138
|
+
/**
|
|
1139
|
+
* @description Amount in after fee
|
|
1140
|
+
* @example 990000
|
|
1141
|
+
*/
|
|
1142
|
+
amountInAfterFee: string | null;
|
|
1133
1143
|
};
|
|
1134
1144
|
/** @description Custom execution payload */
|
|
1135
1145
|
CustomPayload: {
|
|
@@ -9,6 +9,7 @@ const buildPayload = (orderType, params) => {
|
|
|
9
9
|
return {
|
|
10
10
|
expectedDstAmount,
|
|
11
11
|
actualDstAmount: null,
|
|
12
|
+
amountInAfterFee: null,
|
|
12
13
|
};
|
|
13
14
|
case "mint_nft":
|
|
14
15
|
if (nft?.type === "erc1155") {
|
|
@@ -46,6 +47,7 @@ const buildPayload = (orderType, params) => {
|
|
|
46
47
|
return {
|
|
47
48
|
expectedDstAmount,
|
|
48
49
|
actualDstAmount: null,
|
|
50
|
+
amountInAfterFee: null,
|
|
49
51
|
};
|
|
50
52
|
default:
|
|
51
53
|
throw new Error(`Invalid order type: ${orderType}`);
|
|
@@ -113,8 +113,7 @@ export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, load
|
|
|
113
113
|
dstChain: isDepositMode ? base.id : selectedDstChainId, // For deposits, always Base; for swaps, use selected destination
|
|
114
114
|
srcTokenAddress: paymentType === "fiat" ? USDC_BASE.address : selectedSrcToken.address,
|
|
115
115
|
dstTokenAddress: isDepositMode ? B3_TOKEN.address : selectedSrcToken.address, // For deposits, always B3
|
|
116
|
-
type: "
|
|
117
|
-
tradeType: "EXACT_INPUT",
|
|
116
|
+
type: "hype_duel",
|
|
118
117
|
amount: activeInputAmountInWei,
|
|
119
118
|
recipientAddress: selectedRecipientAddress,
|
|
120
119
|
onrampVendor: paymentType === "fiat" ? getOnrampVendor(selectedFiatPaymentMethod) : undefined,
|
|
@@ -1117,6 +1117,11 @@ export interface components {
|
|
|
1117
1117
|
* @example 990000
|
|
1118
1118
|
*/
|
|
1119
1119
|
actualDstAmount: string | null;
|
|
1120
|
+
/**
|
|
1121
|
+
* @description Amount in after fee
|
|
1122
|
+
* @example 990000
|
|
1123
|
+
*/
|
|
1124
|
+
amountInAfterFee: string | null;
|
|
1120
1125
|
};
|
|
1121
1126
|
/** @description HypeDuel-specific payload */
|
|
1122
1127
|
HypeDuelPayload: {
|
|
@@ -1130,6 +1135,11 @@ export interface components {
|
|
|
1130
1135
|
* @example 990000
|
|
1131
1136
|
*/
|
|
1132
1137
|
actualDstAmount: string | null;
|
|
1138
|
+
/**
|
|
1139
|
+
* @description Amount in after fee
|
|
1140
|
+
* @example 990000
|
|
1141
|
+
*/
|
|
1142
|
+
amountInAfterFee: string | null;
|
|
1133
1143
|
};
|
|
1134
1144
|
/** @description Custom execution payload */
|
|
1135
1145
|
CustomPayload: {
|
|
@@ -6,6 +6,7 @@ export const buildPayload = (orderType, params) => {
|
|
|
6
6
|
return {
|
|
7
7
|
expectedDstAmount,
|
|
8
8
|
actualDstAmount: null,
|
|
9
|
+
amountInAfterFee: null,
|
|
9
10
|
};
|
|
10
11
|
case "mint_nft":
|
|
11
12
|
if (nft?.type === "erc1155") {
|
|
@@ -43,6 +44,7 @@ export const buildPayload = (orderType, params) => {
|
|
|
43
44
|
return {
|
|
44
45
|
expectedDstAmount,
|
|
45
46
|
actualDstAmount: null,
|
|
47
|
+
amountInAfterFee: null,
|
|
46
48
|
};
|
|
47
49
|
default:
|
|
48
50
|
throw new Error(`Invalid order type: ${orderType}`);
|
|
@@ -1117,6 +1117,11 @@ export interface components {
|
|
|
1117
1117
|
* @example 990000
|
|
1118
1118
|
*/
|
|
1119
1119
|
actualDstAmount: string | null;
|
|
1120
|
+
/**
|
|
1121
|
+
* @description Amount in after fee
|
|
1122
|
+
* @example 990000
|
|
1123
|
+
*/
|
|
1124
|
+
amountInAfterFee: string | null;
|
|
1120
1125
|
};
|
|
1121
1126
|
/** @description HypeDuel-specific payload */
|
|
1122
1127
|
HypeDuelPayload: {
|
|
@@ -1130,6 +1135,11 @@ export interface components {
|
|
|
1130
1135
|
* @example 990000
|
|
1131
1136
|
*/
|
|
1132
1137
|
actualDstAmount: string | null;
|
|
1138
|
+
/**
|
|
1139
|
+
* @description Amount in after fee
|
|
1140
|
+
* @example 990000
|
|
1141
|
+
*/
|
|
1142
|
+
amountInAfterFee: string | null;
|
|
1133
1143
|
};
|
|
1134
1144
|
/** @description Custom execution payload */
|
|
1135
1145
|
CustomPayload: {
|
package/package.json
CHANGED
|
@@ -163,8 +163,7 @@ export function useAnyspendFlow({
|
|
|
163
163
|
dstChain: isDepositMode ? base.id : selectedDstChainId, // For deposits, always Base; for swaps, use selected destination
|
|
164
164
|
srcTokenAddress: paymentType === "fiat" ? USDC_BASE.address : selectedSrcToken.address,
|
|
165
165
|
dstTokenAddress: isDepositMode ? B3_TOKEN.address : selectedSrcToken.address, // For deposits, always B3
|
|
166
|
-
type: "
|
|
167
|
-
tradeType: "EXACT_INPUT",
|
|
166
|
+
type: "hype_duel",
|
|
168
167
|
amount: activeInputAmountInWei,
|
|
169
168
|
recipientAddress: selectedRecipientAddress,
|
|
170
169
|
onrampVendor: paymentType === "fiat" ? getOnrampVendor(selectedFiatPaymentMethod) : undefined,
|
|
@@ -1124,6 +1124,11 @@ export interface components {
|
|
|
1124
1124
|
* @example 990000
|
|
1125
1125
|
*/
|
|
1126
1126
|
actualDstAmount: string | null;
|
|
1127
|
+
/**
|
|
1128
|
+
* @description Amount in after fee
|
|
1129
|
+
* @example 990000
|
|
1130
|
+
*/
|
|
1131
|
+
amountInAfterFee: string | null;
|
|
1127
1132
|
};
|
|
1128
1133
|
/** @description HypeDuel-specific payload */
|
|
1129
1134
|
HypeDuelPayload: {
|
|
@@ -1137,6 +1142,11 @@ export interface components {
|
|
|
1137
1142
|
* @example 990000
|
|
1138
1143
|
*/
|
|
1139
1144
|
actualDstAmount: string | null;
|
|
1145
|
+
/**
|
|
1146
|
+
* @description Amount in after fee
|
|
1147
|
+
* @example 990000
|
|
1148
|
+
*/
|
|
1149
|
+
amountInAfterFee: string | null;
|
|
1140
1150
|
};
|
|
1141
1151
|
/** @description Custom execution payload */
|
|
1142
1152
|
CustomPayload: {
|
|
@@ -18,6 +18,7 @@ export const buildPayload = (orderType: components["schemas"]["Order"]["type"],
|
|
|
18
18
|
return {
|
|
19
19
|
expectedDstAmount,
|
|
20
20
|
actualDstAmount: null,
|
|
21
|
+
amountInAfterFee: null,
|
|
21
22
|
};
|
|
22
23
|
case "mint_nft":
|
|
23
24
|
if (nft?.type === "erc1155") {
|
|
@@ -53,6 +54,7 @@ export const buildPayload = (orderType: components["schemas"]["Order"]["type"],
|
|
|
53
54
|
return {
|
|
54
55
|
expectedDstAmount,
|
|
55
56
|
actualDstAmount: null,
|
|
57
|
+
amountInAfterFee: null,
|
|
56
58
|
};
|
|
57
59
|
default:
|
|
58
60
|
throw new Error(`Invalid order type: ${orderType}`);
|