Skip to content

Commit 7daf09f

Browse files
committed
v1.0.3: Transaction Taxonomies & Semantics for Symbol from NEM
1 parent f68334e commit 7daf09f

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ Donations can also be made with cryptocurrencies and will be used for running th
5757

5858
## License
5959

60-
Copyright 2020-2021 Using Blockchain Ltd, Reg No.: 12658136, United Kingdom, All rights reserved.
60+
Copyright 2020-2021 [Using Blockchain Ltd][ref-ltd], Reg No.: 12658136, United Kingdom, All rights reserved.
6161

6262
Licensed under the [AGPL v3 License](LICENSE).
6363

6464
[ref-docs]: https://symbol-taxonomy.symbol.ninja/
65-
65+
[ref-ltd]: https://using-blockchain.org
6666
[npm-url]: https://www.npmjs.com/package/@ubcdigital/symbol-taxonomy
6767
[npm-badge]: https://img.shields.io/npm/v/@ubcdigital/symbol-taxonomy
6868
[size-badge]: https://img.shields.io/bundlephobia/min/@ubcdigital/symbol-taxonomy

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ubcdigital/symbol-taxonomy",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"license": "AGPL-3.0",
55
"description": "Open source library for defining transaction taxonomies and in-aggregate semantics for Symbol from NEM",
66
"keywords": [

src/SemanticsMap.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ import { TaxonomyMapEntry } from './TaxonomyMap'
1515
* @class SemanticsMap
1616
* @since v1.0.0
1717
* @description Class that describes indexed semantic rulesets.
18+
*
19+
* @example How to create a semantics map
20+
*
21+
* ```javascript
22+
* import * as Lib from '@ubcdigital/symbol-taxonomy'
23+
*
24+
* const semantics = new Lib.SemanticsMap([
25+
* [0, Lib.RequiredEntry([], 1, 5)],
26+
* ])
27+
* ```
1828
*/
1929
export class SemanticsMap extends Map<number, SemanticRuleset> {
2030
/**
@@ -51,12 +61,6 @@ export class SemanticsMap extends Map<number, SemanticRuleset> {
5161
return -1
5262
}
5363

54-
// - Gets the next transaction following bundle(s)
55-
const bundlesUntilIdx = numOccurences * entries.length
56-
const nextTransaction = bundlesUntilIdx > 0 && bundlesUntilIdx < transactions.length
57-
? transactions.slice(bundlesUntilIdx, bundlesUntilIdx+1).shift()
58-
: null
59-
6064
// - Repeatable entries must be kept within boundaries
6165
if (! this.validateBoundaries(ruleset, numOccurences)) {
6266
return -2

src/Taxonomy.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,22 @@ import { SemanticRuleset } from './Semantics/SemanticRuleset'
2222
* @example How to create a transaction taxonomy
2323
*
2424
* ```javascript
25-
* import { Taxonomy, TaxonomyMap } from '@ubcdigital/symbol-taxonomy'
25+
* import * as Lib from '@ubcdigital/symbol-taxonomy'
2626
* import {
2727
* AggregateTransaction,
2828
* TransactionType as TType,
2929
* } from 'symbol-sdk'
3030
*
31-
* cont taxonomy = new Taxonomy(
31+
* const taxonomy = new Lib.Taxonomy(
3232
* 'UBCDigital.NamedAssetCreation',
33-
* new TaxonomyMap([
34-
* [0, { type: TType.NAMESPACE_REGISTRATION, required: true }],
35-
* [1, { type: TType.MOSAIC_DEFINITION, required: true }],
36-
* [2, { type: TType.MOSAIC_SUPPLY_CHANGE, required: false }],
37-
* [3, { type: TType.TRANSFER, required: true }],
33+
* new Lib.TaxonomyMap([
34+
* [0, { type: TType.NAMESPACE_REGISTRATION, required: true }],
35+
* [1, { type: TType.MOSAIC_DEFINITION, required: true }],
36+
* [2, { type: TType.MOSAIC_SUPPLY_CHANGE, required: false }],
37+
* [3, { type: TType.TRANSFER, required: false }],
38+
* ]),
39+
* new Lib.SemanticsMap([
40+
* [3, new Lib.OptionalEntry([], 0)]
3841
* ])
3942
* )
4043
*

0 commit comments

Comments
 (0)