Skip to content

Commit

Permalink
Merge pull request #123 from magiclabs/PDEEXP-594-update-admin-sdk-de…
Browse files Browse the repository at this point in the history
…pendency-versions-to-support-web-3

Pdeexp 594 update admin sdk dependency versions to support web 3
  • Loading branch information
Ethella authored Mar 8, 2024
2 parents 4a361bd + 13f86ae commit feb3c22
Show file tree
Hide file tree
Showing 4 changed files with 1,625 additions and 911 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.10
24 changes: 10 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,29 @@
"clean_node_modules": "rimraf node_modules"
},
"devDependencies": {
"@ikscodes/eslint-config": "^6.2.0",
"@ikscodes/prettier-config": "^1.0.0",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/jest": "^27.4.1",
"@types/node": "^13.1.2",
"@types/node-fetch": "^2.5.4",
"@typescript-eslint/eslint-plugin": "^2.15.0",
"auto": "^9.60.1",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"auto": "11.0.5",
"boxen-cli": "^1.0.0",
"esbuild": "^0.14.54",
"eslint": "^6.7.2",
"eslint": "^8.56.0",
"eslint-import-resolver-typescript": "^2.0.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.15.1",
"eslint-plugin-react-hooks": "^1.7.0",
"husky": "^4.2.3",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^8.0.3",
"jest": "^27.5.1",
"lint-staged": "^10.0.8",
"npm-run-all": "~4.1.5",
"prettier": "^1.19.1",
"prettier": "^3.2.4",
"rimraf": "~3.0.0",
"ts-jest": "^27.1.3",
"ts-node": "~8.5.2",
"ts-node": "^10.2.0",
"tslint": "~5.20.1",
"typescript": "~3.8.3"
"typescript": "^5.3.3"
},
"dependencies": {
"ethereum-cryptography": "^1.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/modules/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Web3 from 'web3';
import { BaseModule } from '../base-module';
import { createExpectedBearerStringError } from '../../core/sdk-exceptions';
import {createExpectedBearerStringError, MagicAdminSDKError} from '../../core/sdk-exceptions';
import { ValidateTokenOwnershipResponse } from '../../types';
import { ERC1155ContractABI, ERC721ContractABI } from './ownershipABIs';

Expand Down Expand Up @@ -33,14 +33,14 @@ export class UtilsModule extends BaseModule {
await this.sdk.token.validate(didToken);
} catch (e) {
// Check if code is malformed token
if (e.code === 'ERROR_MALFORMED_TOKEN') {
if ((e as MagicAdminSDKError).code === 'ERROR_MALFORMED_TOKEN') {
return {
valid: false,
error_code: 'UNAUTHORIZED',
message: 'Invalid DID token: ERROR_MALFORMED_TOKEN',
};
}
throw new Error(e.code);
throw new Error((e as MagicAdminSDKError).code);
}
const { email, publicAddress: walletAddress } = await this.sdk.users.getMetadataByToken(didToken);
if (!email || !walletAddress) {
Expand Down
Loading

0 comments on commit feb3c22

Please sign in to comment.