@b3dotfun/sdk 0.0.40-alpha.21 → 0.0.40-alpha.22
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 +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +9 -3
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +1 -0
- package/dist/cjs/anyspend/types/api.d.ts +30 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +2 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +9 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +1 -0
- package/dist/esm/anyspend/types/api.d.ts +30 -0
- package/dist/types/anyspend/types/api.d.ts +30 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +2 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +10 -2
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +1 -0
- package/src/anyspend/types/api.ts +30 -0
|
@@ -330,6 +330,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
|
|
|
330
330
|
type: "swap",
|
|
331
331
|
tradeType: isSrcInputDirty ? "EXACT_INPUT" : "EXACT_OUTPUT",
|
|
332
332
|
amount: activeInputAmountInWei,
|
|
333
|
+
recipientAddress,
|
|
333
334
|
}
|
|
334
335
|
: {
|
|
335
336
|
srcChain: chains_1.base.id,
|
|
@@ -339,6 +340,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
|
|
|
339
340
|
type: "swap",
|
|
340
341
|
tradeType: "EXACT_INPUT",
|
|
341
342
|
amount: srcAmountOnrampInWei,
|
|
343
|
+
recipientAddress,
|
|
342
344
|
onrampVendor: getOnrampVendor(selectedFiatPaymentMethod),
|
|
343
345
|
});
|
|
344
346
|
// Load custom recipients from local storage on mount
|
|
@@ -40,7 +40,7 @@ var PanelView;
|
|
|
40
40
|
PanelView[PanelView["FIAT_PAYMENT_METHOD"] = 6] = "FIAT_PAYMENT_METHOD";
|
|
41
41
|
PanelView[PanelView["POINTS_DETAIL"] = 7] = "POINTS_DETAIL";
|
|
42
42
|
})(PanelView || (PanelView = {}));
|
|
43
|
-
function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChainId, dstToken, dstAmount, contractAddress, tokenId, contractType, encodedData, spenderAddress, }) {
|
|
43
|
+
function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChainId, dstToken, recipientAddress, dstAmount, contractAddress, tokenId, contractType, encodedData, spenderAddress, }) {
|
|
44
44
|
switch (orderType) {
|
|
45
45
|
case "mint_nft": {
|
|
46
46
|
(0, invariant_1.default)(contractType, "Contract type is required");
|
|
@@ -50,6 +50,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
50
50
|
srcTokenAddress: srcToken.address,
|
|
51
51
|
dstChain: dstChainId,
|
|
52
52
|
dstTokenAddress: dstToken.address,
|
|
53
|
+
recipientAddress,
|
|
53
54
|
price: dstAmount,
|
|
54
55
|
contractAddress: contractAddress,
|
|
55
56
|
tokenId: tokenId,
|
|
@@ -63,6 +64,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
63
64
|
srcTokenAddress: srcToken.address,
|
|
64
65
|
dstChain: dstChainId,
|
|
65
66
|
dstTokenAddress: dstToken.address,
|
|
67
|
+
recipientAddress,
|
|
66
68
|
price: dstAmount,
|
|
67
69
|
contractAddress: contractAddress,
|
|
68
70
|
};
|
|
@@ -74,6 +76,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
74
76
|
srcTokenAddress: srcToken.address,
|
|
75
77
|
dstChain: dstChainId,
|
|
76
78
|
dstTokenAddress: dstToken.address,
|
|
79
|
+
recipientAddress,
|
|
77
80
|
fundAmount: dstAmount,
|
|
78
81
|
contractAddress: contractAddress,
|
|
79
82
|
};
|
|
@@ -85,6 +88,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
85
88
|
srcTokenAddress: srcToken.address,
|
|
86
89
|
dstChain: dstChainId,
|
|
87
90
|
dstTokenAddress: dstToken.address,
|
|
91
|
+
recipientAddress,
|
|
88
92
|
payload: {
|
|
89
93
|
amount: dstAmount,
|
|
90
94
|
data: encodedData,
|
|
@@ -179,10 +183,11 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
179
183
|
srcToken: activeTab === "fiat" ? constants_1.USDC_BASE : srcToken,
|
|
180
184
|
dstChainId: dstChainId,
|
|
181
185
|
dstToken: dstToken,
|
|
186
|
+
recipientAddress,
|
|
182
187
|
dstAmount: dstAmount,
|
|
183
188
|
contractAddress: contractAddress,
|
|
184
|
-
tokenId: orderType === "mint_nft" ? metadata
|
|
185
|
-
contractType: orderType === "mint_nft" ? metadata
|
|
189
|
+
tokenId: orderType === "mint_nft" ? metadata?.nftContract?.tokenId : undefined,
|
|
190
|
+
contractType: orderType === "mint_nft" ? metadata?.nftContract?.type : undefined,
|
|
186
191
|
encodedData: encodedData,
|
|
187
192
|
spenderAddress: spenderAddress,
|
|
188
193
|
});
|
|
@@ -196,6 +201,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
196
201
|
metadata?.nftContract?.tokenId,
|
|
197
202
|
metadata?.nftContract?.type,
|
|
198
203
|
orderType,
|
|
204
|
+
recipientAddress,
|
|
199
205
|
spenderAddress,
|
|
200
206
|
srcChainId,
|
|
201
207
|
srcToken,
|
|
@@ -120,6 +120,7 @@ function useAnyspendFlow({ paymentType = "crypto", recipientAddress, loadOrder,
|
|
|
120
120
|
type: "swap",
|
|
121
121
|
tradeType: "EXACT_INPUT",
|
|
122
122
|
amount: activeInputAmountInWei,
|
|
123
|
+
recipientAddress: selectedRecipientAddress,
|
|
123
124
|
onrampVendor: paymentType === "fiat" ? getOnrampVendor(selectedFiatPaymentMethod) : undefined,
|
|
124
125
|
});
|
|
125
126
|
// Get geo options for fiat
|
|
@@ -503,6 +503,11 @@ export interface paths {
|
|
|
503
503
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
504
504
|
*/
|
|
505
505
|
dstTokenAddress: string;
|
|
506
|
+
/**
|
|
507
|
+
* @description Recipient address
|
|
508
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
509
|
+
*/
|
|
510
|
+
recipientAddress?: string;
|
|
506
511
|
/**
|
|
507
512
|
* @description Type of trade execution
|
|
508
513
|
* @enum {string}
|
|
@@ -544,6 +549,11 @@ export interface paths {
|
|
|
544
549
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
545
550
|
*/
|
|
546
551
|
dstTokenAddress: string;
|
|
552
|
+
/**
|
|
553
|
+
* @description Recipient address
|
|
554
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
555
|
+
*/
|
|
556
|
+
recipientAddress?: string;
|
|
547
557
|
/** @description Custom payload for execution */
|
|
548
558
|
payload: {
|
|
549
559
|
/** @description Encoded transaction data */
|
|
@@ -567,6 +577,11 @@ export interface paths {
|
|
|
567
577
|
dstChain: number;
|
|
568
578
|
srcTokenAddress: string;
|
|
569
579
|
dstTokenAddress: string;
|
|
580
|
+
/**
|
|
581
|
+
* @description Recipient address
|
|
582
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
583
|
+
*/
|
|
584
|
+
recipientAddress?: string;
|
|
570
585
|
/** @enum {string} */
|
|
571
586
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
572
587
|
contractAddress: string;
|
|
@@ -581,6 +596,11 @@ export interface paths {
|
|
|
581
596
|
dstChain: number;
|
|
582
597
|
srcTokenAddress: string;
|
|
583
598
|
dstTokenAddress: string;
|
|
599
|
+
/**
|
|
600
|
+
* @description Recipient address
|
|
601
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
602
|
+
*/
|
|
603
|
+
recipientAddress?: string;
|
|
584
604
|
/** @enum {string} */
|
|
585
605
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
586
606
|
contractAddress: string;
|
|
@@ -592,6 +612,11 @@ export interface paths {
|
|
|
592
612
|
dstChain: number;
|
|
593
613
|
srcTokenAddress: string;
|
|
594
614
|
dstTokenAddress: string;
|
|
615
|
+
/**
|
|
616
|
+
* @description Recipient address
|
|
617
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
618
|
+
*/
|
|
619
|
+
recipientAddress?: string;
|
|
595
620
|
/** @enum {string} */
|
|
596
621
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
597
622
|
contractAddress: string;
|
|
@@ -622,6 +647,11 @@ export interface paths {
|
|
|
622
647
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
623
648
|
*/
|
|
624
649
|
dstTokenAddress: string;
|
|
650
|
+
/**
|
|
651
|
+
* @description Recipient address
|
|
652
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
653
|
+
*/
|
|
654
|
+
recipientAddress?: string;
|
|
625
655
|
/**
|
|
626
656
|
* @description Amount to quote
|
|
627
657
|
* @example 1000000000000000000
|
|
@@ -323,6 +323,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
|
|
|
323
323
|
type: "swap",
|
|
324
324
|
tradeType: isSrcInputDirty ? "EXACT_INPUT" : "EXACT_OUTPUT",
|
|
325
325
|
amount: activeInputAmountInWei,
|
|
326
|
+
recipientAddress,
|
|
326
327
|
}
|
|
327
328
|
: {
|
|
328
329
|
srcChain: base.id,
|
|
@@ -332,6 +333,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
|
|
|
332
333
|
type: "swap",
|
|
333
334
|
tradeType: "EXACT_INPUT",
|
|
334
335
|
amount: srcAmountOnrampInWei,
|
|
336
|
+
recipientAddress,
|
|
335
337
|
onrampVendor: getOnrampVendor(selectedFiatPaymentMethod),
|
|
336
338
|
});
|
|
337
339
|
// Load custom recipients from local storage on mount
|
|
@@ -34,7 +34,7 @@ var PanelView;
|
|
|
34
34
|
PanelView[PanelView["FIAT_PAYMENT_METHOD"] = 6] = "FIAT_PAYMENT_METHOD";
|
|
35
35
|
PanelView[PanelView["POINTS_DETAIL"] = 7] = "POINTS_DETAIL";
|
|
36
36
|
})(PanelView || (PanelView = {}));
|
|
37
|
-
function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChainId, dstToken, dstAmount, contractAddress, tokenId, contractType, encodedData, spenderAddress, }) {
|
|
37
|
+
function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChainId, dstToken, recipientAddress, dstAmount, contractAddress, tokenId, contractType, encodedData, spenderAddress, }) {
|
|
38
38
|
switch (orderType) {
|
|
39
39
|
case "mint_nft": {
|
|
40
40
|
invariant(contractType, "Contract type is required");
|
|
@@ -44,6 +44,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
44
44
|
srcTokenAddress: srcToken.address,
|
|
45
45
|
dstChain: dstChainId,
|
|
46
46
|
dstTokenAddress: dstToken.address,
|
|
47
|
+
recipientAddress,
|
|
47
48
|
price: dstAmount,
|
|
48
49
|
contractAddress: contractAddress,
|
|
49
50
|
tokenId: tokenId,
|
|
@@ -57,6 +58,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
57
58
|
srcTokenAddress: srcToken.address,
|
|
58
59
|
dstChain: dstChainId,
|
|
59
60
|
dstTokenAddress: dstToken.address,
|
|
61
|
+
recipientAddress,
|
|
60
62
|
price: dstAmount,
|
|
61
63
|
contractAddress: contractAddress,
|
|
62
64
|
};
|
|
@@ -68,6 +70,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
68
70
|
srcTokenAddress: srcToken.address,
|
|
69
71
|
dstChain: dstChainId,
|
|
70
72
|
dstTokenAddress: dstToken.address,
|
|
73
|
+
recipientAddress,
|
|
71
74
|
fundAmount: dstAmount,
|
|
72
75
|
contractAddress: contractAddress,
|
|
73
76
|
};
|
|
@@ -79,6 +82,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
79
82
|
srcTokenAddress: srcToken.address,
|
|
80
83
|
dstChain: dstChainId,
|
|
81
84
|
dstTokenAddress: dstToken.address,
|
|
85
|
+
recipientAddress,
|
|
82
86
|
payload: {
|
|
83
87
|
amount: dstAmount,
|
|
84
88
|
data: encodedData,
|
|
@@ -173,10 +177,11 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
173
177
|
srcToken: activeTab === "fiat" ? USDC_BASE : srcToken,
|
|
174
178
|
dstChainId: dstChainId,
|
|
175
179
|
dstToken: dstToken,
|
|
180
|
+
recipientAddress,
|
|
176
181
|
dstAmount: dstAmount,
|
|
177
182
|
contractAddress: contractAddress,
|
|
178
|
-
tokenId: orderType === "mint_nft" ? metadata
|
|
179
|
-
contractType: orderType === "mint_nft" ? metadata
|
|
183
|
+
tokenId: orderType === "mint_nft" ? metadata?.nftContract?.tokenId : undefined,
|
|
184
|
+
contractType: orderType === "mint_nft" ? metadata?.nftContract?.type : undefined,
|
|
180
185
|
encodedData: encodedData,
|
|
181
186
|
spenderAddress: spenderAddress,
|
|
182
187
|
});
|
|
@@ -190,6 +195,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
190
195
|
metadata?.nftContract?.tokenId,
|
|
191
196
|
metadata?.nftContract?.type,
|
|
192
197
|
orderType,
|
|
198
|
+
recipientAddress,
|
|
193
199
|
spenderAddress,
|
|
194
200
|
srcChainId,
|
|
195
201
|
srcToken,
|
|
@@ -116,6 +116,7 @@ export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, load
|
|
|
116
116
|
type: "swap",
|
|
117
117
|
tradeType: "EXACT_INPUT",
|
|
118
118
|
amount: activeInputAmountInWei,
|
|
119
|
+
recipientAddress: selectedRecipientAddress,
|
|
119
120
|
onrampVendor: paymentType === "fiat" ? getOnrampVendor(selectedFiatPaymentMethod) : undefined,
|
|
120
121
|
});
|
|
121
122
|
// Get geo options for fiat
|
|
@@ -503,6 +503,11 @@ export interface paths {
|
|
|
503
503
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
504
504
|
*/
|
|
505
505
|
dstTokenAddress: string;
|
|
506
|
+
/**
|
|
507
|
+
* @description Recipient address
|
|
508
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
509
|
+
*/
|
|
510
|
+
recipientAddress?: string;
|
|
506
511
|
/**
|
|
507
512
|
* @description Type of trade execution
|
|
508
513
|
* @enum {string}
|
|
@@ -544,6 +549,11 @@ export interface paths {
|
|
|
544
549
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
545
550
|
*/
|
|
546
551
|
dstTokenAddress: string;
|
|
552
|
+
/**
|
|
553
|
+
* @description Recipient address
|
|
554
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
555
|
+
*/
|
|
556
|
+
recipientAddress?: string;
|
|
547
557
|
/** @description Custom payload for execution */
|
|
548
558
|
payload: {
|
|
549
559
|
/** @description Encoded transaction data */
|
|
@@ -567,6 +577,11 @@ export interface paths {
|
|
|
567
577
|
dstChain: number;
|
|
568
578
|
srcTokenAddress: string;
|
|
569
579
|
dstTokenAddress: string;
|
|
580
|
+
/**
|
|
581
|
+
* @description Recipient address
|
|
582
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
583
|
+
*/
|
|
584
|
+
recipientAddress?: string;
|
|
570
585
|
/** @enum {string} */
|
|
571
586
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
572
587
|
contractAddress: string;
|
|
@@ -581,6 +596,11 @@ export interface paths {
|
|
|
581
596
|
dstChain: number;
|
|
582
597
|
srcTokenAddress: string;
|
|
583
598
|
dstTokenAddress: string;
|
|
599
|
+
/**
|
|
600
|
+
* @description Recipient address
|
|
601
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
602
|
+
*/
|
|
603
|
+
recipientAddress?: string;
|
|
584
604
|
/** @enum {string} */
|
|
585
605
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
586
606
|
contractAddress: string;
|
|
@@ -592,6 +612,11 @@ export interface paths {
|
|
|
592
612
|
dstChain: number;
|
|
593
613
|
srcTokenAddress: string;
|
|
594
614
|
dstTokenAddress: string;
|
|
615
|
+
/**
|
|
616
|
+
* @description Recipient address
|
|
617
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
618
|
+
*/
|
|
619
|
+
recipientAddress?: string;
|
|
595
620
|
/** @enum {string} */
|
|
596
621
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
597
622
|
contractAddress: string;
|
|
@@ -622,6 +647,11 @@ export interface paths {
|
|
|
622
647
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
623
648
|
*/
|
|
624
649
|
dstTokenAddress: string;
|
|
650
|
+
/**
|
|
651
|
+
* @description Recipient address
|
|
652
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
653
|
+
*/
|
|
654
|
+
recipientAddress?: string;
|
|
625
655
|
/**
|
|
626
656
|
* @description Amount to quote
|
|
627
657
|
* @example 1000000000000000000
|
|
@@ -503,6 +503,11 @@ export interface paths {
|
|
|
503
503
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
504
504
|
*/
|
|
505
505
|
dstTokenAddress: string;
|
|
506
|
+
/**
|
|
507
|
+
* @description Recipient address
|
|
508
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
509
|
+
*/
|
|
510
|
+
recipientAddress?: string;
|
|
506
511
|
/**
|
|
507
512
|
* @description Type of trade execution
|
|
508
513
|
* @enum {string}
|
|
@@ -544,6 +549,11 @@ export interface paths {
|
|
|
544
549
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
545
550
|
*/
|
|
546
551
|
dstTokenAddress: string;
|
|
552
|
+
/**
|
|
553
|
+
* @description Recipient address
|
|
554
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
555
|
+
*/
|
|
556
|
+
recipientAddress?: string;
|
|
547
557
|
/** @description Custom payload for execution */
|
|
548
558
|
payload: {
|
|
549
559
|
/** @description Encoded transaction data */
|
|
@@ -567,6 +577,11 @@ export interface paths {
|
|
|
567
577
|
dstChain: number;
|
|
568
578
|
srcTokenAddress: string;
|
|
569
579
|
dstTokenAddress: string;
|
|
580
|
+
/**
|
|
581
|
+
* @description Recipient address
|
|
582
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
583
|
+
*/
|
|
584
|
+
recipientAddress?: string;
|
|
570
585
|
/** @enum {string} */
|
|
571
586
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
572
587
|
contractAddress: string;
|
|
@@ -581,6 +596,11 @@ export interface paths {
|
|
|
581
596
|
dstChain: number;
|
|
582
597
|
srcTokenAddress: string;
|
|
583
598
|
dstTokenAddress: string;
|
|
599
|
+
/**
|
|
600
|
+
* @description Recipient address
|
|
601
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
602
|
+
*/
|
|
603
|
+
recipientAddress?: string;
|
|
584
604
|
/** @enum {string} */
|
|
585
605
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
586
606
|
contractAddress: string;
|
|
@@ -592,6 +612,11 @@ export interface paths {
|
|
|
592
612
|
dstChain: number;
|
|
593
613
|
srcTokenAddress: string;
|
|
594
614
|
dstTokenAddress: string;
|
|
615
|
+
/**
|
|
616
|
+
* @description Recipient address
|
|
617
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
618
|
+
*/
|
|
619
|
+
recipientAddress?: string;
|
|
595
620
|
/** @enum {string} */
|
|
596
621
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
597
622
|
contractAddress: string;
|
|
@@ -622,6 +647,11 @@ export interface paths {
|
|
|
622
647
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
623
648
|
*/
|
|
624
649
|
dstTokenAddress: string;
|
|
650
|
+
/**
|
|
651
|
+
* @description Recipient address
|
|
652
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
653
|
+
*/
|
|
654
|
+
recipientAddress?: string;
|
|
625
655
|
/**
|
|
626
656
|
* @description Amount to quote
|
|
627
657
|
* @example 1000000000000000000
|
package/package.json
CHANGED
|
@@ -448,6 +448,7 @@ function AnySpendInner({
|
|
|
448
448
|
type: "swap",
|
|
449
449
|
tradeType: isSrcInputDirty ? "EXACT_INPUT" : "EXACT_OUTPUT",
|
|
450
450
|
amount: activeInputAmountInWei,
|
|
451
|
+
recipientAddress,
|
|
451
452
|
}
|
|
452
453
|
: {
|
|
453
454
|
srcChain: base.id,
|
|
@@ -457,6 +458,7 @@ function AnySpendInner({
|
|
|
457
458
|
type: "swap",
|
|
458
459
|
tradeType: "EXACT_INPUT",
|
|
459
460
|
amount: srcAmountOnrampInWei,
|
|
461
|
+
recipientAddress,
|
|
460
462
|
onrampVendor: getOnrampVendor(selectedFiatPaymentMethod),
|
|
461
463
|
},
|
|
462
464
|
);
|
|
@@ -70,6 +70,7 @@ function generateGetRelayQuoteRequest({
|
|
|
70
70
|
srcToken,
|
|
71
71
|
dstChainId,
|
|
72
72
|
dstToken,
|
|
73
|
+
recipientAddress,
|
|
73
74
|
dstAmount,
|
|
74
75
|
contractAddress,
|
|
75
76
|
tokenId,
|
|
@@ -82,6 +83,7 @@ function generateGetRelayQuoteRequest({
|
|
|
82
83
|
srcToken: components["schemas"]["Token"];
|
|
83
84
|
dstChainId: number;
|
|
84
85
|
dstToken: components["schemas"]["Token"];
|
|
86
|
+
recipientAddress: string | undefined;
|
|
85
87
|
dstAmount: string;
|
|
86
88
|
contractAddress: string;
|
|
87
89
|
tokenId?: number | null;
|
|
@@ -98,6 +100,7 @@ function generateGetRelayQuoteRequest({
|
|
|
98
100
|
srcTokenAddress: srcToken.address,
|
|
99
101
|
dstChain: dstChainId,
|
|
100
102
|
dstTokenAddress: dstToken.address,
|
|
103
|
+
recipientAddress,
|
|
101
104
|
price: dstAmount,
|
|
102
105
|
contractAddress: contractAddress,
|
|
103
106
|
tokenId: tokenId,
|
|
@@ -111,6 +114,7 @@ function generateGetRelayQuoteRequest({
|
|
|
111
114
|
srcTokenAddress: srcToken.address,
|
|
112
115
|
dstChain: dstChainId,
|
|
113
116
|
dstTokenAddress: dstToken.address,
|
|
117
|
+
recipientAddress,
|
|
114
118
|
price: dstAmount,
|
|
115
119
|
contractAddress: contractAddress,
|
|
116
120
|
};
|
|
@@ -122,6 +126,7 @@ function generateGetRelayQuoteRequest({
|
|
|
122
126
|
srcTokenAddress: srcToken.address,
|
|
123
127
|
dstChain: dstChainId,
|
|
124
128
|
dstTokenAddress: dstToken.address,
|
|
129
|
+
recipientAddress,
|
|
125
130
|
fundAmount: dstAmount,
|
|
126
131
|
contractAddress: contractAddress,
|
|
127
132
|
};
|
|
@@ -133,6 +138,7 @@ function generateGetRelayQuoteRequest({
|
|
|
133
138
|
srcTokenAddress: srcToken.address,
|
|
134
139
|
dstChain: dstChainId,
|
|
135
140
|
dstTokenAddress: dstToken.address,
|
|
141
|
+
recipientAddress,
|
|
136
142
|
payload: {
|
|
137
143
|
amount: dstAmount,
|
|
138
144
|
data: encodedData,
|
|
@@ -320,10 +326,11 @@ function AnySpendCustomInner({
|
|
|
320
326
|
srcToken: activeTab === "fiat" ? USDC_BASE : srcToken,
|
|
321
327
|
dstChainId: dstChainId,
|
|
322
328
|
dstToken: dstToken,
|
|
329
|
+
recipientAddress,
|
|
323
330
|
dstAmount: dstAmount,
|
|
324
331
|
contractAddress: contractAddress,
|
|
325
|
-
tokenId: orderType === "mint_nft" ? metadata
|
|
326
|
-
contractType: orderType === "mint_nft" ? metadata
|
|
332
|
+
tokenId: orderType === "mint_nft" ? metadata?.nftContract?.tokenId : undefined,
|
|
333
|
+
contractType: orderType === "mint_nft" ? metadata?.nftContract?.type : undefined,
|
|
327
334
|
encodedData: encodedData,
|
|
328
335
|
spenderAddress: spenderAddress,
|
|
329
336
|
});
|
|
@@ -337,6 +344,7 @@ function AnySpendCustomInner({
|
|
|
337
344
|
metadata?.nftContract?.tokenId,
|
|
338
345
|
metadata?.nftContract?.type,
|
|
339
346
|
orderType,
|
|
347
|
+
recipientAddress,
|
|
340
348
|
spenderAddress,
|
|
341
349
|
srcChainId,
|
|
342
350
|
srcToken,
|
|
@@ -166,6 +166,7 @@ export function useAnyspendFlow({
|
|
|
166
166
|
type: "swap",
|
|
167
167
|
tradeType: "EXACT_INPUT",
|
|
168
168
|
amount: activeInputAmountInWei,
|
|
169
|
+
recipientAddress: selectedRecipientAddress,
|
|
169
170
|
onrampVendor: paymentType === "fiat" ? getOnrampVendor(selectedFiatPaymentMethod) : undefined,
|
|
170
171
|
});
|
|
171
172
|
|
|
@@ -505,6 +505,11 @@ export interface paths {
|
|
|
505
505
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
506
506
|
*/
|
|
507
507
|
dstTokenAddress: string;
|
|
508
|
+
/**
|
|
509
|
+
* @description Recipient address
|
|
510
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
511
|
+
*/
|
|
512
|
+
recipientAddress?: string;
|
|
508
513
|
/**
|
|
509
514
|
* @description Type of trade execution
|
|
510
515
|
* @enum {string}
|
|
@@ -547,6 +552,11 @@ export interface paths {
|
|
|
547
552
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
548
553
|
*/
|
|
549
554
|
dstTokenAddress: string;
|
|
555
|
+
/**
|
|
556
|
+
* @description Recipient address
|
|
557
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
558
|
+
*/
|
|
559
|
+
recipientAddress?: string;
|
|
550
560
|
/** @description Custom payload for execution */
|
|
551
561
|
payload: {
|
|
552
562
|
/** @description Encoded transaction data */
|
|
@@ -571,6 +581,11 @@ export interface paths {
|
|
|
571
581
|
dstChain: number;
|
|
572
582
|
srcTokenAddress: string;
|
|
573
583
|
dstTokenAddress: string;
|
|
584
|
+
/**
|
|
585
|
+
* @description Recipient address
|
|
586
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
587
|
+
*/
|
|
588
|
+
recipientAddress?: string;
|
|
574
589
|
/** @enum {string} */
|
|
575
590
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
576
591
|
contractAddress: string;
|
|
@@ -586,6 +601,11 @@ export interface paths {
|
|
|
586
601
|
dstChain: number;
|
|
587
602
|
srcTokenAddress: string;
|
|
588
603
|
dstTokenAddress: string;
|
|
604
|
+
/**
|
|
605
|
+
* @description Recipient address
|
|
606
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
607
|
+
*/
|
|
608
|
+
recipientAddress?: string;
|
|
589
609
|
/** @enum {string} */
|
|
590
610
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
591
611
|
contractAddress: string;
|
|
@@ -598,6 +618,11 @@ export interface paths {
|
|
|
598
618
|
dstChain: number;
|
|
599
619
|
srcTokenAddress: string;
|
|
600
620
|
dstTokenAddress: string;
|
|
621
|
+
/**
|
|
622
|
+
* @description Recipient address
|
|
623
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
624
|
+
*/
|
|
625
|
+
recipientAddress?: string;
|
|
601
626
|
/** @enum {string} */
|
|
602
627
|
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
603
628
|
contractAddress: string;
|
|
@@ -629,6 +654,11 @@ export interface paths {
|
|
|
629
654
|
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
630
655
|
*/
|
|
631
656
|
dstTokenAddress: string;
|
|
657
|
+
/**
|
|
658
|
+
* @description Recipient address
|
|
659
|
+
* @example 0x55c71fca5e01cf246718748ae540473e608d0282
|
|
660
|
+
*/
|
|
661
|
+
recipientAddress?: string;
|
|
632
662
|
/**
|
|
633
663
|
* @description Amount to quote
|
|
634
664
|
* @example 1000000000000000000
|