Skip to content

Commit

Permalink
feat(PLTF-454): add sei chain support (#631)
Browse files Browse the repository at this point in the history
* feat(PLTF-454): add sei chain support
  • Loading branch information
ex1st0r authored Jun 7, 2024
1 parent 30af304 commit 20969c6
Show file tree
Hide file tree
Showing 24 changed files with 146 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"@commitlint/config-conventional": "^13.1.0",
"@onflow/fcl": "^1.4.1",
"@onflow/types": "^1.1.0",
"@rarible/api-client": "0.16.5-alpha.10",
"@rarible/api-client": "0.16.5-alpha.13",
"@rarible/eslint-config-react": "~0.10.0-alpha.37",
"@rarible/eslint-config-ts": "~0.10.0-alpha.37",
"@rarible/prettier": "~0.10.0-alpha.37",
Expand Down
2 changes: 1 addition & 1 deletion packages/aptos-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"verify": "tsc --noEmit --project tsconfig-build.json"
},
"dependencies": {
"@rarible/types": "~0.9.26",
"@rarible/types": "~0.9.27",
"@rarible/utils": "~0.9.10"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/aptos-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"dependencies": {
"@rarible/sdk-common": "^0.13.68-fix.25",
"@rarible/types": "~0.9.26"
"@rarible/types": "~0.9.27"
},
"peerDependencies": {
"@aptos-labs/ts-sdk": "^1.5.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/connectors/connector-aptos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"verify": "tsc --noEmit --project tsconfig-build.json"
},
"dependencies": {
"@rarible/api-client": "0.16.5-alpha.10",
"@rarible/api-client": "0.16.5-alpha.13",
"@rarible/connector": "^0.13.68-fix.25",
"@rarible/types": "~0.9.26"
"@rarible/types": "~0.9.27"
},
"peerDependencies": {
"tslib": "^2.3.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/connectors/connector-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@imtbl/imx-sdk": "^2.1.1",
"@rarible/api-client": "0.16.5-alpha.10",
"@rarible/api-client": "0.16.5-alpha.13",
"@rarible/connector": "^0.13.68-fix.25",
"@rarible/connector-beacon": "^0.13.68-fix.25",
"@rarible/connector-fcl": "^0.13.68-fix.25",
Expand Down
4 changes: 2 additions & 2 deletions packages/connectors/connector-mattel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"@auth0/auth0-spa-js": "~2.1.1",
"@magic-ext/flow": "~13.5.0",
"@magic-ext/oidc": "~1.3.0",
"@rarible/api-client": "0.16.5-alpha.10",
"@rarible/api-client": "0.16.5-alpha.13",
"@rarible/connector": "^0.13.68-fix.25",
"@rarible/types": "~0.9.26"
"@rarible/types": "~0.9.27"
},
"peerDependencies": {
"@onflow/fcl": "^1.4.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"verify": "tsc --noEmit"
},
"dependencies": {
"@rarible/api-client": "0.16.5-alpha.10",
"@rarible/api-client": "0.16.5-alpha.13",
"@rarible/ethereum-sdk-test-common": "^0.13.68-fix.25",
"@rarible/flow-test-common": "~0.5.75-fix.1",
"@rarible/sdk-wallet": "^0.13.68-fix.25",
"@rarible/types": "~0.9.26",
"@rarible/types": "~0.9.27",
"bignumber.js": "^9.0.1"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions packages/ethereum/sdk/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ export function getBlockchainBySDKNetwork(network: EthereumNetwork): EVMBlockcha
case "kroma":
case "testnet-kroma":
return Blockchain.KROMA
case "sei-arctic-1":
case "sei-pacific-1":
return Blockchain.SEI
default:
throw new Error(`Unrecognized ethereum network ${network}`)
}
Expand Down
3 changes: 3 additions & 0 deletions packages/ethereum/sdk/src/common/test/test-credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { getEthereumConfig } from "../../config"

export function getTestAPIKey(env: EthereumNetwork) {
const network = getEthereumConfig(env)
if (!network) {
throw new Error(`Config for env=${env} has not been found`)
}
switch (network.environment) {
case "production":
return readEnv("SDK_API_KEY_PROD")
Expand Down
4 changes: 4 additions & 0 deletions packages/ethereum/sdk/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import { celoTestnetConfig } from "./testnet-celo"
import { celoConfig } from "./celo"
import { polygonAmoyConfig } from "./polygon-amoy"
import { astarKyotoConfig } from "./astar-kyoto"
import { seiArctic1Config } from "./sei-arctic-1"
import { seiPacific1Config } from "./sei-pacific-1"

export const configDictionary: Record<EthereumNetwork, EthereumConfig> = {
mainnet: mainnetConfig,
Expand Down Expand Up @@ -64,6 +66,8 @@ export const configDictionary: Record<EthereumNetwork, EthereumConfig> = {
"testnet-fief": fiefTestnetConfig,
"testnet-kroma": kromaTestnetConfig,
kroma: kromaConfig,
"sei-arctic-1": seiArctic1Config,
"sei-pacific-1": seiPacific1Config,
}

export function getEthereumConfig(env: EthereumNetwork): EthereumConfig {
Expand Down
48 changes: 48 additions & 0 deletions packages/ethereum/sdk/src/config/sei-arctic-1.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 seiArctic1Config: EthereumConfig = {
basePath: "https://testnet-sei-api.rarible.org",
chainId: 713715,
environment: "testnet",
exchange: {
v1: ZERO_ADDRESS,
v2: toAddress("0x5b96ddd3245aaC0cd97cFf6717985F3b9B01df3B"),
openseaV1: ZERO_ADDRESS,
wrapper: toAddress("0x0D7147461cef9Ce51B8ba63560Dc53f96E90638B"),
looksrare: ZERO_ADDRESS,
looksrareV2: ZERO_ADDRESS,
x2y2: ZERO_ADDRESS,
},
transferProxies: {
nft: toAddress("0xA5707153b8AF346e17AF765235B054136eCf99EC"),
erc20: toAddress("0xA3d49c7e2c845b792e422696FE0D9ef17a509731"),
erc721Lazy: toAddress("0x74eBEEB6FBCf94f748f5999E14aCf3642A38e813"),
erc1155Lazy: toAddress("0xd60D801E1E76a44f8A2E728F6d3a760626aa2cf2"),
openseaV1: ZERO_ADDRESS,
cryptoPunks: ZERO_ADDRESS,
},
feeConfigUrl: FEE_CONFIG_URL,
openSea: {
metadata: id32("RARIBLE"),
proxyRegistry: ZERO_ADDRESS,
merkleValidator: ZERO_ADDRESS,
},
factories: {
erc721: toAddress("0xE5D43624116007CD79D17fB7136672A49fd33CE0"),
erc1155: toAddress("0x6E6d179b1DCEaad5483edaCF907bf619FB35C7Eb"),
},
cryptoPunks: {
marketContract: ZERO_ADDRESS,
wrapperContract: ZERO_ADDRESS,
},
sudoswap: {
pairFactory: ZERO_ADDRESS,
pairRouter: ZERO_ADDRESS,
},
weth: toAddress("0x57ee725beeb991c70c53f9642f36755ec6eb2139"),
auction: ZERO_ADDRESS,
looksrareOrderValidatorV2: ZERO_ADDRESS,
}
48 changes: 48 additions & 0 deletions packages/ethereum/sdk/src/config/sei-pacific-1.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 seiPacific1Config: EthereumConfig = {
basePath: "https://sei-api.rarible.org",
chainId: 1329,
environment: "production",
exchange: {
v1: ZERO_ADDRESS,
v2: toAddress("0x42b8DB7aCB54B4f8690C7379Ff2Befb6caf67478"),
openseaV1: ZERO_ADDRESS,
wrapper: toAddress("0x4Da5504b5FD5C5073906478B2e9B66d278aB4D2C"),
looksrare: ZERO_ADDRESS,
looksrareV2: ZERO_ADDRESS,
x2y2: ZERO_ADDRESS,
},
transferProxies: {
nft: toAddress("0x8dBEcA8fA7ed5424f8b8dD5945dDC62393D0a642"),
erc20: toAddress("0xb1199ECB7bdB9eE082b9535A6c08c912914CaBAC"),
erc721Lazy: toAddress("0x9f1e78A81fF684F034efBbd97cCE508dF19B4210"),
erc1155Lazy: toAddress("0x56A3A3D3DeC25526eb54C771B15159443672602A"),
openseaV1: ZERO_ADDRESS,
cryptoPunks: ZERO_ADDRESS,
},
feeConfigUrl: FEE_CONFIG_URL,
openSea: {
metadata: id32("RARIBLE"),
proxyRegistry: ZERO_ADDRESS,
merkleValidator: ZERO_ADDRESS,
},
factories: {
erc721: toAddress("0x4fA35DD15183a320254fE36aE1CC7067dDAC112f"),
erc1155: toAddress("0xa008fe83286382B4D56D92A07C4E602d58AF62F1"),
},
cryptoPunks: {
marketContract: ZERO_ADDRESS,
wrapperContract: ZERO_ADDRESS,
},
sudoswap: {
pairFactory: ZERO_ADDRESS,
pairRouter: ZERO_ADDRESS,
},
weth: toAddress("0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7"),
auction: ZERO_ADDRESS,
looksrareOrderValidatorV2: ZERO_ADDRESS,
}
2 changes: 2 additions & 0 deletions packages/ethereum/sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const ethereumNetworks = [
"xai",
"testnet-kroma",
"kroma",
"sei-arctic-1",
"sei-pacific-1",
]

export type EthereumNetwork = (typeof ethereumNetworks)[number]
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum/test-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@rarible/ethereum-provider": "^0.13.68-fix.25",
"@rarible/test-provider": "~0.5.0",
"@rarible/types": "~0.9.26",
"@rarible/types": "~0.9.27",
"@types/web3-provider-engine": "^14.0.1",
"eth-sig-util": "^3.0.1",
"ethereumjs-wallet": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@mui/material": "^5.15.17",
"@nfid/embed": "0.0.5-alpha.0",
"@nfid/wallet": "^1.1.0",
"@rarible/api-client": "0.16.5-alpha.10",
"@rarible/api-client": "0.16.5-alpha.13",
"@rarible/connector": "^0.13.68-fix.25",
"@rarible/connector-beacon": "^0.13.68-fix.25",
"@rarible/connector-fcl": "^0.13.68-fix.25",
Expand Down
2 changes: 1 addition & 1 deletion packages/imx-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@rarible/immutable-wallet": "^0.13.68-fix.25"
},
"devDependencies": {
"@rarible/types": "~0.9.26",
"@rarible/types": "~0.9.27",
"@rarible/utils": "~0.9.10"
},
"publishConfig": {
Expand Down
4 changes: 3 additions & 1 deletion packages/sdk-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
"test": "jest --runInBand --passWithNoTests",
"verify": "tsc --noEmit --project tsconfig-build.json"
},
"dependencies": {
"@rarible/api-client": "0.16.5-alpha.13"
},
"peerDependencies": {
"@rarible/api-client": "0.16.5-alpha.10",
"tslib": "^2.3.1"
},
"publishConfig": {
Expand Down
1 change: 1 addition & 0 deletions packages/sdk-common/src/utils/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const EVMBlockchains = [
Blockchain.XAI,
Blockchain.KROMA,
Blockchain.CELO,
Blockchain.SEI,
] as const

export type EVMBlockchain = (typeof EVMBlockchains)[number]
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk-examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"verify": "tsc --noEmit --project tsconfig-build.json"
},
"dependencies": {
"@rarible/api-client": "0.16.5-alpha.10",
"@rarible/api-client": "0.16.5-alpha.13",
"@rarible/estimate-middleware": "~0.9.6",
"@rarible/ethers-ethereum": "^0.13.68-fix.25",
"@rarible/sdk": "^0.13.68-fix.25",
"@rarible/sdk-wallet": "^0.13.68-fix.25",
"@rarible/test-provider": "~0.5.4",
"@rarible/types": "~0.9.26",
"@rarible/types": "~0.9.27",
"ethereumjs-wallet": "^1.0.2",
"ethers": "^5.6.2",
"web3-provider-engine": "^16.0.4"
Expand Down
5 changes: 3 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"dependencies": {
"@ethersproject/keccak256": "^5.6.0",
"@rarible/action": "~0.9.1",
"@rarible/api-client": "0.16.5-alpha.13",
"@rarible/aptos-sdk": "^0.13.68-fix.25",
"@rarible/flow-sdk": "~0.5.78-fix.3",
"@rarible/immutable-sdk": "^0.13.68-fix.25",
Expand All @@ -41,7 +42,7 @@
"@rarible/sdk-wallet": "^0.13.68-fix.25",
"@rarible/solana-sdk": "^0.13.68-fix.25",
"@rarible/tezos-sdk": "0.1.46",
"@rarible/types": "~0.9.26",
"@rarible/types": "~0.9.27",
"@rarible/utils": "~0.9.10",
"@solana/web3.js": "~1.54.0",
"bignumber.js": "^9.0.1",
Expand Down Expand Up @@ -85,7 +86,7 @@
"yargs": "^17.2.1"
},
"peerDependencies": {
"@rarible/api-client": "0.16.5-alpha.10",
"@rarible/api-client": "0.16.5-alpha.13",
"axios": "^0.26.1",
"tslib": "^2.3.1"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/transaction/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"@rarible/protocol-ethereum-sdk": "^0.13.68-fix.25",
"@rarible/solana-sdk": "^0.13.68-fix.25",
"@rarible/tezos-sdk": "0.1.46",
"@rarible/types": "~0.9.26"
"@rarible/types": "~0.9.27"
},
"peerDependencies": {
"@rarible/api-client": "0.16.5-alpha.10",
"@rarible/api-client": "0.16.5-alpha.13",
"tslib": "^2.3.1"
},
"publishConfig": {
Expand Down
4 changes: 4 additions & 0 deletions packages/transaction/src/ethereum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ export class BlockchainEthereumTransaction<TransactionResult = undefined>
return `https://blockscout.sepolia.kroma.network/tx/${this.hash()}`
case "kroma":
return `https://blockscout.kroma.network/tx/${this.hash()}`
case "sei-arctic-1":
return `https://seitrace.com/tx/${this.hash()}?chain=arctic-1`
case "sei-pacific-1":
return `https://seitrace.com/tx/${this.hash()}?chain=pacific-1`
default:
throw new Error("Unsupported transaction network")
}
Expand Down
3 changes: 2 additions & 1 deletion packages/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@rarible/solana-common": "^0.13.68-fix.25",
"@rarible/solana-wallet": "^0.13.68-fix.25",
"@rarible/tezos-sdk": "0.1.46",
"@rarible/types": "~0.9.27",
"@rarible/web3-ethereum": "^0.13.68-fix.25",
"text-encoding": "~0.7.0"
},
Expand All @@ -67,7 +68,7 @@
"stream-browserify": "^3.0.0"
},
"peerDependencies": {
"@rarible/api-client": "0.16.5-alpha.10",
"@rarible/api-client": "0.16.5-alpha.13",
"tslib": "^2.3.1"
},
"publishConfig": {
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7047,10 +7047,10 @@
dependencies:
callable-instance "^2.0.0"

"@rarible/[email protected].10":
version "0.16.5-alpha.10"
resolved "https://registry.yarnpkg.com/@rarible/api-client/-/api-client-0.16.5-alpha.10.tgz#9f9f43f3134bfd8db6507105903912fc0da8b202"
integrity sha512-GPAhX86KlfOhxnzFgUH6+Pv3PG1tQzsgZ7CtQQ6xKTDJ7fm+vGftBCheuVGogynwcvJ8vQ3sQhmu+mh2M7YoZA==
"@rarible/[email protected].13":
version "0.16.5-alpha.13"
resolved "https://registry.yarnpkg.com/@rarible/api-client/-/api-client-0.16.5-alpha.13.tgz#67333551811f8535fcf9da54e6e061c94109584f"
integrity sha512-7pmHKunl4yVw5nehOBPA5FZ8QD//PpOFMHAegRAjmvl/QDMdy+1UvfJxGwCU1yx/VaEx9eInAMqiF97f2ggFJw==

"@rarible/eslint-config-react@~0.10.0-alpha.37":
version "0.10.0-alpha.37"
Expand Down Expand Up @@ -7213,10 +7213,10 @@
resolved "https://registry.yarnpkg.com/@rarible/types/-/types-0.9.3.tgz#16eac9f500b48e4bd4c43f2d93a84c46dc5a5a13"
integrity sha512-lvmmqyibKNqylXr9yYMdor+onv/2z7O8LThpEsO/DpM2nawJ8f/QeEPjlyqTpjVhQyrpGwwFjuNQCTiiJi3msg==

"@rarible/types@~0.9.26":
version "0.9.26"
resolved "https://registry.yarnpkg.com/@rarible/types/-/types-0.9.26.tgz#2d8183fd53b5cff32640185e4782d6610d00820a"
integrity sha512-q4lX1wOUBDENlzhZXctrCU9O0SFaZBsnU/AIgrKixzLktzq96MG/5lOkXxsBhQzotpUnixuDHFbEDtfqtkaLzw==
"@rarible/types@~0.9.27":
version "0.9.27"
resolved "https://registry.yarnpkg.com/@rarible/types/-/types-0.9.27.tgz#097e5620798e11411854a5e903e53a64779fd11d"
integrity sha512-xUoIkr5QOVY9UvxDwwx/ylW7fLSx7cH4rA4lVAVx4lqyKJBeHxxKglSv2YGROZuM6AJGDwvNWSc9uWkpZFhtYg==

"@rarible/utils@^0.9.1":
version "0.9.1"
Expand Down

0 comments on commit 20969c6

Please sign in to comment.