@b3dotfun/sdk 0.0.44-alpha.0 → 0.0.44-alpha.1
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/common/OrderDetails.js +1 -6
- package/dist/cjs/anyspend/react/components/common/OrderHistoryItem.js +1 -6
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +3 -3
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +2 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +36 -0
- package/dist/cjs/anyspend/types/api.d.ts +13 -10
- package/dist/cjs/anyspend/utils/orderPayload.js +0 -4
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +1 -6
- package/dist/esm/anyspend/react/components/common/OrderHistoryItem.js +1 -6
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +3 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +2 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +36 -0
- package/dist/esm/anyspend/types/api.d.ts +13 -10
- package/dist/esm/anyspend/utils/orderPayload.js +0 -4
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +2 -0
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +36 -0
- package/dist/types/anyspend/types/api.d.ts +13 -10
- package/package.json +1 -1
- package/src/anyspend/react/components/common/OrderDetails.tsx +1 -7
- package/src/anyspend/react/components/common/OrderHistoryItem.tsx +1 -7
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +3 -3
- package/src/anyspend/types/api.ts +13 -10
- package/src/anyspend/utils/orderPayload.ts +0 -4
|
@@ -280,12 +280,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
280
280
|
? "0"
|
|
281
281
|
: order.payload.expectedDstAmount.toString();
|
|
282
282
|
const formattedExpectedDstAmount = (0, number_1.formatTokenAmount)(BigInt(expectedDstAmount), dstToken.decimals);
|
|
283
|
-
const actualDstAmount = order.
|
|
284
|
-
order.type === "join_tournament" ||
|
|
285
|
-
order.type === "fund_tournament" ||
|
|
286
|
-
order.type === "custom"
|
|
287
|
-
? undefined
|
|
288
|
-
: order.payload.actualDstAmount;
|
|
283
|
+
const actualDstAmount = order.settlement?.actualDstAmount;
|
|
289
284
|
const formattedActualDstAmount = actualDstAmount
|
|
290
285
|
? (0, number_1.formatTokenAmount)(BigInt(actualDstAmount), dstToken.decimals)
|
|
291
286
|
: undefined;
|
|
@@ -16,12 +16,7 @@ function OrderHistoryItem({ order, onSelectOrder, mode }) {
|
|
|
16
16
|
const nft = order.type === "mint_nft" ? order.metadata.nft : undefined;
|
|
17
17
|
const tournament = order.type === "join_tournament" || order.type === "fund_tournament" ? order.metadata.tournament : undefined;
|
|
18
18
|
const dstToken = order.metadata.dstToken;
|
|
19
|
-
const actualDstAmount = order.
|
|
20
|
-
order.type === "join_tournament" ||
|
|
21
|
-
order.type === "fund_tournament" ||
|
|
22
|
-
order.type === "custom"
|
|
23
|
-
? undefined
|
|
24
|
-
: order.payload.actualDstAmount;
|
|
19
|
+
const actualDstAmount = order.settlement?.actualDstAmount;
|
|
25
20
|
const expectedDstAmount = order.type === "mint_nft" ||
|
|
26
21
|
order.type === "join_tournament" ||
|
|
27
22
|
order.type === "fund_tournament" ||
|
|
@@ -36,6 +36,7 @@ export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrd
|
|
|
36
36
|
relayTxs: components["schemas"]["RelayTx"][];
|
|
37
37
|
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
38
38
|
refundTxs: components["schemas"]["RefundTx"][];
|
|
39
|
+
points: number | null;
|
|
39
40
|
};
|
|
40
41
|
statusCode: number;
|
|
41
42
|
} | undefined;
|
|
@@ -192,8 +192,8 @@ function useAnyspendFlow({ paymentType = "crypto", recipientAddress, loadOrder,
|
|
|
192
192
|
// Handle order completion
|
|
193
193
|
(0, react_3.useEffect)(() => {
|
|
194
194
|
if (oat?.data?.order.status === "executed") {
|
|
195
|
-
// get the actualDstAmount if available from
|
|
196
|
-
const amount = oat.data.order.
|
|
195
|
+
// get the actualDstAmount if available from settlement
|
|
196
|
+
const amount = oat.data.order.settlement?.actualDstAmount;
|
|
197
197
|
const formattedActualDstAmount = amount
|
|
198
198
|
? (0, number_1.formatTokenAmount)(BigInt(amount), oat.data.order.metadata.dstToken.decimals)
|
|
199
199
|
: undefined;
|
|
@@ -201,7 +201,7 @@ function useAnyspendFlow({ paymentType = "crypto", recipientAddress, loadOrder,
|
|
|
201
201
|
}
|
|
202
202
|
}, [
|
|
203
203
|
oat?.data?.order.status,
|
|
204
|
-
oat?.data?.order.
|
|
204
|
+
oat?.data?.order.settlement?.actualDstAmount,
|
|
205
205
|
onTransactionSuccess,
|
|
206
206
|
oat?.data?.order.metadata.dstToken.decimals,
|
|
207
207
|
]);
|
|
@@ -8,6 +8,7 @@ export declare function useAnyspendOrderAndTransactions(orderId: string | undefi
|
|
|
8
8
|
relayTxs: import("../..").components["schemas"]["RelayTx"][];
|
|
9
9
|
executeTx: import("../..").components["schemas"]["ExecuteTx"] | null;
|
|
10
10
|
refundTxs: import("../..").components["schemas"]["RefundTx"][];
|
|
11
|
+
points: number | null;
|
|
11
12
|
};
|
|
12
13
|
statusCode: number;
|
|
13
14
|
} | undefined;
|
|
@@ -22,6 +23,7 @@ export declare function useAnyspendOrderAndTransactions(orderId: string | undefi
|
|
|
22
23
|
relayTxs: import("../..").components["schemas"]["RelayTx"][];
|
|
23
24
|
executeTx: import("../..").components["schemas"]["ExecuteTx"] | null;
|
|
24
25
|
refundTxs: import("../..").components["schemas"]["RefundTx"][];
|
|
26
|
+
points: number | null;
|
|
25
27
|
};
|
|
26
28
|
statusCode: number;
|
|
27
29
|
}, Error>>;
|
|
@@ -18,6 +18,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
18
18
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
19
19
|
oneClickBuyUrl: string | null;
|
|
20
20
|
stripePaymentIntentId: string | null;
|
|
21
|
+
settlement: {
|
|
22
|
+
actualDstAmount: string | null;
|
|
23
|
+
} | null;
|
|
21
24
|
} & {
|
|
22
25
|
type: "swap";
|
|
23
26
|
payload: import("../..").components["schemas"]["SwapPayload"];
|
|
@@ -41,6 +44,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
41
44
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
42
45
|
oneClickBuyUrl: string | null;
|
|
43
46
|
stripePaymentIntentId: string | null;
|
|
47
|
+
settlement: {
|
|
48
|
+
actualDstAmount: string | null;
|
|
49
|
+
} | null;
|
|
44
50
|
} & {
|
|
45
51
|
type: "hype_duel";
|
|
46
52
|
payload: import("../..").components["schemas"]["HypeDuelPayload"];
|
|
@@ -64,6 +70,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
64
70
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
65
71
|
oneClickBuyUrl: string | null;
|
|
66
72
|
stripePaymentIntentId: string | null;
|
|
73
|
+
settlement: {
|
|
74
|
+
actualDstAmount: string | null;
|
|
75
|
+
} | null;
|
|
67
76
|
} & {
|
|
68
77
|
type: "custom";
|
|
69
78
|
payload: import("../..").components["schemas"]["CustomPayload"];
|
|
@@ -87,6 +96,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
87
96
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
88
97
|
oneClickBuyUrl: string | null;
|
|
89
98
|
stripePaymentIntentId: string | null;
|
|
99
|
+
settlement: {
|
|
100
|
+
actualDstAmount: string | null;
|
|
101
|
+
} | null;
|
|
90
102
|
} & {
|
|
91
103
|
type: "mint_nft";
|
|
92
104
|
payload: import("../..").components["schemas"]["MintNftPayload"];
|
|
@@ -110,6 +122,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
110
122
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
111
123
|
oneClickBuyUrl: string | null;
|
|
112
124
|
stripePaymentIntentId: string | null;
|
|
125
|
+
settlement: {
|
|
126
|
+
actualDstAmount: string | null;
|
|
127
|
+
} | null;
|
|
113
128
|
} & {
|
|
114
129
|
type: "join_tournament";
|
|
115
130
|
payload: import("../..").components["schemas"]["JoinTournamentPayload"];
|
|
@@ -133,6 +148,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
133
148
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
134
149
|
oneClickBuyUrl: string | null;
|
|
135
150
|
stripePaymentIntentId: string | null;
|
|
151
|
+
settlement: {
|
|
152
|
+
actualDstAmount: string | null;
|
|
153
|
+
} | null;
|
|
136
154
|
} & {
|
|
137
155
|
type: "fund_tournament";
|
|
138
156
|
payload: import("../..").components["schemas"]["FundTournamentPayload"];
|
|
@@ -159,6 +177,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
159
177
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
160
178
|
oneClickBuyUrl: string | null;
|
|
161
179
|
stripePaymentIntentId: string | null;
|
|
180
|
+
settlement: {
|
|
181
|
+
actualDstAmount: string | null;
|
|
182
|
+
} | null;
|
|
162
183
|
} & {
|
|
163
184
|
type: "swap";
|
|
164
185
|
payload: import("../..").components["schemas"]["SwapPayload"];
|
|
@@ -182,6 +203,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
182
203
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
183
204
|
oneClickBuyUrl: string | null;
|
|
184
205
|
stripePaymentIntentId: string | null;
|
|
206
|
+
settlement: {
|
|
207
|
+
actualDstAmount: string | null;
|
|
208
|
+
} | null;
|
|
185
209
|
} & {
|
|
186
210
|
type: "hype_duel";
|
|
187
211
|
payload: import("../..").components["schemas"]["HypeDuelPayload"];
|
|
@@ -205,6 +229,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
205
229
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
206
230
|
oneClickBuyUrl: string | null;
|
|
207
231
|
stripePaymentIntentId: string | null;
|
|
232
|
+
settlement: {
|
|
233
|
+
actualDstAmount: string | null;
|
|
234
|
+
} | null;
|
|
208
235
|
} & {
|
|
209
236
|
type: "custom";
|
|
210
237
|
payload: import("../..").components["schemas"]["CustomPayload"];
|
|
@@ -228,6 +255,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
228
255
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
229
256
|
oneClickBuyUrl: string | null;
|
|
230
257
|
stripePaymentIntentId: string | null;
|
|
258
|
+
settlement: {
|
|
259
|
+
actualDstAmount: string | null;
|
|
260
|
+
} | null;
|
|
231
261
|
} & {
|
|
232
262
|
type: "mint_nft";
|
|
233
263
|
payload: import("../..").components["schemas"]["MintNftPayload"];
|
|
@@ -251,6 +281,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
251
281
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
252
282
|
oneClickBuyUrl: string | null;
|
|
253
283
|
stripePaymentIntentId: string | null;
|
|
284
|
+
settlement: {
|
|
285
|
+
actualDstAmount: string | null;
|
|
286
|
+
} | null;
|
|
254
287
|
} & {
|
|
255
288
|
type: "join_tournament";
|
|
256
289
|
payload: import("../..").components["schemas"]["JoinTournamentPayload"];
|
|
@@ -274,6 +307,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
274
307
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
275
308
|
oneClickBuyUrl: string | null;
|
|
276
309
|
stripePaymentIntentId: string | null;
|
|
310
|
+
settlement: {
|
|
311
|
+
actualDstAmount: string | null;
|
|
312
|
+
} | null;
|
|
277
313
|
} & {
|
|
278
314
|
type: "fund_tournament";
|
|
279
315
|
payload: import("../..").components["schemas"]["FundTournamentPayload"];
|
|
@@ -434,6 +434,11 @@ export interface paths {
|
|
|
434
434
|
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
435
435
|
/** @description Refund transactions if order failed */
|
|
436
436
|
refundTxs: components["schemas"]["RefundTx"][];
|
|
437
|
+
/**
|
|
438
|
+
* @description Points awarded for this order (only present when order status is executed)
|
|
439
|
+
* @example 100
|
|
440
|
+
*/
|
|
441
|
+
points: number | null;
|
|
437
442
|
};
|
|
438
443
|
/** @example 200 */
|
|
439
444
|
statusCode: number;
|
|
@@ -1112,11 +1117,6 @@ export interface components {
|
|
|
1112
1117
|
* @example 990000
|
|
1113
1118
|
*/
|
|
1114
1119
|
expectedDstAmount: string;
|
|
1115
|
-
/**
|
|
1116
|
-
* @description Actual received amount (null for new orders)
|
|
1117
|
-
* @example 990000
|
|
1118
|
-
*/
|
|
1119
|
-
actualDstAmount: string | null;
|
|
1120
1120
|
};
|
|
1121
1121
|
/** @description HypeDuel-specific payload */
|
|
1122
1122
|
HypeDuelPayload: {
|
|
@@ -1125,11 +1125,6 @@ export interface components {
|
|
|
1125
1125
|
* @example 990000
|
|
1126
1126
|
*/
|
|
1127
1127
|
expectedDstAmount: string;
|
|
1128
|
-
/**
|
|
1129
|
-
* @description Actual received amount (null for new orders)
|
|
1130
|
-
* @example 990000
|
|
1131
|
-
*/
|
|
1132
|
-
actualDstAmount: string | null;
|
|
1133
1128
|
};
|
|
1134
1129
|
/** @description Custom execution payload */
|
|
1135
1130
|
CustomPayload: {
|
|
@@ -1315,6 +1310,14 @@ export interface components {
|
|
|
1315
1310
|
* @example pi_3Rko0sJnoDg53PsP0PDLsHkR
|
|
1316
1311
|
*/
|
|
1317
1312
|
stripePaymentIntentId: string | null;
|
|
1313
|
+
/** @description Settlement information for executed orders */
|
|
1314
|
+
settlement: {
|
|
1315
|
+
/**
|
|
1316
|
+
* @description Actual received amount after execution
|
|
1317
|
+
* @example 990000
|
|
1318
|
+
*/
|
|
1319
|
+
actualDstAmount: string | null;
|
|
1320
|
+
} | null;
|
|
1318
1321
|
};
|
|
1319
1322
|
SwapOrder: components["schemas"]["BaseOrder"] & {
|
|
1320
1323
|
/**
|
|
@@ -8,8 +8,6 @@ const buildPayload = (orderType, params) => {
|
|
|
8
8
|
case "swap":
|
|
9
9
|
return {
|
|
10
10
|
expectedDstAmount,
|
|
11
|
-
actualDstAmount: null,
|
|
12
|
-
amountInAfterFee: null,
|
|
13
11
|
};
|
|
14
12
|
case "mint_nft":
|
|
15
13
|
if (nft?.type === "erc1155") {
|
|
@@ -46,8 +44,6 @@ const buildPayload = (orderType, params) => {
|
|
|
46
44
|
case "hype_duel":
|
|
47
45
|
return {
|
|
48
46
|
expectedDstAmount,
|
|
49
|
-
actualDstAmount: null,
|
|
50
|
-
amountInAfterFee: null,
|
|
51
47
|
};
|
|
52
48
|
default:
|
|
53
49
|
throw new Error(`Invalid order type: ${orderType}`);
|
|
@@ -274,12 +274,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
274
274
|
? "0"
|
|
275
275
|
: order.payload.expectedDstAmount.toString();
|
|
276
276
|
const formattedExpectedDstAmount = formatTokenAmount(BigInt(expectedDstAmount), dstToken.decimals);
|
|
277
|
-
const actualDstAmount = order.
|
|
278
|
-
order.type === "join_tournament" ||
|
|
279
|
-
order.type === "fund_tournament" ||
|
|
280
|
-
order.type === "custom"
|
|
281
|
-
? undefined
|
|
282
|
-
: order.payload.actualDstAmount;
|
|
277
|
+
const actualDstAmount = order.settlement?.actualDstAmount;
|
|
283
278
|
const formattedActualDstAmount = actualDstAmount
|
|
284
279
|
? formatTokenAmount(BigInt(actualDstAmount), dstToken.decimals)
|
|
285
280
|
: undefined;
|
|
@@ -10,12 +10,7 @@ export function OrderHistoryItem({ order, onSelectOrder, mode }) {
|
|
|
10
10
|
const nft = order.type === "mint_nft" ? order.metadata.nft : undefined;
|
|
11
11
|
const tournament = order.type === "join_tournament" || order.type === "fund_tournament" ? order.metadata.tournament : undefined;
|
|
12
12
|
const dstToken = order.metadata.dstToken;
|
|
13
|
-
const actualDstAmount = order.
|
|
14
|
-
order.type === "join_tournament" ||
|
|
15
|
-
order.type === "fund_tournament" ||
|
|
16
|
-
order.type === "custom"
|
|
17
|
-
? undefined
|
|
18
|
-
: order.payload.actualDstAmount;
|
|
13
|
+
const actualDstAmount = order.settlement?.actualDstAmount;
|
|
19
14
|
const expectedDstAmount = order.type === "mint_nft" ||
|
|
20
15
|
order.type === "join_tournament" ||
|
|
21
16
|
order.type === "fund_tournament" ||
|
|
@@ -36,6 +36,7 @@ export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrd
|
|
|
36
36
|
relayTxs: components["schemas"]["RelayTx"][];
|
|
37
37
|
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
38
38
|
refundTxs: components["schemas"]["RefundTx"][];
|
|
39
|
+
points: number | null;
|
|
39
40
|
};
|
|
40
41
|
statusCode: number;
|
|
41
42
|
} | undefined;
|
|
@@ -188,8 +188,8 @@ export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, load
|
|
|
188
188
|
// Handle order completion
|
|
189
189
|
useEffect(() => {
|
|
190
190
|
if (oat?.data?.order.status === "executed") {
|
|
191
|
-
// get the actualDstAmount if available from
|
|
192
|
-
const amount = oat.data.order.
|
|
191
|
+
// get the actualDstAmount if available from settlement
|
|
192
|
+
const amount = oat.data.order.settlement?.actualDstAmount;
|
|
193
193
|
const formattedActualDstAmount = amount
|
|
194
194
|
? formatTokenAmount(BigInt(amount), oat.data.order.metadata.dstToken.decimals)
|
|
195
195
|
: undefined;
|
|
@@ -197,7 +197,7 @@ export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, load
|
|
|
197
197
|
}
|
|
198
198
|
}, [
|
|
199
199
|
oat?.data?.order.status,
|
|
200
|
-
oat?.data?.order.
|
|
200
|
+
oat?.data?.order.settlement?.actualDstAmount,
|
|
201
201
|
onTransactionSuccess,
|
|
202
202
|
oat?.data?.order.metadata.dstToken.decimals,
|
|
203
203
|
]);
|
|
@@ -8,6 +8,7 @@ export declare function useAnyspendOrderAndTransactions(orderId: string | undefi
|
|
|
8
8
|
relayTxs: import("../..").components["schemas"]["RelayTx"][];
|
|
9
9
|
executeTx: import("../..").components["schemas"]["ExecuteTx"] | null;
|
|
10
10
|
refundTxs: import("../..").components["schemas"]["RefundTx"][];
|
|
11
|
+
points: number | null;
|
|
11
12
|
};
|
|
12
13
|
statusCode: number;
|
|
13
14
|
} | undefined;
|
|
@@ -22,6 +23,7 @@ export declare function useAnyspendOrderAndTransactions(orderId: string | undefi
|
|
|
22
23
|
relayTxs: import("../..").components["schemas"]["RelayTx"][];
|
|
23
24
|
executeTx: import("../..").components["schemas"]["ExecuteTx"] | null;
|
|
24
25
|
refundTxs: import("../..").components["schemas"]["RefundTx"][];
|
|
26
|
+
points: number | null;
|
|
25
27
|
};
|
|
26
28
|
statusCode: number;
|
|
27
29
|
}, Error>>;
|
|
@@ -18,6 +18,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
18
18
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
19
19
|
oneClickBuyUrl: string | null;
|
|
20
20
|
stripePaymentIntentId: string | null;
|
|
21
|
+
settlement: {
|
|
22
|
+
actualDstAmount: string | null;
|
|
23
|
+
} | null;
|
|
21
24
|
} & {
|
|
22
25
|
type: "swap";
|
|
23
26
|
payload: import("../..").components["schemas"]["SwapPayload"];
|
|
@@ -41,6 +44,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
41
44
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
42
45
|
oneClickBuyUrl: string | null;
|
|
43
46
|
stripePaymentIntentId: string | null;
|
|
47
|
+
settlement: {
|
|
48
|
+
actualDstAmount: string | null;
|
|
49
|
+
} | null;
|
|
44
50
|
} & {
|
|
45
51
|
type: "hype_duel";
|
|
46
52
|
payload: import("../..").components["schemas"]["HypeDuelPayload"];
|
|
@@ -64,6 +70,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
64
70
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
65
71
|
oneClickBuyUrl: string | null;
|
|
66
72
|
stripePaymentIntentId: string | null;
|
|
73
|
+
settlement: {
|
|
74
|
+
actualDstAmount: string | null;
|
|
75
|
+
} | null;
|
|
67
76
|
} & {
|
|
68
77
|
type: "custom";
|
|
69
78
|
payload: import("../..").components["schemas"]["CustomPayload"];
|
|
@@ -87,6 +96,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
87
96
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
88
97
|
oneClickBuyUrl: string | null;
|
|
89
98
|
stripePaymentIntentId: string | null;
|
|
99
|
+
settlement: {
|
|
100
|
+
actualDstAmount: string | null;
|
|
101
|
+
} | null;
|
|
90
102
|
} & {
|
|
91
103
|
type: "mint_nft";
|
|
92
104
|
payload: import("../..").components["schemas"]["MintNftPayload"];
|
|
@@ -110,6 +122,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
110
122
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
111
123
|
oneClickBuyUrl: string | null;
|
|
112
124
|
stripePaymentIntentId: string | null;
|
|
125
|
+
settlement: {
|
|
126
|
+
actualDstAmount: string | null;
|
|
127
|
+
} | null;
|
|
113
128
|
} & {
|
|
114
129
|
type: "join_tournament";
|
|
115
130
|
payload: import("../..").components["schemas"]["JoinTournamentPayload"];
|
|
@@ -133,6 +148,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
133
148
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
134
149
|
oneClickBuyUrl: string | null;
|
|
135
150
|
stripePaymentIntentId: string | null;
|
|
151
|
+
settlement: {
|
|
152
|
+
actualDstAmount: string | null;
|
|
153
|
+
} | null;
|
|
136
154
|
} & {
|
|
137
155
|
type: "fund_tournament";
|
|
138
156
|
payload: import("../..").components["schemas"]["FundTournamentPayload"];
|
|
@@ -159,6 +177,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
159
177
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
160
178
|
oneClickBuyUrl: string | null;
|
|
161
179
|
stripePaymentIntentId: string | null;
|
|
180
|
+
settlement: {
|
|
181
|
+
actualDstAmount: string | null;
|
|
182
|
+
} | null;
|
|
162
183
|
} & {
|
|
163
184
|
type: "swap";
|
|
164
185
|
payload: import("../..").components["schemas"]["SwapPayload"];
|
|
@@ -182,6 +203,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
182
203
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
183
204
|
oneClickBuyUrl: string | null;
|
|
184
205
|
stripePaymentIntentId: string | null;
|
|
206
|
+
settlement: {
|
|
207
|
+
actualDstAmount: string | null;
|
|
208
|
+
} | null;
|
|
185
209
|
} & {
|
|
186
210
|
type: "hype_duel";
|
|
187
211
|
payload: import("../..").components["schemas"]["HypeDuelPayload"];
|
|
@@ -205,6 +229,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
205
229
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
206
230
|
oneClickBuyUrl: string | null;
|
|
207
231
|
stripePaymentIntentId: string | null;
|
|
232
|
+
settlement: {
|
|
233
|
+
actualDstAmount: string | null;
|
|
234
|
+
} | null;
|
|
208
235
|
} & {
|
|
209
236
|
type: "custom";
|
|
210
237
|
payload: import("../..").components["schemas"]["CustomPayload"];
|
|
@@ -228,6 +255,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
228
255
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
229
256
|
oneClickBuyUrl: string | null;
|
|
230
257
|
stripePaymentIntentId: string | null;
|
|
258
|
+
settlement: {
|
|
259
|
+
actualDstAmount: string | null;
|
|
260
|
+
} | null;
|
|
231
261
|
} & {
|
|
232
262
|
type: "mint_nft";
|
|
233
263
|
payload: import("../..").components["schemas"]["MintNftPayload"];
|
|
@@ -251,6 +281,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
251
281
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
252
282
|
oneClickBuyUrl: string | null;
|
|
253
283
|
stripePaymentIntentId: string | null;
|
|
284
|
+
settlement: {
|
|
285
|
+
actualDstAmount: string | null;
|
|
286
|
+
} | null;
|
|
254
287
|
} & {
|
|
255
288
|
type: "join_tournament";
|
|
256
289
|
payload: import("../..").components["schemas"]["JoinTournamentPayload"];
|
|
@@ -274,6 +307,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
274
307
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
275
308
|
oneClickBuyUrl: string | null;
|
|
276
309
|
stripePaymentIntentId: string | null;
|
|
310
|
+
settlement: {
|
|
311
|
+
actualDstAmount: string | null;
|
|
312
|
+
} | null;
|
|
277
313
|
} & {
|
|
278
314
|
type: "fund_tournament";
|
|
279
315
|
payload: import("../..").components["schemas"]["FundTournamentPayload"];
|
|
@@ -434,6 +434,11 @@ export interface paths {
|
|
|
434
434
|
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
435
435
|
/** @description Refund transactions if order failed */
|
|
436
436
|
refundTxs: components["schemas"]["RefundTx"][];
|
|
437
|
+
/**
|
|
438
|
+
* @description Points awarded for this order (only present when order status is executed)
|
|
439
|
+
* @example 100
|
|
440
|
+
*/
|
|
441
|
+
points: number | null;
|
|
437
442
|
};
|
|
438
443
|
/** @example 200 */
|
|
439
444
|
statusCode: number;
|
|
@@ -1112,11 +1117,6 @@ export interface components {
|
|
|
1112
1117
|
* @example 990000
|
|
1113
1118
|
*/
|
|
1114
1119
|
expectedDstAmount: string;
|
|
1115
|
-
/**
|
|
1116
|
-
* @description Actual received amount (null for new orders)
|
|
1117
|
-
* @example 990000
|
|
1118
|
-
*/
|
|
1119
|
-
actualDstAmount: string | null;
|
|
1120
1120
|
};
|
|
1121
1121
|
/** @description HypeDuel-specific payload */
|
|
1122
1122
|
HypeDuelPayload: {
|
|
@@ -1125,11 +1125,6 @@ export interface components {
|
|
|
1125
1125
|
* @example 990000
|
|
1126
1126
|
*/
|
|
1127
1127
|
expectedDstAmount: string;
|
|
1128
|
-
/**
|
|
1129
|
-
* @description Actual received amount (null for new orders)
|
|
1130
|
-
* @example 990000
|
|
1131
|
-
*/
|
|
1132
|
-
actualDstAmount: string | null;
|
|
1133
1128
|
};
|
|
1134
1129
|
/** @description Custom execution payload */
|
|
1135
1130
|
CustomPayload: {
|
|
@@ -1315,6 +1310,14 @@ export interface components {
|
|
|
1315
1310
|
* @example pi_3Rko0sJnoDg53PsP0PDLsHkR
|
|
1316
1311
|
*/
|
|
1317
1312
|
stripePaymentIntentId: string | null;
|
|
1313
|
+
/** @description Settlement information for executed orders */
|
|
1314
|
+
settlement: {
|
|
1315
|
+
/**
|
|
1316
|
+
* @description Actual received amount after execution
|
|
1317
|
+
* @example 990000
|
|
1318
|
+
*/
|
|
1319
|
+
actualDstAmount: string | null;
|
|
1320
|
+
} | null;
|
|
1318
1321
|
};
|
|
1319
1322
|
SwapOrder: components["schemas"]["BaseOrder"] & {
|
|
1320
1323
|
/**
|
|
@@ -5,8 +5,6 @@ export const buildPayload = (orderType, params) => {
|
|
|
5
5
|
case "swap":
|
|
6
6
|
return {
|
|
7
7
|
expectedDstAmount,
|
|
8
|
-
actualDstAmount: null,
|
|
9
|
-
amountInAfterFee: null,
|
|
10
8
|
};
|
|
11
9
|
case "mint_nft":
|
|
12
10
|
if (nft?.type === "erc1155") {
|
|
@@ -43,8 +41,6 @@ export const buildPayload = (orderType, params) => {
|
|
|
43
41
|
case "hype_duel":
|
|
44
42
|
return {
|
|
45
43
|
expectedDstAmount,
|
|
46
|
-
actualDstAmount: null,
|
|
47
|
-
amountInAfterFee: null,
|
|
48
44
|
};
|
|
49
45
|
default:
|
|
50
46
|
throw new Error(`Invalid order type: ${orderType}`);
|
|
@@ -36,6 +36,7 @@ export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrd
|
|
|
36
36
|
relayTxs: components["schemas"]["RelayTx"][];
|
|
37
37
|
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
38
38
|
refundTxs: components["schemas"]["RefundTx"][];
|
|
39
|
+
points: number | null;
|
|
39
40
|
};
|
|
40
41
|
statusCode: number;
|
|
41
42
|
} | undefined;
|
|
@@ -8,6 +8,7 @@ export declare function useAnyspendOrderAndTransactions(orderId: string | undefi
|
|
|
8
8
|
relayTxs: import("../..").components["schemas"]["RelayTx"][];
|
|
9
9
|
executeTx: import("../..").components["schemas"]["ExecuteTx"] | null;
|
|
10
10
|
refundTxs: import("../..").components["schemas"]["RefundTx"][];
|
|
11
|
+
points: number | null;
|
|
11
12
|
};
|
|
12
13
|
statusCode: number;
|
|
13
14
|
} | undefined;
|
|
@@ -22,6 +23,7 @@ export declare function useAnyspendOrderAndTransactions(orderId: string | undefi
|
|
|
22
23
|
relayTxs: import("../..").components["schemas"]["RelayTx"][];
|
|
23
24
|
executeTx: import("../..").components["schemas"]["ExecuteTx"] | null;
|
|
24
25
|
refundTxs: import("../..").components["schemas"]["RefundTx"][];
|
|
26
|
+
points: number | null;
|
|
25
27
|
};
|
|
26
28
|
statusCode: number;
|
|
27
29
|
}, Error>>;
|
|
@@ -18,6 +18,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
18
18
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
19
19
|
oneClickBuyUrl: string | null;
|
|
20
20
|
stripePaymentIntentId: string | null;
|
|
21
|
+
settlement: {
|
|
22
|
+
actualDstAmount: string | null;
|
|
23
|
+
} | null;
|
|
21
24
|
} & {
|
|
22
25
|
type: "swap";
|
|
23
26
|
payload: import("../..").components["schemas"]["SwapPayload"];
|
|
@@ -41,6 +44,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
41
44
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
42
45
|
oneClickBuyUrl: string | null;
|
|
43
46
|
stripePaymentIntentId: string | null;
|
|
47
|
+
settlement: {
|
|
48
|
+
actualDstAmount: string | null;
|
|
49
|
+
} | null;
|
|
44
50
|
} & {
|
|
45
51
|
type: "hype_duel";
|
|
46
52
|
payload: import("../..").components["schemas"]["HypeDuelPayload"];
|
|
@@ -64,6 +70,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
64
70
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
65
71
|
oneClickBuyUrl: string | null;
|
|
66
72
|
stripePaymentIntentId: string | null;
|
|
73
|
+
settlement: {
|
|
74
|
+
actualDstAmount: string | null;
|
|
75
|
+
} | null;
|
|
67
76
|
} & {
|
|
68
77
|
type: "custom";
|
|
69
78
|
payload: import("../..").components["schemas"]["CustomPayload"];
|
|
@@ -87,6 +96,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
87
96
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
88
97
|
oneClickBuyUrl: string | null;
|
|
89
98
|
stripePaymentIntentId: string | null;
|
|
99
|
+
settlement: {
|
|
100
|
+
actualDstAmount: string | null;
|
|
101
|
+
} | null;
|
|
90
102
|
} & {
|
|
91
103
|
type: "mint_nft";
|
|
92
104
|
payload: import("../..").components["schemas"]["MintNftPayload"];
|
|
@@ -110,6 +122,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
110
122
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
111
123
|
oneClickBuyUrl: string | null;
|
|
112
124
|
stripePaymentIntentId: string | null;
|
|
125
|
+
settlement: {
|
|
126
|
+
actualDstAmount: string | null;
|
|
127
|
+
} | null;
|
|
113
128
|
} & {
|
|
114
129
|
type: "join_tournament";
|
|
115
130
|
payload: import("../..").components["schemas"]["JoinTournamentPayload"];
|
|
@@ -133,6 +148,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
133
148
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
134
149
|
oneClickBuyUrl: string | null;
|
|
135
150
|
stripePaymentIntentId: string | null;
|
|
151
|
+
settlement: {
|
|
152
|
+
actualDstAmount: string | null;
|
|
153
|
+
} | null;
|
|
136
154
|
} & {
|
|
137
155
|
type: "fund_tournament";
|
|
138
156
|
payload: import("../..").components["schemas"]["FundTournamentPayload"];
|
|
@@ -159,6 +177,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
159
177
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
160
178
|
oneClickBuyUrl: string | null;
|
|
161
179
|
stripePaymentIntentId: string | null;
|
|
180
|
+
settlement: {
|
|
181
|
+
actualDstAmount: string | null;
|
|
182
|
+
} | null;
|
|
162
183
|
} & {
|
|
163
184
|
type: "swap";
|
|
164
185
|
payload: import("../..").components["schemas"]["SwapPayload"];
|
|
@@ -182,6 +203,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
182
203
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
183
204
|
oneClickBuyUrl: string | null;
|
|
184
205
|
stripePaymentIntentId: string | null;
|
|
206
|
+
settlement: {
|
|
207
|
+
actualDstAmount: string | null;
|
|
208
|
+
} | null;
|
|
185
209
|
} & {
|
|
186
210
|
type: "hype_duel";
|
|
187
211
|
payload: import("../..").components["schemas"]["HypeDuelPayload"];
|
|
@@ -205,6 +229,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
205
229
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
206
230
|
oneClickBuyUrl: string | null;
|
|
207
231
|
stripePaymentIntentId: string | null;
|
|
232
|
+
settlement: {
|
|
233
|
+
actualDstAmount: string | null;
|
|
234
|
+
} | null;
|
|
208
235
|
} & {
|
|
209
236
|
type: "custom";
|
|
210
237
|
payload: import("../..").components["schemas"]["CustomPayload"];
|
|
@@ -228,6 +255,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
228
255
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
229
256
|
oneClickBuyUrl: string | null;
|
|
230
257
|
stripePaymentIntentId: string | null;
|
|
258
|
+
settlement: {
|
|
259
|
+
actualDstAmount: string | null;
|
|
260
|
+
} | null;
|
|
231
261
|
} & {
|
|
232
262
|
type: "mint_nft";
|
|
233
263
|
payload: import("../..").components["schemas"]["MintNftPayload"];
|
|
@@ -251,6 +281,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
251
281
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
252
282
|
oneClickBuyUrl: string | null;
|
|
253
283
|
stripePaymentIntentId: string | null;
|
|
284
|
+
settlement: {
|
|
285
|
+
actualDstAmount: string | null;
|
|
286
|
+
} | null;
|
|
254
287
|
} & {
|
|
255
288
|
type: "join_tournament";
|
|
256
289
|
payload: import("../..").components["schemas"]["JoinTournamentPayload"];
|
|
@@ -274,6 +307,9 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
274
307
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
275
308
|
oneClickBuyUrl: string | null;
|
|
276
309
|
stripePaymentIntentId: string | null;
|
|
310
|
+
settlement: {
|
|
311
|
+
actualDstAmount: string | null;
|
|
312
|
+
} | null;
|
|
277
313
|
} & {
|
|
278
314
|
type: "fund_tournament";
|
|
279
315
|
payload: import("../..").components["schemas"]["FundTournamentPayload"];
|
|
@@ -434,6 +434,11 @@ export interface paths {
|
|
|
434
434
|
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
435
435
|
/** @description Refund transactions if order failed */
|
|
436
436
|
refundTxs: components["schemas"]["RefundTx"][];
|
|
437
|
+
/**
|
|
438
|
+
* @description Points awarded for this order (only present when order status is executed)
|
|
439
|
+
* @example 100
|
|
440
|
+
*/
|
|
441
|
+
points: number | null;
|
|
437
442
|
};
|
|
438
443
|
/** @example 200 */
|
|
439
444
|
statusCode: number;
|
|
@@ -1112,11 +1117,6 @@ export interface components {
|
|
|
1112
1117
|
* @example 990000
|
|
1113
1118
|
*/
|
|
1114
1119
|
expectedDstAmount: string;
|
|
1115
|
-
/**
|
|
1116
|
-
* @description Actual received amount (null for new orders)
|
|
1117
|
-
* @example 990000
|
|
1118
|
-
*/
|
|
1119
|
-
actualDstAmount: string | null;
|
|
1120
1120
|
};
|
|
1121
1121
|
/** @description HypeDuel-specific payload */
|
|
1122
1122
|
HypeDuelPayload: {
|
|
@@ -1125,11 +1125,6 @@ export interface components {
|
|
|
1125
1125
|
* @example 990000
|
|
1126
1126
|
*/
|
|
1127
1127
|
expectedDstAmount: string;
|
|
1128
|
-
/**
|
|
1129
|
-
* @description Actual received amount (null for new orders)
|
|
1130
|
-
* @example 990000
|
|
1131
|
-
*/
|
|
1132
|
-
actualDstAmount: string | null;
|
|
1133
1128
|
};
|
|
1134
1129
|
/** @description Custom execution payload */
|
|
1135
1130
|
CustomPayload: {
|
|
@@ -1315,6 +1310,14 @@ export interface components {
|
|
|
1315
1310
|
* @example pi_3Rko0sJnoDg53PsP0PDLsHkR
|
|
1316
1311
|
*/
|
|
1317
1312
|
stripePaymentIntentId: string | null;
|
|
1313
|
+
/** @description Settlement information for executed orders */
|
|
1314
|
+
settlement: {
|
|
1315
|
+
/**
|
|
1316
|
+
* @description Actual received amount after execution
|
|
1317
|
+
* @example 990000
|
|
1318
|
+
*/
|
|
1319
|
+
actualDstAmount: string | null;
|
|
1320
|
+
} | null;
|
|
1318
1321
|
};
|
|
1319
1322
|
SwapOrder: components["schemas"]["BaseOrder"] & {
|
|
1320
1323
|
/**
|
package/package.json
CHANGED
|
@@ -391,13 +391,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
391
391
|
: order.payload.expectedDstAmount.toString();
|
|
392
392
|
const formattedExpectedDstAmount = formatTokenAmount(BigInt(expectedDstAmount), dstToken.decimals);
|
|
393
393
|
|
|
394
|
-
const actualDstAmount =
|
|
395
|
-
order.type === "mint_nft" ||
|
|
396
|
-
order.type === "join_tournament" ||
|
|
397
|
-
order.type === "fund_tournament" ||
|
|
398
|
-
order.type === "custom"
|
|
399
|
-
? undefined
|
|
400
|
-
: order.payload.actualDstAmount;
|
|
394
|
+
const actualDstAmount = order.settlement?.actualDstAmount;
|
|
401
395
|
const formattedActualDstAmount = actualDstAmount
|
|
402
396
|
? formatTokenAmount(BigInt(actualDstAmount), dstToken.decimals)
|
|
403
397
|
: undefined;
|
|
@@ -18,13 +18,7 @@ export function OrderHistoryItem({ order, onSelectOrder, mode }: OrderHistoryIte
|
|
|
18
18
|
const tournament =
|
|
19
19
|
order.type === "join_tournament" || order.type === "fund_tournament" ? order.metadata.tournament : undefined;
|
|
20
20
|
const dstToken = order.metadata.dstToken;
|
|
21
|
-
const actualDstAmount =
|
|
22
|
-
order.type === "mint_nft" ||
|
|
23
|
-
order.type === "join_tournament" ||
|
|
24
|
-
order.type === "fund_tournament" ||
|
|
25
|
-
order.type === "custom"
|
|
26
|
-
? undefined
|
|
27
|
-
: order.payload.actualDstAmount;
|
|
21
|
+
const actualDstAmount = order.settlement?.actualDstAmount;
|
|
28
22
|
const expectedDstAmount =
|
|
29
23
|
order.type === "mint_nft" ||
|
|
30
24
|
order.type === "join_tournament" ||
|
|
@@ -247,8 +247,8 @@ export function useAnyspendFlow({
|
|
|
247
247
|
// Handle order completion
|
|
248
248
|
useEffect(() => {
|
|
249
249
|
if (oat?.data?.order.status === "executed") {
|
|
250
|
-
// get the actualDstAmount if available from
|
|
251
|
-
const amount =
|
|
250
|
+
// get the actualDstAmount if available from settlement
|
|
251
|
+
const amount = oat.data.order.settlement?.actualDstAmount;
|
|
252
252
|
const formattedActualDstAmount = amount
|
|
253
253
|
? formatTokenAmount(BigInt(amount), oat.data.order.metadata.dstToken.decimals)
|
|
254
254
|
: undefined;
|
|
@@ -256,7 +256,7 @@ export function useAnyspendFlow({
|
|
|
256
256
|
}
|
|
257
257
|
}, [
|
|
258
258
|
oat?.data?.order.status,
|
|
259
|
-
oat?.data?.order.
|
|
259
|
+
oat?.data?.order.settlement?.actualDstAmount,
|
|
260
260
|
onTransactionSuccess,
|
|
261
261
|
oat?.data?.order.metadata.dstToken.decimals,
|
|
262
262
|
]);
|
|
@@ -435,6 +435,11 @@ export interface paths {
|
|
|
435
435
|
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
436
436
|
/** @description Refund transactions if order failed */
|
|
437
437
|
refundTxs: components["schemas"]["RefundTx"][];
|
|
438
|
+
/**
|
|
439
|
+
* @description Points awarded for this order (only present when order status is executed)
|
|
440
|
+
* @example 100
|
|
441
|
+
*/
|
|
442
|
+
points: number | null;
|
|
438
443
|
};
|
|
439
444
|
/** @example 200 */
|
|
440
445
|
statusCode: number;
|
|
@@ -1119,11 +1124,6 @@ export interface components {
|
|
|
1119
1124
|
* @example 990000
|
|
1120
1125
|
*/
|
|
1121
1126
|
expectedDstAmount: string;
|
|
1122
|
-
/**
|
|
1123
|
-
* @description Actual received amount (null for new orders)
|
|
1124
|
-
* @example 990000
|
|
1125
|
-
*/
|
|
1126
|
-
actualDstAmount: string | null;
|
|
1127
1127
|
};
|
|
1128
1128
|
/** @description HypeDuel-specific payload */
|
|
1129
1129
|
HypeDuelPayload: {
|
|
@@ -1132,11 +1132,6 @@ export interface components {
|
|
|
1132
1132
|
* @example 990000
|
|
1133
1133
|
*/
|
|
1134
1134
|
expectedDstAmount: string;
|
|
1135
|
-
/**
|
|
1136
|
-
* @description Actual received amount (null for new orders)
|
|
1137
|
-
* @example 990000
|
|
1138
|
-
*/
|
|
1139
|
-
actualDstAmount: string | null;
|
|
1140
1135
|
};
|
|
1141
1136
|
/** @description Custom execution payload */
|
|
1142
1137
|
CustomPayload: {
|
|
@@ -1332,6 +1327,14 @@ export interface components {
|
|
|
1332
1327
|
* @example pi_3Rko0sJnoDg53PsP0PDLsHkR
|
|
1333
1328
|
*/
|
|
1334
1329
|
stripePaymentIntentId: string | null;
|
|
1330
|
+
/** @description Settlement information for executed orders */
|
|
1331
|
+
settlement: {
|
|
1332
|
+
/**
|
|
1333
|
+
* @description Actual received amount after execution
|
|
1334
|
+
* @example 990000
|
|
1335
|
+
*/
|
|
1336
|
+
actualDstAmount: string | null;
|
|
1337
|
+
} | null;
|
|
1335
1338
|
};
|
|
1336
1339
|
SwapOrder: components["schemas"]["BaseOrder"] & {
|
|
1337
1340
|
/**
|
|
@@ -17,8 +17,6 @@ export const buildPayload = (orderType: components["schemas"]["Order"]["type"],
|
|
|
17
17
|
case "swap":
|
|
18
18
|
return {
|
|
19
19
|
expectedDstAmount,
|
|
20
|
-
actualDstAmount: null,
|
|
21
|
-
amountInAfterFee: null,
|
|
22
20
|
};
|
|
23
21
|
case "mint_nft":
|
|
24
22
|
if (nft?.type === "erc1155") {
|
|
@@ -53,8 +51,6 @@ export const buildPayload = (orderType: components["schemas"]["Order"]["type"],
|
|
|
53
51
|
case "hype_duel":
|
|
54
52
|
return {
|
|
55
53
|
expectedDstAmount,
|
|
56
|
-
actualDstAmount: null,
|
|
57
|
-
amountInAfterFee: null,
|
|
58
54
|
};
|
|
59
55
|
default:
|
|
60
56
|
throw new Error(`Invalid order type: ${orderType}`);
|