pshenmic-dpp 1.0.12 → 1.0.13-rc.1

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.
Files changed (46) hide show
  1. package/package.json +4 -3
  2. package/tests/{BatchTransition.spec.js → BatchTransition.spec.cjs} +1 -1
  3. package/tests/{DataContract.spec.js → DataContract.spec.cjs} +1 -1
  4. package/tests/{DataContractCreateStateTransition.spec.js → DataContractCreateStateTransition.spec.cjs} +1 -1
  5. package/tests/{DataContractUpdateStateTransition.spec.js → DataContractUpdateStateTransition.spec.cjs} +1 -1
  6. package/tests/{Document.spec.js → Document.spec.cjs} +1 -1
  7. package/tests/{DocumentTransition.spec.js → DocumentTransition.spec.cjs} +1 -1
  8. package/tests/{DocumentsTransitions.spec.js → DocumentsTransitions.spec.cjs} +1 -1
  9. package/tests/{TokenBaseTransition.spec.js → TokenBaseTransition.spec.cjs} +1 -1
  10. package/tests/{TokensTransitions.spec.js → TokensTransitions.spec.cjs} +1 -1
  11. package/tests/mocks/DataContract/index.js +6 -6
  12. package/tests/mocks/Document/index.js +13 -11
  13. package/tests/mocks/Identity/index.js +12 -6
  14. package/tests/mocks/Locks/index.js +2 -5
  15. package/tests/mocks/PrivateKey/index.js +5 -5
  16. package/tests/mocks/PublicKey/index.js +12 -13
  17. package/tests/mocks/TokenConfiguration/index.js +4 -6
  18. package/tests/utils/hex.js +11 -12
  19. /package/tests/{AssetLockProof.spec.js → AssetLockProof.spec.cjs} +0 -0
  20. /package/tests/{AuthorizedActionTakers.spec.js → AuthorizedActionTakers.spec.cjs} +0 -0
  21. /package/tests/{ChainLockProof.spec.js → ChainLockProof.spec.cjs} +0 -0
  22. /package/tests/{ChangeControlRules.spec.js → ChangeControlRules.spec.cjs} +0 -0
  23. /package/tests/{CoreScript.spec.js → CoreScript.spec.cjs} +0 -0
  24. /package/tests/{DistributionFunction.spec.js → DistributionFunction.spec.cjs} +0 -0
  25. /package/tests/{Identifier.spec.js → Identifier.spec.cjs} +0 -0
  26. /package/tests/{Identity.spec.js → Identity.spec.cjs} +0 -0
  27. /package/tests/{IdentityCreateTransition.spec.js → IdentityCreateTransition.spec.cjs} +0 -0
  28. /package/tests/{IdentityCreditTransferTransition.spec.js → IdentityCreditTransferTransition.spec.cjs} +0 -0
  29. /package/tests/{IdentityCreditWithdrawalTransition.spec.js → IdentityCreditWithdrawalTransition.spec.cjs} +0 -0
  30. /package/tests/{IdentityPublicKey.spec.js → IdentityPublicKey.spec.cjs} +0 -0
  31. /package/tests/{IdentityTopUpTransition.spec.js → IdentityTopUpTransition.spec.cjs} +0 -0
  32. /package/tests/{IdentityUpdateTransition.spec.js → IdentityUpdateTransition.spec.cjs} +0 -0
  33. /package/tests/{InstantLockProof.spec.js → InstantLockProof.spec.cjs} +0 -0
  34. /package/tests/{OutPoint.spec.js → OutPoint.spec.cjs} +0 -0
  35. /package/tests/{PrivateKey.spec.js → PrivateKey.spec.cjs} +0 -0
  36. /package/tests/{PublicKeyInCreation.spec.js → PublicKeyInCreation.spec.cjs} +0 -0
  37. /package/tests/{RewardDistributionType.spec.js → RewardDistributionType.spec.cjs} +0 -0
  38. /package/tests/{TokenConfiguration.spec.js → TokenConfiguration.spec.cjs} +0 -0
  39. /package/tests/{TokenConfigurationConvention.spec.js → TokenConfigurationConvention.spec.cjs} +0 -0
  40. /package/tests/{TokenConfigurationLocalization.spec.js → TokenConfigurationLocalization.spec.cjs} +0 -0
  41. /package/tests/{TokenDistributionRecipient.spec.js → TokenDistributionRecipient.spec.cjs} +0 -0
  42. /package/tests/{TokenDistributionRules.spec.js → TokenDistributionRules.spec.cjs} +0 -0
  43. /package/tests/{TokenKeepsHistoryRules.spec.js → TokenKeepsHistoryRules.spec.cjs} +0 -0
  44. /package/tests/{TokenPerpetualDistribution.spec.js → TokenPerpetualDistribution.spec.cjs} +0 -0
  45. /package/tests/{TokenPreProgrammedDistribution.spec.js → TokenPreProgrammedDistribution.spec.cjs} +0 -0
  46. /package/tests/{TxOut.spec.js → TxOut.spec.cjs} +0 -0
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "pshenmic-dpp",
3
- "version": "1.0.12",
3
+ "version": "1.0.13-rc.1",
4
4
  "main": "dist/wasm/index.js",
5
5
  "types": "dist/wasm/index.d.ts",
6
+ "type": "module",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "https://github.com/owl352/pshenmic-dpp"
@@ -12,9 +13,9 @@
12
13
  "build:js": "./scripts/build-js.sh",
13
14
  "build:full": "./scripts/build.sh && ./scripts/build-js.sh",
14
15
  "build:raw": "./scripts/build.sh && RAW=true ./scripts/build-js.sh",
15
- "docs": "ts-node ./generate-docs.ts && typedoc",
16
+ "docs": "node --loader ts-node/esm ./generate-docs.ts && typedoc",
16
17
  "babel": "babel dist/wasm --out-dir dist/cjs/wasm",
17
- "tests": "mocha ./tests/*.spec.js",
18
+ "tests": "mocha ./tests/*.spec.cjs",
18
19
  "lint": "cargo fmt",
19
20
  "lint:test": "standard --fix ./tests"
20
21
  },
@@ -1,6 +1,6 @@
1
1
  const assert = require('assert')
2
2
  const { describe, it } = require('mocha')
3
- const { document, documentTypeName, revision, dataContractId, ownerId, id } = require('./mocks/Document')
3
+ const { document, documentTypeName, revision, dataContractId, ownerId, id } = require('./mocks/Document/index.js')
4
4
  const { default: wasm } = require('..')
5
5
 
6
6
  describe('BatchTransition', function () {
@@ -1,6 +1,6 @@
1
1
  const assert = require('assert')
2
2
  const { describe, it, before } = require('mocha')
3
- const { value, id, ownerId } = require('./mocks/DataContract')
3
+ const { value, id, ownerId } = require('./mocks/DataContract/index.js')
4
4
  const { PlatformVersionWASM } = require('..')
5
5
  const { fromHexString } = require('./utils/hex')
6
6
  const { default: wasm } = require('..')
@@ -1,6 +1,6 @@
1
1
  const assert = require('assert')
2
2
  const { describe, it } = require('mocha')
3
- const { value, dataContractsBytes } = require('./mocks/DataContract')
3
+ const { value, dataContractsBytes } = require('./mocks/DataContract/index.js')
4
4
  const { PlatformVersionWASM } = require('..')
5
5
  const { fromHexString } = require('./utils/hex')
6
6
  const { default: wasm } = require('..')
@@ -1,6 +1,6 @@
1
1
  const assert = require('assert')
2
2
  const { describe, it } = require('mocha')
3
- const { value, dataContractsBytes } = require('./mocks/DataContract')
3
+ const { value, dataContractsBytes } = require('./mocks/DataContract/index.js')
4
4
  const { PlatformVersionWASM } = require('..')
5
5
  const { fromHexString } = require('./utils/hex')
6
6
  const { default: wasm } = require('..')
@@ -2,7 +2,7 @@ const assert = require('assert')
2
2
  const { describe, it } = require('mocha')
3
3
  const {
4
4
  document, dataContractId, ownerId, documentTypeName, revision, dataContractValue, id, document2, documentBytes
5
- } = require('./mocks/Document')
5
+ } = require('./mocks/Document/index.js')
6
6
  const { fromHexString } = require('./utils/hex')
7
7
  const { default: wasm } = require('..')
8
8
 
@@ -1,6 +1,6 @@
1
1
  const assert = require('assert')
2
2
  const { describe, it, before } = require('mocha')
3
- const { document, documentTypeName, revision, dataContractId, ownerId, id } = require('./mocks/Document')
3
+ const { document, documentTypeName, revision, dataContractId, ownerId, id } = require('./mocks/Document/index.js')
4
4
  const { default: wasm } = require('..')
5
5
 
6
6
  let documentInstance
@@ -1,6 +1,6 @@
1
1
  const assert = require('assert')
2
2
  const { describe, it } = require('mocha')
3
- const { document, documentTypeName, revision, dataContractId, ownerId, id } = require('./mocks/Document')
3
+ const { document, documentTypeName, revision, dataContractId, ownerId, id } = require('./mocks/Document/index.js')
4
4
  const { default: wasm } = require('..')
5
5
 
6
6
  describe('DocumentsTransitions', function () {
@@ -1,6 +1,6 @@
1
1
  const assert = require('assert')
2
2
  const { describe, it } = require('mocha')
3
- const { dataContractId, ownerId } = require('./mocks/Document')
3
+ const { dataContractId, ownerId } = require('./mocks/Document/index.js')
4
4
  const { default: wasm } = require('..')
5
5
 
6
6
  describe('TokenBaseTransition', function () {
@@ -1,6 +1,6 @@
1
1
  const { describe, it, before } = require('mocha')
2
2
  const assert = require('assert')
3
- const { dataContractId, ownerId } = require('./mocks/Document')
3
+ const { dataContractId, ownerId } = require('./mocks/Document/index.js')
4
4
  const { default: wasm } = require('..')
5
5
 
6
6
  let baseTransition
@@ -1,6 +1,6 @@
1
- module.exports = {
2
- value: require('./DataContract.json'),
3
- id: '4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6',
4
- ownerId: '11111111111111111111111111111111',
5
- dataContractsBytes: ['00ea8920edea52fa400de2ccc43052b2821f45585241a2875d4250e35d4ce937c800000000000101000001ab321b19457b1c16b12762509276d47d952f582d978cbd8b50bbfc2fd8a7767d0001046e6f7465160312047479706512066f626a656374120a70726f70657274696573160112076d65737361676516021204747970651206737472696e671208706f736974696f6e030012146164646974696f6e616c50726f706572746965731300']
6
- }
1
+ import value from "./DataContract.json" with {type: 'json'}
2
+
3
+ export {value}
4
+ export const id = '4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6'
5
+ export const ownerId = '11111111111111111111111111111111'
6
+ export const dataContractsBytes = ['00ea8920edea52fa400de2ccc43052b2821f45585241a2875d4250e35d4ce937c800000000000101000001ab321b19457b1c16b12762509276d47d952f582d978cbd8b50bbfc2fd8a7767d0001046e6f7465160312047479706512066f626a656374120a70726f70657274696573160112076d65737361676516021204747970651206737472696e671208706f736974696f6e030012146164646974696f6e616c50726f706572746965731300']
@@ -1,11 +1,13 @@
1
- module.exports = {
2
- document: require('./document.json'),
3
- document2: require('./document2.json'),
4
- dataContractValue: require('./DataContract.json'),
5
- documentTypeName: 'note',
6
- revision: BigInt(1),
7
- dataContractId: 'GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X',
8
- ownerId: 'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i',
9
- id: '9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
10
- documentBytes: '00840b5cec9f0401b1950610e85dcb26829122ac8853464e1e2c7e38ed22b48903ab321b19457b1c16b12762509276d47d952f582d978cbd8b50bbfc2fd8a7767d01000001305475746f7269616c20434920546573742040205475652c203037204a616e20323032352031353a32373a353020474d5400'
11
- }
1
+ import document from './document.json' with { type: 'json' };
2
+ import document2 from './document2.json' with { type: 'json' };
3
+ import dataContractValue from './DataContract.json' with { type: 'json' };
4
+
5
+
6
+ export { document, document2, dataContractValue };
7
+
8
+ export const documentTypeName = 'note';
9
+ export const revision = BigInt(1);
10
+ export const dataContractId = 'GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X';
11
+ export const ownerId = 'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i';
12
+ export const id = '9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn';
13
+ export const documentBytes = '00840b5cec9f0401b1950610e85dcb26829122ac8853464e1e2c7e38ed22b48903ab321b19457b1c16b12762509276d47d952f582d978cbd8b50bbfc2fd8a7767d01000001305475746f7269616c20434920546573742040205475652c203037204a616e20323032352031353a32373a353020474d5400';
@@ -1,7 +1,13 @@
1
- module.exports = {
2
- identifier: 'H2pb35GtKpjLinncBYeMsXkdDYXCbsFzzVmssce6pSJ1',
3
- identifierBytes: [238, 50, 96, 211, 63, 140, 169, 225, 76, 97, 8, 6, 212, 109, 184, 253, 51, 67, 82, 42, 208, 228, 72, 192, 215, 137, 161, 88, 144, 55, 244, 230],
4
- balance: BigInt(100),
5
- revision: BigInt(99111),
6
- identityBytesWithoutKeys: [0, 238, 50, 96, 211, 63, 140, 169, 225, 76, 97, 8, 6, 212, 109, 184, 253, 51, 67, 82, 42, 208, 228, 72, 192, 215, 137, 161, 88, 144, 55, 244, 230, 0, 0, 0]
1
+ const identifier = 'H2pb35GtKpjLinncBYeMsXkdDYXCbsFzzVmssce6pSJ1'
2
+ const identifierBytes = [238, 50, 96, 211, 63, 140, 169, 225, 76, 97, 8, 6, 212, 109, 184, 253, 51, 67, 82, 42, 208, 228, 72, 192, 215, 137, 161, 88, 144, 55, 244, 230]
3
+ const balance = BigInt(100)
4
+ const revision = BigInt(99111)
5
+ const identityBytesWithoutKeys = [0, 238, 50, 96, 211, 63, 140, 169, 225, 76, 97, 8, 6, 212, 109, 184, 253, 51, 67, 82, 42, 208, 228, 72, 192, 215, 137, 161, 88, 144, 55, 244, 230, 0, 0, 0]
6
+
7
+ export {
8
+ identifier,
9
+ identifierBytes,
10
+ balance,
11
+ revision,
12
+ identityBytesWithoutKeys
7
13
  }
@@ -1,5 +1,2 @@
1
- module.exports = {
2
- instantLockBytes: [1, 1, 89, 68, 206, 254, 139, 111, 183, 115, 169, 122, 19, 26, 29, 175, 97, 14, 156, 207, 215, 16, 92, 152, 110, 29, 167, 34, 91, 149, 243, 48, 250, 217, 0, 0, 0, 0, 61, 111, 50, 237, 225, 255, 25, 159, 133, 89, 244, 234, 150, 19, 61, 198, 218, 144, 144, 44, 45, 189, 109, 187, 247, 117, 93, 95, 156, 46, 12, 216, 1, 49, 33, 55, 67, 236, 100, 131, 20, 54, 98, 71, 159, 60, 21, 2, 116, 197, 18, 154, 171, 227, 15, 30, 21, 0, 0, 0, 0, 0, 0, 0, 169, 241, 49, 98, 108, 73, 162, 241, 131, 183, 162, 245, 99, 173, 29, 197, 10, 200, 34, 1, 144, 219, 237, 184, 5, 32, 155, 96, 142, 184, 100, 224, 29, 98, 241, 139, 201, 250, 166, 10, 139, 138, 39, 245, 160, 199, 200, 185, 20, 250, 58, 20, 54, 10, 47, 37, 85, 142, 224, 224, 166, 147, 177, 143, 172, 203, 181, 158, 195, 155, 155, 60, 174, 67, 14, 11, 118, 235, 8, 7, 82, 206, 16, 61, 247, 101, 55, 161, 165, 131, 104, 10, 89, 20, 82, 157],
3
- transactionBytes: [3, 0, 8, 0, 1, 89, 68, 206, 254, 139, 111, 183, 115, 169, 122, 19, 26, 29, 175, 97, 14, 156, 207, 215, 16, 92, 152, 110, 29, 167, 34, 91, 149, 243, 48, 250, 217, 0, 0, 0, 0, 107, 72, 48, 69, 2, 33, 0, 157, 215, 234, 11, 75, 36, 23, 153, 82, 143, 163, 76, 75, 118, 142, 19, 6, 13, 64, 50, 24, 199, 141, 199, 163, 14, 86, 81, 67, 150, 240, 28, 2, 32, 105, 238, 106, 123, 228, 237, 166, 210, 251, 103, 249, 36, 15, 233, 177, 30, 40, 125, 67, 108, 224, 183, 4, 5, 18, 239, 231, 185, 223, 195, 92, 240, 1, 33, 3, 238, 76, 67, 141, 205, 25, 38, 200, 164, 105, 53, 55, 189, 36, 52, 232, 121, 166, 108, 186, 227, 161, 55, 7, 105, 135, 102, 219, 224, 117, 213, 70, 255, 255, 255, 255, 2, 128, 29, 44, 4, 0, 0, 0, 0, 2, 106, 0, 48, 232, 38, 1, 0, 0, 0, 0, 25, 118, 169, 20, 232, 101, 217, 39, 144, 120, 74, 135, 230, 203, 134, 239, 207, 15, 238, 152, 16, 172, 45, 177, 136, 172, 0, 0, 0, 0, 36, 1, 1, 128, 29, 44, 4, 0, 0, 0, 0, 25, 118, 169, 20, 12, 182, 70, 130, 142, 161, 106, 83, 94, 200, 33, 4, 251, 5, 50, 93, 28, 107, 159, 168, 136, 172]
4
-
5
- }
1
+ export const instantLockBytes = [1, 1, 89, 68, 206, 254, 139, 111, 183, 115, 169, 122, 19, 26, 29, 175, 97, 14, 156, 207, 215, 16, 92, 152, 110, 29, 167, 34, 91, 149, 243, 48, 250, 217, 0, 0, 0, 0, 61, 111, 50, 237, 225, 255, 25, 159, 133, 89, 244, 234, 150, 19, 61, 198, 218, 144, 144, 44, 45, 189, 109, 187, 247, 117, 93, 95, 156, 46, 12, 216, 1, 49, 33, 55, 67, 236, 100, 131, 20, 54, 98, 71, 159, 60, 21, 2, 116, 197, 18, 154, 171, 227, 15, 30, 21, 0, 0, 0, 0, 0, 0, 0, 169, 241, 49, 98, 108, 73, 162, 241, 131, 183, 162, 245, 99, 173, 29, 197, 10, 200, 34, 1, 144, 219, 237, 184, 5, 32, 155, 96, 142, 184, 100, 224, 29, 98, 241, 139, 201, 250, 166, 10, 139, 138, 39, 245, 160, 199, 200, 185, 20, 250, 58, 20, 54, 10, 47, 37, 85, 142, 224, 224, 166, 147, 177, 143, 172, 203, 181, 158, 195, 155, 155, 60, 174, 67, 14, 11, 118, 235, 8, 7, 82, 206, 16, 61, 247, 101, 55, 161, 165, 131, 104, 10, 89, 20, 82, 157]
2
+ export const transactionBytes = [3, 0, 8, 0, 1, 89, 68, 206, 254, 139, 111, 183, 115, 169, 122, 19, 26, 29, 175, 97, 14, 156, 207, 215, 16, 92, 152, 110, 29, 167, 34, 91, 149, 243, 48, 250, 217, 0, 0, 0, 0, 107, 72, 48, 69, 2, 33, 0, 157, 215, 234, 11, 75, 36, 23, 153, 82, 143, 163, 76, 75, 118, 142, 19, 6, 13, 64, 50, 24, 199, 141, 199, 163, 14, 86, 81, 67, 150, 240, 28, 2, 32, 105, 238, 106, 123, 228, 237, 166, 210, 251, 103, 249, 36, 15, 233, 177, 30, 40, 125, 67, 108, 224, 183, 4, 5, 18, 239, 231, 185, 223, 195, 92, 240, 1, 33, 3, 238, 76, 67, 141, 205, 25, 38, 200, 164, 105, 53, 55, 189, 36, 52, 232, 121, 166, 108, 186, 227, 161, 55, 7, 105, 135, 102, 219, 224, 117, 213, 70, 255, 255, 255, 255, 2, 128, 29, 44, 4, 0, 0, 0, 0, 2, 106, 0, 48, 232, 38, 1, 0, 0, 0, 0, 25, 118, 169, 20, 232, 101, 217, 39, 144, 120, 74, 135, 230, 203, 134, 239, 207, 15, 238, 152, 16, 172, 45, 177, 136, 172, 0, 0, 0, 0, 36, 1, 1, 128, 29, 44, 4, 0, 0, 0, 0, 25, 118, 169, 20, 12, 182, 70, 130, 142, 161, 106, 83, 94, 200, 33, 4, 251, 5, 50, 93, 28, 107, 159, 168, 136, 172]
@@ -1,5 +1,5 @@
1
- module.exports = {
2
- wif: 'cR4EZ2nAvCmn2cFepKn7UgSSQFgFTjkySAchvcoiEVdm48eWjQGn',
3
- bytes: '67ad1669d882da256b6fa05e1b0ae384a6ac8aed146ea53602b8ff0e1e9c18e9',
4
- publicKeyHash: '622fd260c35f0d826d05983d1f0524b02dec27a0'
5
- }
1
+ export const wif = 'cR4EZ2nAvCmn2cFepKn7UgSSQFgFTjkySAchvcoiEVdm48eWjQGn'
2
+
3
+ export const bytes = '67ad1669d882da256b6fa05e1b0ae384a6ac8aed146ea53602b8ff0e1e9c18e9'
4
+
5
+ export const publicKeyHash = '622fd260c35f0d826d05983d1f0524b02dec27a0'
@@ -1,14 +1,13 @@
1
- const { Purpose, SecurityLevel, KeyType } = require('../../..')
1
+ import { Purpose, SecurityLevel, KeyType } from '../../../dist/wasm/pshenmic_dpp.js'
2
2
 
3
- module.exports = {
4
- keyId: 2,
5
- purpose: 'AUTHENTICATION',
6
- securityLevel: SecurityLevel.CRITICAL,
7
- keyType: KeyType.ECDSA_SECP256K1,
8
- binaryData: '036a394312e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48',
9
- keyIdSet: 3,
10
- purposeSet: Purpose.ENCRYPTION,
11
- securityLevelSet: SecurityLevel.HIGH,
12
- keyTypeSet: KeyType.ECDSA_HASH160,
13
- binaryDataSet: '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
14
- }
3
+ export const keyId = 2
4
+ export const purpose = 'AUTHENTICATION'
5
+ export const securityLevel = SecurityLevel.CRITICAL
6
+ export const keyType = KeyType.ECDSA_SECP256K1
7
+ export const binaryData = '036a394312e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
8
+
9
+ export const keyIdSet = 3
10
+ export const purposeSet = Purpose.ENCRYPTION
11
+ export const securityLevelSet = SecurityLevel.HIGH
12
+ export const keyTypeSet = KeyType.ECDSA_HASH160
13
+ export const binaryDataSet = '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
@@ -1,7 +1,5 @@
1
- module.exports = {
2
- tokenLocalization: {
3
- shouldCapitalize: true,
4
- singularForm: 'TOKEN',
5
- pluralForm: 'TOKENS'
6
- }
1
+ export const tokenLocalization = {
2
+ shouldCapitalize: true,
3
+ singularForm: 'TOKEN',
4
+ pluralForm: 'TOKENS'
7
5
  }
@@ -1,15 +1,14 @@
1
- module.exports = {
2
- toHexString: (byteArray) => {
3
- return Array.prototype.map.call(byteArray, function (byte) {
4
- return ('0' + (byte & 0xFF).toString(16)).slice(-2)
5
- }).join('')
6
- },
7
- fromHexString: (str) => {
8
- const bytes = []
9
- for (let i = 0; i < str.length; i += 2) {
10
- bytes.push(parseInt(str.slice(i, i + 2), 16))
11
- }
1
+ export const toHexString = (byteArray) => {
2
+ return Array.prototype.map.call(byteArray, function (byte) {
3
+ return ('0' + (byte & 0xFF).toString(16)).slice(-2)
4
+ }).join('')
5
+ }
12
6
 
13
- return Uint8Array.from(bytes)
7
+ export const fromHexString = (str) => {
8
+ const bytes = []
9
+ for (let i = 0; i < str.length; i += 2) {
10
+ bytes.push(parseInt(str.slice(i, i + 2), 16))
14
11
  }
12
+
13
+ return Uint8Array.from(bytes)
15
14
  }
File without changes
File without changes
File without changes