diff --git a/backend/src/apis/dltConnector/model/AccountIdentifier.ts b/backend/src/apis/dltConnector/model/AccountIdentifier.ts index 3882e8584..1d324a70f 100644 --- a/backend/src/apis/dltConnector/model/AccountIdentifier.ts +++ b/backend/src/apis/dltConnector/model/AccountIdentifier.ts @@ -1,15 +1,17 @@ import { CommunityAccountIdentifier } from './CommunityAccountIdentifier' export class AccountIdentifier { communityTopicId: string + communityId: string account?: CommunityAccountIdentifier seed?: string // used for deferred transfers - constructor(communityTopicId: string, input: CommunityAccountIdentifier | string) { + constructor(communityTopicId: string, communityUuid: string, input: CommunityAccountIdentifier | string) { if (input instanceof CommunityAccountIdentifier) { this.account = input } else { this.seed = input } this.communityTopicId = communityTopicId + this.communityId = communityUuid } } diff --git a/backend/src/apis/dltConnector/model/TransactionDraft.ts b/backend/src/apis/dltConnector/model/TransactionDraft.ts index 1727c7fd8..5352bf841 100755 --- a/backend/src/apis/dltConnector/model/TransactionDraft.ts +++ b/backend/src/apis/dltConnector/model/TransactionDraft.ts @@ -36,6 +36,7 @@ export class TransactionDraft { const draft = new TransactionDraft() draft.user = new AccountIdentifier( community.hieroTopicId, + community.communityUuid!, new CommunityAccountIdentifier(user.gradidoID), ) draft.type = TransactionType.REGISTER_ADDRESS @@ -58,10 +59,12 @@ export class TransactionDraft { const draft = new TransactionDraft() draft.user = new AccountIdentifier( community.hieroTopicId, + community.communityUuid!, new CommunityAccountIdentifier(contribution.user.gradidoID), ) draft.linkedUser = new AccountIdentifier( community.hieroTopicId, + community.communityUuid!, new CommunityAccountIdentifier(signingUser.gradidoID), ) draft.type = TransactionType.GRADIDO_CREATION @@ -96,10 +99,12 @@ export class TransactionDraft { const draft = new TransactionDraft() draft.user = new AccountIdentifier( senderUserTopic, + sendingUser.community.communityUuid!, new CommunityAccountIdentifier(sendingUser.gradidoID), ) draft.linkedUser = new AccountIdentifier( receiverUserTopic, + receivingUser.community.communityUuid!, new CommunityAccountIdentifier(receivingUser.gradidoID), ) draft.type = TransactionType.GRADIDO_TRANSFER @@ -125,9 +130,10 @@ export class TransactionDraft { const draft = new TransactionDraft() draft.user = new AccountIdentifier( senderUserTopic, + sendingUser.community.communityUuid!, new CommunityAccountIdentifier(sendingUser.gradidoID), ) - draft.linkedUser = new AccountIdentifier(senderUserTopic, transactionLink.code) + draft.linkedUser = new AccountIdentifier(senderUserTopic, sendingUser.community.communityUuid!, transactionLink.code) draft.type = TransactionType.GRADIDO_DEFERRED_TRANSFER draft.createdAt = createdAtOnlySeconds.toISOString() draft.amount = transactionLink.amount.toString() @@ -159,9 +165,14 @@ export class TransactionDraft { const createdAtOnlySeconds = createdAt createdAtOnlySeconds.setMilliseconds(0) const draft = new TransactionDraft() - draft.user = new AccountIdentifier(senderUserTopic, transactionLink.code) + draft.user = new AccountIdentifier( + senderUserTopic, + transactionLink.user.community.communityUuid!, + transactionLink.code, + ) draft.linkedUser = new AccountIdentifier( recipientUserTopic, + recipientUser.community.communityUuid!, new CommunityAccountIdentifier(recipientUser.gradidoID), ) draft.type = TransactionType.GRADIDO_REDEEM_DEFERRED_TRANSFER