New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@metamask-institutional/custody-keyring

Package Overview
Dependencies
Maintainers
0
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask-institutional/custody-keyring - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

7

CHANGELOG.md

@@ -50,2 +50,9 @@ # Change Log

## [2.0.1](https://github.com/consensys-vertical-apps/metamask-institutional/compare/custody-keyring-v2.0.0...custody-keyring-v2.0.1) (2024-05-29)
### Bug Fixes
* **supportedchainids:** better error handling ([#733](https://github.com/consensys-vertical-apps/metamask-institutional/issues/733)) ([3c5f350](https://github.com/consensys-vertical-apps/metamask-institutional/commit/3c5f350e2ef0e9df94ad7c004f4971cc379e13e8))
## [2.0.0](https://github.com/consensys-vertical-apps/metamask-institutional/compare/custody-keyring-v1.1.2...custody-keyring-v2.0.0) (2024-05-17)

@@ -52,0 +59,0 @@

25

dist/custodianTypes/index.js

@@ -9,28 +9,3 @@ "use strict";

const JsonRpcCustodyKeyring_1 = require("./json-rpc/JsonRpcCustodyKeyring");
const QredoCustodyKeyring_1 = require("./qredo/QredoCustodyKeyring");
exports.CUSTODIAN_TYPES = {
QREDO: {
name: "Qredo",
displayName: "Qredo",
apiUrl: "https://api-v2.qredo.network/api/v2",
imgSrc: "https://dashboard.metamask-institutional.io/custodian-icons/qredo-icon.svg",
icon: "https://dashboard.metamask-institutional.io/custodian-icons/qredo-icon.svg",
website: "https://www.qredo.com",
onboardingUrl: "https://www.qredo.com",
envName: "qredo",
keyringClass: QredoCustodyKeyring_1.QredoCustodyKeyring,
production: true,
hidden: false,
origins: [],
environmentMapping: [
{
pattern: /^.*$/u,
mmiApiUrl: "https://mmi.codefi.network/v1",
},
{
pattern: /^https:\/\/api.qredo.network/u,
mmiApiUrl: "https://api.mmi-prod.codefi.network/v1",
},
],
},
CACTUS: {

@@ -37,0 +12,0 @@ name: "Cactus",

17

dist/CustodyKeyring.js

@@ -247,7 +247,16 @@ "use strict";

const chainId = Number(txMeta.chainId).toString(10);
const supportedChainIds = await sdk.getSupportedChains(fromAddress);
const normalisedSupportedChainIds = supportedChainIds.map(chainId => Number(chainId).toString());
if (!normalisedSupportedChainIds.includes(chainId)) {
throw new Error(`This network ${chainId} is not configured or supported with your custody provider.`);
try {
const supportedChainIds = await sdk.getSupportedChains(fromAddress);
if (!supportedChainIds || supportedChainIds.length === 0) {
throw new Error("Didn't find any supported chains or an error occurred.");
}
const normalisedSupportedChainIds = supportedChainIds.map(chainId => Number(chainId).toString());
if (!normalisedSupportedChainIds.includes(chainId)) {
throw new Error(`This network ${chainId} is not configured or supported with your custody provider.`);
}
}
catch (error) {
console.error("Error processing chain IDs:", error);
throw error;
}
let payload;

@@ -254,0 +263,0 @@ if (eip1559) {

{
"name": "@metamask-institutional/custody-keyring",
"version": "2.0.0",
"version": "2.0.1",
"description": "The Custody Keyring Class is the initial point of contact with a custodian, it gets access to the sdk and all methods of interaction with a custodian, like custodian accounts, sign a tx, account details, tx details.",

@@ -30,3 +30,3 @@ "author": "Albert Olive <albertolivecorbella@gmail.com>",

},
"gitHead": "62ed7639b9145658a4fa1273e35e99d300acdc99",
"gitHead": "295009ad9dff2e65b30d8327f64e4fc9e2cab57f",
"dependencies": {

@@ -38,3 +38,3 @@ "@ethereumjs/tx": "^4.1.1",

"@metamask-institutional/types": "^1.1.0",
"@metamask/obs-store": "^8.0.0",
"@metamask/obs-store": "^9.0.0",
"crypto": "^1.0.1",

@@ -41,0 +41,0 @@ "lodash.clonedeep": "^4.5.0"

{
"name": "@metamask-institutional/custody-keyring",
"version": "2.0.0",
"version": "2.0.1",
"description": "The Custody Keyring Class is the initial point of contact with a custodian, it gets access to the sdk and all methods of interaction with a custodian, like custodian accounts, sign a tx, account details, tx details.",

@@ -30,3 +30,3 @@ "author": "Albert Olive <albertolivecorbella@gmail.com>",

},
"gitHead": "62ed7639b9145658a4fa1273e35e99d300acdc99",
"gitHead": "295009ad9dff2e65b30d8327f64e4fc9e2cab57f",
"dependencies": {

@@ -38,3 +38,3 @@ "@ethereumjs/tx": "^4.1.1",

"@metamask-institutional/types": "^1.1.0",
"@metamask/obs-store": "^8.0.0",
"@metamask/obs-store": "^9.0.0",
"crypto": "^1.0.1",

@@ -41,0 +41,0 @@ "lodash.clonedeep": "^4.5.0"

@@ -8,29 +8,4 @@ import { ICustodianType } from "@metamask-institutional/types";

import { JsonRpcCustodyKeyring } from "./json-rpc/JsonRpcCustodyKeyring";
import { QredoCustodyKeyring } from "./qredo/QredoCustodyKeyring";
export const CUSTODIAN_TYPES: { [key: string]: ICustodianType } = {
QREDO: {
name: "Qredo",
displayName: "Qredo",
apiUrl: "https://api-v2.qredo.network/api/v2",
imgSrc: "https://dashboard.metamask-institutional.io/custodian-icons/qredo-icon.svg",
icon: "https://dashboard.metamask-institutional.io/custodian-icons/qredo-icon.svg",
website: "https://www.qredo.com",
onboardingUrl: "https://www.qredo.com",
envName: "qredo",
keyringClass: QredoCustodyKeyring,
production: true,
hidden: false,
origins: [],
environmentMapping: [
{
pattern: /^.*$/u,
mmiApiUrl: "https://mmi.codefi.network/v1",
},
{
pattern: /^https:\/\/api.qredo.network/u,
mmiApiUrl: "https://api.mmi-prod.codefi.network/v1",
},
],
},
CACTUS: {

@@ -37,0 +12,0 @@ name: "Cactus",

@@ -383,9 +383,19 @@ import { FeeMarketEIP1559Transaction, Transaction } from "@ethereumjs/tx";

const supportedChainIds = await sdk.getSupportedChains(fromAddress);
try {
const supportedChainIds = await sdk.getSupportedChains(fromAddress);
// JSON-RPC chains are hexlified
const normalisedSupportedChainIds = supportedChainIds.map(chainId => Number(chainId).toString());
// Check for both undefined and empty array scenarios.
if (!supportedChainIds || supportedChainIds.length === 0) {
throw new Error("Didn't find any supported chains or an error occurred.");
}
if (!normalisedSupportedChainIds.includes(chainId)) {
throw new Error(`This network ${chainId} is not configured or supported with your custody provider.`);
// JSON-RPC chains are hexlified
const normalisedSupportedChainIds = supportedChainIds.map(chainId => Number(chainId).toString());
if (!normalisedSupportedChainIds.includes(chainId)) {
throw new Error(`This network ${chainId} is not configured or supported with your custody provider.`);
}
} catch (error) {
console.error("Error processing chain IDs:", error);
throw error;
}

@@ -392,0 +402,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc