@@ -14,12 +14,13 @@ import {
1414 AllocationFactory_Allocate ,
1515 AllocationSpecification ,
1616 Transfer ,
17+ transferInstructionRegistryTypes ,
18+ allocationInstructionRegistryTypes ,
1719 ExtraArgs ,
1820 Metadata ,
1921 FEATURED_APP_DELEGATE_PROXY_INTERFACE_ID ,
2022 Holding ,
2123 Beneficiaries ,
22- OffLedger ,
2324} from '@canton-network/core-token-standard'
2425import {
2526 EventFilterBySetup ,
@@ -505,7 +506,7 @@ class AllocationService {
505506 choiceArgs : AllocationFactory_Allocate ,
506507 excludeDebugFields : boolean = true
507508 ) : Promise <
508- OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'FactoryWithChoiceContext' ]
509+ allocationInstructionRegistryTypes [ 'schemas' ] [ 'FactoryWithChoiceContext' ]
509510 > {
510511 return this . core
511512 . getTokenStandardClient ( registryUrl )
@@ -518,7 +519,7 @@ class AllocationService {
518519 async createAllocationInstructionFromContext (
519520 factoryId : string ,
520521 choiceArgs : AllocationFactory_Allocate ,
521- choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
522+ choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
522523 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
523524 choiceArgs . extraArgs . context = {
524525 ...choiceContext . choiceContextData ,
@@ -541,7 +542,7 @@ class AllocationService {
541542 requestedAt ?: string ,
542543 prefetchedRegistryChoiceContext ?: {
543544 factoryId : string
544- choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
545+ choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
545546 }
546547 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
547548 const choiceArgs = await this . buildAllocationFactoryChoiceArgs (
@@ -578,7 +579,7 @@ class AllocationService {
578579 | 'Allocation_ExecuteTransfer'
579580 | 'Allocation_Withdraw'
580581 | 'Allocation_Cancel' ,
581- choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
582+ choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
582583 ) : [ ExerciseCommand , DisclosedContract [ ] ] {
583584 const exercise : ExerciseCommand = {
584585 templateId,
@@ -613,7 +614,7 @@ class AllocationService {
613614
614615 createExecuteTransferAllocationFromContext (
615616 allocationCid : string ,
616- choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
617+ choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
617618 ) : [ ExerciseCommand , DisclosedContract [ ] ] {
618619 return this . buildAllocationExerciseWithContext (
619620 ALLOCATION_INTERFACE_ID ,
@@ -626,7 +627,7 @@ class AllocationService {
626627 async createExecuteTransferAllocation (
627628 allocationCid : string ,
628629 registryUrl : string ,
629- prefetchedRegistryChoiceContext ?: OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
630+ prefetchedRegistryChoiceContext ?: allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
630631 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
631632 if ( prefetchedRegistryChoiceContext ) {
632633 return this . createExecuteTransferAllocationFromContext (
@@ -647,9 +648,7 @@ class AllocationService {
647648 async fetchWithdrawAllocationChoiceContext (
648649 allocationCid : string ,
649650 registryUrl : string
650- ) : Promise <
651- OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
652- > {
651+ ) : Promise < allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ] > {
653652 return this . core . getTokenStandardClient ( registryUrl ) . post (
654653 '/registry/allocations/v1/{allocationId}/choice-contexts/withdraw' ,
655654 {
@@ -661,7 +660,7 @@ class AllocationService {
661660
662661 createWithdrawAllocationFromContext (
663662 allocationCid : string ,
664- choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
663+ choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
665664 ) : [ ExerciseCommand , DisclosedContract [ ] ] {
666665 return this . buildAllocationExerciseWithContext (
667666 ALLOCATION_INTERFACE_ID ,
@@ -674,7 +673,7 @@ class AllocationService {
674673 async createWithdrawAllocation (
675674 allocationCid : string ,
676675 registryUrl : string ,
677- prefetchedRegistryChoiceContext ?: OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
676+ prefetchedRegistryChoiceContext ?: allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
678677 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
679678 if ( prefetchedRegistryChoiceContext ) {
680679 return this . createWithdrawAllocationFromContext (
@@ -695,9 +694,7 @@ class AllocationService {
695694 async fetchCancelAllocationChoiceContext (
696695 allocationCid : string ,
697696 registryUrl : string
698- ) : Promise <
699- OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
700- > {
697+ ) : Promise < allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ] > {
701698 return this . core . getTokenStandardClient ( registryUrl ) . post (
702699 '/registry/allocations/v1/{allocationId}/choice-contexts/cancel' ,
703700 {
@@ -709,7 +706,7 @@ class AllocationService {
709706
710707 createCancelAllocationFromContext (
711708 allocationCid : string ,
712- choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
709+ choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
713710 ) : [ ExerciseCommand , DisclosedContract [ ] ] {
714711 return this . buildAllocationExerciseWithContext (
715712 ALLOCATION_INTERFACE_ID ,
@@ -722,7 +719,7 @@ class AllocationService {
722719 async createCancelAllocation (
723720 allocationCid : string ,
724721 registryUrl : string ,
725- prefetchedRegistryChoiceContext ?: OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
722+ prefetchedRegistryChoiceContext ?: allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
726723 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
727724 if ( prefetchedRegistryChoiceContext ) {
728725 return this . createCancelAllocationFromContext (
@@ -878,7 +875,7 @@ class TransferService {
878875 choiceArgs : CreateTransferChoiceArgs ,
879876 excludeDebugFields : boolean = true
880877 ) : Promise <
881- OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'TransferFactoryWithChoiceContext' ]
878+ transferInstructionRegistryTypes [ 'schemas' ] [ 'TransferFactoryWithChoiceContext' ]
882879 > {
883880 return await this . core
884881 . getTokenStandardClient ( registryUrl )
@@ -891,7 +888,7 @@ class TransferService {
891888 async createTransferFromContext (
892889 factoryId : string ,
893890 choiceArgs : CreateTransferChoiceArgs ,
894- choiceContext : OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
891+ choiceContext : transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
895892 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
896893 this . logger . debug ( 'Creating transfer from pre-fetched context...' )
897894 choiceArgs . extraArgs . context = {
@@ -921,7 +918,7 @@ class TransferService {
921918 meta ?: Metadata ,
922919 prefetchedRegistryChoiceContext ?: {
923920 factoryId : string
924- choiceContext : OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
921+ choiceContext : transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
925922 } ,
926923 continueUntilCompletion ?: boolean
927924 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
@@ -1129,7 +1126,7 @@ class TransferService {
11291126 async createAcceptTransferInstruction (
11301127 transferInstructionCid : string ,
11311128 registryUrl : string ,
1132- prefetchedRegistryChoiceContext ?: OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
1129+ prefetchedRegistryChoiceContext ?: transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
11331130 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
11341131 if ( prefetchedRegistryChoiceContext ) {
11351132 return this . createAcceptTransferInstructionFromContext (
@@ -1210,7 +1207,7 @@ class TransferService {
12101207 async createRejectTransferInstruction (
12111208 transferInstructionCid : string ,
12121209 registryUrl : string ,
1213- prefetchedRegistryChoiceContext ?: OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
1210+ prefetchedRegistryChoiceContext ?: transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
12141211 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
12151212 if ( prefetchedRegistryChoiceContext ) {
12161213 return this . createRejectTransferInstructionFromContext (
@@ -1292,7 +1289,7 @@ class TransferService {
12921289 async createWithdrawTransferInstruction (
12931290 transferInstructionCid : string ,
12941291 registryUrl : string ,
1295- prefetchedRegistryChoiceContext ?: OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
1292+ prefetchedRegistryChoiceContext ?: transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
12961293 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
12971294 if ( prefetchedRegistryChoiceContext ) {
12981295 return this . createWithdrawTransferInstructionFromContext (
@@ -1320,7 +1317,7 @@ class TransferService {
13201317 transferInstructionCid : string ,
13211318 registryUrl : string ,
13221319 instructionChoice : 'Accept' | 'Reject' | 'Withdraw' ,
1323- prefetchedRegistryChoiceContext ?: OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
1320+ prefetchedRegistryChoiceContext ?: transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
13241321 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
13251322 switch ( instructionChoice ) {
13261323 case 'Accept' :
0 commit comments