File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
infrastructure/transaction Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ import {Crypto} from '../../core/crypto';
1818import { IdGenerator } from '../../core/format' ;
1919
2020export 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 */
Original file line number Diff line number Diff line change 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' ;
1916import { Convert as convert , RawUInt64 as uint64_t } from '../../core/format' ;
17+ import { NamespaceMosaicIdGenerator } from '../../infrastructure/transaction/NamespaceMosaicIdGenerator' ;
2018import { PublicAccount } from '../account/PublicAccount' ;
2119import { Id } from '../Id' ;
2220import { 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
Original file line number Diff line number Diff line change 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' ;
1716import { Convert as convert } from '../../core/format' ;
17+ import { NamespaceMosaicIdGenerator } from '../../infrastructure/transaction/NamespaceMosaicIdGenerator' ;
1818import { 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
You can’t perform that action at this time.
0 commit comments