@0xsequence/checkout 5.0.2 → 5.0.4
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/api/data.d.ts +10 -0
- package/dist/cjs/api/data.d.ts.map +1 -1
- package/dist/cjs/api/data.js +19 -1
- package/dist/cjs/api/data.js.map +1 -1
- package/dist/cjs/components/SequenceCheckoutProvider/SequenceCheckoutProvider.d.ts.map +1 -1
- package/dist/cjs/components/SequenceCheckoutProvider/SequenceCheckoutProvider.js +2 -1
- package/dist/cjs/components/SequenceCheckoutProvider/SequenceCheckoutProvider.js.map +1 -1
- package/dist/cjs/contexts/AddFundsModal.d.ts +3 -0
- package/dist/cjs/contexts/AddFundsModal.d.ts.map +1 -1
- package/dist/cjs/contexts/AddFundsModal.js.map +1 -1
- package/dist/cjs/contexts/Environment.d.ts +2 -1
- package/dist/cjs/contexts/Environment.d.ts.map +1 -1
- package/dist/cjs/contexts/Environment.js.map +1 -1
- package/dist/cjs/contexts/SelectPaymentModal.d.ts +2 -0
- package/dist/cjs/contexts/SelectPaymentModal.d.ts.map +1 -1
- package/dist/cjs/contexts/SelectPaymentModal.js.map +1 -1
- package/dist/cjs/hooks/index.d.ts +1 -0
- package/dist/cjs/hooks/index.d.ts.map +1 -1
- package/dist/cjs/hooks/index.js +1 -0
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useAddFundsModal.d.ts +51 -3
- package/dist/cjs/hooks/useAddFundsModal.d.ts.map +1 -1
- package/dist/cjs/hooks/useAddFundsModal.js +38 -0
- package/dist/cjs/hooks/useAddFundsModal.js.map +1 -1
- package/dist/cjs/hooks/useCheckoutModal.d.ts +80 -3
- package/dist/cjs/hooks/useCheckoutModal.d.ts.map +1 -1
- package/dist/cjs/hooks/useCheckoutModal.js +67 -0
- package/dist/cjs/hooks/useCheckoutModal.js.map +1 -1
- package/dist/cjs/hooks/useERC1155SaleContractCheckout.d.ts +73 -3
- package/dist/cjs/hooks/useERC1155SaleContractCheckout.d.ts.map +1 -1
- package/dist/cjs/hooks/useERC1155SaleContractCheckout.js +62 -0
- package/dist/cjs/hooks/useERC1155SaleContractCheckout.js.map +1 -1
- package/dist/cjs/hooks/useSardineOnRampLink.d.ts +3 -0
- package/dist/cjs/hooks/useSardineOnRampLink.d.ts.map +1 -0
- package/dist/cjs/hooks/useSardineOnRampLink.js +20 -0
- package/dist/cjs/hooks/useSardineOnRampLink.js.map +1 -0
- package/dist/cjs/hooks/useSelectPaymentModal.d.ts +106 -3
- package/dist/cjs/hooks/useSelectPaymentModal.d.ts.map +1 -1
- package/dist/cjs/hooks/useSelectPaymentModal.js +93 -0
- package/dist/cjs/hooks/useSelectPaymentModal.js.map +1 -1
- package/dist/cjs/hooks/useSwapModal.d.ts +72 -3
- package/dist/cjs/hooks/useSwapModal.d.ts.map +1 -1
- package/dist/cjs/hooks/useSwapModal.js +59 -0
- package/dist/cjs/hooks/useSwapModal.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/views/AddFunds.d.ts +2 -0
- package/dist/cjs/views/AddFunds.d.ts.map +1 -1
- package/dist/cjs/views/AddFunds.js +74 -5
- package/dist/cjs/views/AddFunds.js.map +1 -1
- package/dist/cjs/views/PaymentSelection/FundWithFiat.d.ts +10 -0
- package/dist/cjs/views/PaymentSelection/FundWithFiat.d.ts.map +1 -0
- package/dist/cjs/views/PaymentSelection/FundWithFiat.js +27 -0
- package/dist/cjs/views/PaymentSelection/FundWithFiat.js.map +1 -0
- package/dist/cjs/views/PaymentSelection/PayWithCrypto/index.d.ts.map +1 -1
- package/dist/cjs/views/PaymentSelection/PayWithCrypto/index.js +4 -1
- package/dist/cjs/views/PaymentSelection/PayWithCrypto/index.js.map +1 -1
- package/dist/cjs/views/PaymentSelection/index.d.ts.map +1 -1
- package/dist/cjs/views/PaymentSelection/index.js +4 -2
- package/dist/cjs/views/PaymentSelection/index.js.map +1 -1
- package/dist/cjs/views/PendingCreditCardTransaction.js +3 -3
- package/dist/cjs/views/PendingCreditCardTransaction.js.map +1 -1
- package/dist/esm/api/data.d.ts +10 -0
- package/dist/esm/api/data.d.ts.map +1 -1
- package/dist/esm/api/data.js +17 -0
- package/dist/esm/api/data.js.map +1 -1
- package/dist/esm/components/SequenceCheckoutProvider/SequenceCheckoutProvider.d.ts.map +1 -1
- package/dist/esm/components/SequenceCheckoutProvider/SequenceCheckoutProvider.js +2 -1
- package/dist/esm/components/SequenceCheckoutProvider/SequenceCheckoutProvider.js.map +1 -1
- package/dist/esm/contexts/AddFundsModal.d.ts +3 -0
- package/dist/esm/contexts/AddFundsModal.d.ts.map +1 -1
- package/dist/esm/contexts/AddFundsModal.js.map +1 -1
- package/dist/esm/contexts/Environment.d.ts +2 -1
- package/dist/esm/contexts/Environment.d.ts.map +1 -1
- package/dist/esm/contexts/Environment.js.map +1 -1
- package/dist/esm/contexts/SelectPaymentModal.d.ts +2 -0
- package/dist/esm/contexts/SelectPaymentModal.d.ts.map +1 -1
- package/dist/esm/contexts/SelectPaymentModal.js.map +1 -1
- package/dist/esm/hooks/index.d.ts +1 -0
- package/dist/esm/hooks/index.d.ts.map +1 -1
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useAddFundsModal.d.ts +51 -3
- package/dist/esm/hooks/useAddFundsModal.d.ts.map +1 -1
- package/dist/esm/hooks/useAddFundsModal.js +38 -0
- package/dist/esm/hooks/useAddFundsModal.js.map +1 -1
- package/dist/esm/hooks/useCheckoutModal.d.ts +80 -3
- package/dist/esm/hooks/useCheckoutModal.d.ts.map +1 -1
- package/dist/esm/hooks/useCheckoutModal.js +67 -0
- package/dist/esm/hooks/useCheckoutModal.js.map +1 -1
- package/dist/esm/hooks/useERC1155SaleContractCheckout.d.ts +73 -3
- package/dist/esm/hooks/useERC1155SaleContractCheckout.d.ts.map +1 -1
- package/dist/esm/hooks/useERC1155SaleContractCheckout.js +62 -0
- package/dist/esm/hooks/useERC1155SaleContractCheckout.js.map +1 -1
- package/dist/esm/hooks/useSardineOnRampLink.d.ts +3 -0
- package/dist/esm/hooks/useSardineOnRampLink.d.ts.map +1 -0
- package/dist/esm/hooks/useSardineOnRampLink.js +16 -0
- package/dist/esm/hooks/useSardineOnRampLink.js.map +1 -0
- package/dist/esm/hooks/useSelectPaymentModal.d.ts +106 -3
- package/dist/esm/hooks/useSelectPaymentModal.d.ts.map +1 -1
- package/dist/esm/hooks/useSelectPaymentModal.js +93 -0
- package/dist/esm/hooks/useSelectPaymentModal.js.map +1 -1
- package/dist/esm/hooks/useSwapModal.d.ts +72 -3
- package/dist/esm/hooks/useSwapModal.d.ts.map +1 -1
- package/dist/esm/hooks/useSwapModal.js +59 -0
- package/dist/esm/hooks/useSwapModal.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/views/AddFunds.d.ts +2 -0
- package/dist/esm/views/AddFunds.d.ts.map +1 -1
- package/dist/esm/views/AddFunds.js +69 -2
- package/dist/esm/views/AddFunds.js.map +1 -1
- package/dist/esm/views/PaymentSelection/FundWithFiat.d.ts +10 -0
- package/dist/esm/views/PaymentSelection/FundWithFiat.d.ts.map +1 -0
- package/dist/esm/views/PaymentSelection/FundWithFiat.js +23 -0
- package/dist/esm/views/PaymentSelection/FundWithFiat.js.map +1 -0
- package/dist/esm/views/PaymentSelection/PayWithCrypto/index.d.ts.map +1 -1
- package/dist/esm/views/PaymentSelection/PayWithCrypto/index.js +4 -1
- package/dist/esm/views/PaymentSelection/PayWithCrypto/index.js.map +1 -1
- package/dist/esm/views/PaymentSelection/index.d.ts.map +1 -1
- package/dist/esm/views/PaymentSelection/index.js +5 -3
- package/dist/esm/views/PaymentSelection/index.js.map +1 -1
- package/dist/esm/views/PendingCreditCardTransaction.js +3 -3
- package/dist/esm/views/PendingCreditCardTransaction.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPaymentModal.js","sourceRoot":"","sources":["../../../src/contexts/SelectPaymentModal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectPaymentModal.js","sourceRoot":"","sources":["../../../src/contexts/SelectPaymentModal.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AA8CvD,MAAM,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,GAAG,oBAAoB,EAA6B,CAAA;AAEjH,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA"}
|
package/dist/esm/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA"}
|
|
@@ -1,6 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { AddFundsSettings } from '../contexts/AddFundsModal';
|
|
2
|
+
/**
|
|
3
|
+
* Return type for the useAddFundsModal hook.
|
|
4
|
+
*
|
|
5
|
+
* @property Function to open the On-ramp modal `triggerAddFunds`
|
|
6
|
+
* @property Function to close the On-ramp modal `closeAddFunds`
|
|
7
|
+
* @property Current settings for the On-ramp modal `addFundsSettings`
|
|
8
|
+
*/
|
|
9
|
+
type UseAddFundsModalReturnType = {
|
|
10
|
+
triggerAddFunds: (settings: AddFundsSettings) => void;
|
|
3
11
|
closeAddFunds: () => void;
|
|
4
|
-
addFundsSettings:
|
|
12
|
+
addFundsSettings: AddFundsSettings | undefined;
|
|
5
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Hook to manage the On-ramp modal that allows users to buy cryptocurrency with a credit/debit card.
|
|
16
|
+
*
|
|
17
|
+
* This hook provides methods to open and close the modal, and access its current settings.
|
|
18
|
+
* The modal integration is powered by Transak, allowing users to purchase crypto directly within
|
|
19
|
+
* your application.
|
|
20
|
+
*
|
|
21
|
+
* Go to {@link https://docs.sequence.xyz/sdk/web/hooks/useAddFundsModal} for more detailed documentation.
|
|
22
|
+
*
|
|
23
|
+
* @returns An object containing functions and settings for the On-ramp modal {@link UseAddFundsModalReturnType}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* import { useAddFundsModal } from '@0xsequence/checkout'
|
|
28
|
+
*
|
|
29
|
+
* const YourComponent = () => {
|
|
30
|
+
* const { triggerAddFunds } = useAddFundsModal()
|
|
31
|
+
* const walletAddress = '0x123...' // User's wallet address
|
|
32
|
+
*
|
|
33
|
+
* const handleAddFunds = () => {
|
|
34
|
+
* triggerAddFunds({
|
|
35
|
+
* walletAddress,
|
|
36
|
+
* defaultFiatAmount: '50',
|
|
37
|
+
* defaultCryptoCurrency: 'USDC',
|
|
38
|
+
* onOrderSuccessful: (data) => {
|
|
39
|
+
* console.log('Order successful!', data)
|
|
40
|
+
* }
|
|
41
|
+
* })
|
|
42
|
+
* }
|
|
43
|
+
*
|
|
44
|
+
* return (
|
|
45
|
+
* <button onClick={handleAddFunds}>
|
|
46
|
+
* Add Funds
|
|
47
|
+
* </button>
|
|
48
|
+
* )
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare const useAddFundsModal: () => UseAddFundsModalReturnType;
|
|
53
|
+
export {};
|
|
6
54
|
//# sourceMappingURL=useAddFundsModal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAddFundsModal.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAddFundsModal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAddFundsModal.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAddFundsModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA2B,MAAM,2BAA2B,CAAA;AAErF;;;;;;GAMG;AACH,KAAK,0BAA0B,GAAG;IAChC,eAAe,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACrD,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,CAAA;CAC/C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,gBAAgB,QAAO,0BAInC,CAAA"}
|
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
import { useAddFundsModalContext } from '../contexts/AddFundsModal';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to manage the On-ramp modal that allows users to buy cryptocurrency with a credit/debit card.
|
|
4
|
+
*
|
|
5
|
+
* This hook provides methods to open and close the modal, and access its current settings.
|
|
6
|
+
* The modal integration is powered by Transak, allowing users to purchase crypto directly within
|
|
7
|
+
* your application.
|
|
8
|
+
*
|
|
9
|
+
* Go to {@link https://docs.sequence.xyz/sdk/web/hooks/useAddFundsModal} for more detailed documentation.
|
|
10
|
+
*
|
|
11
|
+
* @returns An object containing functions and settings for the On-ramp modal {@link UseAddFundsModalReturnType}
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { useAddFundsModal } from '@0xsequence/checkout'
|
|
16
|
+
*
|
|
17
|
+
* const YourComponent = () => {
|
|
18
|
+
* const { triggerAddFunds } = useAddFundsModal()
|
|
19
|
+
* const walletAddress = '0x123...' // User's wallet address
|
|
20
|
+
*
|
|
21
|
+
* const handleAddFunds = () => {
|
|
22
|
+
* triggerAddFunds({
|
|
23
|
+
* walletAddress,
|
|
24
|
+
* defaultFiatAmount: '50',
|
|
25
|
+
* defaultCryptoCurrency: 'USDC',
|
|
26
|
+
* onOrderSuccessful: (data) => {
|
|
27
|
+
* console.log('Order successful!', data)
|
|
28
|
+
* }
|
|
29
|
+
* })
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* return (
|
|
33
|
+
* <button onClick={handleAddFunds}>
|
|
34
|
+
* Add Funds
|
|
35
|
+
* </button>
|
|
36
|
+
* )
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
2
40
|
export const useAddFundsModal = () => {
|
|
3
41
|
const { triggerAddFunds, closeAddFunds, addFundsSettings } = useAddFundsModalContext();
|
|
4
42
|
return { triggerAddFunds, closeAddFunds, addFundsSettings };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAddFundsModal.js","sourceRoot":"","sources":["../../../src/hooks/useAddFundsModal.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useAddFundsModal.js","sourceRoot":"","sources":["../../../src/hooks/useAddFundsModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAerF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAA+B,EAAE;IAC/D,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,uBAAuB,EAAE,CAAA;IAEtF,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAA;AAC7D,CAAC,CAAA"}
|
|
@@ -1,6 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { CheckoutSettings } from '../contexts/CheckoutModal';
|
|
2
|
+
/**
|
|
3
|
+
* Return type for the useCheckoutModal hook.
|
|
4
|
+
*
|
|
5
|
+
* @property {function(settings: CheckoutSettings): void} triggerCheckout - Function to open the Checkout modal
|
|
6
|
+
* @property {function(): void} closeCheckout - Function to close the Checkout modal
|
|
7
|
+
* @property {CheckoutSettings|undefined} settings - Current settings for the Checkout modal
|
|
8
|
+
*/
|
|
9
|
+
type UseCheckoutModalReturnType = {
|
|
10
|
+
triggerCheckout: (settings: CheckoutSettings) => void;
|
|
3
11
|
closeCheckout: () => void;
|
|
4
|
-
settings:
|
|
12
|
+
settings: CheckoutSettings | undefined;
|
|
5
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Hook to manage the Checkout modal that allows users to complete purchases using various payment methods.
|
|
16
|
+
*
|
|
17
|
+
* This hook provides methods to open and close the checkout modal, and access its current settings.
|
|
18
|
+
* Checkout supports credit card payments and crypto payments for purchasing digital assets.
|
|
19
|
+
*
|
|
20
|
+
* Go to {@link https://docs.sequence.xyz/sdk/web/hooks/useCheckoutModal} for more detailed documentation.
|
|
21
|
+
*
|
|
22
|
+
* @returns An object containing functions and settings for the Checkout modal {@link UseCheckoutModalReturnType}
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { useCheckoutModal } from '@0xsequence/checkout'
|
|
27
|
+
* import { ChainId } from '@0xsequence/network'
|
|
28
|
+
* import { getOrderbookCalldata } from '../utils'
|
|
29
|
+
*
|
|
30
|
+
* const YourComponent = () => {
|
|
31
|
+
* const { address } = useAccount()
|
|
32
|
+
* const { triggerCheckout } = useCheckoutModal()
|
|
33
|
+
*
|
|
34
|
+
* const handleCheckout = () => {
|
|
35
|
+
* // NFT purchase settings
|
|
36
|
+
* const chainId = ChainId.POLYGON
|
|
37
|
+
* const orderbookAddress = '0xB537a160472183f2150d42EB1c3DD6684A55f74c'
|
|
38
|
+
* const nftQuantity = '1'
|
|
39
|
+
* const orderId = 'your-order-id'
|
|
40
|
+
* const tokenContractAddress = '0xabcdef...' // NFT contract address
|
|
41
|
+
* const tokenId = '123' // NFT token ID
|
|
42
|
+
*
|
|
43
|
+
* triggerCheckout({
|
|
44
|
+
* creditCardCheckout: {
|
|
45
|
+
* chainId,
|
|
46
|
+
* contractAddress: orderbookAddress,
|
|
47
|
+
* recipientAddress: address || '',
|
|
48
|
+
* currencyQuantity: '100000',
|
|
49
|
+
* currencySymbol: 'USDC',
|
|
50
|
+
* currencyAddress: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
51
|
+
* currencyDecimals: '6',
|
|
52
|
+
* nftId: tokenId,
|
|
53
|
+
* nftAddress: tokenContractAddress,
|
|
54
|
+
* nftQuantity,
|
|
55
|
+
* approvedSpenderAddress: orderbookAddress,
|
|
56
|
+
* calldata: getOrderbookCalldata({
|
|
57
|
+
* orderId,
|
|
58
|
+
* quantity: nftQuantity,
|
|
59
|
+
* recipient: address || ''
|
|
60
|
+
* }),
|
|
61
|
+
* onSuccess: (txHash) => console.log('Success!', txHash)
|
|
62
|
+
* },
|
|
63
|
+
* orderSummaryItems: [
|
|
64
|
+
* {
|
|
65
|
+
* title: 'NFT #' + tokenId,
|
|
66
|
+
* subtitle: 'Your Collection',
|
|
67
|
+
* imageUrl: 'https://example.com/nft.png'
|
|
68
|
+
* }
|
|
69
|
+
* ]
|
|
70
|
+
* })
|
|
71
|
+
* }
|
|
72
|
+
*
|
|
73
|
+
* return (
|
|
74
|
+
* <button onClick={handleCheckout}>
|
|
75
|
+
* Checkout
|
|
76
|
+
* </button>
|
|
77
|
+
* )
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare const useCheckoutModal: () => UseCheckoutModalReturnType;
|
|
82
|
+
export {};
|
|
6
83
|
//# sourceMappingURL=useCheckoutModal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckoutModal.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCheckoutModal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCheckoutModal.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCheckoutModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA2B,MAAM,2BAA2B,CAAA;AAErF;;;;;;GAMG;AACH,KAAK,0BAA0B,GAAG;IAChC,eAAe,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACrD,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,QAAQ,EAAE,gBAAgB,GAAG,SAAS,CAAA;CACvC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,eAAO,MAAM,gBAAgB,QAAO,0BAInC,CAAA"}
|
|
@@ -1,4 +1,71 @@
|
|
|
1
1
|
import { useCheckoutModalContext } from '../contexts/CheckoutModal';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to manage the Checkout modal that allows users to complete purchases using various payment methods.
|
|
4
|
+
*
|
|
5
|
+
* This hook provides methods to open and close the checkout modal, and access its current settings.
|
|
6
|
+
* Checkout supports credit card payments and crypto payments for purchasing digital assets.
|
|
7
|
+
*
|
|
8
|
+
* Go to {@link https://docs.sequence.xyz/sdk/web/hooks/useCheckoutModal} for more detailed documentation.
|
|
9
|
+
*
|
|
10
|
+
* @returns An object containing functions and settings for the Checkout modal {@link UseCheckoutModalReturnType}
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import { useCheckoutModal } from '@0xsequence/checkout'
|
|
15
|
+
* import { ChainId } from '@0xsequence/network'
|
|
16
|
+
* import { getOrderbookCalldata } from '../utils'
|
|
17
|
+
*
|
|
18
|
+
* const YourComponent = () => {
|
|
19
|
+
* const { address } = useAccount()
|
|
20
|
+
* const { triggerCheckout } = useCheckoutModal()
|
|
21
|
+
*
|
|
22
|
+
* const handleCheckout = () => {
|
|
23
|
+
* // NFT purchase settings
|
|
24
|
+
* const chainId = ChainId.POLYGON
|
|
25
|
+
* const orderbookAddress = '0xB537a160472183f2150d42EB1c3DD6684A55f74c'
|
|
26
|
+
* const nftQuantity = '1'
|
|
27
|
+
* const orderId = 'your-order-id'
|
|
28
|
+
* const tokenContractAddress = '0xabcdef...' // NFT contract address
|
|
29
|
+
* const tokenId = '123' // NFT token ID
|
|
30
|
+
*
|
|
31
|
+
* triggerCheckout({
|
|
32
|
+
* creditCardCheckout: {
|
|
33
|
+
* chainId,
|
|
34
|
+
* contractAddress: orderbookAddress,
|
|
35
|
+
* recipientAddress: address || '',
|
|
36
|
+
* currencyQuantity: '100000',
|
|
37
|
+
* currencySymbol: 'USDC',
|
|
38
|
+
* currencyAddress: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
39
|
+
* currencyDecimals: '6',
|
|
40
|
+
* nftId: tokenId,
|
|
41
|
+
* nftAddress: tokenContractAddress,
|
|
42
|
+
* nftQuantity,
|
|
43
|
+
* approvedSpenderAddress: orderbookAddress,
|
|
44
|
+
* calldata: getOrderbookCalldata({
|
|
45
|
+
* orderId,
|
|
46
|
+
* quantity: nftQuantity,
|
|
47
|
+
* recipient: address || ''
|
|
48
|
+
* }),
|
|
49
|
+
* onSuccess: (txHash) => console.log('Success!', txHash)
|
|
50
|
+
* },
|
|
51
|
+
* orderSummaryItems: [
|
|
52
|
+
* {
|
|
53
|
+
* title: 'NFT #' + tokenId,
|
|
54
|
+
* subtitle: 'Your Collection',
|
|
55
|
+
* imageUrl: 'https://example.com/nft.png'
|
|
56
|
+
* }
|
|
57
|
+
* ]
|
|
58
|
+
* })
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* return (
|
|
62
|
+
* <button onClick={handleCheckout}>
|
|
63
|
+
* Checkout
|
|
64
|
+
* </button>
|
|
65
|
+
* )
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
2
69
|
export const useCheckoutModal = () => {
|
|
3
70
|
const { triggerCheckout, closeCheckout, settings } = useCheckoutModalContext();
|
|
4
71
|
return { triggerCheckout, closeCheckout, settings };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckoutModal.js","sourceRoot":"","sources":["../../../src/hooks/useCheckoutModal.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useCheckoutModal.js","sourceRoot":"","sources":["../../../src/hooks/useCheckoutModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAerF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAA+B,EAAE;IAC/D,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,uBAAuB,EAAE,CAAA;IAE9E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAA;AACrD,CAAC,CAAA"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { CheckoutOptionsSalesContractArgs } from '@0xsequence/marketplace';
|
|
2
2
|
import { SelectPaymentSettings } from '../contexts/SelectPaymentModal';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Return type for the useERC1155SaleContractCheckout hook.
|
|
5
|
+
*
|
|
6
|
+
* @property Function to open the checkout modal `openCheckoutModal`
|
|
7
|
+
* @property Function to close the checkout modal `closeCheckoutModal`
|
|
8
|
+
* @property Current payment settings for the modal `selectPaymentSettings`
|
|
9
|
+
* @property Whether the contract data is still loading `isLoading`
|
|
10
|
+
* @property Whether there was an error loading the contract data `isError`
|
|
11
|
+
*/
|
|
12
|
+
interface UseERC1155SaleContractCheckoutReturnType {
|
|
4
13
|
openCheckoutModal: () => void;
|
|
5
14
|
closeCheckoutModal: () => void;
|
|
6
15
|
selectPaymentSettings?: SelectPaymentSettings;
|
|
@@ -9,7 +18,68 @@ interface UseERC1155SaleContractCheckoutReturn {
|
|
|
9
18
|
}
|
|
10
19
|
type SaleContractSettings = Omit<SelectPaymentSettings, 'txData' | 'collectibles' | 'price' | 'currencyAddress' | 'recipientAddress' | 'targetContractAddress'>;
|
|
11
20
|
export declare const getERC1155SaleContractConfig: ({ chain, price, currencyAddress, recipientAddress, collectibles, collectionAddress, ...restProps }: Omit<SelectPaymentSettings, "txData">) => SelectPaymentSettings;
|
|
12
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Hook for enabling ERC-1155 NFT purchases using a standard sale contract.
|
|
23
|
+
*
|
|
24
|
+
* This hook simplifies the process of purchasing ERC-1155 tokens by automatically:
|
|
25
|
+
* - Fetching price information from the sale contract
|
|
26
|
+
* - Determining payment options (crypto, credit card, etc.)
|
|
27
|
+
* - Generating the proper transaction data
|
|
28
|
+
* - Opening and managing the checkout modal
|
|
29
|
+
*
|
|
30
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useERC1155SaleContractCheckout} for more detailed documentation.
|
|
31
|
+
*
|
|
32
|
+
* @param {object} params - Configuration options for the ERC-1155 sale contract checkout
|
|
33
|
+
* @param {number} params.chain - Chain ID where the sale contract is deployed
|
|
34
|
+
* @param {string} params.contractAddress - Address of the ERC-1155 sale contract
|
|
35
|
+
* @param {string} params.wallet - Address of the wallet that will receive the NFTs
|
|
36
|
+
* @param {string} params.collectionAddress - Address of the ERC-1155 token contract
|
|
37
|
+
* @param {Array<{tokenId: string, quantity: string}>} params.items - Array of token IDs and quantities to purchase
|
|
38
|
+
* @param {function} [params.onSuccess] - Callback function when the transaction is successful
|
|
39
|
+
* @param {function} [params.onError] - Callback function when an error occurs
|
|
40
|
+
* @param {function} [params.onClose] - Callback function when the modal is closed
|
|
41
|
+
*
|
|
42
|
+
* @returns Object containing functions to control the checkout modal and state {@link UseERC1155SaleContractCheckoutReturnType}
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* import { useERC1155SaleContractCheckout } from "@0xsequence/checkout";
|
|
47
|
+
* import { useAccount } from "wagmi";
|
|
48
|
+
*
|
|
49
|
+
* const MyComponent = () => {
|
|
50
|
+
* const { address: userAddress } = useAccount();
|
|
51
|
+
* const { openCheckoutModal } = useERC1155SaleContractCheckout({
|
|
52
|
+
* chain: 80001, // chainId of the chain the collectible is on
|
|
53
|
+
* contractAddress: "0x0327b2f274e04d292e74a06809bcd687c63a4ba4", // address of the contract handling the minting function
|
|
54
|
+
* wallet: userAddress!, // address of the recipient
|
|
55
|
+
* collectionAddress: "0x888a322db4b8033bac3ff84412738c096f87f9d0", // address of the collection contract
|
|
56
|
+
* items: [
|
|
57
|
+
* // array of collectibles to purchase
|
|
58
|
+
* {
|
|
59
|
+
* tokenId: "0",
|
|
60
|
+
* quantity: "1",
|
|
61
|
+
* },
|
|
62
|
+
* ],
|
|
63
|
+
* onSuccess: (txnHash: string) => {
|
|
64
|
+
* console.log("success!", txnHash);
|
|
65
|
+
* },
|
|
66
|
+
* onError: (error: Error) => {
|
|
67
|
+
* console.error(error);
|
|
68
|
+
* },
|
|
69
|
+
* });
|
|
70
|
+
*
|
|
71
|
+
* const onClick = () => {
|
|
72
|
+
* if (!userAddress) {
|
|
73
|
+
* return;
|
|
74
|
+
* }
|
|
75
|
+
* openCheckoutModal();
|
|
76
|
+
* };
|
|
77
|
+
*
|
|
78
|
+
* return <button onClick={onClick}>Buy ERC-1155 collectible!</button>;
|
|
79
|
+
* };
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare const useERC1155SaleContractCheckout: ({ chain, contractAddress, wallet, collectionAddress, items, ...restArgs }: CheckoutOptionsSalesContractArgs & SaleContractSettings) => UseERC1155SaleContractCheckoutReturnType;
|
|
13
83
|
interface UseSaleContractConfigArgs {
|
|
14
84
|
chainId: number;
|
|
15
85
|
contractAddress: string;
|
|
@@ -32,6 +102,6 @@ export declare const useSaleContractConfig: ({ chainId, contractAddress, tokenId
|
|
|
32
102
|
/**
|
|
33
103
|
* @deprecated use useERC1155SaleContractPaymentModal instead
|
|
34
104
|
*/
|
|
35
|
-
export declare const useERC1155SaleContractPaymentModal: ({ chain, contractAddress, wallet, collectionAddress, items, ...restArgs }: CheckoutOptionsSalesContractArgs & SaleContractSettings) =>
|
|
105
|
+
export declare const useERC1155SaleContractPaymentModal: ({ chain, contractAddress, wallet, collectionAddress, items, ...restArgs }: CheckoutOptionsSalesContractArgs & SaleContractSettings) => UseERC1155SaleContractCheckoutReturnType;
|
|
36
106
|
export {};
|
|
37
107
|
//# sourceMappingURL=useERC1155SaleContractCheckout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useERC1155SaleContractCheckout.d.ts","sourceRoot":"","sources":["../../../src/hooks/useERC1155SaleContractCheckout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAA2B,MAAM,yBAAyB,CAAA;AAMnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAKtE,UAAU,
|
|
1
|
+
{"version":3,"file":"useERC1155SaleContractCheckout.d.ts","sourceRoot":"","sources":["../../../src/hooks/useERC1155SaleContractCheckout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAA2B,MAAM,yBAAyB,CAAA;AAMnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAKtE;;;;;;;;GAQG;AACH,UAAU,wCAAwC;IAChD,iBAAiB,EAAE,MAAM,IAAI,CAAA;IAC7B,kBAAkB,EAAE,MAAM,IAAI,CAAA;IAC9B,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,KAAK,oBAAoB,GAAG,IAAI,CAC9B,qBAAqB,EACrB,QAAQ,GAAG,cAAc,GAAG,OAAO,GAAG,iBAAiB,GAAG,kBAAkB,GAAG,uBAAuB,CACvG,CAAA;AAED,eAAO,MAAM,4BAA4B,GAAI,oGAQ1C,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,KAAG,qBA0B1C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,eAAO,MAAM,8BAA8B,GAAI,2EAO5C,gCAAgC,GAAG,oBAAoB,KAAG,wCAgE5D,CAAA;AAED,UAAU,yBAAyB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd;AAED,UAAU,yBAAyB;IACjC,eAAe,EAAE,MAAM,CAAA;IACvB,WAAW,EAAE,UAAU,EAAE,CAAA;CAC1B;AAED,UAAU,2BAA2B;IACnC,IAAI,CAAC,EAAE,yBAAyB,CAAA;IAChC,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,eAAO,MAAM,qBAAqB,GAAI,wCAInC,yBAAyB,KAAG,2BAgG9B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kCAAkC,8EAjM5C,gCAAgC,GAAG,oBAAoB,KAAG,wCAiMmB,CAAA"}
|
|
@@ -31,6 +31,67 @@ export const getERC1155SaleContractConfig = ({ chain, price, currencyAddress = z
|
|
|
31
31
|
...restProps
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Hook for enabling ERC-1155 NFT purchases using a standard sale contract.
|
|
36
|
+
*
|
|
37
|
+
* This hook simplifies the process of purchasing ERC-1155 tokens by automatically:
|
|
38
|
+
* - Fetching price information from the sale contract
|
|
39
|
+
* - Determining payment options (crypto, credit card, etc.)
|
|
40
|
+
* - Generating the proper transaction data
|
|
41
|
+
* - Opening and managing the checkout modal
|
|
42
|
+
*
|
|
43
|
+
* @see {@link https://docs.sequence.xyz/sdk/web/hooks/useERC1155SaleContractCheckout} for more detailed documentation.
|
|
44
|
+
*
|
|
45
|
+
* @param {object} params - Configuration options for the ERC-1155 sale contract checkout
|
|
46
|
+
* @param {number} params.chain - Chain ID where the sale contract is deployed
|
|
47
|
+
* @param {string} params.contractAddress - Address of the ERC-1155 sale contract
|
|
48
|
+
* @param {string} params.wallet - Address of the wallet that will receive the NFTs
|
|
49
|
+
* @param {string} params.collectionAddress - Address of the ERC-1155 token contract
|
|
50
|
+
* @param {Array<{tokenId: string, quantity: string}>} params.items - Array of token IDs and quantities to purchase
|
|
51
|
+
* @param {function} [params.onSuccess] - Callback function when the transaction is successful
|
|
52
|
+
* @param {function} [params.onError] - Callback function when an error occurs
|
|
53
|
+
* @param {function} [params.onClose] - Callback function when the modal is closed
|
|
54
|
+
*
|
|
55
|
+
* @returns Object containing functions to control the checkout modal and state {@link UseERC1155SaleContractCheckoutReturnType}
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* import { useERC1155SaleContractCheckout } from "@0xsequence/checkout";
|
|
60
|
+
* import { useAccount } from "wagmi";
|
|
61
|
+
*
|
|
62
|
+
* const MyComponent = () => {
|
|
63
|
+
* const { address: userAddress } = useAccount();
|
|
64
|
+
* const { openCheckoutModal } = useERC1155SaleContractCheckout({
|
|
65
|
+
* chain: 80001, // chainId of the chain the collectible is on
|
|
66
|
+
* contractAddress: "0x0327b2f274e04d292e74a06809bcd687c63a4ba4", // address of the contract handling the minting function
|
|
67
|
+
* wallet: userAddress!, // address of the recipient
|
|
68
|
+
* collectionAddress: "0x888a322db4b8033bac3ff84412738c096f87f9d0", // address of the collection contract
|
|
69
|
+
* items: [
|
|
70
|
+
* // array of collectibles to purchase
|
|
71
|
+
* {
|
|
72
|
+
* tokenId: "0",
|
|
73
|
+
* quantity: "1",
|
|
74
|
+
* },
|
|
75
|
+
* ],
|
|
76
|
+
* onSuccess: (txnHash: string) => {
|
|
77
|
+
* console.log("success!", txnHash);
|
|
78
|
+
* },
|
|
79
|
+
* onError: (error: Error) => {
|
|
80
|
+
* console.error(error);
|
|
81
|
+
* },
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* const onClick = () => {
|
|
85
|
+
* if (!userAddress) {
|
|
86
|
+
* return;
|
|
87
|
+
* }
|
|
88
|
+
* openCheckoutModal();
|
|
89
|
+
* };
|
|
90
|
+
*
|
|
91
|
+
* return <button onClick={onClick}>Buy ERC-1155 collectible!</button>;
|
|
92
|
+
* };
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
34
95
|
export const useERC1155SaleContractCheckout = ({ chain, contractAddress, wallet, collectionAddress, items, ...restArgs }) => {
|
|
35
96
|
const { openSelectPaymentModal, closeSelectPaymentModal, selectPaymentSettings } = useSelectPaymentModal();
|
|
36
97
|
const { data: checkoutOptions, isLoading: isLoadingCheckoutOptions, isError: isErrorCheckoutOptions } = useCheckoutOptionsSalesContract(chain, {
|
|
@@ -68,6 +129,7 @@ export const useERC1155SaleContractCheckout = ({ chain, contractAddress, wallet,
|
|
|
68
129
|
enableMainCurrencyPayment: true,
|
|
69
130
|
enableSwapPayments: checkoutOptions?.options?.swap?.includes(TransactionSwapProvider.zerox) || false,
|
|
70
131
|
creditCardProviders: checkoutOptions?.options.nftCheckout || [],
|
|
132
|
+
onRampProvider: checkoutOptions?.options.onRamp?.[0],
|
|
71
133
|
...restArgs
|
|
72
134
|
}));
|
|
73
135
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useERC1155SaleContractCheckout.js","sourceRoot":"","sources":["../../../src/hooks/useERC1155SaleContractCheckout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAY,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAEzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAGzD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"useERC1155SaleContractCheckout.js","sourceRoot":"","sources":["../../../src/hooks/useERC1155SaleContractCheckout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAY,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAEzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAGzD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAwB/D,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EAC3C,KAAK,EACL,KAAK,EACL,eAAe,GAAG,WAAW,EAC7B,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,GAAG,SAAS,EAC0B,EAAyB,EAAE;IACjE,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;QACjD,GAAG,EAAE,sBAAsB;QAC3B,YAAY,EA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G,CAAC,uBAAuB,EAAE,CAAC,KAAK,CAAC,CAAC,MAA6B,CAAA,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAA;YACvG,OAAO;gBACL,OAAO;gBACP,KAAK,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;aACnE,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,SAAS,CAAA;IAClB,CAAC,CAAA;IAED,OAAO;QACL,IAAI,EAAE;YACJ,eAAe,EAAE,mBAA6B;YAC9C,WAAW,EAAE,cAAc,EAAE;SAC9B;QACD,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE,cAAc;KACxB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,8BAA8B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSardineOnRampLink.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSardineOnRampLink.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAA0B,MAAM,aAAa,CAAA;AAE3E,eAAO,MAAM,oBAAoB,GAAI,MAAM,qBAAqB,EAAE,WAAW,OAAO,kEAanF,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { fetchSardineOnRampLink } from '../api/data';
|
|
3
|
+
export const useSardineOnRampLink = (args, disabled) => {
|
|
4
|
+
return useQuery({
|
|
5
|
+
queryKey: ['useSardineOnRampLink', args],
|
|
6
|
+
queryFn: async () => {
|
|
7
|
+
const res = await fetchSardineOnRampLink(args);
|
|
8
|
+
return res;
|
|
9
|
+
},
|
|
10
|
+
retry: false,
|
|
11
|
+
staleTime: 0,
|
|
12
|
+
enabled: !disabled,
|
|
13
|
+
refetchOnWindowFocus: false
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useSardineOnRampLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSardineOnRampLink.js","sourceRoot":"","sources":["../../../src/hooks/useSardineOnRampLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAAyB,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAE3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAA2B,EAAE,QAAkB,EAAE,EAAE;IACtF,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC;QACxC,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,GAAG,GAAG,MAAM,sBAAsB,CAAC,IAAI,CAAC,CAAA;YAE9C,OAAO,GAAG,CAAA;QACZ,CAAC;QACD,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC,QAAQ;QAClB,oBAAoB,EAAE,KAAK;KAC5B,CAAC,CAAA;AACJ,CAAC,CAAA"}
|