@b3dotfun/sdk 0.0.33-alpha.6 → 0.0.33-alpha.7
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/AnySpend.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +5 -36
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +3 -3
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +17 -25
- package/dist/cjs/anyspend/react/components/common/OrderStatus.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +3 -3
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +6 -6
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +54 -10
- package/dist/cjs/anyspend/react/hooks/useAnyspendQuote.js +1 -1
- package/dist/cjs/anyspend/types/api.d.ts +130 -14
- package/dist/cjs/anyspend/utils/chain.js +1 -1
- package/dist/cjs/anyspend/utils/format.js +1 -0
- package/dist/cjs/anyspend/utils/orderPayload.js +7 -0
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -2
- package/dist/esm/anyspend/react/components/AnySpend.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +0 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +6 -37
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +3 -3
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +17 -25
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +1 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +3 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +6 -6
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +54 -10
- package/dist/esm/anyspend/react/hooks/useAnyspendQuote.js +1 -1
- package/dist/esm/anyspend/types/api.d.ts +130 -14
- package/dist/esm/anyspend/utils/chain.js +1 -1
- package/dist/esm/anyspend/utils/format.js +1 -0
- package/dist/esm/anyspend/utils/orderPayload.js +7 -0
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -2
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +0 -1
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +3 -3
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +3 -3
- package/dist/types/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +6 -6
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +54 -10
- package/dist/types/anyspend/types/api.d.ts +130 -14
- package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -2
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +1 -1
- package/src/anyspend/react/components/AnySpendCustom.tsx +1 -1
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +5 -43
- package/src/anyspend/react/components/common/OrderDetails.tsx +45 -53
- package/src/anyspend/react/components/common/OrderStatus.tsx +1 -1
- package/src/anyspend/react/hooks/useAnyspendQuote.ts +1 -1
- package/src/anyspend/types/api.ts +131 -11
- package/src/anyspend/utils/chain.ts +1 -1
- package/src/anyspend/utils/format.ts +1 -0
- package/src/anyspend/utils/orderPayload.ts +7 -0
- package/src/global-account/react/stores/useModalStore.ts +0 -2
|
@@ -418,18 +418,23 @@ export interface paths {
|
|
|
418
418
|
* }
|
|
419
419
|
* ]
|
|
420
420
|
*/
|
|
421
|
-
depositTxs: components["schemas"]["DepositTx"][]
|
|
422
|
-
/**
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
|
|
421
|
+
depositTxs: components["schemas"]["DepositTx"][];
|
|
422
|
+
/**
|
|
423
|
+
* @description Cross-chain relay transactions
|
|
424
|
+
* @example [
|
|
425
|
+
* {
|
|
426
|
+
* "orderId": "5392f7a7-d472-4d6b-9848-bd07117fb82d",
|
|
427
|
+
* "chain": 8453,
|
|
428
|
+
* "txHash": "0x9df917e14bb089f74763d1d2662761d75c97a5a068b8a9e411c3d384c9c40d19",
|
|
429
|
+
* "status": "success",
|
|
430
|
+
* "createdAt": 1752505817654
|
|
431
|
+
* }
|
|
432
|
+
* ]
|
|
433
|
+
*/
|
|
434
|
+
relayTxs: components["schemas"]["RelayTx"][];
|
|
430
435
|
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
431
436
|
/** @description Refund transactions if order failed */
|
|
432
|
-
refundTxs: components["schemas"]["RefundTx"][]
|
|
437
|
+
refundTxs: components["schemas"]["RefundTx"][];
|
|
433
438
|
};
|
|
434
439
|
/** @example 200 */
|
|
435
440
|
statusCode: number;
|
|
@@ -468,7 +473,7 @@ export interface paths {
|
|
|
468
473
|
"/orders/quote": {
|
|
469
474
|
/**
|
|
470
475
|
* Get anyspend quote
|
|
471
|
-
* @description Retrieves a quote to swap or
|
|
476
|
+
* @description Retrieves a quote to swap, execute contract, or participate in HypeDuel
|
|
472
477
|
*/
|
|
473
478
|
post: {
|
|
474
479
|
requestBody: {
|
|
@@ -597,6 +602,43 @@ export interface paths {
|
|
|
597
602
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
598
603
|
contractAddress: string;
|
|
599
604
|
fundAmount: string;
|
|
605
|
+
}
|
|
606
|
+
| {
|
|
607
|
+
/**
|
|
608
|
+
* @description Order type for HypeDuel
|
|
609
|
+
* @enum {string}
|
|
610
|
+
*/
|
|
611
|
+
type: "hype_duel";
|
|
612
|
+
/**
|
|
613
|
+
* @description Source chain ID
|
|
614
|
+
* @example 1
|
|
615
|
+
*/
|
|
616
|
+
srcChain: number;
|
|
617
|
+
/**
|
|
618
|
+
* @description Destination chain ID
|
|
619
|
+
* @example 8453
|
|
620
|
+
*/
|
|
621
|
+
dstChain: number;
|
|
622
|
+
/**
|
|
623
|
+
* @description Source token contract address
|
|
624
|
+
* @example 0x0000000000000000000000000000000000000000
|
|
625
|
+
*/
|
|
626
|
+
srcTokenAddress: string;
|
|
627
|
+
/**
|
|
628
|
+
* @description Destination token contract address
|
|
629
|
+
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
630
|
+
*/
|
|
631
|
+
dstTokenAddress: string;
|
|
632
|
+
/**
|
|
633
|
+
* @description Amount to quote
|
|
634
|
+
* @example 1000000000000000000
|
|
635
|
+
*/
|
|
636
|
+
amount: string;
|
|
637
|
+
/**
|
|
638
|
+
* @description Optional onramp vendor
|
|
639
|
+
* @enum {string}
|
|
640
|
+
*/
|
|
641
|
+
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
600
642
|
};
|
|
601
643
|
};
|
|
602
644
|
};
|
|
@@ -1043,6 +1085,19 @@ export interface components {
|
|
|
1043
1085
|
*/
|
|
1044
1086
|
actualDstAmount: string | null;
|
|
1045
1087
|
};
|
|
1088
|
+
/** @description HypeDuel-specific payload */
|
|
1089
|
+
HypeDuelPayload: {
|
|
1090
|
+
/**
|
|
1091
|
+
* @description Expected amount of destination tokens
|
|
1092
|
+
* @example 990000
|
|
1093
|
+
*/
|
|
1094
|
+
expectedDstAmount: string;
|
|
1095
|
+
/**
|
|
1096
|
+
* @description Actual received amount (null for new orders)
|
|
1097
|
+
* @example 990000
|
|
1098
|
+
*/
|
|
1099
|
+
actualDstAmount: string | null;
|
|
1100
|
+
};
|
|
1046
1101
|
/** @description Custom execution payload */
|
|
1047
1102
|
CustomPayload: {
|
|
1048
1103
|
/**
|
|
@@ -1121,6 +1176,11 @@ export interface components {
|
|
|
1121
1176
|
srcToken: components["schemas"]["Token"];
|
|
1122
1177
|
dstToken: components["schemas"]["Token"];
|
|
1123
1178
|
};
|
|
1179
|
+
/** @description HypeDuel metadata for display purposes */
|
|
1180
|
+
HypeDuelMetadata: {
|
|
1181
|
+
srcToken: components["schemas"]["Token"];
|
|
1182
|
+
dstToken: components["schemas"]["Token"];
|
|
1183
|
+
};
|
|
1124
1184
|
/** @description Custom metadata for display purposes */
|
|
1125
1185
|
CustomMetadata: {
|
|
1126
1186
|
srcToken: components["schemas"]["Token"];
|
|
@@ -1197,6 +1257,7 @@ export interface components {
|
|
|
1197
1257
|
| "expired"
|
|
1198
1258
|
| "sending_token_from_vault"
|
|
1199
1259
|
| "relay"
|
|
1260
|
+
| "executing"
|
|
1200
1261
|
| "executed"
|
|
1201
1262
|
| "refunding"
|
|
1202
1263
|
| "refunded"
|
|
@@ -1239,6 +1300,15 @@ export interface components {
|
|
|
1239
1300
|
payload: components["schemas"]["SwapPayload"];
|
|
1240
1301
|
metadata: components["schemas"]["SwapMetadata"];
|
|
1241
1302
|
};
|
|
1303
|
+
HypeDuelOrder: components["schemas"]["BaseOrder"] & {
|
|
1304
|
+
/**
|
|
1305
|
+
* @description Order type
|
|
1306
|
+
* @enum {string}
|
|
1307
|
+
*/
|
|
1308
|
+
type: "hype_duel";
|
|
1309
|
+
payload: components["schemas"]["HypeDuelPayload"];
|
|
1310
|
+
metadata: components["schemas"]["HypeDuelMetadata"];
|
|
1311
|
+
};
|
|
1242
1312
|
CustomOrder: components["schemas"]["BaseOrder"] & {
|
|
1243
1313
|
/**
|
|
1244
1314
|
* @description Order type
|
|
@@ -1277,6 +1347,7 @@ export interface components {
|
|
|
1277
1347
|
};
|
|
1278
1348
|
Order:
|
|
1279
1349
|
| components["schemas"]["SwapOrder"]
|
|
1350
|
+
| components["schemas"]["HypeDuelOrder"]
|
|
1280
1351
|
| components["schemas"]["CustomOrder"]
|
|
1281
1352
|
| components["schemas"]["MintNftOrder"]
|
|
1282
1353
|
| components["schemas"]["JoinTournamentOrder"]
|
|
@@ -1329,6 +1400,54 @@ export interface components {
|
|
|
1329
1400
|
*/
|
|
1330
1401
|
creatorAddress?: string;
|
|
1331
1402
|
};
|
|
1403
|
+
/** @description HypeDuel order request */
|
|
1404
|
+
HypeDuelOrderRequest: {
|
|
1405
|
+
/**
|
|
1406
|
+
* @description Order type
|
|
1407
|
+
* @enum {string}
|
|
1408
|
+
*/
|
|
1409
|
+
type: "hype_duel";
|
|
1410
|
+
/**
|
|
1411
|
+
* @description Address to receive the destination tokens
|
|
1412
|
+
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
1413
|
+
*/
|
|
1414
|
+
recipientAddress: string;
|
|
1415
|
+
/**
|
|
1416
|
+
* @description Source chain ID
|
|
1417
|
+
* @example 1
|
|
1418
|
+
*/
|
|
1419
|
+
srcChain: number;
|
|
1420
|
+
/**
|
|
1421
|
+
* @description Destination chain ID
|
|
1422
|
+
* @example 8453
|
|
1423
|
+
*/
|
|
1424
|
+
dstChain: number;
|
|
1425
|
+
/**
|
|
1426
|
+
* @description Source token contract address
|
|
1427
|
+
* @example 0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234
|
|
1428
|
+
*/
|
|
1429
|
+
srcTokenAddress: string;
|
|
1430
|
+
/**
|
|
1431
|
+
* @description Destination token contract address
|
|
1432
|
+
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
1433
|
+
*/
|
|
1434
|
+
dstTokenAddress: string;
|
|
1435
|
+
/**
|
|
1436
|
+
* @description Amount of source tokens for HypeDuel
|
|
1437
|
+
* @example 1000000
|
|
1438
|
+
*/
|
|
1439
|
+
srcAmount: string;
|
|
1440
|
+
payload: components["schemas"]["HypeDuelPayload"];
|
|
1441
|
+
metadata: components["schemas"]["HypeDuelMetadata"];
|
|
1442
|
+
/** @description Optional partner identifier */
|
|
1443
|
+
partnerId?: string;
|
|
1444
|
+
onramp?: components["schemas"]["Onramp"];
|
|
1445
|
+
/**
|
|
1446
|
+
* @description Optional address of the order creator
|
|
1447
|
+
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
1448
|
+
*/
|
|
1449
|
+
creatorAddress?: string;
|
|
1450
|
+
};
|
|
1332
1451
|
/** @description Custom order request */
|
|
1333
1452
|
CustomOrderRequest: {
|
|
1334
1453
|
/**
|
|
@@ -1523,6 +1642,7 @@ export interface components {
|
|
|
1523
1642
|
};
|
|
1524
1643
|
OrderRequest:
|
|
1525
1644
|
| components["schemas"]["SwapOrderRequest"]
|
|
1645
|
+
| components["schemas"]["HypeDuelOrderRequest"]
|
|
1526
1646
|
| components["schemas"]["CustomOrderRequest"]
|
|
1527
1647
|
| components["schemas"]["MintNftOrderRequest"]
|
|
1528
1648
|
| components["schemas"]["JoinTournamentOrderRequest"]
|
|
@@ -64,7 +64,7 @@ export const EVM_MAINNET: Record<number, IEVMChain> = {
|
|
|
64
64
|
name: "Arbitrum",
|
|
65
65
|
type: ChainType.EVM,
|
|
66
66
|
logoUrl: "https://assets.relay.link/icons/square/42161/light.png",
|
|
67
|
-
nativeRequired: parseEther("0.
|
|
67
|
+
nativeRequired: parseEther("0.0003"),
|
|
68
68
|
canDepositNative: true,
|
|
69
69
|
defaultToken: getEthToken(arbitrum.id),
|
|
70
70
|
nativeToken: getEthToken(arbitrum.id),
|
|
@@ -48,6 +48,11 @@ export const buildPayload = (orderType: components["schemas"]["Order"]["type"],
|
|
|
48
48
|
};
|
|
49
49
|
case "custom":
|
|
50
50
|
return { ...payload };
|
|
51
|
+
case "hype_duel":
|
|
52
|
+
return {
|
|
53
|
+
expectedDstAmount,
|
|
54
|
+
actualDstAmount: null,
|
|
55
|
+
};
|
|
51
56
|
default:
|
|
52
57
|
throw new Error(`Invalid order type: ${orderType}`);
|
|
53
58
|
}
|
|
@@ -69,6 +74,8 @@ export const buildMetadata = (orderType: components["schemas"]["Order"]["type"],
|
|
|
69
74
|
return { ...baseMetadata, tournament };
|
|
70
75
|
case "custom":
|
|
71
76
|
return { ...baseMetadata, action: payload.action };
|
|
77
|
+
case "hype_duel":
|
|
78
|
+
return { ...baseMetadata };
|
|
72
79
|
default:
|
|
73
80
|
throw new Error(`Invalid order type: ${orderType}`);
|
|
74
81
|
}
|
|
@@ -297,8 +297,6 @@ export interface AnySpendDepositHypeProps extends BaseModalProps {
|
|
|
297
297
|
sourceTokenChainId?: number;
|
|
298
298
|
/** Payment type - crypto or fiat */
|
|
299
299
|
paymentType?: "crypto" | "fiat";
|
|
300
|
-
/** Deposit contract address */
|
|
301
|
-
depositContractAddress: string;
|
|
302
300
|
/** Main footer */
|
|
303
301
|
mainFooter?: React.ReactNode;
|
|
304
302
|
/** Callback function called when the deposit is successful */
|