2.4.2 • Published 4 days ago

@0xsequence/kit-checkout v2.4.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 days ago

Sequence Kit Checkout

Checkout modal for Sequence Kit. Displays a list a summary of collectibles to be purchased

Installing the module

First install the package:

npm install @0xsequence/kit-checkout
# or
pnpm install @0xsequence/kit-checkout
# or
yarn add @0xsequence/kit-checkout

Then the wallet provider module must placed below the Sequence Kit Core provider.

import { KitCheckoutProvider } from '@0xsequence/kit-checkout'


const App = () => {
  return (
    <WagmiConfig config={config}>
      <QueryClientProvider client={queryClient}> 
        <KitProvider>
          <KitCheckoutProvider>
            <Page />
          </KitCheckoutProvider>
        </KitProvider>
      </QueryClientProvider>
    </WagmiConfig>
  )
}

Open the checkout modal

The useCheckoutModal hook must be used to open the modal. Furthermore, it is necessary to pass a settings object.

  import { useCheckoutModal } from '@0xsequence/kit-checkout'


  const MyComponent = () => {
    const { triggerCheckout } = useCheckoutModal()
  
    const onClick = () => {
      const checkoutSettings = {...}
      triggerCheckout(checkoutSettings)
    }

    return (
      <button onClick={onClick}>checkout</button>
    )
  }

Configuration

The react example has an example configuration for setting up the checkout.

Example settings

const checkoutSettings = {
  cryptoCheckout: {...},
  orderSummaryItems: {...}
}

cryptoCheckout

The cryptoCheckout specifies settings regarding checking out with crypto. An example usecase might be interacting with a minting contract.

The actual cryptoTransaction must be passed down to the triggerTransaction field.

cons checkoutConfig = {
  {...},
  cryptoCheckout: {
    chainId: 137,
    triggerTransaction: async () => { console.log('triggered transaction') },
    coinQuantity: {
      contractAddress: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
      amountRequiredRaw: '10000000000'
    },
  },
}

orderSummaryItems

This field specific the list of collectibles that will show up in the order summary.

    orderSummaryItems: [
      {
        contractAddress: '0x631998e91476da5b870d741192fc5cbc55f5a52e',
        tokenId: '66597',
        quantityRaw: '100'
      },
    ]
2.4.1

4 days ago

2.4.0

5 days ago

2.4.2

4 days ago

2.3.0

12 days ago

2.2.2

13 days ago

2.2.1

14 days ago

2.2.0

18 days ago

2.1.1

19 days ago

2.1.1-beta

21 days ago

2.1.1-beta.1

21 days ago

2.0.8-beta.2

24 days ago

2.1.0

24 days ago

2.0.8-beta

25 days ago

2.0.8-beta.1

25 days ago

2.0.8

1 month ago

2.0.7

1 month ago

2.0.6

1 month ago

2.0.5-beta.12

2 months ago

2.0.5-beta.14

2 months ago

2.0.5-beta.13

2 months ago

2.0.5-beta.11

2 months ago

2.0.5-beta.10

2 months ago

2.0.5-beta.9

2 months ago

2.0.5

2 months ago

2.0.5-beta.8

2 months ago

2.0.5-beta.5

2 months ago

2.0.5-beta.4

2 months ago

2.0.5-beta.7

2 months ago

2.0.5-beta.6

2 months ago

2.0.5-beta.3

2 months ago

2.0.4

3 months ago

2.0.5-beta.1

3 months ago

2.0.5-beta.2

3 months ago

2.0.4-beta.1

3 months ago

2.0.3

3 months ago

2.0.2

3 months ago

2.0.1

3 months ago

2.0.0-beta.2

3 months ago

2.0.0

3 months ago

1.0.14

3 months ago

1.0.13

3 months ago

1.0.11

3 months ago

1.0.12

3 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

6 months ago

1.0.10

5 months ago

1.0.2

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.1

6 months ago

1.0.0

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago