From 9925a685cdf8be3d64db9d3033393be9104af8c5 Mon Sep 17 00:00:00 2001 From: pshenmic Date: Wed, 25 Dec 2024 00:48:47 +0700 Subject: [PATCH] chore(js-sdk): cleanup --- .../src/SDK/Client/Platform/methods/documents/broadcast.ts | 5 ++--- .../src/SDK/Client/Platform/methods/documents/transfer.ts | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/js-dash-sdk/src/SDK/Client/Platform/methods/documents/broadcast.ts b/packages/js-dash-sdk/src/SDK/Client/Platform/methods/documents/broadcast.ts index fdcd18d51d..e01cf3e217 100644 --- a/packages/js-dash-sdk/src/SDK/Client/Platform/methods/documents/broadcast.ts +++ b/packages/js-dash-sdk/src/SDK/Client/Platform/methods/documents/broadcast.ts @@ -6,12 +6,12 @@ import { signStateTransition } from '../../signStateTransition'; /** * Broadcast document onto the platform * + * @param {Platform} this - bound instance class * @param {Object} documents * @param {ExtendedDocument[]} [documents.create] * @param {ExtendedDocument[]} [documents.replace] * @param {ExtendedDocument[]} [documents.delete] * @param identity - identity - * @param keyIndex - identity key index */ export default async function broadcast( this: Platform, @@ -21,7 +21,6 @@ export default async function broadcast( delete?: ExtendedDocument[], }, identity: any, - keyIndex : number, ): Promise { this.logger.debug('[Document#broadcast] Broadcast documents', { create: documents.create?.length || 0, @@ -54,7 +53,7 @@ export default async function broadcast( this.logger.silly('[Document#broadcast] Created documents batch transition'); - await signStateTransition(this, documentsBatchTransition, identity, keyIndex ?? 1); + await signStateTransition(this, documentsBatchTransition, identity, 1); // Broadcast state transition also wait for the result to be obtained await broadcastStateTransition(this, documentsBatchTransition); diff --git a/packages/js-dash-sdk/src/SDK/Client/Platform/methods/documents/transfer.ts b/packages/js-dash-sdk/src/SDK/Client/Platform/methods/documents/transfer.ts index 43ccb1b39a..31fa427d11 100644 --- a/packages/js-dash-sdk/src/SDK/Client/Platform/methods/documents/transfer.ts +++ b/packages/js-dash-sdk/src/SDK/Client/Platform/methods/documents/transfer.ts @@ -17,14 +17,15 @@ export async function transfer( receiver: Identity, sender: Identity, ): Promise { - this.logger.debug('[Document#transfer] Transfer document'); + this.logger.debug(`[Document#transfer] Transfer document ${document.getId().toString()} + from ${sender.getId().toString} to {${receiver.getId().toString()}`); await this.initialize(); const identityContractNonce = await this.nonceManager .bumpIdentityContractNonce(sender.getId(), document.getDataContractId()); const documentsBatchTransition = document - .createTransferTransition(receiver.getId(), BigInt(identityContractNonce)); + .createTransferStateTransition(receiver.getId(), BigInt(identityContractNonce)); await signStateTransition(this, documentsBatchTransition, sender, 1);