Skip to content

Commit

Permalink
Merge pull request #758 from reservoirprotocol/jaden/shape-support
Browse files Browse the repository at this point in the history
feat: adding shape and shape sepolia
  • Loading branch information
JadenDurnford committed Sep 5, 2024
2 parents 386ee3c + 5ad8228 commit 3319c92
Show file tree
Hide file tree
Showing 15 changed files with 312 additions and 637 deletions.
6 changes: 6 additions & 0 deletions .changeset/light-games-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@reservoir0x/reservoir-sdk': patch
'@reservoir0x/reservoir-kit-ui': patch
---

adding shape and shape sepolia
3 changes: 3 additions & 0 deletions demo/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ const chains = [
customChains.formaSketchpad,
customChains.b3,
customChains.apechain,
customChains.curtis,
customChains.shape,
customChains.shapeSepolia,
] as [Chain, ...Chain[]]

const wagmiConfig = getDefaultConfig({
Expand Down
9 changes: 9 additions & 0 deletions demo/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,13 @@ export default [
{
...reservoirChains.apechain,
},
{
...reservoirChains.curtis,
},
{
...reservoirChains.shape,
},
{
...reservoirChains.shapeSepolia,
},
]
75 changes: 75 additions & 0 deletions packages/sdk/src/utils/customChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,78 @@ export const apechain = {
},
} as const satisfies Chain

export const curtis = {
id: 33111,
name: 'Curtis',
nativeCurrency: { name: 'ApeCoin', symbol: 'APE', decimals: 18 },
rpcUrls: {
default: {
http: ['https://curtis.rpc.caldera.xyz/http'],
},
public: {
http: ['https://curtis.rpc.caldera.xyz/http'],
},
},
blockExplorers: {
etherscan: {
name: 'Curtis Explorer',
url: 'https://curtis.explorer.caldera.xyz',
},
default: {
name: 'Curtis Explorer',
url: 'https://curtis.explorer.caldera.xyz',
},
},
} as const satisfies Chain

export const shape = {
id: 360,
name: 'Shape',
nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['https://mainnet.shape.network'],
},
public: {
http: ['https://mainnet.shape.network'],
},
},
blockExplorers: {
etherscan: {
name: 'Shape Explorer',
url: 'https://internal-shaper-explorer.alchemypreview.com',
},
default: {
name: 'Shape Explorer',
url: 'https://internal-shaper-explorer.alchemypreview.com',
},
},
} as const satisfies Chain

export const shapeSepolia = {
id: 11011,
name: 'Shape Sepolia',
nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['https://sepolia.shape.network'],
},
public: {
http: ['https://sepolia.shape.network'],
},
},
blockExplorers: {
etherscan: {
name: 'Shape Sepolia Explorer',
url: 'https://explorer-sepolia.shape.network',
},
default: {
name: 'Shape Sepolia Explorer',
url: 'https://explorer-sepolia.shape.network',
},
},
} as const satisfies Chain

export const customChains = {
ancient8,
ancient8Testnet,
Expand Down Expand Up @@ -657,4 +729,7 @@ export const customChains = {
formaSketchpad,
b3,
apechain,
curtis,
shape,
shapeSepolia,
} as const satisfies Record<string, Chain>
54 changes: 54 additions & 0 deletions packages/sdk/src/utils/paymentTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,4 +901,58 @@ export const chainPaymentTokensMap = {
decimals: 18,
},
],

// Curtis
33111: [
{
chainId: 33111,
address: zeroAddress,
symbol: 'APE',
name: 'APE',
decimals: 18,
},
{
chainId: 33111,
address: '0x34b097b133bf3fe3b7dad0d65e8f18dd5bf1a57b',
symbol: 'WAPE',
name: 'WAPE',
decimals: 18,
},
],

// Shape
360: [
{
chainId: 360,
address: zeroAddress,
symbol: 'ETH',
name: 'ETH',
decimals: 18,
},
{
chainId: 360,
address: '0x48a9b22b80f566e88f0f1dcc90ea15a8a3bae8a4',
symbol: 'WETH',
name: 'WETH',
decimals: 18,
},
],

// Shape Sepolia
11011: [
{
chainId: 11011,
address: zeroAddress,
symbol: 'ETH',
name: 'ETH',
decimals: 18,
},
{
chainId: 11011,
address: '0x48a9b22b80f566e88f0f1dcc90ea15a8a3bae8a4',
symbol: 'WETH',
name: 'WETH',
decimals: 18,
},
],
} as Record<number, PaymentToken[]>
27 changes: 27 additions & 0 deletions packages/sdk/src/utils/reservoirChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,30 @@ const apechain = {
checkPollingInterval: 1000,
} satisfies ReservoirBaseChain

const curtis = {
id: 33111,
name: 'Curtis',
baseApiUrl: 'https://api-curtis.reservoir.tools',
paymentTokens: chainPaymentTokensMap[33111],
checkPollingInterval: 1000,
} satisfies ReservoirBaseChain

const shape = {
id: 360,
name: 'Shape',
baseApiUrl: 'https://api-shape.reservoir.tools',
paymentTokens: chainPaymentTokensMap[360],
checkPollingInterval: 1000,
} satisfies ReservoirBaseChain

const shapeSepolia = {
id: 11011,
name: 'Shape Sepolia',
baseApiUrl: 'https://api-shape-sepolia.reservoir.tools',
paymentTokens: chainPaymentTokensMap[11011],
checkPollingInterval: 1000,
} satisfies ReservoirBaseChain

export const reservoirChains = {
mainnet,
polygon,
Expand Down Expand Up @@ -425,4 +449,7 @@ export const reservoirChains = {
formaSketchpad,
b3,
apechain,
curtis,
shape,
shapeSepolia,
}
18 changes: 18 additions & 0 deletions packages/ui/src/constants/chainIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ import FormaIconColor from '../img/chains/FormaIconColor'
import ApechainIconLight from '../img/chains/ApechainIconLight'
import ApechainIconDark from '../img/chains/ApechainIconDark'
import ApechainIconColor from '../img/chains/ApechainIconColor'
import ShapeIconLight from '../img/chains/ShapeIconLight'
import ShapeIconDark from '../img/chains/ShapeIconDark'
import ShapeIconColor from '../img/chains/ShapeIconColor'

const chainIcons = {
[reservoirChains.ancient8.id]: {
Expand Down Expand Up @@ -336,6 +339,21 @@ const chainIcons = {
dark: <ApechainIconDark />,
color: <ApechainIconColor />,
},
[reservoirChains.curtis.id]: {
light: <ApechainIconLight />,
dark: <ApechainIconDark />,
color: <ApechainIconColor />,
},
[reservoirChains.shape.id]: {
light: <ShapeIconLight />,
dark: <ShapeIconDark />,
color: <ShapeIconColor />,
},
[reservoirChains.shapeSepolia.id]: {
light: <ShapeIconLight />,
dark: <ShapeIconDark />,
color: <ShapeIconColor />,
},
}

export default chainIcons
3 changes: 3 additions & 0 deletions packages/ui/src/constants/wrappedContractNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@ const wrappedContractNames: Record<number, string> = {
984123: 'WTIA', // forma sketchpad
8333: 'WETH', // b3
33139: 'WAPE', // apechain
33111: 'WAPE', // apechain
360: 'WETH', // shape
11011: 'WETH', // shape sepolia
}
export default wrappedContractNames
3 changes: 3 additions & 0 deletions packages/ui/src/constants/wrappedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const wrappedContracts: Record<number, string> = {
984123: '0xd5eace1274dbf70960714f513db207433615a263', // forma sketchpad
8333: '0x48a9b22b80f566e88f0f1dcc90ea15a8a3bae8a4', // b3
33139: '0x8073b2158aa023dd7f8d4799c883b65daf6baa57', // apechain
33111: '0x34b097b133bf3fe3b7dad0d65e8f18dd5bf1a57b', // curtis
360: '0x48a9b22b80f566e88f0f1dcc90ea15a8a3bae8a4', // shape
11011: '0x48a9b22b80f566e88f0f1dcc90ea15a8a3bae8a4', // shape sepolia
}

export default wrappedContracts
Loading

0 comments on commit 3319c92

Please sign in to comment.