Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fief xai celo kroma astar evm blockchains supporting #602

Merged
merged 5 commits into from
Mar 8, 2024
Merged
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
8 changes: 8 additions & 0 deletions packages/ethereum/sdk/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ export function getBlockchainBySDKNetwork(network: EthereumNetwork): EVMBlockcha
case "testnet-celo":
case "celo":
return Blockchain.CELO
case "testnet-fief":
return Blockchain.FIEF
case "xai":
case "testnet-xai":
return Blockchain.XAI
case "kroma":
case "testnet-kroma":
return Blockchain.KROMA
default: throw new Error(`Unrecognized ethereum network ${network}`)
}
}
Expand Down
10 changes: 10 additions & 0 deletions packages/ethereum/sdk/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ import { rariMainnetConfig } from "./rari"
import { zkatanaConfig } from "./zkatana"
import { baseConfig } from "./base"
import { baseSepoliaConfig } from "./base-sepolia"
import { xaiConfig } from "./xai"
import { fiefTestnetConfig } from "./testnet-fief"
import { xaiTestnetConfig } from "./testnet-xai"
import { kromaTestnetConfig } from "./testnet-kroma"
import { kromaConfig } from "./kroma"
import { astarZKEVMConfig } from "./astar-zkevm"
import { celoTestnetConfig } from "./testnet-celo"
import { celoConfig } from "./celo"
Expand Down Expand Up @@ -50,6 +55,11 @@ export const configDictionary: Record<EthereumNetwork, EthereumConfig> = {
"base-sepolia": baseSepoliaConfig,
"testnet-celo": celoTestnetConfig,
celo: celoConfig,
"testnet-xai": xaiTestnetConfig,
xai: xaiConfig,
"testnet-fief": fiefTestnetConfig,
"testnet-kroma": kromaTestnetConfig,
kroma: kromaConfig,
}

export function getEthereumConfig(env: EthereumNetwork): EthereumConfig {
Expand Down
47 changes: 47 additions & 0 deletions packages/ethereum/sdk/src/config/kroma.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { toAddress, ZERO_ADDRESS } from "@rarible/types"
import { id32 } from "../common/id"
import type { EthereumConfig } from "./type"
import { FEE_CONFIG_URL } from "./common"

export const kromaConfig: EthereumConfig = {
basePath: "https://kroma-api.rarible.org",
chainId: 255,
environment: "production",
exchange: {
v1: ZERO_ADDRESS,
v2: toAddress("0x418f1b76448866CF072dd14d092138190CcdC9aF"),
openseaV1: ZERO_ADDRESS,
wrapper: toAddress("0x69Be0b6f5BB5e9F8DfAA1562F06427142fb0a10a"),
looksrare: ZERO_ADDRESS,
looksrareV2: ZERO_ADDRESS,
x2y2: ZERO_ADDRESS,
},
transferProxies: {
nft: toAddress("0x30fc6eed1d302F5f5C4a8aa58047d1a730b3Cc91"),
erc20: toAddress("0x6C65a3C3AA67b126e43F86DA85775E0F5e9743F7"),
erc721Lazy: toAddress("0x9f4CE147beF144a571c1372cd6e1DEB148742027"),
erc1155Lazy: toAddress("0x8d5D3e1e6609A798B84160Ec9CC25198B9e4F177"),
openseaV1: ZERO_ADDRESS,
cryptoPunks: ZERO_ADDRESS,
},
feeConfigUrl: FEE_CONFIG_URL,
openSea: {
metadata: id32("RARIBLE"),
proxyRegistry: ZERO_ADDRESS,
merkleValidator: ZERO_ADDRESS,
},
factories: {
erc721: toAddress("0x24562E94332f06F1F0aEa79cAf283088F9e1B8A8"),
erc1155: toAddress("0xbd426Ce20Ac84ad3a6FA6FF50cfe5fB325AB0e5d"),
},
cryptoPunks: {
marketContract: ZERO_ADDRESS,
wrapperContract: ZERO_ADDRESS,
},
sudoswap: {
pairFactory: ZERO_ADDRESS,
pairRouter: ZERO_ADDRESS,
},
weth: toAddress("0x4200000000000000000000000000000000000001"),
auction: ZERO_ADDRESS,
}
48 changes: 48 additions & 0 deletions packages/ethereum/sdk/src/config/testnet-fief.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { toAddress, ZERO_ADDRESS } from "@rarible/types"
import { id32 } from "../common/id"
import type { EthereumConfig } from "./type"
import { FEE_CONFIG_URL } from "./common"

export const fiefTestnetConfig: EthereumConfig = {
basePath: "https://testnet-fief-api.rarible.org",
chainId: 712,
environment: "testnet",
exchange: {
v1: ZERO_ADDRESS,
v2: toAddress("0x61512179F6a16bEC0D259d8010CC0485CE363868"),
openseaV1: ZERO_ADDRESS,
wrapper: toAddress("0xc798B273FaF23932Cf11177402C10C9b44D30Da2"),
looksrare: ZERO_ADDRESS,
looksrareV2: ZERO_ADDRESS,
x2y2: ZERO_ADDRESS,
},
transferProxies: {
nft: toAddress("0x00C74eD067Cea48F1D6F7D00aBABa3C1D5B2598b"),
erc20: toAddress("0xA094E566b61b3c2D88ACf7Cc15e3Dd0FA83F32af"),
erc721Lazy: toAddress("0xB8863180CAC2d0Ab665e5968C0De25298A1D8CEe"),
erc1155Lazy: toAddress("0xa2eEBb837aEF89369Ad117568d75348e6174520e"),
openseaV1: ZERO_ADDRESS,
cryptoPunks: ZERO_ADDRESS,
},
feeConfigUrl: FEE_CONFIG_URL,
openSea: {
metadata: id32("RARIBLE"),
proxyRegistry: ZERO_ADDRESS,
merkleValidator: ZERO_ADDRESS,
},
factories: {
erc721: toAddress("0xe10605b2026884aCc669C2A9Cd4A5ec5f5FFf494"),
erc1155: toAddress("0x57B3f3b79F64c475a37E6c493BAA8E6E7C5F748e"),
},
cryptoPunks: {
marketContract: ZERO_ADDRESS,
wrapperContract: ZERO_ADDRESS,
},
sudoswap: {
pairFactory: ZERO_ADDRESS,
pairRouter: ZERO_ADDRESS,
},
//@todo wrapper token is not available yet (https://docs.fiefdom.gg/core-apps/fief-less-than-greater-than-wfief-wrapper)
weth: ZERO_ADDRESS,
auction: ZERO_ADDRESS,
}
47 changes: 47 additions & 0 deletions packages/ethereum/sdk/src/config/testnet-kroma.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { toAddress, ZERO_ADDRESS } from "@rarible/types"
import { id32 } from "../common/id"
import type { EthereumConfig } from "./type"
import { FEE_CONFIG_URL } from "./common"

export const kromaTestnetConfig: EthereumConfig = {
basePath: "https://testnet-kroma-api.rarible.org",
chainId: 2358,
environment: "testnet",
exchange: {
v1: ZERO_ADDRESS,
v2: toAddress("0x0fE65B68Eb627c21EAF3cfe8183C4F946F3d48BD"),
openseaV1: ZERO_ADDRESS,
wrapper: toAddress("0x166F6180170f438Ddc38050a2B708d38c0890956"),
looksrare: ZERO_ADDRESS,
looksrareV2: ZERO_ADDRESS,
x2y2: ZERO_ADDRESS,
},
transferProxies: {
nft: toAddress("0x4f4cC63D7f2bC894078d41f284453062842Afa46"),
erc20: toAddress("0xBc57D6e50fa760A01536A7c2EAEDD6fC9b2A4f9A"),
erc721Lazy: toAddress("0xF1cb795B7eA59a9213a790f868104c11a14690Fa"),
erc1155Lazy: toAddress("0xa90e536A492aef0d57e6d295FA17687c3ca93347"),
openseaV1: ZERO_ADDRESS,
cryptoPunks: ZERO_ADDRESS,
},
feeConfigUrl: FEE_CONFIG_URL,
openSea: {
metadata: id32("RARIBLE"),
proxyRegistry: ZERO_ADDRESS,
merkleValidator: ZERO_ADDRESS,
},
factories: {
erc721: toAddress("0x41407B447Fb5425187A9BCA3a062644EF2410F8D"),
erc1155: toAddress("0xc798B273FaF23932Cf11177402C10C9b44D30Da2"),
},
cryptoPunks: {
marketContract: ZERO_ADDRESS,
wrapperContract: ZERO_ADDRESS,
},
sudoswap: {
pairFactory: ZERO_ADDRESS,
pairRouter: ZERO_ADDRESS,
},
weth: toAddress("0x4200000000000000000000000000000000000001"),
auction: ZERO_ADDRESS,
}
46 changes: 46 additions & 0 deletions packages/ethereum/sdk/src/config/testnet-xai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { toAddress, ZERO_ADDRESS } from "@rarible/types"
import { id32 } from "../common/id"
import type { EthereumConfig } from "./type"
import { FEE_CONFIG_URL } from "./common"
export const xaiTestnetConfig: EthereumConfig = {
basePath: "https://testnet-xai-api.rarible.org",
chainId: 37714555429,
environment: "testnet",
exchange: {
v1: ZERO_ADDRESS,
v2: toAddress("0x61512179F6a16bEC0D259d8010CC0485CE363868"),
openseaV1: ZERO_ADDRESS,
wrapper: toAddress("0xc798B273FaF23932Cf11177402C10C9b44D30Da2"),
looksrare: ZERO_ADDRESS,
looksrareV2: ZERO_ADDRESS,
x2y2: ZERO_ADDRESS,
},
transferProxies: {
nft: toAddress("0x00C74eD067Cea48F1D6F7D00aBABa3C1D5B2598b"),
erc20: toAddress("0xA094E566b61b3c2D88ACf7Cc15e3Dd0FA83F32af"),
erc721Lazy: toAddress("0xB8863180CAC2d0Ab665e5968C0De25298A1D8CEe"),
erc1155Lazy: toAddress("0xa2eEBb837aEF89369Ad117568d75348e6174520e"),
openseaV1: ZERO_ADDRESS,
cryptoPunks: ZERO_ADDRESS,
},
feeConfigUrl: FEE_CONFIG_URL,
openSea: {
metadata: id32("RARIBLE"),
proxyRegistry: ZERO_ADDRESS,
merkleValidator: ZERO_ADDRESS,
},
factories: {
erc721: toAddress("0xe10605b2026884aCc669C2A9Cd4A5ec5f5FFf494"),
erc1155: toAddress("0x57B3f3b79F64c475a37E6c493BAA8E6E7C5F748e"),
},
cryptoPunks: {
marketContract: ZERO_ADDRESS,
wrapperContract: ZERO_ADDRESS,
},
sudoswap: {
pairFactory: ZERO_ADDRESS,
pairRouter: ZERO_ADDRESS,
},
weth: toAddress("0x3fB787101DC6Be47cfe18aeEe15404dcC842e6AF"),
auction: ZERO_ADDRESS,
}
47 changes: 47 additions & 0 deletions packages/ethereum/sdk/src/config/xai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { toAddress, ZERO_ADDRESS } from "@rarible/types"
import { id32 } from "../common/id"
import type { EthereumConfig } from "./type"
import { FEE_CONFIG_URL } from "./common"

export const xaiConfig: EthereumConfig = {
basePath: "https://xai-api.rarible.org",
chainId: 660279,
environment: "production",
exchange: {
v1: ZERO_ADDRESS,
v2: toAddress("0x5faf16A85028BE138A7178B222DeC98092FEEF97"),
openseaV1: ZERO_ADDRESS,
wrapper: toAddress("0xF965237c6b3f89f8C62B45b94097899E3562A830"),
looksrare: ZERO_ADDRESS,
looksrareV2: ZERO_ADDRESS,
x2y2: ZERO_ADDRESS,
},
transferProxies: {
nft: toAddress("0xF65eF65a95821A16E02973b1C2200FA58898e3c0"),
erc20: toAddress("0x248B46BEB66b3078D771a9E7E5a0a0216d0d07ba"),
erc721Lazy: toAddress("0xce4bf732f53A76C463aE8822be858017b02779c8"),
erc1155Lazy: toAddress("0xdA12E4Ab1d731F29bF4Bff8f971579D95f8DDD07"),
openseaV1: ZERO_ADDRESS,
cryptoPunks: ZERO_ADDRESS,
},
feeConfigUrl: FEE_CONFIG_URL,
openSea: {
metadata: id32("RARIBLE"),
proxyRegistry: ZERO_ADDRESS,
merkleValidator: ZERO_ADDRESS,
},
factories: {
erc721: toAddress("0xC699FB932c1bD7235C7ED19388f26A2428224AED"),
erc1155: toAddress("0xdA12E4Ab1d731F29bF4Bff8f971579D95f8DDD07"),
},
cryptoPunks: {
marketContract: ZERO_ADDRESS,
wrapperContract: ZERO_ADDRESS,
},
sudoswap: {
pairFactory: ZERO_ADDRESS,
pairRouter: ZERO_ADDRESS,
},
weth: toAddress("0x3fB787101DC6Be47cfe18aeEe15404dcC842e6AF"),
auction: ZERO_ADDRESS,
}
5 changes: 5 additions & 0 deletions packages/ethereum/sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export const ethereumNetworks = [
"base-sepolia",
"testnet-celo",
"celo",
"testnet-fief",
"testnet-xai",
"xai",
"testnet-kroma",
"kroma",
]

export type EthereumNetwork = typeof ethereumNetworks[number]
Expand Down
3 changes: 3 additions & 0 deletions packages/sdk-common/src/utils/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export const EVMBlockchains = [
Blockchain.RARI,
Blockchain.ASTARZKEVM,
Blockchain.BASE,
Blockchain.FIEF,
Blockchain.XAI,
Blockchain.KROMA,
Blockchain.CELO,
] as const

Expand Down
4 changes: 4 additions & 0 deletions packages/sdk/src/config/development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ export const developmentConfig: RaribleSdkConfig = {
lightlink: "testnet-lightlink",
rari: "testnet-rari",
base: "base-sepolia",
xai: "testnet-xai",
fief: "testnet-fief",
kroma: "testnet-kroma",
celo: "testnet-celo",
}
4 changes: 4 additions & 0 deletions packages/sdk/src/config/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ export type RaribleSdkConfig = {
lightlink: EthereumNetwork
rari: EthereumNetwork
base: EthereumNetwork
xai: EthereumNetwork
fief?: EthereumNetwork
kroma?: EthereumNetwork
celo: EthereumNetwork
}
4 changes: 4 additions & 0 deletions packages/sdk/src/config/prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ export const prodConfig: RaribleSdkConfig = {
lightlink: "lightlink",
rari: "rari",
base: "base",
xai: "testnet-xai",
fief: "testnet-fief",
kroma: "testnet-kroma",
celo: "testnet-celo",
}
4 changes: 4 additions & 0 deletions packages/sdk/src/config/testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ export const testnetConfig: RaribleSdkConfig = {
lightlink: "testnet-lightlink",
rari: "testnet-rari",
base: "base-sepolia",
xai: "testnet-xai",
fief: "testnet-fief",
kroma: "testnet-kroma",
celo: "testnet-celo",
}
10 changes: 10 additions & 0 deletions packages/transaction/src/ethereum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ Blockchain, TransactionResult
return `https://explorer.celo.org/alfajores/tx/${this.hash()}`
case "celo":
return `https://explorer.celo.org/mainnet/tx/${this.hash()}`
case "testnet-fief":
return `https://explorer.playground.fiefdom.gg/tx/${this.hash()}`
case "testnet-xai":
return `https://testnet-explorer-v2.xai-chain.net/tx/${this.hash()}`
case "xai":
return `https://explorer.xai-chain.net/tx/${this.hash()}`
case "testnet-kroma":
return `https://blockscout.sepolia.kroma.network/tx/${this.hash()}`
case "kroma":
return `https://blockscout.kroma.network/tx/${this.hash()}`
default:
throw new Error("Unsupported transaction network")
}
Expand Down