Skip to content

Commit 8e10736

Browse files
authored
feat(core-ledger-client): expose MEMO_KEY from TokenStandardService (#994)
dApps should be able to use this in order to read and write transfer messages. I chose to attach it to the TokenStandardService since it is specified in there, an alternative would be to rename it to TOKEN_STANDARD_MEMO_KEY and export it. Signed-off-by: Jasper Van der Jeugt <[email protected]>
1 parent e08fe70 commit 8e10736

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/ledger-client/src/token-standard-service.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import type { PrettyTransactions, Transaction } from './txparse/types.js'
4141
import { Types } from './ledger-client.js'
4242
import { AccessTokenProvider } from '@canton-network/core-wallet-auth'
4343

44-
const MEMO_KEY = 'splice.lfdecentralizedtrust.org/reason'
4544
const REQUESTED_AT_SKEW_MS = 60_000
4645

4746
export type ExerciseCommand = Types['ExerciseCommand']
@@ -755,7 +754,12 @@ class TransferService {
755754
).toISOString(),
756755
inputHoldingCids:
757756
inputHoldingCids as unknown as ContractId<Holding>[],
758-
meta: { values: { [MEMO_KEY]: memo || '', ...meta?.values } },
757+
meta: {
758+
values: {
759+
[TokenStandardService.MEMO_KEY]: memo || '',
760+
...meta?.values,
761+
},
762+
},
759763
},
760764
extraArgs: {
761765
context: { values: {} },
@@ -1198,6 +1202,8 @@ class TransferService {
11981202
}
11991203

12001204
export class TokenStandardService {
1205+
static readonly MEMO_KEY = 'splice.lfdecentralizedtrust.org/reason'
1206+
12011207
readonly core: CoreService
12021208
readonly allocation: AllocationService
12031209
readonly transfer: TransferService

0 commit comments

Comments
 (0)