Skip to content

Commit

Permalink
Merge pull request #366 from getsafle/dev
Browse files Browse the repository at this point in the history
Dev -> test Integrated the following chains to safle-vault opBNB, Ronin, Sei Skale - Nebula, Immutable zk-EVM
  • Loading branch information
apoorvq authored Dec 10, 2024
2 parents 9cee2d9 + ac7ed3d commit 26699ec
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 4 deletions.
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)

-Integrated the following chains to safle-vault opBNB, Ronin, Sei Skale - Nebula, Immutable zk-EVM
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 },
};

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

1 comment on commit 26699ec

@github-actions
Copy link

Choose a reason for hiding this comment

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

Coverage Report (79%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files78.8969.5890.179.2 
chains94.735010094.73 
   index.js94.735010094.7360
config100100100100 
   index.js100100100100 
constants100100100100 
   index.js100100100100 
constants/responses100100100100 
   index.js100100100100 
lib79.7571.5791.4279.69 
   keyring.js77.3770.291.2277.2753, 70, 80, 84–85, 168–188, 241, 284–294, 371–449, 478, 496–497, 507, 513, 522, 528, 558–567, 572, 586–591, 601, 607, 616, 622, 638, 644, 658–663, 672, 678, 687, 693, 701, 715, 738, 768–781, 871–874, 1085, 1115, 1141–1142, 1161–1278, 1380, 1409–1412, 1436–1438, 1485, 1544–1547, 1575, 1620, 1626
   vault.js92.3883.6792.392.3824, 34, 56–58, 87, 100, 116
utils71.7555.3882.3573.8 
   helper.js71.7555.3882.3573.89–16, 89–99, 132, 155, 167–169, 178–182, 203–205, 232, 250, 268, 335–367

Please sign in to comment.