Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions examples/react/src/components/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
TransactionOnRampProvider,
useAddFundsModal,
useCheckoutModal,
useERC1155SaleContractCheckout,
useSelectPaymentModal,
useSwapModal,
useTransactionStatusModal,
Expand Down Expand Up @@ -83,17 +82,6 @@ export const Connected = () => {
reset: resetSendUnsponsoredTransaction
} = useSendTransaction()

const { openCheckoutModal, isLoading: erc1155CheckoutLoading } = useERC1155SaleContractCheckout({
chain: 137,
contractAddress: '0xf0056139095224f4eec53c578ab4de1e227b9597',
wallet: address || '',
collectionAddress: '0x92473261f2c26f2264429c451f70b0192f858795',
items: [{ tokenId: '1', quantity: '1' }],
onSuccess: txnHash => {
console.log('txnHash', txnHash)
}
})

const [isSigningMessage, setIsSigningMessage] = React.useState(false)
const [isMessageValid, setIsMessageValid] = React.useState<boolean | undefined>()
const [messageSig, setMessageSig] = React.useState<string | undefined>()
Expand Down Expand Up @@ -803,13 +791,6 @@ export const Connected = () => {
onClick={() => setIsOpenCustomCheckout(true)}
/>

<CardButton
title="ERC1155 Checkout"
description="Purchase with useERC1155SaleContractCheckout hook"
onClick={openCheckoutModal}
isPending={erc1155CheckoutLoading}
/>

<CardButton
title="Transaction Status Modal"
description="Transaction status modal"
Expand Down
41 changes: 0 additions & 41 deletions packages/checkout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,47 +134,6 @@ const MyComponent = () => {
- **blockConfirmations**: The number of block confirmations required for the transaction to be considered successful and trigger `onSuccess`.
- **onError**: Callback function triggered if an error has occurred before or after sending the transaction.

## Utility functions

The `@0xsequence/checkout` library indeed simplifies the integration of Web3 payment solutions by providing utility functions. One such function, `useERC1155SaleContractPaymentModal`, is tailored for use cases involving the minting of ERC-1155 tokens. This function works in conjunction with Sequence's wallet ecosystem and its deployable smart contract infrastructure, such as the ERC-1155 sale contract available through the [Sequence Builder](https://sequence.build).

```js
import { useERC1155SaleContractCheckout } from "@0xsequence/checkout";
import { useAccount } from "wagmi";

const MyComponent = () => {
const { address: userAddress } = useAccount();
const { openCheckoutModal } = useERC1155SaleContractCheckout({
chain: 80001, // chainId of the chain the collectible is on
contractAddress: "0x0327b2f274e04d292e74a06809bcd687c63a4ba4", // address of the contract handling the minting function
wallet: userAddress!, // address of the recipient
collectionAddress: "0x888a322db4b8033bac3ff84412738c096f87f9d0", // address of the collection contract
items: [
// array of collectibles to purchase
{
tokenId: "0",
quantity: "1",
},
],
onSuccess: (txnHash?: string) => {
console.log("success!", txnHash);
},
onError: (error: Error) => {
console.error(error);
},
});

const onClick = () => {
if (!userAddress) {
return;
}
openCheckoutModal();
};

return <button onClick={onClick}>Buy ERC-1155 collectible!</button>;
};
```

# Swap

<div align="center">
Expand Down
1 change: 0 additions & 1 deletion packages/checkout/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export * from './useTransferFundsModal.js'
export * from './useTransactionStatusModal.js'
export * from './useSwapModal.js'
export * from './useCheckoutOptionsSalesContract.js'
export * from './useERC1155SaleContractCheckout.js'
export * from './useSkipOnCloseCallback.js'
export * from './useFortePaymentIntent.js'
export * from './useAddFundsModal.js'
Expand Down
Loading