lunesjs 1.5.0 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/deploy.yml +47 -0
- package/.github/workflows/test.yml +31 -14
- package/.gitlab/.gitlab-ci.yml +1 -1
- package/.gitlab/issue_templates/bug.md +4 -4
- package/.gitlab/issue_templates/proposal.md +3 -3
- package/.gitlab/merge_request_templates/MR.md +3 -3
- package/.prettierrc.yml +1 -1
- package/CHANGELOG.md +1 -4
- package/CONTRIBUTING.md +20 -24
- package/Dockerfile +1 -4
- package/README.md +2 -2
- package/dist/client/transactions/BaseTransaction.d.ts +6 -0
- package/dist/client/transactions/BaseTransaction.js +2 -0
- package/dist/client/transactions/transactions.types.d.ts +10 -0
- package/dist/client/transactions/transactions.types.js +17 -0
- package/dist/client/transactions/transfer/service.transfer.d.ts +12 -0
- package/dist/client/transactions/transfer/service.transfer.js +78 -0
- package/dist/client/transactions/transfer/transfer.types.d.ts +12 -0
- package/dist/client/transactions/transfer/transfer.types.js +2 -0
- package/dist/client/transactions/transfer/validator.d.ts +9 -0
- package/dist/client/transactions/transfer/validator.js +93 -0
- package/dist/client/wallet/constants.d.ts +8 -0
- package/dist/client/wallet/constants.js +2064 -0
- package/dist/client/wallet/service.account.d.ts +20 -0
- package/dist/client/wallet/service.account.js +35 -0
- package/dist/client/wallet/wallet.types.d.ts +21 -0
- package/dist/client/wallet/wallet.types.js +11 -0
- package/dist/utils/crypto.d.ts +13 -0
- package/dist/utils/crypto.js +102 -0
- package/package.json +10 -45
- package/src/client/transactions/transfer/service.transfer.ts +15 -21
- package/src/client/transactions/transfer/validator.ts +18 -10
- package/src/client/wallet/service.account.ts +1 -1
- package/src/utils/crypto.ts +24 -28
- package/test/client/transactions/transfer/transfer.token.test.ts +14 -12
- package/test/client/wallet/service.account.test.ts +17 -7
- package/tsconfig.json +12 -89
- package/.github/workflows/build.yml +0 -18
- package/.husky/commit-msg +0 -4
- package/.prettierignore +0 -2
- package/commitlint.config.js +0 -10
- package/docker/runner/Dockerfile +0 -22
- package/src/client/transactions/transfer/validators.ts +0 -27
- package/src/server/blocks/block.types.ts +0 -13
- package/src/server/blocks/service.blocks.ts +0 -8
@@ -0,0 +1,47 @@
|
|
1
|
+
name: Deploy
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [main]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
lint:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- uses: actions/setup-node@v3
|
14
|
+
|
15
|
+
- name: Install dependencies
|
16
|
+
run: yarn install -D
|
17
|
+
|
18
|
+
- name: Format Checker
|
19
|
+
run: yarn fmtc
|
20
|
+
|
21
|
+
test:
|
22
|
+
runs-on: ubuntu-latest
|
23
|
+
needs: lint
|
24
|
+
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v2
|
27
|
+
- uses: actions/setup-node@v3
|
28
|
+
|
29
|
+
- name: Install dependencies
|
30
|
+
run: yarn install -D
|
31
|
+
|
32
|
+
- name: Format Checker
|
33
|
+
run: yarn test
|
34
|
+
|
35
|
+
deploy-npm:
|
36
|
+
runs-on: ubuntu-latest
|
37
|
+
needs: [lint, test]
|
38
|
+
|
39
|
+
steps:
|
40
|
+
- uses: actions/checkout@v1
|
41
|
+
- uses: actions/setup-node@v1
|
42
|
+
with:
|
43
|
+
node-version: 16
|
44
|
+
- run: yarn install
|
45
|
+
- uses: JS-DevTools/npm-publish@v1
|
46
|
+
with:
|
47
|
+
token: ${{ secrets.NPM_TOKEN }}
|
@@ -1,18 +1,35 @@
|
|
1
|
-
name: Test
|
1
|
+
name: Lint & Test
|
2
2
|
|
3
3
|
on:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
push:
|
5
|
+
branches-ignore: [main]
|
6
|
+
pull_request:
|
7
|
+
branches: [main]
|
8
8
|
|
9
9
|
jobs:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
lint:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- uses: actions/setup-node@v3
|
16
|
+
|
17
|
+
- name: Install dependencies
|
18
|
+
run: yarn install -D
|
19
|
+
|
20
|
+
- name: Format Checker
|
21
|
+
run: yarn fmtc
|
22
|
+
|
23
|
+
test:
|
24
|
+
runs-on: ubuntu-latest
|
25
|
+
needs: lint
|
26
|
+
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v2
|
29
|
+
- uses: actions/setup-node@v3
|
30
|
+
|
31
|
+
- name: Install dependencies
|
32
|
+
run: yarn install -D
|
33
|
+
|
34
|
+
- name: Format Checker
|
35
|
+
run: yarn test
|
package/.gitlab/.gitlab-ci.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
## MR template
|
2
2
|
|
3
|
-
-
|
3
|
+
- [ ] CODE WITHOUT TEST WILL BE REJECTED
|
4
4
|
|
5
|
-
-
|
5
|
+
- [ ] CODE WITHOUT DOCS WILL BE REJECTED
|
6
6
|
|
7
|
-
-
|
7
|
+
- [ ] COMMITS OUTSIDE THE CONVENTIONAL WILL BE REJECTED
|
package/.prettierrc.yml
CHANGED
package/CHANGELOG.md
CHANGED
package/CONTRIBUTING.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# CONTRIBUTING
|
2
2
|
|
3
|
-
|
4
3
|
## What is the workflow?
|
5
4
|
|
6
5
|
1. Create and describe your **proposal/bug** in an _issue_.
|
@@ -22,34 +21,31 @@ why was it modified?
|
|
22
21
|
#issue
|
23
22
|
```
|
24
23
|
|
25
|
-
-
|
26
|
-
-
|
27
|
-
-
|
28
|
-
-
|
29
|
-
-
|
30
|
-
- **deprecated** compatibility break
|
24
|
+
- **fix** Fix a bug
|
25
|
+
- **add** Add a new feature
|
26
|
+
- **remove** Remove a peace of code
|
27
|
+
- **deprecate** compatibility break
|
28
|
+
- **update** Update any thing. e.g. feature, piece, refact
|
31
29
|
|
32
30
|
### **Semantic Version**
|
33
31
|
|
34
|
-
-
|
35
|
-
-
|
36
|
-
-
|
32
|
+
- **deprecate** -> _Major_
|
33
|
+
- **add** -> _Minor_
|
34
|
+
- **fix** -> _Patch_
|
37
35
|
|
38
36
|
---
|
39
37
|
|
40
38
|
## References
|
41
39
|
|
42
|
-
-
|
43
|
-
-
|
44
|
-
-
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
53
|
-
-
|
54
|
-
|
55
|
-
|
40
|
+
- [Good Practices](https://bestpractices.coreinfrastructure.org/pt-BR)
|
41
|
+
- [Semantic Versioning](https://semver.org/lang/pt-BR/)
|
42
|
+
- [More about Versioning](http://www.modelcvs.org/versioning/)
|
43
|
+
- [Versioning Automate](https://bhuwanupadhyay.github.io/2020/04/applying-semantic-versioning-with-git-repository/)
|
44
|
+
- [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0-beta.2/#why-use-conventional-commits)
|
45
|
+
- [Default Angular Commit](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines)
|
46
|
+
- [Global hook for repositories](https://docs.gitlab.com/ce/administration/server_hooks.html#set-a-global-server-hook-for-all-repositories)
|
47
|
+
- [More about Commits](https://chris.beams.io/posts/git-commit/)
|
48
|
+
- [Quick Actions for Commits](https://docs.gitlab.com/ee/user/project/quick_actions.html)
|
49
|
+
- [Commits examples](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#)
|
50
|
+
- [Full Tutorial Add Convetional Commit as default](https://prahladyeri.com/blog/2019/06/how-to-enforce-conventional-commit-messages-using-git-hooks.html)
|
51
|
+
- [Create a global git commit hook](https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook)
|
package/Dockerfile
CHANGED
@@ -1,9 +1,6 @@
|
|
1
|
-
FROM node:16
|
1
|
+
FROM node:16-alpine
|
2
2
|
|
3
3
|
RUN apk --update --upgrade add git openssh curl zsh
|
4
4
|
RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
5
5
|
|
6
6
|
RUN npm install -g npm@latest
|
7
|
-
RUN npm install -g commitizen
|
8
|
-
RUN npm install -g --save-dev --save-exact prettier
|
9
|
-
RUN npm install -g jest
|
package/README.md
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
|
7
7
|
# LunesJS
|
8
8
|
|
9
|
-
-
|
9
|
+
- Built from the WebAssembly Library 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
10
|
|
11
|
-
[![
|
11
|
+
[![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
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
13
|
[![Stars](https://img.shields.io/github/stars/lunes-platform/lunesjs?color=blueviolet)](https://github.com/lunes-platform/lunesjs/stargazers)
|
14
14
|
[![Release](https://img.shields.io/github/v/release/lunes-platform/lunesjs)](https://github.com/lunes-platform/lunesjs/releases)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.TransactionsTypes = void 0;
|
4
|
+
var TransactionsTypes;
|
5
|
+
(function (TransactionsTypes) {
|
6
|
+
let TransferToken;
|
7
|
+
(function (TransferToken) {
|
8
|
+
TransferToken[TransferToken["int"] = 4] = "int";
|
9
|
+
TransferToken[TransferToken["fee"] = 1000000] = "fee";
|
10
|
+
})(TransferToken = TransactionsTypes.TransferToken || (TransactionsTypes.TransferToken = {}));
|
11
|
+
let IssueToken;
|
12
|
+
(function (IssueToken) {
|
13
|
+
IssueToken[IssueToken["int"] = 5] = "int";
|
14
|
+
IssueToken[IssueToken["fee"] = 1000000000] = "fee";
|
15
|
+
})(IssueToken = TransactionsTypes.IssueToken || (TransactionsTypes.IssueToken = {}));
|
16
|
+
//...
|
17
|
+
})(TransactionsTypes = exports.TransactionsTypes || (exports.TransactionsTypes = {}));
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { WalletTypes } from "../../wallet/wallet.types";
|
2
|
+
import { BaseTransaction } from "../BaseTransaction";
|
3
|
+
import { ITransfer } from "./transfer.types";
|
4
|
+
declare class TransferToken implements BaseTransaction {
|
5
|
+
private tx;
|
6
|
+
constructor(tx: ITransfer);
|
7
|
+
transaction(): ITransfer;
|
8
|
+
sign(privateKey: WalletTypes.PrivateKey): ITransfer;
|
9
|
+
send(): Promise<void>;
|
10
|
+
}
|
11
|
+
export declare function transferTokenFactory(senderPublicKey: string, recipient: string, amount: number, chain?: WalletTypes.Chain, timestamp?: number, feeAsset?: string, assetId?: string, fee?: number): TransferToken;
|
12
|
+
export {};
|
@@ -0,0 +1,78 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
|
+
});
|
33
|
+
};
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
36
|
+
};
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
38
|
+
exports.transferTokenFactory = void 0;
|
39
|
+
const transactions_types_1 = require("../transactions.types");
|
40
|
+
const wallet_types_1 = require("../../wallet/wallet.types");
|
41
|
+
const validator_1 = __importDefault(require("./validator"));
|
42
|
+
const wasm = __importStar(require("lunesrs"));
|
43
|
+
class TransferToken {
|
44
|
+
constructor(tx) {
|
45
|
+
this.tx = tx;
|
46
|
+
}
|
47
|
+
transaction() {
|
48
|
+
return this.tx;
|
49
|
+
}
|
50
|
+
sign(privateKey) {
|
51
|
+
this.tx.signature = validator_1.default.sign(privateKey, this.tx);
|
52
|
+
return this.tx;
|
53
|
+
}
|
54
|
+
send() {
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
56
|
+
validator_1.default.send(this.tx);
|
57
|
+
});
|
58
|
+
}
|
59
|
+
}
|
60
|
+
function transferTokenFactory(senderPublicKey, recipient, amount, chain, timestamp, feeAsset, assetId, fee) {
|
61
|
+
const chain_id = chain != undefined ? chain : wallet_types_1.WalletTypes.Chain.Mainnet;
|
62
|
+
if (false == validator_1.default.ready(senderPublicKey, recipient, amount, chain_id)) {
|
63
|
+
throw new Error("dados invalidos");
|
64
|
+
}
|
65
|
+
return new TransferToken({
|
66
|
+
senderPublicKey: senderPublicKey,
|
67
|
+
recipient: recipient,
|
68
|
+
amount: amount,
|
69
|
+
sender: wasm.arrayToBase58(wasm.toAddress(1, chain_id, wasm.base58ToArray(senderPublicKey))),
|
70
|
+
timestamp: timestamp != undefined ? timestamp : new Date().getTime(),
|
71
|
+
feeAsset: feeAsset != undefined ? feeAsset : "",
|
72
|
+
assetId: assetId != undefined ? assetId : "",
|
73
|
+
type: transactions_types_1.TransactionsTypes.TransferToken.int,
|
74
|
+
fee: fee != undefined ? fee : transactions_types_1.TransactionsTypes.TransferToken.fee,
|
75
|
+
signature: ""
|
76
|
+
});
|
77
|
+
}
|
78
|
+
exports.transferTokenFactory = transferTokenFactory;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { WalletTypes } from "../../wallet/wallet.types";
|
2
|
+
import { ITransfer } from "./transfer.types";
|
3
|
+
declare const validator: {
|
4
|
+
serialize: (senderPublicKey: string, assetId: string, feeAsset: string, timestamp: number, amount: number, fee: number, recipient: string) => Uint8Array;
|
5
|
+
ready: (senderPublicKey: string, recipient: string, amount: number, chain: WalletTypes.Chain) => boolean;
|
6
|
+
sign: (privateKey: WalletTypes.PrivateKey, tx: ITransfer) => string;
|
7
|
+
send: (tx: ITransfer) => Promise<void>;
|
8
|
+
};
|
9
|
+
export default validator;
|
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
|
+
});
|
33
|
+
};
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
36
|
+
};
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
38
|
+
const transactions_types_1 = require("../transactions.types");
|
39
|
+
const crypto_1 = __importDefault(require("../../../utils/crypto"));
|
40
|
+
const wasm = __importStar(require("lunesrs"));
|
41
|
+
const axios_1 = __importDefault(require("axios"));
|
42
|
+
const validator = {
|
43
|
+
serialize: (senderPublicKey, assetId, feeAsset, timestamp, amount, fee, recipient) => {
|
44
|
+
const tokenId = assetId != ""
|
45
|
+
? new Uint8Array([1, ...wasm.base58ToArray(assetId)])
|
46
|
+
: new Uint8Array([0]);
|
47
|
+
const tokenFee = feeAsset != ""
|
48
|
+
? new Uint8Array([1, ...wasm.base58ToArray(feeAsset)])
|
49
|
+
: new Uint8Array([0]);
|
50
|
+
return new Uint8Array([
|
51
|
+
...[transactions_types_1.TransactionsTypes.TransferToken.int],
|
52
|
+
...wasm.base58ToArray(senderPublicKey),
|
53
|
+
...tokenId,
|
54
|
+
...tokenFee,
|
55
|
+
...wasm.serializeUInteger(BigInt(timestamp)),
|
56
|
+
...wasm.serializeUInteger(BigInt(amount)),
|
57
|
+
...wasm.serializeUInteger(BigInt(fee)),
|
58
|
+
...wasm.base58ToArray(recipient)
|
59
|
+
]);
|
60
|
+
},
|
61
|
+
ready: (senderPublicKey, recipient, amount, chain) => {
|
62
|
+
const sender = wasm.arrayToBase58(wasm.toAddress(1, chain, wasm.base58ToArray(senderPublicKey)));
|
63
|
+
if (amount <= 0) {
|
64
|
+
return false;
|
65
|
+
}
|
66
|
+
else if (!(crypto_1.default.validateAddress(sender, chain) === true &&
|
67
|
+
crypto_1.default.validateAddress(recipient, chain) === true)) {
|
68
|
+
return false;
|
69
|
+
}
|
70
|
+
else {
|
71
|
+
return true;
|
72
|
+
}
|
73
|
+
},
|
74
|
+
sign: (privateKey, tx) => {
|
75
|
+
const message = validator.serialize(tx.senderPublicKey, tx.assetId, tx.feeAsset, tx.timestamp, tx.amount, tx.fee, tx.recipient);
|
76
|
+
return crypto_1.default.fastSignature(privateKey, wasm.arrayToBase58(new Uint8Array(message)));
|
77
|
+
},
|
78
|
+
send: (tx) => __awaiter(void 0, void 0, void 0, function* () {
|
79
|
+
yield axios_1.default
|
80
|
+
.request({
|
81
|
+
url: "https://lunesnode.lunes.io/transactions/broadcast",
|
82
|
+
method: "post",
|
83
|
+
data: tx
|
84
|
+
})
|
85
|
+
.then((x) => {
|
86
|
+
console.log(x);
|
87
|
+
})
|
88
|
+
.catch((error) => {
|
89
|
+
console.error(error.response.data);
|
90
|
+
});
|
91
|
+
})
|
92
|
+
};
|
93
|
+
exports.default = validator;
|