Skip to content

Commit

Permalink
chore: bumped package version to v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sarvalabs-gokul committed Aug 29, 2023
1 parent 3922e68 commit fda7844
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 69 deletions.
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# built documents.
#
# The short X.Y version.
version = u'v0.1.0'
version = u'v0.1.2'
# The full version, including alpha/beta/rc tags.
release = u'v0.1.0'
release = u'v0.1.2'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/source/constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ js-moi-sdk package.
console.log(moi.VERSION)
>> 0.1.0
>> 0.1.2
MOI Derivation Path
-------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/logic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ applications on the MOI network.
const mnemonic = "mother clarify push liquid ordinary social track ...";
const provider = new JsonRpcProvider("http://localhost:1600/");
const wallet = new Wallet(provider);
await wallet.fromMnemonic(mnemonic);
return await wallet.fromMnemonic(mnemonic);
}
const manifest = { ... }
Expand Down Expand Up @@ -265,7 +265,7 @@ Functions
const mnemonic = "mother clarify push liquid ordinary social track ...";
const provider = new JsonRpcProvider("http://localhost:1600/");
const wallet = new Wallet(provider);
await wallet.fromMnemonic(mnemonic);
return await wallet.fromMnemonic(mnemonic);
}
const logicId = "0x0800007d70c34ed6ec4384c75d469894052647a078b33ac0f08db0d3751c1fce29a49a";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moi",
"version": "0.1.1",
"version": "0.1.2",
"description": "JavaScript library to interact with MOI Protocol via RPC API",
"private": true,
"main": "packages/js-moi/dist/index.js",
Expand Down
10 changes: 5 additions & 5 deletions packages/js-moi-bip39/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-moi-bip39",
"version": "0.1.1",
"version": "0.1.2",
"description": "Bitcoin BIP39 package for deterministic key generation using mnemonic code",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -24,10 +24,10 @@
"author": "Sarva Labs Inc. & MOI Protocol Developers",
"license": "Apache-2.0 OR MIT",
"dependencies": {
"js-moi-hdnode": "^0.1.1",
"js-moi-signer": "^0.1.1",
"js-moi-constants": "^0.1.1",
"js-moi-utils": "^0.1.1",
"js-moi-hdnode": "^0.1.2",
"js-moi-signer": "^0.1.2",
"js-moi-constants": "^0.1.2",
"js-moi-utils": "^0.1.2",
"buffer": "^6.0.3",
"@noble/hashes": "^1.1.5"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/js-moi-constants/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-moi-constants",
"version": "0.1.1",
"version": "0.1.2",
"description": "Collection of constant variables used in js-moi-sdk",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/js-moi-hdnode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-moi-hdnode",
"version": "0.1.1",
"version": "0.1.2",
"description": "BIP32 HD Node for cryptocurrency key management.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -23,7 +23,7 @@
"author": "Sarva Labs Inc. & MOI Protocol Developers",
"license": "Apache-2.0 OR MIT",
"dependencies": {
"js-moi-utils": "^0.1.1",
"js-moi-utils": "^0.1.2",
"buffer": "^6.0.3",
"hdkey": "^2.1.0",
"assert": "^2.0.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/js-moi-logic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-moi-logic",
"version": "0.1.1",
"version": "0.1.2",
"description": "Module to interact with MOI Logic Objects.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -23,10 +23,10 @@
"author": "Sarva Labs Inc. & MOI Protocol Developers",
"license": "Apache-2.0 OR MIT",
"dependencies": {
"js-moi-manifest": "^0.1.1",
"js-moi-utils": "^0.1.1",
"js-moi-providers": "^0.1.1",
"js-moi-signer": "^0.1.1",
"js-moi-manifest": "^0.1.2",
"js-moi-utils": "^0.1.2",
"js-moi-providers": "^0.1.2",
"js-moi-signer": "^0.1.2",
"blakejs": "^1.2.1",
"buffer": "^6.0.3"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/js-moi-manifest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-moi-manifest",
"version": "0.1.1",
"version": "0.1.2",
"description": "Module to encode and decode MOI Logic Engine input and output.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -23,7 +23,7 @@
"author": "Sarva Labs Inc. & MOI Protocol Developers",
"license": "Apache-2.0 OR MIT",
"dependencies": {
"js-moi-utils": "^0.1.1",
"js-moi-utils": "^0.1.2",
"js-polo": "^0.1.2"
}
}
6 changes: 3 additions & 3 deletions packages/js-moi-providers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-moi-providers",
"version": "0.1.1",
"version": "0.1.2",
"description": "Module to connect and interact with MOI network",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -23,8 +23,8 @@
"author": "Sarva Labs Inc. & MOI Protocol Developers",
"license": "Apache-2.0 OR MIT",
"dependencies": {
"js-moi-utils": "^0.1.1",
"js-moi-manifest": "^0.1.1",
"js-moi-utils": "^0.1.2",
"js-moi-manifest": "^0.1.2",
"cross-fetch": "^4.0.0",
"websocket": "^1.0.34"
}
Expand Down
5 changes: 2 additions & 3 deletions packages/js-moi-signer/dist/signature.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const js_moi_utils_1 = require("js-moi-utils");
const js_moi_utils_2 = require("js-moi-utils");
class Signature {
prefix;
digest;
Expand Down Expand Up @@ -40,7 +39,7 @@ class Signature {
*/
getSigByte() {
if (typeof this.prefix[0] !== "number") {
js_moi_utils_2.ErrorUtils.throwError("Invalid signature byte.", js_moi_utils_2.ErrorCode.INVALID_SIGNATURE);
js_moi_utils_1.ErrorUtils.throwError("Invalid signature byte.", js_moi_utils_1.ErrorCode.INVALID_SIGNATURE);
}
return this.prefix[0];
}
Expand All @@ -59,7 +58,7 @@ class Signature {
}
serialize() {
if (this.name === "") {
js_moi_utils_2.ErrorUtils.throwError("Signature is not initialized", js_moi_utils_2.ErrorCode.NOT_INITIALIZED);
js_moi_utils_1.ErrorUtils.throwError("Signature is not initialized", js_moi_utils_1.ErrorCode.NOT_INITIALIZED);
}
const finalSigBytesWithoutExtra = new Uint8Array([...this.prefix, ...this.digest]);
const finalSigBytes = new Uint8Array([...finalSigBytesWithoutExtra, ...this.extraData]);
Expand Down
31 changes: 15 additions & 16 deletions packages/js-moi-signer/dist/signer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Signer = void 0;
const js_moi_utils_1 = require("js-moi-utils");
const ecdsa_1 = __importDefault(require("./ecdsa"));
const signature_1 = __importDefault(require("./signature"));
const js_moi_utils_2 = require("js-moi-utils");
const js_moi_utils_1 = require("js-moi-utils");
/**
* An abstract class representing a signer responsible for cryptographic
* activities like signing and verification.
Expand All @@ -31,7 +30,7 @@ class Signer {
if (this.provider) {
return this.provider;
}
js_moi_utils_2.ErrorUtils.throwError("Provider is not initialized!", js_moi_utils_2.ErrorCode.NOT_INITIALIZED);
js_moi_utils_1.ErrorUtils.throwError("Provider is not initialized!", js_moi_utils_1.ErrorCode.NOT_INITIALIZED);
}
/**
* Retrieves the nonce (interaction count) for the signer's address
Expand Down Expand Up @@ -65,34 +64,34 @@ class Signer {
*/
checkInteraction(ixObject, nonce) {
if (ixObject.type === undefined || ixObject.type === null) {
js_moi_utils_2.ErrorUtils.throwError("Interaction type is missing", js_moi_utils_2.ErrorCode.MISSING_ARGUMENT);
js_moi_utils_1.ErrorUtils.throwError("Interaction type is missing", js_moi_utils_1.ErrorCode.MISSING_ARGUMENT);
}
if (!(0, js_moi_utils_2.isValidAddress)(ixObject.sender)) {
js_moi_utils_2.ErrorUtils.throwError("Invalid sender address", js_moi_utils_2.ErrorCode.INVALID_ARGUMENT);
if (!(0, js_moi_utils_1.isValidAddress)(ixObject.sender)) {
js_moi_utils_1.ErrorUtils.throwError("Invalid sender address", js_moi_utils_1.ErrorCode.INVALID_ARGUMENT);
}
if (ixObject.sender !== this.getAddress()) {
js_moi_utils_2.ErrorUtils.throwError("Sender address mismatches with the signer", js_moi_utils_2.ErrorCode.UNEXPECTED_ARGUMENT);
js_moi_utils_1.ErrorUtils.throwError("Sender address mismatches with the signer", js_moi_utils_1.ErrorCode.UNEXPECTED_ARGUMENT);
}
if (ixObject.type === js_moi_utils_2.IxType.VALUE_TRANSFER) {
if (ixObject.type === js_moi_utils_1.IxType.VALUE_TRANSFER) {
if (!ixObject.receiver) {
js_moi_utils_2.ErrorUtils.throwError("Receiver address is missing", js_moi_utils_2.ErrorCode.MISSING_ARGUMENT);
js_moi_utils_1.ErrorUtils.throwError("Receiver address is missing", js_moi_utils_1.ErrorCode.MISSING_ARGUMENT);
}
if (!(0, js_moi_utils_2.isValidAddress)(ixObject.receiver)) {
js_moi_utils_2.ErrorUtils.throwError("Invalid receiver address", js_moi_utils_2.ErrorCode.INVALID_ARGUMENT);
if (!(0, js_moi_utils_1.isValidAddress)(ixObject.receiver)) {
js_moi_utils_1.ErrorUtils.throwError("Invalid receiver address", js_moi_utils_1.ErrorCode.INVALID_ARGUMENT);
}
}
if (ixObject.fuel_price === undefined || ixObject.fuel_price === null) {
js_moi_utils_2.ErrorUtils.throwError("Fuel price is missing", js_moi_utils_2.ErrorCode.MISSING_ARGUMENT);
js_moi_utils_1.ErrorUtils.throwError("Fuel price is missing", js_moi_utils_1.ErrorCode.MISSING_ARGUMENT);
}
if (ixObject.fuel_limit === undefined || ixObject.fuel_limit === null) {
js_moi_utils_2.ErrorUtils.throwError("Fuel limit is missing", js_moi_utils_2.ErrorCode.MISSING_ARGUMENT);
js_moi_utils_1.ErrorUtils.throwError("Fuel limit is missing", js_moi_utils_1.ErrorCode.MISSING_ARGUMENT);
}
if (ixObject.fuel_limit === 0) {
js_moi_utils_2.ErrorUtils.throwError("Invalid fuel limit", js_moi_utils_2.ErrorCode.INTERACTION_UNDERPRICED);
js_moi_utils_1.ErrorUtils.throwError("Invalid fuel limit", js_moi_utils_1.ErrorCode.INTERACTION_UNDERPRICED);
}
if (ixObject.nonce !== undefined || ixObject.nonce !== null) {
if (ixObject.nonce < nonce) {
js_moi_utils_2.ErrorUtils.throwError("Invalid nonce", js_moi_utils_2.ErrorCode.NONCE_EXPIRED);
js_moi_utils_1.ErrorUtils.throwError("Invalid nonce", js_moi_utils_1.ErrorCode.NONCE_EXPIRED);
}
}
}
Expand Down Expand Up @@ -204,7 +203,7 @@ class Signer {
return _sig.verify(message, sig, verificationKey);
}
default: {
js_moi_utils_2.ErrorUtils.throwError("Invalid signature provided. Unable to verify the signature.", js_moi_utils_2.ErrorCode.INVALID_SIGNATURE);
js_moi_utils_1.ErrorUtils.throwError("Invalid signature provided. Unable to verify the signature.", js_moi_utils_1.ErrorCode.INVALID_SIGNATURE);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/js-moi-signer/dist/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions packages/js-moi-signer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-moi-signer",
"version": "0.1.1",
"version": "0.1.2",
"description": "This package enables users to sign and verify messages in their applications.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -23,7 +23,8 @@
"author": "Sarva Labs Inc. & MOI Protocol Developers",
"license": "Apache-2.0 OR MIT",
"dependencies": {
"js-moi-utils": "^0.1.1",
"js-moi-providers": "^0.1.2",
"js-moi-utils": "^0.1.2",
"blake2b": "^2.1.4",
"buffer": "^6.0.3",
"@noble/hashes": "^1.1.5",
Expand Down
3 changes: 1 addition & 2 deletions packages/js-moi-signer/src/signature.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { hexToBytes } from "js-moi-utils";
import { ErrorCode, ErrorUtils } from "js-moi-utils";
import { ErrorCode, ErrorUtils, hexToBytes } from "js-moi-utils";

export default class Signature {
private prefix: Uint8Array;
Expand Down
4 changes: 1 addition & 3 deletions packages/js-moi-signer/src/signer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { hexToBytes } from "js-moi-utils"
import { AbstractProvider, Options, InteractionResponse, InteractionRequest, CallorEstimateIxObject, InteractionCallResponse, InteractionObject } from "js-moi-providers";
import ECDSA_S256 from "./ecdsa";
import { SigType, SigningAlgorithms } from "../types";
import Signature from "./signature";
import { ErrorCode, ErrorUtils, IxType, isValidAddress } from "js-moi-utils";

import { ErrorCode, ErrorUtils, hexToBytes, IxType, isValidAddress } from "js-moi-utils";

/**
* An abstract class representing a signer responsible for cryptographic
Expand Down
2 changes: 1 addition & 1 deletion packages/js-moi-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-moi-utils",
"version": "0.1.1",
"version": "0.1.2",
"description": "Collection of utility functions used in js-moi-sdk.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
14 changes: 7 additions & 7 deletions packages/js-moi-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-moi-wallet",
"version": "0.1.1",
"version": "0.1.2",
"description": "Module to interact with the MOI accounts.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -23,12 +23,12 @@
"author": "Sarva Labs Inc. & MOI Protocol Developers",
"license": "Apache-2.0 OR MIT",
"dependencies": {
"js-moi-hdnode": "^0.1.1",
"js-moi-signer": "^0.1.1",
"js-moi-providers": "^0.1.1",
"js-moi-constants": "^0.1.1",
"js-moi-utils": "^0.1.1",
"js-moi-bip39": "^0.1.1",
"js-moi-hdnode": "^0.1.2",
"js-moi-signer": "^0.1.2",
"js-moi-providers": "^0.1.2",
"js-moi-constants": "^0.1.2",
"js-moi-utils": "^0.1.2",
"js-moi-bip39": "^0.1.2",
"buffer": "^6.0.3",
"crypto": "npm:crypto-browserify",
"elliptic": "^6.5.4",
Expand Down
20 changes: 10 additions & 10 deletions packages/js-moi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-moi-sdk",
"version": "0.1.1",
"version": "0.1.2",
"description": "A feature-rich library designed to seamlessly interact with the MOI Protocol.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -23,14 +23,14 @@
"author": "Sarva Labs Inc. & MOI Protocol Developers",
"license": "Apache-2.0 OR MIT",
"dependencies": {
"js-moi-providers": "^0.1.1",
"js-moi-manifest": "^0.1.1",
"js-moi-logic": "^0.1.1",
"js-moi-hdnode": "^0.1.1",
"js-moi-wallet": "^0.1.1",
"js-moi-signer": "^0.1.1",
"js-moi-bip39": "^0.1.1",
"js-moi-constants": "^0.1.1",
"js-moi-utils": "^0.1.1"
"js-moi-providers": "^0.1.2",
"js-moi-manifest": "^0.1.2",
"js-moi-logic": "^0.1.2",
"js-moi-hdnode": "^0.1.2",
"js-moi-wallet": "^0.1.2",
"js-moi-signer": "^0.1.2",
"js-moi-bip39": "^0.1.2",
"js-moi-constants": "^0.1.2",
"js-moi-utils": "^0.1.2"
}
}

0 comments on commit fda7844

Please sign in to comment.