@arkecosystem/typescript-crypto 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/utils/Abi/json/index.d.ts +4 -0
- package/dist/utils/Abi/json/index.d.ts.map +1 -0
- package/dist/utils/Abi/json/index.js +3 -0
- package/dist/utils/AbiBase.d.ts.map +1 -1
- package/dist/utils/AbiBase.js +1 -3
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/utils/Abi/json/index.ts +3 -0
- package/src/utils/AbiBase.ts +1 -3
- package/tests/unit/configuration/Network.test.ts +6 -6
- package/tests/unit/utils/Slot.test.ts +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
@@ -28326,6 +28326,7 @@ export {
|
|
28326
28326
|
AbstractTransaction,
|
28327
28327
|
AbstractTransactionBuilder,
|
28328
28328
|
Address,
|
28329
|
+
Abi_Consensus_default as ConsensusContract,
|
28329
28330
|
Constants,
|
28330
28331
|
ContractAbiType,
|
28331
28332
|
ContractAddresses,
|
@@ -28338,6 +28339,7 @@ export {
|
|
28338
28339
|
Message,
|
28339
28340
|
Multipayment,
|
28340
28341
|
MultipaymentBuilder,
|
28342
|
+
Abi_Multipayment_default as MultipaymentContract,
|
28341
28343
|
Network,
|
28342
28344
|
PrivateKey,
|
28343
28345
|
PublicKey,
|
@@ -28354,6 +28356,7 @@ export {
|
|
28354
28356
|
UsernameRegistrationBuilder,
|
28355
28357
|
UsernameResignation,
|
28356
28358
|
UsernameResignationBuilder,
|
28359
|
+
Abi_Usernames_default as UsernamesContract,
|
28357
28360
|
ValidatorRegistration,
|
28358
28361
|
ValidatorRegistrationBuilder,
|
28359
28362
|
ValidatorResignation,
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/Abi/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AbiBase.d.ts","sourceRoot":"","sources":["../../src/utils/AbiBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"AbiBase.d.ts","sourceRoot":"","sources":["../../src/utils/AbiBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGnC,8BAAsB,OAAO;IAC5B,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;gBAEnB,IAAI,GAAE,eAA2C,EAAE,SAAS,CAAC,EAAE,MAAM;IAMjF,OAAO,CAAC,WAAW;CAgBnB"}
|
package/dist/utils/AbiBase.js
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
import { ContractAbiType } from "@/enums/ContractAbiType";
|
2
2
|
import { Interface } from "ethers";
|
3
|
-
import ConsensusContract from "
|
4
|
-
import MultipaymentContract from "./Abi/json/Abi.Multipayment.json";
|
5
|
-
import UsernamesContract from "./Abi/json/Abi.Usernames.json";
|
3
|
+
import { ConsensusContract, MultipaymentContract, UsernamesContract } from "@/utils/Abi/json";
|
6
4
|
export class AbiBase {
|
7
5
|
constructor(type = ContractAbiType.CONSENSUS, customAbi) {
|
8
6
|
const abi = this.contractAbi(type, customAbi);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/utils/AbiBase.ts
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
import { ContractAbiType } from "@/enums/ContractAbiType";
|
2
2
|
import { Interface } from "ethers";
|
3
|
-
import ConsensusContract from "
|
4
|
-
import MultipaymentContract from "./Abi/json/Abi.Multipayment.json";
|
5
|
-
import UsernamesContract from "./Abi/json/Abi.Usernames.json";
|
3
|
+
import { ConsensusContract, MultipaymentContract, UsernamesContract } from "@/utils/Abi/json";
|
6
4
|
|
7
5
|
export abstract class AbiBase {
|
8
6
|
protected interface: Interface;
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { Network } from "@/configuration/Network";
|
2
1
|
import { AbstractNetwork } from "@/networks/AbstractNetwork";
|
3
2
|
import { Mainnet } from "@/networks/Mainnet";
|
3
|
+
import { Network } from "@/configuration/Network";
|
4
4
|
import { Testnet } from "@/networks/Testnet";
|
5
5
|
|
6
6
|
class CustomNetwork extends AbstractNetwork {
|
7
7
|
public chainId(): number {
|
8
|
-
return
|
8
|
+
return 11813;
|
9
9
|
}
|
10
10
|
|
11
11
|
public epoch(): string {
|
@@ -20,7 +20,7 @@ class CustomNetwork extends AbstractNetwork {
|
|
20
20
|
it("should get_network", () => {
|
21
21
|
const network = Network.get();
|
22
22
|
|
23
|
-
expect(network.chainId()).toEqual(
|
23
|
+
expect(network.chainId()).toEqual(11812);
|
24
24
|
});
|
25
25
|
|
26
26
|
it("should set_network", () => {
|
@@ -30,7 +30,7 @@ it("should set_network", () => {
|
|
30
30
|
|
31
31
|
expect(network.wif()).toEqual("ba");
|
32
32
|
expect(network.epoch()).toEqual("2017-03-21T13:00:00.000Z");
|
33
|
-
expect(network.chainId()).toEqual(
|
33
|
+
expect(network.chainId()).toEqual(11811);
|
34
34
|
|
35
35
|
Network.set(new Testnet());
|
36
36
|
|
@@ -38,7 +38,7 @@ it("should set_network", () => {
|
|
38
38
|
|
39
39
|
expect(network.wif()).toEqual("ba");
|
40
40
|
expect(network.epoch()).toEqual("2017-03-21T13:00:00.000Z");
|
41
|
-
expect(network.chainId()).toEqual(
|
41
|
+
expect(network.chainId()).toEqual(11812);
|
42
42
|
});
|
43
43
|
|
44
44
|
it("should set_custom_network", () => {
|
@@ -48,5 +48,5 @@ it("should set_custom_network", () => {
|
|
48
48
|
|
49
49
|
expect(network.wif()).toEqual("82");
|
50
50
|
expect(network.epoch()).toEqual("2017-01-01T13:00:00.000Z");
|
51
|
-
expect(network.chainId()).toEqual(
|
51
|
+
expect(network.chainId()).toEqual(11813);
|
52
52
|
});
|
@@ -54,7 +54,7 @@ describe("Slot", () => {
|
|
54
54
|
});
|
55
55
|
|
56
56
|
it("should calculate correct time with Testnet configuration", () => {
|
57
|
-
expect(Network.get().chainId()).toBe(
|
57
|
+
expect(Network.get().chainId()).toBe(11812);
|
58
58
|
|
59
59
|
const actualEpochTime = Slot.epoch();
|
60
60
|
const actualSlotTime = Slot.time();
|