@metamask-institutional/custody-keyring
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -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 @@ |
@@ -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", |
@@ -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 @@ |
155136
85
3272
+ Added@metamask/obs-store@9.1.0(transitive)
+ Added@metamask/safe-event-emitter@3.1.2(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
- Removed@metamask/obs-store@8.1.0(transitive)
- Removed@metamask/safe-event-emitter@2.0.0(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedisarray@1.0.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedxtend@4.0.2(transitive)
Updated@metamask/obs-store@^9.0.0