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

Integrated the following chains to safle-vault opBNB, Ronin, Sei Skale - Nebula, Immutable zk-EVM #365

Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 9 additions & 0 deletions .env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not supposed to be changed in this PR, please raise a separate PR for this. @Husienvora

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
OLD_MNEMONIC= "fun rough treat scan glimpse region century purpose expire video remind second"
MNEMONIC="vintage reflect pass input polar enlist giggle judge render position also document"
PIN="696969"
PRIVATE_KEY_EVM="0x7a9633b8103fec11c9e855a6b6c8c072e9af311a69b92ab0ad8186b1fb57371f"
PRIVATE_KEY_BTC= "KzQfcdjDRUwpVmKKev6k2aAeJFJ359Ht9Umxdg77MTzf2E3bzGsC"
EVM_ADDRESS_1='0x6bbc122fa843f3ed30d23f8cdd9a430d1f898d07'
EVM_ADDRESS_2="0xbae949ddb4d8ac763c12f206db842b9b2d49a464"
BITCOIN_ADDRESS_1="bc1qugw5q5yrzw86wnw3lgldm8en0c736k4hvceuzl"
BITCOIN_ADDRESS_2="bc1qta5f6q32cphxt5rck3kuspukac7keqvxyuk4cl"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,3 +676,7 @@
-Resolved issue for unarchival of a wallet
-Adding test for bitcoin
-Adding sensitive info in env github pipeline

### 2.9.3 (2024-12-10)

-Adding new chains
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the name of the chains added

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getsafle/safle-vault",
"version": "2.9.2",
"version": "2.9.3",
"description": "Safle Vault is a non-custodial, flexible and highly available crypto wallet which can be used to access dapps, send/receive crypto and store identity. Vault SDK is used to manage the vault and provide methods to generate vault, add new accounts, update the state and also enable the user to perform several vault related operations.",
"main": "src/index.js",
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions src/chains/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const evmChains = {
zkEVM: { symbol: "ZKEVM", txType: 2 },
bevm: { symbol: "BTC", txType: 0 },
rootstock: { symbol: "RBTC", txType: 0 },
opbnb: { symbol: "BNB", txType: 0 },
sei: { symbol: "SEI", txType: 0 },
ronin: { symbol: "RON", txType: 0 },
nebula: { symbol: "sFUEL", txType: 0 },
immutable: { symbol: "IMX", txType: 0 },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this Immutable or Immutable ZK?

};

const nonEvmChains = {
Expand Down
30 changes: 30 additions & 0 deletions src/lib/test/keyring.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ let NETWORKS = {
URL: "https://public-node.testnet.rsk.co",
CHAIN_ID: 31,
},
opbnb: {
URL: "https://opbnb-rpc.publicnode.com",
CHAIN_ID: 204,
},
sei: {
URL: "https://evm-rpc.sei-apis.com",
CHAIN_ID: 1329,
},
ronin: {
URL: "https://ronin.lgns.net/rpc",
CHAIN_ID: 2020,
},
nebula: {
URL: "https://mainnet.skalenodes.com/v1/green-giddy-denebola",
CHAIN_ID: 1482601649,
},
immutable: {
URL: "https://rpc.immutable.com",
CHAIN_ID: 13371,
},
};

const chainConfigs = {
Expand All @@ -73,6 +93,11 @@ const chainConfigs = {
bevm: { symbol: "BTC", txType: 0 },
rootstock: { symbol: "RBTC", txType: 0 },
bitcoin: { symbol: "BTC", txType: 0 },
opbnb: { symbol: "BNB", txType: 0 },
sei: { symbol: "SEI", txType: 0 },
ronin: { symbol: "RON", txType: 0 },
nebula: { symbol: "sFUEL", txType: 0 },
immutable: { symbol: "IMX", txType: 0 },
};

// Add the helper function
Expand Down Expand Up @@ -312,6 +337,11 @@ describe("getActiveChains", () => {
{ chain: "zkEVM", symbol: "ZKEVM" },
{ chain: "bevm", symbol: "BTC" },
{ chain: "rootstock", symbol: "RBTC" },
{ chain: "opbnb", symbol: "BNB" },
{ chain: "sei", symbol: "SEI" },
{ chain: "ronin", symbol: "RON" },
{ chain: "nebula", symbol: "sFUEL" },
{ chain: "immutable", symbol: "IMX" },
],
}).toMatchObject(result);
});
Expand Down
7 changes: 5 additions & 2 deletions src/lib/test/vault.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ let phrase = process.env.MNEMONIC;

let pin = process.env.PIN;
let vault = new Vault({});

const logs = [
{
action: "add-account",
Expand Down Expand Up @@ -67,7 +66,6 @@ const logs = [
_id: "64ec3339a58abcbf66a9b34a",
},
];

describe("getSupportedChains", () => {
test("getSupportedChains", async () => {
let result = await new Vault({}).getSupportedChains();
Expand All @@ -85,6 +83,11 @@ describe("getSupportedChains", () => {
zkEVM: "ZKEVM",
bevm: "BTC",
rootstock: "RBTC",
opbnb: "BNB",
sei: "SEI",
ronin: "RON",
nebula: "sFUEL",
immutable: "IMX",
},
nonEvmChains: { bitcoin: "BTC", stacks: "STX", solana: "SOL" },
}).toMatchObject(result.response);
Expand Down
Loading