Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
a3df626
added fetchForteAccessToken and createPaymentIntent endpoint
SamueleA Apr 17, 2025
ed5e99f
add usePaymentIntent flow
SamueleA Apr 22, 2025
c04df07
forte config
SamueleA Apr 28, 2025
df89663
openSea testnet
SamueleA Apr 29, 2025
8f7afd5
forte integration opensea
SamueleA Apr 30, 2025
3684b22
payment status checking
SamueleA Apr 30, 2025
e0121b7
pass selleraddress to payment intent
SamueleA Apr 30, 2025
ce6dd9a
widget data
SamueleA Apr 30, 2025
15136ff
changed test input for opensea tx
SamueleA Apr 30, 2025
f124f42
fixed widget data
SamueleA May 1, 2025
fefa351
return null from the widget loader
SamueleA May 1, 2025
616e05d
response.ok check
SamueleA May 1, 2025
38a75ff
fix for forte widget implementation
SamueleA May 2, 2025
c566d51
Forte payment controller (WIP)
SamueleA May 2, 2025
61cb1e1
initialize fortepayment from the controller
SamueleA May 2, 2025
4d8ba29
forte orderHash
SamueleA May 2, 2025
0293a6f
different types for different payment configs
SamueleA May 5, 2025
3c571d7
added magic eden payment intent
SamueleA May 5, 2025
712b162
linter fixes
SamueleA May 26, 2025
923b0cf
mint configs for forte
SamueleA May 27, 2025
1c40b57
updated forte info for mints
SamueleA May 28, 2025
05a6239
calldata fix
SamueleA May 28, 2025
cf88a73
added config for custom evm call
SamueleA May 28, 2025
7eb899c
forte contract address
SamueleA May 28, 2025
7bde434
forte settings
SamueleA May 30, 2025
a2c377a
payment modal presets
SamueleA May 30, 2025
75dc186
orderbook transaction data
SamueleA May 30, 2025
150ed56
config update
SamueleA May 30, 2025
f3ecc43
removal of magic eden for forte
SamueleA Jun 2, 2025
3e73fba
structure call data for forte paymetns
SamueleA Jun 4, 2025
cb44bba
orderbook integration
SamueleA Jun 4, 2025
ce9d2b5
fixed onSuccess params
SamueleA Jun 27, 2025
c2f72b6
fixed forte flow not starting
SamueleA Jun 28, 2025
a836f84
added approvedspender field
SamueleA Jul 4, 2025
49f2c6a
styles
SamueleA Jul 4, 2025
1a98cc4
added settings for checkout
SamueleA Jul 4, 2025
1e90860
fixes related to approvedSpender address
SamueleA Jul 4, 2025
6573912
fixes to configuration
SamueleA Jul 4, 2025
de0e27d
fixed body to work with sequence api
SamueleA Jul 15, 2025
4a84b5d
integration with sequence backend for forte
SamueleA Jul 16, 2025
02966c9
clean up
SamueleA Jul 16, 2025
2013e8d
prevent onSuccess callback from being called multiple times
SamueleA Jul 16, 2025
899ecd4
improve error messages
SamueleA Jul 16, 2025
0f87e44
custom_evm_call fixes
SamueleA Jul 17, 2025
8b2400d
added seller as targetContracts for mints
SamueleA Jul 23, 2025
56dce94
used seller from forteconfig
SamueleA Jul 23, 2025
5f54b06
fixed the apiUrl
SamueleA Jul 23, 2025
947a471
pass project access key to forte endpoints
SamueleA Jul 23, 2025
4f7d30a
updated dev access key
SamueleA Aug 6, 2025
0f9b03c
updated project access key for dev environmnet
SamueleA Aug 7, 2025
cb8c173
fix linter errors
SamueleA Aug 7, 2025
5c3d109
removed dedicated seaport forteconfig option
SamueleA Aug 7, 2025
3c4badc
wait for FortePaymentsWidgetLoaded even before opening the modal
SamueleA Sep 8, 2025
f1077b9
checkout in demo defaults to forte
SamueleA Sep 15, 2025
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
82 changes: 10 additions & 72 deletions examples/react/src/components/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
useCheckoutModal,
useERC1155SaleContractCheckout,
useSelectPaymentModal,
useSwapModal
useSwapModal,
type SwapModalSettings
} from '@0xsequence/checkout'
import type { SwapModalSettings } from '@0xsequence/checkout'
import {
getModalPositionCss,
signEthAuthProof,
Expand All @@ -23,16 +23,15 @@ import { useOpenWalletModal } from '@0xsequence/wallet-widget'
import { CardButton, Header, WalletListItem } from 'example-shared-components'
import { AnimatePresence } from 'motion/react'
import React, { useEffect, type ComponentProps } from 'react'
import { encodeFunctionData, formatUnits, parseAbi, toHex, zeroAddress } from 'viem'
import { encodeFunctionData, formatUnits, parseAbi } from 'viem'
import { createSiweMessage, generateSiweNonce } from 'viem/siwe'
import { useAccount, useChainId, usePublicClient, useSendTransaction, useWalletClient, useWriteContract } from 'wagmi'

import { sponsoredContractAddresses } from '../config'
import { messageToSign } from '../constants'
import { ERC_1155_SALE_CONTRACT } from '../constants/erc1155-sale-contract'
// import { ERC_721_SALE_CONTRACT } from '../constants/erc721-sale-contract'
import { abi } from '../constants/nft-abi'
import { delay, getCheckoutSettings, getOrderbookCalldata } from '../utils'
import { checkoutPresets } from '../utils/checkout'

import { CustomCheckout } from './CustomCheckout'
import { Select } from './Select'
Expand All @@ -42,6 +41,7 @@ const searchParams = new URLSearchParams(location.search)
const isDebugMode = searchParams.has('debug')
const checkoutProvider = searchParams.get('checkoutProvider')
const onRampProvider = searchParams.get('onRampProvider')
const checkoutPreset = searchParams.get('checkoutPreset') || 'forte-payment-erc1155-sale-native-token-testnet'

export const Connected = () => {
const [isOpenCustomCheckout, setIsOpenCustomCheckout] = React.useState(false)
Expand Down Expand Up @@ -413,78 +413,16 @@ export const Connected = () => {
return
}

// NATIVE token sale
const currencyAddress = zeroAddress
const salesContractAddress = '0xf0056139095224f4eec53c578ab4de1e227b9597'
const collectionAddress = '0x92473261f2c26f2264429c451f70b0192f858795'
const price = '200000000000000'
const contractId = '674eb55a3d739107bbd18ecb'

// // ERC-20 contract
// const currencyAddress = '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359'
// const salesContractAddress = '0xe65b75eb7c58ffc0bf0e671d64d0e1c6cd0d3e5b'
// const collectionAddress = '0xdeb398f41ccd290ee5114df7e498cf04fac916cb'
// const price = '200000'
// const contractId = '674eb5613d739107bbd18ed2'

const collectibles = [
{
tokenId: '1',
quantity: '1'
}
]

const purchaseTransactionData = encodeFunctionData({
abi: ERC_1155_SALE_CONTRACT,
functionName: 'mint',
// [to, tokenIds, amounts, data, expectedPaymentToken, maxTotal, proof]
args: [
address,
collectibles.map(c => BigInt(c.tokenId)),
collectibles.map(c => BigInt(c.quantity)),
toHex(0),
currencyAddress,
price,
[toHex(0, { size: 32 })]
]
})

// ERC-721 contract
// const currencyAddress = '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359'
// const salesContractAddress = '0xa0284905d29cbeb19f4be486f9091fac215b7a6a'
// const collectionAddress = '0xd705db0a96075b98758c4bdafe8161d8566a68f8'
// const price = '1'
// const contractId = '674eb5613d739107bbd18ed2'

// const chainId = 137

// const collectibles = [
// {
// quantity: '1'
// }
// ]

// const purchaseTransactionData = encodeFunctionData({
// abi: ERC_721_SALE_CONTRACT,
// functionName: 'mint',
// // [to, amount, expectedPaymentToken, maxTotal, proof]
// args: [address, BigInt(1), currencyAddress, price, [toHex(0, { size: 32 })]]
// })
const creditCardProvider = checkoutProvider || 'forte'

openSelectPaymentModal({
collectibles,
chain: chainId,
price,
targetContractAddress: salesContractAddress,
recipientAddress: address,
currencyAddress,
collectionAddress,
creditCardProviders: [checkoutProvider || 'transak'],
creditCardProviders: [creditCardProvider],
onRampProvider: onRampProvider ? (onRampProvider as TransactionOnRampProvider) : TransactionOnRampProvider.transak,
transakConfig: {
contractId
contractId: '674eb5613d739107bbd18ed2'
},
onSuccess: (txnHash: string) => {
onSuccess: (txnHash?: string) => {
console.log('success!', txnHash)
},
onError: (error: Error) => {
Expand All @@ -493,7 +431,7 @@ export const Connected = () => {
onClose: () => {
console.log('modal closed!')
},
txData: purchaseTransactionData
...checkoutPresets[checkoutPreset as keyof typeof checkoutPresets](address || '')
})
}

Expand Down
2 changes: 1 addition & 1 deletion examples/react/src/components/CustomCheckout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const CustomCheckout = () => {
contractId,
apiKey: '5911d9ec-46b5-48fa-a755-d59a715ff0cf'
},
onSuccess: (txnHash: string) => {
onSuccess: (txnHash?: string) => {
console.log('success!', txnHash)
},
onError: (error: Error) => {
Expand Down
5 changes: 3 additions & 2 deletions examples/react/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const walletType: WalletType = searchParams.get('type') === 'universal' ? 'unive
const isDebugMode = searchParams.has('debug')
// @ts-ignore
const isDev = __SEQUENCE_WEB_SDK_IS_DEV__
const projectAccessKey = isDev ? 'AQAAAAAAAAK2JvvZhWqZ51riasWBftkrVXE' : 'AQAAAAAAAEGvyZiWA9FMslYeG_yayXaHnSI'
const projectAccessKey = isDev ? 'AQAAAAAAAAbRfXdDS5e-ZD2pNeMcCtNnij4' : 'AQAAAAAAAEGvyZiWA9FMslYeG_yayXaHnSI'
const walletConnectProjectId = 'c65a6cb1aa83c4e24500130f23a437d8'

export const sponsoredContractAddresses: Record<number, `0x${string}`> = {
Expand Down Expand Up @@ -184,7 +184,8 @@ export const checkoutConfig: SequenceCheckoutConfig = {
sardineCheckoutUrl: 'https://sardine-checkout-sandbox.sequence.info',
sardineOnRampUrl: 'https://crypto.sandbox.sardine.ai/',
transakApiUrl: 'https://global-stg.transak.com',
transakApiKey: 'c20f2a0e-fe6a-4133-8fa7-77e9f84edf98'
transakApiKey: 'c20f2a0e-fe6a-4133-8fa7-77e9f84edf98',
forteWidgetUrl: 'https://payments.sandbox.lemmax.com/forte-payments-widget.js'
}
: undefined
}
Loading