Skip to content

Commit e189f6a

Browse files
committed
Removed lib namespaceMosaic id generator nem2-lib reference
1 parent ec97c84 commit e189f6a

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/infrastructure/transaction/NamespaceMosaicIdGenerator.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ import {Crypto} from '../../core/crypto';
1818
import { IdGenerator } from '../../core/format';
1919

2020
export class NamespaceMosaicIdGenerator {
21+
/**
22+
* @returns mosaic Id
23+
*/
24+
public static mosaicId = (nonce, ownerPublicId) => {
25+
return IdGenerator.generateMosaicId(nonce, ownerPublicId);
26+
}
27+
2128
/**
2229
* @returns random mosaic nonce
2330
*/

src/model/mosaic/MosaicId.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import {
17-
mosaicId as MosaicIdentifierGenerator,
18-
} from 'nem2-library';
1916
import { Convert as convert, RawUInt64 as uint64_t } from '../../core/format';
17+
import {NamespaceMosaicIdGenerator} from '../../infrastructure/transaction/NamespaceMosaicIdGenerator';
2018
import {PublicAccount} from '../account/PublicAccount';
2119
import {Id} from '../Id';
2220
import {MosaicNonce} from '../mosaic/MosaicNonce';
@@ -41,7 +39,7 @@ export class MosaicId {
4139
* @return {MosaicId}
4240
*/
4341
public static createFromNonce(nonce: MosaicNonce, owner: PublicAccount): MosaicId {
44-
const mosaicId = MosaicIdentifierGenerator(nonce.nonce, convert.hexToUint8(owner.publicKey));
42+
const mosaicId = NamespaceMosaicIdGenerator.mosaicId(nonce.nonce, convert.hexToUint8(owner.publicKey));
4543
return new MosaicId(mosaicId);
4644
}
4745

src/model/namespace/NamespaceId.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import {namespaceId as NamespaceIdGenerator} from 'nem2-library';
1716
import {Convert as convert} from '../../core/format';
17+
import {NamespaceMosaicIdGenerator} from '../../infrastructure/transaction/NamespaceMosaicIdGenerator';
1818
import {Id} from '../Id';
1919

2020
/**
@@ -45,7 +45,7 @@ export class NamespaceId {
4545
this.id = new Id(id);
4646
} else if (typeof id === 'string') {
4747
this.fullName = id;
48-
this.id = new Id(NamespaceIdGenerator(id));
48+
this.id = new Id(NamespaceMosaicIdGenerator.namespaceId(id));
4949
}
5050
}
5151

0 commit comments

Comments
 (0)