diff --git a/core/ledger-client-types/src/index.ts b/core/ledger-client-types/src/index.ts index d01f62e67..124afa775 100644 --- a/core/ledger-client-types/src/index.ts +++ b/core/ledger-client-types/src/index.ts @@ -78,3 +78,15 @@ export const LedgerPostRoutes = new Set([ ...postPaths_v3_4, ...postPaths_v3_5, ]) + +export type RawCommandMap = { + ExerciseCommand: LedgerCommonSchemas['ExerciseCommand'] + CreateCommand: LedgerCommonSchemas['CreateCommand'] + CreateAndExerciseCommand: LedgerCommonSchemas['CreateAndExerciseCommand'] +} + +export type WrappedCommand< + K extends keyof RawCommandMap = keyof RawCommandMap, +> = { + [P in K]: { [Q in P]: RawCommandMap[P] } +}[K] diff --git a/core/test-token/.gitignore b/core/test-token/.gitignore new file mode 100644 index 000000000..7063e39a6 --- /dev/null +++ b/core/test-token/.gitignore @@ -0,0 +1,3 @@ +.daml +daml +.rollup.cache diff --git a/core/test-token/README.md b/core/test-token/README.md new file mode 100644 index 000000000..e09c1ff91 --- /dev/null +++ b/core/test-token/README.md @@ -0,0 +1,106 @@ +# @canton-network/core-test-token + +TypeScript wrapper package for the Test Token DAML codegen. + +## Exports + +From [src/index.ts](src/index.ts): + +- `TestTokenV1`: shortcut to `Splice.Testing.Tokens.TestTokenV1` +- `packageId`: re-export from `@daml.js/test-token-v1` +- `commands`: command builders for Test Token templates and choices + +## Build + +From the repo root: + +```sh +yarn workspace @canton-network/core-test-token build +``` + +The build produces: + +- ESM: `dist/index.js` +- CJS: `dist/index.cjs` +- Browser ESM: `dist/index.browser.js` +- Types: `dist/index.d.ts` + +## Regenerating DAML Codegen Inputs + +This package depends on generated DAML JS artifacts under +`damljs/test-token-v1`. + +To refresh those artifacts, run: + +```sh +yarn script:generate:test-token +``` + +Then rebuild this package. + +## Usage + +```ts +import { + TestTokenV1, + packageId, + commands, +} from '@canton-network/core-test-token' + +const template = TestTokenV1 +console.log(packageId) + +// Build a create command for TokenRules +const createRules = commands.create.rules({ admin: 'Alice::1220...' }) + +// Build an exercise command for TokenTransferOffer.Accept +const acceptTransfer = commands.exercise.transferOffer.accept({ + contractId: '00a1b2c3d4...', + choiceArgument: {}, +}) +``` + +## Command Helpers + +The `commands` export provides typed helpers that return +`WrappedCommand<'CreateCommand'>` and `WrappedCommand<'ExerciseCommand'>`. + +Available builders: + +- `commands.create.transferOffer` +- `commands.create.allocation` +- `commands.create.rules` +- `commands.exercise.transferOffer.accept` +- `commands.exercise.transferOffer.reject` +- `commands.exercise.transferOffer.withdraw` +- `commands.exercise.transferOffer.update` +- `commands.exercise.allocation.executeTransfer` +- `commands.exercise.allocation.cancel` +- `commands.exercise.allocation.withdraw` +- `commands.exercise.rules.transfer.transfer` +- `commands.exercise.rules.transfer.publicFetch` +- `commands.exercise.rules.allocation.allocate` +- `commands.exercise.rules.allocation.publicFetch` + +Example: + +```ts +import { commands } from '@canton-network/core-test-token' + +const createAllocation = commands.create.allocation({ + allocation: { + // Fill with your AllocationSpecification payload + }, +}) + +const executeTransfer = commands.exercise.allocation.executeTransfer({ + contractId: '00f00d...', + choiceArgument: { + // Fill with Allocation_ExecuteTransfer choice argument + }, +}) +``` + +## License + +Apache-2.0 diff --git a/core/test-token/package.json b/core/test-token/package.json new file mode 100644 index 000000000..d0b9908df --- /dev/null +++ b/core/test-token/package.json @@ -0,0 +1,66 @@ +{ + "name": "@canton-network/core-test-token", + "version": "1.0.0", + "type": "module", + "description": "daml codegen js for test-token package", + "author": "Mateusz PiÄ…tkowski ", + "license": "Apache-2.0", + "main": "dist/index.cjs", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "browser": "./dist/index.browser.js", + "import": "./dist/index.js", + "require": "./dist/index.cjs", + "default": "./dist/index.js" + } + }, + "scripts": { + "build": "yarn generate:test-token && yarn clean && rollup -c && yarn clean:types-tmp", + "dev": "rollup -c -w", + "clean:types-tmp": "rm -rf dist/types", + "flatpack": "yarn pack --out \"$FLATPACK_OUTDIR\"", + "clean": "rm -rf dist" + }, + "dependencies": { + "@canton-network/core-ledger-client-types": "workspace:^", + "@canton-network/core-token-standard": "workspace:^", + "@canton-network/core-types": "workspace:^", + "@canton-network/core-wallet-auth": "workspace:^", + "@daml/types": "^3.5.1", + "@mojotech/json-type-validation": "^3.1.0", + "lodash": "^4.18.1", + "openapi-fetch": "^0.17.0", + "uuid": "^14.0.0", + "zod": "^4.4.3" + }, + "devDependencies": { + "@rollup/plugin-alias": "^5.1.1", + "@rollup/plugin-commonjs": "^29.0.3", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^16.0.3", + "@rollup/plugin-typescript": "^12.3.0", + "playwright": "^1.60.0", + "rollup": "^4.62.0", + "rollup-plugin-dts": "^6.4.1", + "tslib": "^2.8.1", + "typescript": "^5.9.3" + }, + "files": [ + "dist/**" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/canton-network/wallet.git", + "directory": "core/test-token" + }, + "homepage": "https://github.com/canton-network/wallet/tree/main/core/test-token#readme", + "bugs": { + "url": "https://github.com/canton-network/wallet/issues" + } +} diff --git a/core/test-token/rollup.config.js b/core/test-token/rollup.config.js new file mode 100644 index 000000000..d25542a9c --- /dev/null +++ b/core/test-token/rollup.config.js @@ -0,0 +1,178 @@ +// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +import typescript from '@rollup/plugin-typescript' +import commonjs from '@rollup/plugin-commonjs' +import { nodeResolve } from '@rollup/plugin-node-resolve' +import json from '@rollup/plugin-json' +import alias from '@rollup/plugin-alias' + +import fs from 'node:fs' +import path from 'node:path' +import dts from 'rollup-plugin-dts' + +const TEST_TOKEN_BASE = path.resolve( + import.meta.dirname, + '../../damljs/test-token-v1' +) + +function buildDamlJsPackagesMap(baseDir) { + const packages = {} + const entries = fs.readdirSync(baseDir, { withFileTypes: true }) + + for (const entry of entries) { + if (!entry.isDirectory()) { + continue + } + + const pkgDir = path.join(baseDir, entry.name) + const pkgJsonPath = path.join(pkgDir, 'package.json') + + if (!fs.existsSync(pkgJsonPath)) { + continue + } + + const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8')) + if (typeof pkgJson.name !== 'string') { + continue + } + + if (!pkgJson.name.startsWith('@daml.js/')) { + continue + } + + packages[pkgJson.name] = pkgDir + } + + return packages +} + +const DAML_JS_PACKAGES = buildDamlJsPackagesMap(TEST_TOKEN_BASE) +const TEST_TOKEN_COMPAT_ALIAS = '@daml.js/test-token-v1' +const TEST_TOKEN_CANONICAL_NAME = '@daml.js/splice-test-token-v1-1.0.0' + +if (DAML_JS_PACKAGES[TEST_TOKEN_CANONICAL_NAME]) { + DAML_JS_PACKAGES[TEST_TOKEN_COMPAT_ALIAS] = + DAML_JS_PACKAGES[TEST_TOKEN_CANONICAL_NAME] +} + +function buildPathsMap(packageDirs) { + const map = {} + for (const [name, pkgDir] of Object.entries(packageDirs)) { + const pkgJson = JSON.parse( + fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf8') + ) + const typesRel = pkgJson.types || pkgJson.typings || 'lib/index.d.ts' + const typesAbs = path.resolve(pkgDir, typesRel) + const libDir = path.resolve(pkgDir, 'lib') + map[name] = [typesAbs] + map[`${name}/*`] = [path.join(libDir, '*')] + + // Force deep "module.js" -> ".d.ts" resolution so dts can inline + map[`${name}/lib/*/module.js`] = [path.join(libDir, '*/module.d.ts')] + map[`${name}/lib/*/index.js`] = [path.join(libDir, '*/index.d.ts')] + } + return map +} + +function buildAliasEntries(packageDirs) { + const entries = [] + for (const [name, pkgDir] of Object.entries(packageDirs)) { + const pkgJson = JSON.parse( + fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf8') + ) + const mainAbs = path.resolve(pkgDir, pkgJson.main || 'lib/index.js') + const escapedName = name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + // Sub-path must come before main to avoid premature matching + entries.push({ + find: new RegExp(`^${escapedName}/(.+)$`), + replacement: `${pkgDir}/$1`, + }) + entries.push({ find: name, replacement: mainAbs }) + } + return entries +} + +const pathsMap = buildPathsMap(DAML_JS_PACKAGES) +const damlJsAlias = alias({ entries: buildAliasEntries(DAML_JS_PACKAGES) }) +const commonjsPlugin = commonjs({ + transformMixedEsModules: true, + esmExternals: true, + requireReturnsDefault: false, +}) + +const pkgPath = path.resolve(process.cwd(), 'package.json') +const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')) + +// Collect deps + peerDeps (but not devDeps, or excepted ones) +const exceptions = [ + '@daml/types', + '@daml/ledger', + '@mojotech/json-type-validation', +] +const external = [ + ...Object.keys(pkg.dependencies || {}), + ...Object.keys(pkg.peerDependencies || {}), +].filter((dep) => !exceptions.includes(dep)) + +// bundle ESM +const codeEsm = { + input: 'src/index.ts', + output: { file: 'dist/index.js', format: 'es', sourcemap: true }, + external, + plugins: [damlJsAlias, json(), commonjsPlugin, nodeResolve(), typescript()], +} + +// bundle CJS +const codeCjs = { + input: 'src/index.ts', + output: { + file: 'dist/index.cjs', + format: 'cjs', + interop: 'auto', + sourcemap: true, + exports: 'named', + }, + external, + plugins: [damlJsAlias, json(), commonjsPlugin, nodeResolve(), typescript()], +} + +// bundle for browser +const codeBrowser = { + input: 'src/index.ts', + output: { + file: 'dist/index.browser.js', + format: 'es', + sourcemap: true, + }, + external, + plugins: [ + damlJsAlias, + json(), + commonjsPlugin, + nodeResolve({ + browser: true, // Prefer browser entrypoints + preferBuiltins: false, // Do NOT use Node builtins + }), + typescript(), + ], +} + +// bundle DTS including types from codegen +const types = { + input: 'src/index.ts', + output: { file: 'dist/index.d.ts', format: 'es' }, + plugins: [ + dts({ + respectExternal: false, + compilerOptions: { + baseUrl: '.', + paths: pathsMap, + declaration: true, + emitDeclarationOnly: true, + }, + }), + ], +} + +export default [codeEsm, codeCjs, codeBrowser, types] diff --git a/core/test-token/src/commands.ts b/core/test-token/src/commands.ts new file mode 100644 index 000000000..01315e7c1 --- /dev/null +++ b/core/test-token/src/commands.ts @@ -0,0 +1,113 @@ +// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { TestTokenV1 } from 'src' +import { + Allocation, + AllocationFactory, + Transfer, + TransferFactory, + TransferInstruction, + AllocationSpecification, +} from '@canton-network/core-token-standard' +import { PartyId } from '@canton-network/core-types' +import { WrappedCommand } from '@canton-network/core-ledger-client-types' + +const generateCommand = { + create(templateId: string) { + return ( + createArguments: CreateArgs + ): WrappedCommand<'CreateCommand'> => ({ + CreateCommand: { + templateId, + createArguments, + }, + }) + }, + exercise(templateId: string, choice: string) { + return ( + args: Pick< + WrappedCommand<'ExerciseCommand'>['ExerciseCommand'], + 'contractId' | 'choiceArgument' + > + ): WrappedCommand<'ExerciseCommand'> => ({ + ExerciseCommand: { + templateId, + contractId: args.contractId, + choice, + choiceArgument: args.choiceArgument, + }, + }) + }, +} + +export const command = { + create: { + transferOffer: generateCommand.create<{ transfer: Transfer }>( + TestTokenV1.TokenTransferOffer.templateId + ), + allocation: generateCommand.create<{ + allocation: AllocationSpecification + }>(TestTokenV1.TokenAllocation.templateId), + rules: generateCommand.create<{ admin: PartyId }>( + TestTokenV1.TokenRules.templateId + ), + }, + + exercise: { + transferOffer: { + accept: generateCommand.exercise( + TestTokenV1.TokenTransferOffer.templateId, + TransferInstruction.TransferInstruction_Accept.choiceName + ), + reject: generateCommand.exercise( + TestTokenV1.TokenTransferOffer.templateId, + TransferInstruction.TransferInstruction_Reject.choiceName + ), + withdraw: generateCommand.exercise( + TestTokenV1.TokenTransferOffer.templateId, + TransferInstruction.TransferInstruction_Withdraw.choiceName + ), + update: generateCommand.exercise( + TestTokenV1.TokenTransferOffer.templateId, + TransferInstruction.TransferInstruction_Update.choiceName + ), + }, + allocation: { + executeTransfer: generateCommand.exercise( + TestTokenV1.TokenAllocation.templateId, + Allocation.Allocation_ExecuteTransfer.choiceName + ), + cancel: generateCommand.exercise( + TestTokenV1.TokenAllocation.templateId, + Allocation.Allocation_Cancel.choiceName + ), + withdraw: generateCommand.exercise( + TestTokenV1.TokenAllocation.templateId, + Allocation.Allocation_Withdraw.choiceName + ), + }, + rules: { + transfer: { + transfer: generateCommand.exercise( + TestTokenV1.TokenRules.templateId, + TransferFactory.TransferFactory_Transfer.choiceName + ), + publicFetch: generateCommand.exercise( + TestTokenV1.TokenRules.templateId, + TransferFactory.TransferFactory_PublicFetch.choiceName + ), + }, + allocation: { + allocate: generateCommand.exercise( + TestTokenV1.TokenRules.templateId, + AllocationFactory.AllocationFactory_Allocate.choiceName + ), + publicFetch: generateCommand.exercise( + TestTokenV1.TokenRules.templateId, + AllocationFactory.AllocationFactory_PublicFetch.choiceName + ), + }, + }, + }, +} diff --git a/core/test-token/src/index.ts b/core/test-token/src/index.ts new file mode 100644 index 000000000..e16499509 --- /dev/null +++ b/core/test-token/src/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { Splice } from '@daml.js/test-token-v1' + +export { packageId } from '@daml.js/test-token-v1' +export const TestTokenV1 = Splice.Testing.Tokens.TestTokenV1 +export * from './commands' diff --git a/core/test-token/tsconfig.json b/core/test-token/tsconfig.json new file mode 100644 index 000000000..56fef3d57 --- /dev/null +++ b/core/test-token/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./dist", + "moduleResolution": "bundler", + "baseUrl": ".", + "paths": { + "@daml.js/test-token-v1": [ + "../../damljs/test-token-v1/splice-test-token-v1-1.0.0/lib/index.d.ts" + ] + } + }, + "include": ["src"] +} diff --git a/core/token-standard-service/src/token-standard-service.test.ts b/core/token-standard-service/src/token-standard-service.test.ts index 62353c51e..b7530909f 100644 --- a/core/token-standard-service/src/token-standard-service.test.ts +++ b/core/token-standard-service/src/token-standard-service.test.ts @@ -876,6 +876,39 @@ describe('Token standard service', () => { ]) }) + it('toPretty transactions', async () => { + const { service } = makeService() + const result = await service.core.toPrettyTransactions([], senderParty) + expect(result.transactions).toHaveLength(0) + expect(result.nextOffset).toBe(0) + + const updates = [ + { update: { OffsetCheckpoint: { value: { offset: 50 } } } }, + { update: { OffsetCheckpoint: { value: { offset: 80 } } } }, + ] + + const updatesResult = await service.core.toPrettyTransactions( + updates as any, + senderParty + ) + expect(updatesResult.nextOffset).toBeGreaterThanOrEqual(80) + }) + + it('toQualfiedMemberId()', async () => { + const { service } = makeService() + expect(service.core.toQualifiedMemberId('abc123')).toBe('PAR::abc123') + expect(service.core.toQualifiedMemberId('PAR::abc123')).toBe( + 'PAR::abc123' + ) + expect(service.core.toQualifiedMemberId('MED::abc123')).toBe( + 'MED::abc123' + ) + + expect(() => service.core.toQualifiedMemberId('')).toThrow( + 'memberId is required' + ) + }) + it('converts all instrument pages to assets', async () => { const { service, tokenClient } = makeService() @@ -931,38 +964,6 @@ describe('Token standard service', () => { ]) }) - it('toPretty transactions', async () => { - const { service } = makeService() - const result = await service.core.toPrettyTransactions([], senderParty) - expect(result.transactions).toHaveLength(0) - expect(result.nextOffset).toBe(0) - - const updates = [ - { update: { OffsetCheckpoint: { value: { offset: 50 } } } }, - { update: { OffsetCheckpoint: { value: { offset: 80 } } } }, - ] - - const updatesResult = await service.core.toPrettyTransactions( - updates as any, - senderParty - ) - expect(updatesResult.nextOffset).toBeGreaterThanOrEqual(80) - }) - - it('toQualfiedMemberId()', async () => { - const { service } = makeService() - expect(service.core.toQualifiedMemberId('abc123')).toBe('PAR::abc123') - expect(service.core.toQualifiedMemberId('PAR::abc123')).toBe( - 'PAR::abc123' - ) - expect(service.core.toQualifiedMemberId('MED::abc123')).toBe( - 'MED::abc123' - ) - - expect(() => service.core.toQualifiedMemberId('')).toThrow( - 'memberId is required' - ) - }) it('holding locked returns correctly', async () => { const future = new Date(Date.now() + 100_000).toISOString() const past = new Date(Date.now() - 100_000).toISOString() diff --git a/core/token-standard-service/src/token-standard-service.ts b/core/token-standard-service/src/token-standard-service.ts index 1f3ffd46a..69b235d14 100644 --- a/core/token-standard-service/src/token-standard-service.ts +++ b/core/token-standard-service/src/token-standard-service.ts @@ -1422,7 +1422,6 @@ export class TokenStandardService { ) instruments.push(...instrumentsResponse.instruments) } - const instrumentAdmin = await this.getInstrumentAdmin(registryUrl) return instruments.map((instrument) => ({ id: instrument.id, diff --git a/core/token-standard/src/types.ts b/core/token-standard/src/types.ts index 2d26221c6..6d9a7dbf2 100644 --- a/core/token-standard/src/types.ts +++ b/core/token-standard/src/types.ts @@ -23,13 +23,11 @@ export type { export type { Transfer, - TransferInstruction, TransferInstructionView, TransferInstruction_Accept, TransferInstruction_Reject, TransferInstruction_Withdraw, TransferInstruction_Update, - TransferFactory, TransferFactoryView, TransferFactory_PublicFetch, TransferFactory_Transfer, @@ -40,6 +38,12 @@ export type { TransferInstructionInterface, } from '@daml.js/token-standard-models-1.0.0/lib/Splice/Api/Token/TransferInstructionV1/module.js' +// Export companion objects as values (needed for accessing choice names at runtime) +export { + TransferInstruction, + TransferFactory, +} from '@daml.js/token-standard-models-1.0.0/lib/Splice/Api/Token/TransferInstructionV1/module.js' + export type { AllocationFactory_Allocate, AllocationFactoryView, @@ -49,12 +53,16 @@ export type { AllocationInstructionView, AllocationInstructionResult, AllocationInstructionResult_Output, - AllocationFactory, AllocationFactoryInterface, - AllocationInstruction, AllocationInstructionInterface, } from '@daml.js/token-standard-models-1.0.0/lib/Splice/Api/Token/AllocationInstructionV1/module.js' +// Export companion objects as values (needed for accessing choice names at runtime) +export { + AllocationFactory, + AllocationInstruction, +} from '@daml.js/token-standard-models-1.0.0/lib/Splice/Api/Token/AllocationInstructionV1/module.js' + export type { AllocationRequest, AllocationRequestView, @@ -69,7 +77,6 @@ export type { SettlementInfo, Reference, AllocationView, - Allocation, AllocationInterface, Allocation_Withdraw, Allocation_Cancel, @@ -79,6 +86,9 @@ export type { Allocation_ExecuteTransferResult, } from '@daml.js/token-standard-models-1.0.0/lib/Splice/Api/Token/AllocationV1/module.js' +// Export companion object as value (needed for accessing choice names at runtime) +export { Allocation } from '@daml.js/token-standard-models-1.0.0/lib/Splice/Api/Token/AllocationV1/module.js' + export type { ExtraArgs, Metadata, diff --git a/sdk/wallet-sdk/src/wallet/namespace/ledger/types.ts b/sdk/wallet-sdk/src/wallet/namespace/ledger/types.ts index f1e5eb3ff..79d25fc99 100644 --- a/sdk/wallet-sdk/src/wallet/namespace/ledger/types.ts +++ b/sdk/wallet-sdk/src/wallet/namespace/ledger/types.ts @@ -2,7 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import { PartyId } from '@canton-network/core-types' -import type { LedgerCommonSchemas } from '@canton-network/core-ledger-client-types' +import type { + LedgerCommonSchemas, + WrappedCommand, +} from '@canton-network/core-ledger-client-types' import { AcsOptions } from '@canton-network/core-acs-reader' export type PrepareOptions = { @@ -18,17 +21,6 @@ export type ExecuteOptions = { partyId: PartyId } -export type RawCommandMap = { - ExerciseCommand: LedgerCommonSchemas['ExerciseCommand'] - CreateCommand: LedgerCommonSchemas['CreateCommand'] - CreateAndExerciseCommand: LedgerCommonSchemas['CreateAndExerciseCommand'] -} -export type WrappedCommand< - K extends keyof RawCommandMap = keyof RawCommandMap, -> = { - [P in K]: { [Q in P]: RawCommandMap[P] } -}[K] - export type AcsRequestOptions = Omit & { offset?: number } diff --git a/sdk/wallet-sdk/src/wallet/namespace/token/utxos/mergeDelegation.ts b/sdk/wallet-sdk/src/wallet/namespace/token/utxos/mergeDelegation.ts index d5c636758..c926fcf3e 100644 --- a/sdk/wallet-sdk/src/wallet/namespace/token/utxos/mergeDelegation.ts +++ b/sdk/wallet-sdk/src/wallet/namespace/token/utxos/mergeDelegation.ts @@ -8,11 +8,11 @@ import { ExerciseCommand, } from '@canton-network/core-token-standard-service' import { Holding, PrettyContract } from '@canton-network/core-tx-parser' -import { WrappedCommand } from '../../ledger/types.js' import { PartyId } from '@canton-network/core-types' import { LedgerNamespace } from '../../ledger/index.js' import { UtxoNamespace } from './index.js' import { resolveProviderParty } from '../utils.js' +import { WrappedCommand } from '@canton-network/core-ledger-client-types' export class MergeDelegationNamespace { private readonly ledger: LedgerNamespace diff --git a/sdk/wallet-sdk/src/wallet/namespace/token/utxos/service.ts b/sdk/wallet-sdk/src/wallet/namespace/token/utxos/service.ts index e99b48a0a..5ca897411 100644 --- a/sdk/wallet-sdk/src/wallet/namespace/token/utxos/service.ts +++ b/sdk/wallet-sdk/src/wallet/namespace/token/utxos/service.ts @@ -5,12 +5,12 @@ import { MergeUtxosParams, ListHoldingsParams } from './types.js' import { HOLDING_INTERFACE_ID } from '@canton-network/core-token-standard' import { TokenStandardService } from '@canton-network/core-token-standard-service' import { Holding, PrettyContract } from '@canton-network/core-tx-parser' -import { WrappedCommand } from '../../ledger/types.js' import { findAsset, LedgerTypes, TokenNamespaceConfig } from '../../../sdk.js' import { Decimal } from 'decimal.js' import { TransferNamespace } from '../transfer/index.js' import { MergeDelegationNamespace } from './mergeDelegation.js' import { parseAssets } from '../../utils/url.js' +import { WrappedCommand } from '@canton-network/core-ledger-client-types' export class UtxoNamespace { public readonly delegatedMerge: MergeDelegationNamespace diff --git a/sdk/wallet-sdk/src/wallet/namespace/transactions/types.ts b/sdk/wallet-sdk/src/wallet/namespace/transactions/types.ts index 520baa256..a8e5b9e9f 100644 --- a/sdk/wallet-sdk/src/wallet/namespace/transactions/types.ts +++ b/sdk/wallet-sdk/src/wallet/namespace/transactions/types.ts @@ -1,8 +1,11 @@ // Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -import type { LedgerCommonSchemas } from '@canton-network/core-ledger-client-types' -import { RawCommandMap, WrappedCommand } from '../ledger/index.js' +import type { + LedgerCommonSchemas, + RawCommandMap, + WrappedCommand, +} from '@canton-network/core-ledger-client-types' export type PreparedCommand< K extends keyof RawCommandMap | (keyof RawCommandMap)[] = [ diff --git a/yarn.lock b/yarn.lock index fc3902cab..432da4e4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1741,6 +1741,33 @@ __metadata: languageName: unknown linkType: soft +"@canton-network/core-test-token@workspace:core/test-token": + version: 0.0.0-use.local + resolution: "@canton-network/core-test-token@workspace:core/test-token" + dependencies: + "@canton-network/core-ledger-client-types": "workspace:^" + "@canton-network/core-token-standard": "workspace:^" + "@canton-network/core-types": "workspace:^" + "@canton-network/core-wallet-auth": "workspace:^" + "@daml/types": "npm:^3.5.1" + "@mojotech/json-type-validation": "npm:^3.1.0" + "@rollup/plugin-alias": "npm:^5.1.1" + "@rollup/plugin-commonjs": "npm:^29.0.3" + "@rollup/plugin-json": "npm:^6.1.0" + "@rollup/plugin-node-resolve": "npm:^16.0.3" + "@rollup/plugin-typescript": "npm:^12.3.0" + lodash: "npm:^4.18.1" + openapi-fetch: "npm:^0.17.0" + playwright: "npm:^1.60.0" + rollup: "npm:^4.62.0" + rollup-plugin-dts: "npm:^6.4.1" + tslib: "npm:^2.8.1" + typescript: "npm:^5.9.3" + uuid: "npm:^14.0.0" + zod: "npm:^4.4.3" + languageName: unknown + linkType: soft + "@canton-network/core-token-standard-service@workspace:^, @canton-network/core-token-standard-service@workspace:core/token-standard-service": version: 0.0.0-use.local resolution: "@canton-network/core-token-standard-service@workspace:core/token-standard-service" @@ -2574,7 +2601,7 @@ __metadata: languageName: node linkType: hard -"@daml/types@npm:^3.5.2": +"@daml/types@npm:^3.5.1, @daml/types@npm:^3.5.2": version: 3.5.2 resolution: "@daml/types@npm:3.5.2" dependencies: @@ -18004,7 +18031,7 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.62.2": +"rollup@npm:^4.62.0, rollup@npm:^4.62.2": version: 4.62.2 resolution: "rollup@npm:4.62.2" dependencies: @@ -20095,7 +20122,7 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^14.0.1": +"uuid@npm:^14.0.0, uuid@npm:^14.0.1": version: 14.0.1 resolution: "uuid@npm:14.0.1" bin: