@@ -14,13 +14,12 @@ import {
1414 AllocationFactory_Allocate ,
1515 AllocationSpecification ,
1616 Transfer ,
17- transferInstructionRegistryTypes ,
18- allocationInstructionRegistryTypes ,
1917 ExtraArgs ,
2018 Metadata ,
2119 FEATURED_APP_DELEGATE_PROXY_INTERFACE_ID ,
2220 Holding ,
2321 Beneficiaries ,
22+ OffLedger ,
2423} from '@canton-network/core-token-standard'
2524import {
2625 EventFilterBySetup ,
@@ -506,7 +505,7 @@ class AllocationService {
506505 choiceArgs : AllocationFactory_Allocate ,
507506 excludeDebugFields : boolean = true
508507 ) : Promise <
509- allocationInstructionRegistryTypes [ 'schemas' ] [ 'FactoryWithChoiceContext' ]
508+ OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'FactoryWithChoiceContext' ]
510509 > {
511510 return this . core
512511 . getTokenStandardClient ( registryUrl )
@@ -519,7 +518,7 @@ class AllocationService {
519518 async createAllocationInstructionFromContext (
520519 factoryId : string ,
521520 choiceArgs : AllocationFactory_Allocate ,
522- choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
521+ choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
523522 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
524523 choiceArgs . extraArgs . context = {
525524 ...choiceContext . choiceContextData ,
@@ -542,7 +541,7 @@ class AllocationService {
542541 requestedAt ?: string ,
543542 prefetchedRegistryChoiceContext ?: {
544543 factoryId : string
545- choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
544+ choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
546545 }
547546 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
548547 const choiceArgs = await this . buildAllocationFactoryChoiceArgs (
@@ -579,7 +578,7 @@ class AllocationService {
579578 | 'Allocation_ExecuteTransfer'
580579 | 'Allocation_Withdraw'
581580 | 'Allocation_Cancel' ,
582- choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
581+ choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
583582 ) : [ ExerciseCommand , DisclosedContract [ ] ] {
584583 const exercise : ExerciseCommand = {
585584 templateId,
@@ -614,7 +613,7 @@ class AllocationService {
614613
615614 createExecuteTransferAllocationFromContext (
616615 allocationCid : string ,
617- choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
616+ choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
618617 ) : [ ExerciseCommand , DisclosedContract [ ] ] {
619618 return this . buildAllocationExerciseWithContext (
620619 ALLOCATION_INTERFACE_ID ,
@@ -627,7 +626,7 @@ class AllocationService {
627626 async createExecuteTransferAllocation (
628627 allocationCid : string ,
629628 registryUrl : string ,
630- prefetchedRegistryChoiceContext ?: allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
629+ prefetchedRegistryChoiceContext ?: OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
631630 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
632631 if ( prefetchedRegistryChoiceContext ) {
633632 return this . createExecuteTransferAllocationFromContext (
@@ -648,7 +647,9 @@ class AllocationService {
648647 async fetchWithdrawAllocationChoiceContext (
649648 allocationCid : string ,
650649 registryUrl : string
651- ) : Promise < allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ] > {
650+ ) : Promise <
651+ OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
652+ > {
652653 return this . core . getTokenStandardClient ( registryUrl ) . post (
653654 '/registry/allocations/v1/{allocationId}/choice-contexts/withdraw' ,
654655 {
@@ -660,7 +661,7 @@ class AllocationService {
660661
661662 createWithdrawAllocationFromContext (
662663 allocationCid : string ,
663- choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
664+ choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
664665 ) : [ ExerciseCommand , DisclosedContract [ ] ] {
665666 return this . buildAllocationExerciseWithContext (
666667 ALLOCATION_INTERFACE_ID ,
@@ -673,7 +674,7 @@ class AllocationService {
673674 async createWithdrawAllocation (
674675 allocationCid : string ,
675676 registryUrl : string ,
676- prefetchedRegistryChoiceContext ?: allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
677+ prefetchedRegistryChoiceContext ?: OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
677678 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
678679 if ( prefetchedRegistryChoiceContext ) {
679680 return this . createWithdrawAllocationFromContext (
@@ -694,7 +695,9 @@ class AllocationService {
694695 async fetchCancelAllocationChoiceContext (
695696 allocationCid : string ,
696697 registryUrl : string
697- ) : Promise < allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ] > {
698+ ) : Promise <
699+ OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
700+ > {
698701 return this . core . getTokenStandardClient ( registryUrl ) . post (
699702 '/registry/allocations/v1/{allocationId}/choice-contexts/cancel' ,
700703 {
@@ -706,7 +709,7 @@ class AllocationService {
706709
707710 createCancelAllocationFromContext (
708711 allocationCid : string ,
709- choiceContext : allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
712+ choiceContext : OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
710713 ) : [ ExerciseCommand , DisclosedContract [ ] ] {
711714 return this . buildAllocationExerciseWithContext (
712715 ALLOCATION_INTERFACE_ID ,
@@ -719,7 +722,7 @@ class AllocationService {
719722 async createCancelAllocation (
720723 allocationCid : string ,
721724 registryUrl : string ,
722- prefetchedRegistryChoiceContext ?: allocationInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
725+ prefetchedRegistryChoiceContext ?: OffLedger . AllocationInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
723726 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
724727 if ( prefetchedRegistryChoiceContext ) {
725728 return this . createCancelAllocationFromContext (
@@ -875,7 +878,7 @@ class TransferService {
875878 choiceArgs : CreateTransferChoiceArgs ,
876879 excludeDebugFields : boolean = true
877880 ) : Promise <
878- transferInstructionRegistryTypes [ 'schemas' ] [ 'TransferFactoryWithChoiceContext' ]
881+ OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'TransferFactoryWithChoiceContext' ]
879882 > {
880883 return await this . core
881884 . getTokenStandardClient ( registryUrl )
@@ -888,7 +891,7 @@ class TransferService {
888891 async createTransferFromContext (
889892 factoryId : string ,
890893 choiceArgs : CreateTransferChoiceArgs ,
891- choiceContext : transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
894+ choiceContext : OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
892895 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
893896 this . logger . debug ( 'Creating transfer from pre-fetched context...' )
894897 choiceArgs . extraArgs . context = {
@@ -918,7 +921,7 @@ class TransferService {
918921 meta ?: Metadata ,
919922 prefetchedRegistryChoiceContext ?: {
920923 factoryId : string
921- choiceContext : transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
924+ choiceContext : OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
922925 } ,
923926 continueUntilCompletion ?: boolean
924927 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
@@ -1126,7 +1129,7 @@ class TransferService {
11261129 async createAcceptTransferInstruction (
11271130 transferInstructionCid : string ,
11281131 registryUrl : string ,
1129- prefetchedRegistryChoiceContext ?: transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
1132+ prefetchedRegistryChoiceContext ?: OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
11301133 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
11311134 if ( prefetchedRegistryChoiceContext ) {
11321135 return this . createAcceptTransferInstructionFromContext (
@@ -1207,7 +1210,7 @@ class TransferService {
12071210 async createRejectTransferInstruction (
12081211 transferInstructionCid : string ,
12091212 registryUrl : string ,
1210- prefetchedRegistryChoiceContext ?: transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
1213+ prefetchedRegistryChoiceContext ?: OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
12111214 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
12121215 if ( prefetchedRegistryChoiceContext ) {
12131216 return this . createRejectTransferInstructionFromContext (
@@ -1289,7 +1292,7 @@ class TransferService {
12891292 async createWithdrawTransferInstruction (
12901293 transferInstructionCid : string ,
12911294 registryUrl : string ,
1292- prefetchedRegistryChoiceContext ?: transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
1295+ prefetchedRegistryChoiceContext ?: OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
12931296 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
12941297 if ( prefetchedRegistryChoiceContext ) {
12951298 return this . createWithdrawTransferInstructionFromContext (
@@ -1317,7 +1320,7 @@ class TransferService {
13171320 transferInstructionCid : string ,
13181321 registryUrl : string ,
13191322 instructionChoice : 'Accept' | 'Reject' | 'Withdraw' ,
1320- prefetchedRegistryChoiceContext ?: transferInstructionRegistryTypes [ 'schemas' ] [ 'ChoiceContext' ]
1323+ prefetchedRegistryChoiceContext ?: OffLedger . TransferInstructionV1 . components [ 'schemas' ] [ 'ChoiceContext' ]
13211324 ) : Promise < [ ExerciseCommand , DisclosedContract [ ] ] > {
13221325 switch ( instructionChoice ) {
13231326 case 'Accept' :
0 commit comments