lunesjs 1.5.14 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +12 -38
- package/lib/index.d.ts +9 -9
- package/lib/index.js +3 -3
- package/lib/{client/transactions → tx}/BaseTransaction.d.ts +0 -0
- package/lib/{client/transactions → tx}/BaseTransaction.js +0 -0
- package/lib/{client/transactions → tx}/transactions.types.d.ts +0 -0
- package/lib/{client/transactions → tx}/transactions.types.js +0 -0
- package/lib/{client/transactions → tx}/transfer/service.transfer.d.ts +0 -0
- package/lib/{client/transactions → tx}/transfer/service.transfer.js +0 -0
- package/lib/{client/transactions → tx}/transfer/transfer.types.d.ts +0 -0
- package/lib/{client/transactions → tx}/transfer/transfer.types.js +0 -0
- package/lib/{client/transactions → tx}/transfer/validator.d.ts +0 -0
- package/lib/{client/transactions → tx}/transfer/validator.js +1 -1
- package/lib/utils/crypto.d.ts +1 -1
- package/lib/utils/crypto.js +1 -1
- package/lib/{client/wallet → wallet}/constants.d.ts +0 -0
- package/lib/{client/wallet → wallet}/constants.js +0 -0
- package/lib/{client/wallet/service.account.d.ts → wallet/wallet.service.d.ts} +1 -1
- package/lib/{client/wallet/service.account.js → wallet/wallet.service.js} +4 -4
- package/lib/{client/wallet → wallet}/wallet.types.d.ts +0 -0
- package/lib/{client/wallet → wallet}/wallet.types.js +0 -0
- package/package.json +3 -3
package/README.md
CHANGED
@@ -1,48 +1,22 @@
|
|
1
|
-
<div align="center">
|
2
|
-
|
3
|
-
<a href="https://lunes.io">
|
4
|
-
<img alt="Lunes" src="static/img/jslogo.png" width="100" />
|
5
|
-
</a>
|
6
|
-
|
7
1
|
# LunesJS
|
8
2
|
|
9
|
-
|
3
|
+
📦 Build based in the WebAssembly by Rust using [LunesRs](https://github.com/lunes-platform/lunesrs) for communication with nodes on the mainnet or testnet of the lunes-blockchain network Allows automation of asset submission, final issuance of token reissue, leasing, registration and creation of a new wallet.
|
10
4
|
|
11
5
|
[![Deploy](https://github.com/lunes-platform/lunesjs/actions/workflows/deploy.yml/badge.svg?branch=main)](https://github.com/lunes-platform/lunesjs/actions/workflows/deploy.yml)
|
12
|
-
[![Test](https://github.com/lunes-platform/lunesjs/actions/workflows/test.yml/badge.svg)](https://github.com/lunes-platform/lunesjs/actions/workflows/test.yml)
|
13
|
-
[![
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
[![Watchers](https://img.shields.io/github/watchers/lunes-platform/lunesjs.svg?color=blueviolet)](https://github.com/lunes-platform/lunesjs/watchers)
|
23
|
-
[![Followers](https://img.shields.io/github/followers/lunes-platform.svg?style=social&label=Follow&maxAge=2592000?color=blueviolet)](https://github.com/lunes-platform?tab=followers)
|
24
|
-
[![Website](https://img.shields.io/website?url=https%3A%2F%2Flunes.io%2F)](https://lunes.io)
|
25
|
-
![PullRequest](https://img.shields.io/github/issues-pr/lunes-platform/lunesjs?color=blueviolet)
|
26
|
-
![PullRequestClosed](https://img.shields.io/github/issues-pr-closed/lunes-platform/lunesjs?color=blueviolet)
|
27
|
-
[![GitHub](https://badgen.net/badge/icon/github?icon=github&label&color=purple)](https://github.com/lunes-platform)
|
28
|
-
![ClosedIssue](https://flat.badgen.net/github/closed-issues/lunes-platform/lunesjs?color=red)
|
29
|
-
|
30
|
-
<a href="https://twitter.com/LunesPlatform" target="_blank">
|
31
|
-
<img alt="Twitter: Lunes Platform" src="https://badgen.net/twitter/follow/lunesplatform?icon=twitter&label=follow @LunesPlatform&color=blue" />
|
32
|
-
</a>
|
33
|
-
<a href="https://t.me/LunesPlatformPT" target="_blank">
|
34
|
-
<img alt="Telegram" src="https://badgen.net/badge/icon/Lunes%20Platform?icon=telegram&label=Telegram&color=blue"/>
|
35
|
-
</a>
|
36
|
-
|
37
|
-
</div>
|
38
|
-
|
39
|
-
## Changelog
|
40
|
-
|
41
|
-
The changelog process for this project is described [here](CHANGELOG.md).
|
6
|
+
[![Test](https://github.com/lunes-platform/lunesjs/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/lunes-platform/lunesjs/actions/workflows/test.yml)
|
7
|
+
[![Lint](https://github.com/lunes-platform/lunesjs/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/lunes-platform/lunesjs/actions/workflows/lint.yml)
|
8
|
+
![npm](https://img.shields.io/npm/v/lunesjs)
|
9
|
+
|
10
|
+
![npm](https://img.shields.io/npm/dm/lunesjs)
|
11
|
+
![GitHub last commit](https://img.shields.io/github/last-commit/lunes-platform/lunesjs)
|
12
|
+
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/lunes-platform/lunesjs)
|
13
|
+
|
14
|
+
![NPM](https://img.shields.io/npm/l/lunesjs)
|
15
|
+
![Discord](https://img.shields.io/discord/958424925453058158)
|
42
16
|
|
43
17
|
## Documentation
|
44
18
|
|
45
|
-
The LunesJS documentations is hosted at [ Telescope ](https://
|
19
|
+
The `LunesJS` documentations is hosted at [ Telescope ](https://github.io/telescope/)
|
46
20
|
|
47
21
|
## Contributing
|
48
22
|
|
package/lib/index.d.ts
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
import { transferTokenFactory } from "./
|
2
|
-
import {
|
1
|
+
import { transferTokenFactory } from "./tx/transfer/service.transfer";
|
2
|
+
import { walletFactory } from "./wallet/wallet.service";
|
3
3
|
declare const _default: {
|
4
4
|
transferTokenFactory: typeof transferTokenFactory;
|
5
|
-
|
5
|
+
walletFactory: typeof walletFactory;
|
6
6
|
cryptoUtils: {
|
7
|
-
fromExistingSeed: (seed: string, nonce: number, chain: import("./
|
8
|
-
fromPrivateKey: (privateKey: string, chain: import("./
|
9
|
-
fromPublicKey: (publicKey: string, chain: import("./
|
10
|
-
fromAddress: (address: string, chain: import("./
|
11
|
-
fromNewSeed: (nWords: number, nonce: number, chain: import("./
|
12
|
-
validateAddress: (address: string, chain: import("./
|
7
|
+
fromExistingSeed: (seed: string, nonce: number, chain: import("./wallet/wallet.types").WalletTypes.Chain) => import("./wallet/wallet.types").IAccount;
|
8
|
+
fromPrivateKey: (privateKey: string, chain: import("./wallet/wallet.types").WalletTypes.Chain) => import("./wallet/wallet.types").IAccount;
|
9
|
+
fromPublicKey: (publicKey: string, chain: import("./wallet/wallet.types").WalletTypes.Chain) => import("./wallet/wallet.types").IAccount;
|
10
|
+
fromAddress: (address: string, chain: import("./wallet/wallet.types").WalletTypes.Chain) => import("./wallet/wallet.types").IAccount;
|
11
|
+
fromNewSeed: (nWords: number, nonce: number, chain: import("./wallet/wallet.types").WalletTypes.Chain) => import("./wallet/wallet.types").IAccount;
|
12
|
+
validateAddress: (address: string, chain: import("./wallet/wallet.types").WalletTypes.Chain) => boolean;
|
13
13
|
validateSignature: (publicKey: string, message: string, signature: string) => boolean;
|
14
14
|
fastSignature: (privateKey: string, message: string) => string;
|
15
15
|
fullSignature: (privateKey: string, message: string) => string;
|
package/lib/index.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const service_transfer_1 = require("./
|
4
|
-
const
|
3
|
+
const service_transfer_1 = require("./tx/transfer/service.transfer");
|
4
|
+
const wallet_service_1 = require("./wallet/wallet.service");
|
5
5
|
const crypto_1 = require("./utils/crypto");
|
6
6
|
exports.default = {
|
7
7
|
transferTokenFactory: service_transfer_1.transferTokenFactory,
|
8
|
-
|
8
|
+
walletFactory: wallet_service_1.walletFactory,
|
9
9
|
cryptoUtils: crypto_1.cryptoUtils
|
10
10
|
};
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
36
|
};
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
38
38
|
const transactions_types_1 = require("../transactions.types");
|
39
|
-
const crypto_1 = require("
|
39
|
+
const crypto_1 = require("../../utils/crypto");
|
40
40
|
const wasm = __importStar(require("lunesrs"));
|
41
41
|
const axios_1 = __importDefault(require("axios"));
|
42
42
|
const validator = {
|
package/lib/utils/crypto.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IAccount, WalletTypes } from "../
|
1
|
+
import { IAccount, WalletTypes } from "../wallet/wallet.types";
|
2
2
|
export declare const cryptoUtils: {
|
3
3
|
fromExistingSeed: (seed: string, nonce: number, chain: WalletTypes.Chain) => IAccount;
|
4
4
|
fromPrivateKey: (privateKey: string, chain: WalletTypes.Chain) => IAccount;
|
package/lib/utils/crypto.js
CHANGED
@@ -27,7 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
27
|
};
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
29
|
exports.cryptoUtils = void 0;
|
30
|
-
const constants_1 = __importDefault(require("../
|
30
|
+
const constants_1 = __importDefault(require("../wallet/constants"));
|
31
31
|
const wasm = __importStar(require("lunesrs"));
|
32
32
|
exports.cryptoUtils = {
|
33
33
|
fromExistingSeed: (seed, nonce, chain) => {
|
File without changes
|
File without changes
|
@@ -8,7 +8,7 @@ declare class Account implements IAccount {
|
|
8
8
|
seed: string;
|
9
9
|
constructor(wallet: IAccount);
|
10
10
|
}
|
11
|
-
export declare function
|
11
|
+
export declare function walletFactory({ privateKey, publicKey, address, nWords, chain, nonce, seed }?: {
|
12
12
|
privateKey?: string;
|
13
13
|
publicKey?: string;
|
14
14
|
address?: string;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
const crypto_1 = require("
|
3
|
+
exports.walletFactory = void 0;
|
4
|
+
const crypto_1 = require("../utils/crypto");
|
5
5
|
class Account {
|
6
6
|
constructor(wallet) {
|
7
7
|
this.privateKey = wallet.privateKey;
|
@@ -12,7 +12,7 @@ class Account {
|
|
12
12
|
this.seed = wallet.seed;
|
13
13
|
}
|
14
14
|
}
|
15
|
-
function
|
15
|
+
function walletFactory({ privateKey, publicKey, address, nWords, chain, nonce, seed } = {}) {
|
16
16
|
if (seed != undefined) {
|
17
17
|
return new Account(Object.assign({}, crypto_1.cryptoUtils.fromExistingSeed(seed, nonce != undefined ? nonce : 0, chain != undefined ? chain : 1)));
|
18
18
|
}
|
@@ -29,4 +29,4 @@ function accountFactory({ privateKey, publicKey, address, nWords, chain, nonce,
|
|
29
29
|
return new Account(Object.assign({}, crypto_1.cryptoUtils.fromNewSeed(nWords != undefined ? nWords : 12, nonce != undefined ? nonce : 0, chain != undefined ? chain : 1)));
|
30
30
|
}
|
31
31
|
}
|
32
|
-
exports.
|
32
|
+
exports.walletFactory = walletFactory;
|
File without changes
|
File without changes
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "lunesjs",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.6.0",
|
4
4
|
"description": "Library for communication with nodes in mainnet or testnet of the lunes-blockchain network",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"types": "lib/index.d.ts",
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"deploy": "yarn build && yarn publish",
|
23
23
|
"fmt": "prettier -w .",
|
24
24
|
"fmtc": "prettier -c",
|
25
|
-
"
|
25
|
+
"t": "yarn jest",
|
26
26
|
"build": "tsc"
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
@@ -35,6 +35,6 @@
|
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
37
|
"axios": "^0.26.1",
|
38
|
-
"lunesrs": "^1.
|
38
|
+
"lunesrs": "^1.9.1"
|
39
39
|
}
|
40
40
|
}
|