Socket
Socket
Sign inDemoInstall

@moralisweb3/common-aptos-utils

Package Overview
Dependencies
Maintainers
8
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@moralisweb3/common-aptos-utils - npm Package Compare versions

Comparing version 2.13.0 to 2.14.0

lib/utils/AccountAddress.d.ts

4

lib/CommonAptosUtils.d.ts
import Core, { Module } from '@moralisweb3/common-core';
import * as dataTypes from './dataTypes';
export declare class CommonAptosUtils extends Module {

@@ -8,3 +9,6 @@ static readonly moduleName = "aptosUtils";

start(): void;
get AptosAddress(): typeof dataTypes.AptosAddress;
get AptosNative(): typeof dataTypes.AptosNative;
get AptosNetwork(): typeof dataTypes.AptosNetwork;
}
//# sourceMappingURL=CommonAptosUtils.d.ts.map

@@ -17,2 +17,25 @@ "use strict";

})();
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -22,2 +45,3 @@ exports.CommonAptosUtils = void 0;

var config_1 = require("./config");
var dataTypes = __importStar(require("./dataTypes"));
var CommonAptosUtils = /** @class */ (function (_super) {

@@ -37,2 +61,23 @@ __extends(CommonAptosUtils, _super);

};
Object.defineProperty(CommonAptosUtils.prototype, "AptosAddress", {
get: function () {
return dataTypes.AptosAddress;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CommonAptosUtils.prototype, "AptosNative", {
get: function () {
return dataTypes.AptosNative;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CommonAptosUtils.prototype, "AptosNetwork", {
get: function () {
return dataTypes.AptosNetwork;
},
enumerable: false,
configurable: true
});
CommonAptosUtils.moduleName = 'aptosUtils';

@@ -39,0 +84,0 @@ return CommonAptosUtils;

5

lib/dataTypes/AptosAddress/AptosAddress.js

@@ -5,4 +5,3 @@ "use strict";

var common_core_1 = require("@moralisweb3/common-core");
var aptos_1 = require("aptos");
var AccountAddress = aptos_1.TxnBuilderTypes.AccountAddress;
var AccountAddress_1 = require("../../utils/AccountAddress");
/**

@@ -30,3 +29,3 @@ * A representation of an address on the Aptos network.

try {
if (!AccountAddress.isValid(address)) {
if (!AccountAddress_1.AccountAddress.isValid(address)) {
// Throw and catch locally to resolve the same way if it is invalid and if it cannot be parsed

@@ -33,0 +32,0 @@ throw new Error();

@@ -6,2 +6,6 @@ "use strict";

var aptosNetworkNames = ['mainnet', 'testnet', 'devnet'];
var aptosChainIdToNetworkNames = {
'1': 'mainnet',
'2': 'testnet',
};
/**

@@ -62,11 +66,17 @@ * A representation of a Aptos network.

AptosNetwork.parse = function (network) {
if (typeof network === 'string') {
if (!aptosNetworkNames.includes(network)) {
throw new common_core_1.CoreError({
code: common_core_1.CoreErrorCode.INVALID_ARGUMENT,
message: "Aptos network is not supported: ".concat(network),
});
}
var _a;
if (typeof network !== 'string') {
throw new common_core_1.CoreError({
code: common_core_1.CoreErrorCode.INVALID_ARGUMENT,
message: "Aptos network is not supported: ".concat(network),
});
}
return network;
var networkName = (_a = aptosChainIdToNetworkNames[network]) !== null && _a !== void 0 ? _a : network;
if (!aptosNetworkNames.includes(networkName)) {
throw new common_core_1.CoreError({
code: common_core_1.CoreErrorCode.INVALID_ARGUMENT,
message: "Aptos network is not supported: ".concat(network),
});
}
return networkName;
};

@@ -73,0 +83,0 @@ /**

{
"name": "@moralisweb3/common-aptos-utils",
"author": "Moralis",
"version": "2.13.0",
"version": "2.14.0",
"license": "MIT",

@@ -33,5 +33,5 @@ "main": "./lib/index.js",

"dependencies": {
"@moralisweb3/common-core": "^2.13.0",
"aptos": "^1.6.0"
"@moralisweb3/common-core": "^2.14.0",
"@noble/hashes": "^1.2.0"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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