@canton-network/core-ledger-client 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.d.ts +0 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +8 -8
- package/dist/index.d.ts +2 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -9
- package/dist/ledger-api-utils.d.ts +14 -2
- package/dist/ledger-api-utils.d.ts.map +1 -1
- package/dist/ledger-api-utils.js +76 -5
- package/dist/ledger-client.d.ts +35 -1
- package/dist/ledger-client.d.ts.map +1 -1
- package/dist/ledger-client.js +146 -10
- package/dist/token-standard-service.d.ts +33 -9
- package/dist/token-standard-service.d.ts.map +1 -1
- package/dist/token-standard-service.js +284 -67
- package/dist/topology-write-service.d.ts +15 -3
- package/dist/topology-write-service.d.ts.map +1 -1
- package/dist/topology-write-service.js +28 -18
- package/dist/txparse/parser.d.ts +2 -1
- package/dist/txparse/parser.d.ts.map +1 -1
- package/dist/txparse/parser.js +22 -18
- package/dist/txparse/parser.test.js +3 -3
- package/dist/txparse/types.d.ts +9 -9
- package/dist/txparse/types.d.ts.map +1 -1
- package/package.json +6 -8
- package/dist/_proto/com/daml/ledger/api/v2/admin/command_inspection_service.client.d.ts +0 -58
- package/dist/_proto/com/daml/ledger/api/v2/admin/command_inspection_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/command_inspection_service.client.js +0 -34
- package/dist/_proto/com/daml/ledger/api/v2/admin/command_inspection_service.d.ts +0 -232
- package/dist/_proto/com/daml/ledger/api/v2/admin/command_inspection_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/command_inspection_service.js +0 -560
- package/dist/_proto/com/daml/ledger/api/v2/admin/identity_provider_config_service.client.d.ts +0 -144
- package/dist/_proto/com/daml/ledger/api/v2/admin/identity_provider_config_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/identity_provider_config_service.client.js +0 -85
- package/dist/_proto/com/daml/ledger/api/v2/admin/identity_provider_config_service.d.ts +0 -291
- package/dist/_proto/com/daml/ledger/api/v2/admin/identity_provider_config_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/identity_provider_config_service.js +0 -663
- package/dist/_proto/com/daml/ledger/api/v2/admin/object_meta.d.ts +0 -76
- package/dist/_proto/com/daml/ledger/api/v2/admin/object_meta.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/object_meta.js +0 -96
- package/dist/_proto/com/daml/ledger/api/v2/admin/package_management_service.client.d.ts +0 -106
- package/dist/_proto/com/daml/ledger/api/v2/admin/package_management_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/package_management_service.client.js +0 -62
- package/dist/_proto/com/daml/ledger/api/v2/admin/package_management_service.d.ts +0 -199
- package/dist/_proto/com/daml/ledger/api/v2/admin/package_management_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/package_management_service.js +0 -427
- package/dist/_proto/com/daml/ledger/api/v2/admin/participant_pruning_service.client.d.ts +0 -56
- package/dist/_proto/com/daml/ledger/api/v2/admin/participant_pruning_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/participant_pruning_service.client.js +0 -35
- package/dist/_proto/com/daml/ledger/api/v2/admin/participant_pruning_service.d.ts +0 -81
- package/dist/_proto/com/daml/ledger/api/v2/admin/participant_pruning_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/participant_pruning_service.js +0 -135
- package/dist/_proto/com/daml/ledger/api/v2/admin/party_management_service.client.d.ts +0 -196
- package/dist/_proto/com/daml/ledger/api/v2/admin/party_management_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/party_management_service.client.js +0 -113
- package/dist/_proto/com/daml/ledger/api/v2/admin/party_management_service.d.ts +0 -413
- package/dist/_proto/com/daml/ledger/api/v2/admin/party_management_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/party_management_service.js +0 -867
- package/dist/_proto/com/daml/ledger/api/v2/admin/user_management_service.client.d.ts +0 -210
- package/dist/_proto/com/daml/ledger/api/v2/admin/user_management_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/user_management_service.client.js +0 -126
- package/dist/_proto/com/daml/ledger/api/v2/admin/user_management_service.d.ts +0 -758
- package/dist/_proto/com/daml/ledger/api/v2/admin/user_management_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/admin/user_management_service.js +0 -1580
- package/dist/_proto/com/daml/ledger/api/v2/command_completion_service.client.d.ts +0 -66
- package/dist/_proto/com/daml/ledger/api/v2/command_completion_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/command_completion_service.client.js +0 -38
- package/dist/_proto/com/daml/ledger/api/v2/command_completion_service.d.ts +0 -90
- package/dist/_proto/com/daml/ledger/api/v2/command_completion_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/command_completion_service.js +0 -178
- package/dist/_proto/com/daml/ledger/api/v2/command_service.client.d.ts +0 -99
- package/dist/_proto/com/daml/ledger/api/v2/command_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/command_service.client.js +0 -61
- package/dist/_proto/com/daml/ledger/api/v2/command_service.d.ts +0 -210
- package/dist/_proto/com/daml/ledger/api/v2/command_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/command_service.js +0 -436
- package/dist/_proto/com/daml/ledger/api/v2/command_submission_service.client.d.ts +0 -80
- package/dist/_proto/com/daml/ledger/api/v2/command_submission_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/command_submission_service.client.js +0 -47
- package/dist/_proto/com/daml/ledger/api/v2/command_submission_service.d.ts +0 -91
- package/dist/_proto/com/daml/ledger/api/v2/command_submission_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/command_submission_service.js +0 -200
- package/dist/_proto/com/daml/ledger/api/v2/commands.d.ts +0 -491
- package/dist/_proto/com/daml/ledger/api/v2/commands.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/commands.js +0 -828
- package/dist/_proto/com/daml/ledger/api/v2/completion.d.ts +0 -149
- package/dist/_proto/com/daml/ledger/api/v2/completion.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/completion.js +0 -196
- package/dist/_proto/com/daml/ledger/api/v2/event.d.ts +0 -495
- package/dist/_proto/com/daml/ledger/api/v2/event.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/event.js +0 -723
- package/dist/_proto/com/daml/ledger/api/v2/event_query_service.client.d.ts +0 -52
- package/dist/_proto/com/daml/ledger/api/v2/event_query_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/event_query_service.client.js +0 -31
- package/dist/_proto/com/daml/ledger/api/v2/event_query_service.d.ts +0 -150
- package/dist/_proto/com/daml/ledger/api/v2/event_query_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/event_query_service.js +0 -291
- package/dist/_proto/com/daml/ledger/api/v2/experimental_features.d.ts +0 -96
- package/dist/_proto/com/daml/ledger/api/v2/experimental_features.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/experimental_features.js +0 -225
- package/dist/_proto/com/daml/ledger/api/v2/interactive/interactive_submission_common_data.d.ts +0 -43
- package/dist/_proto/com/daml/ledger/api/v2/interactive/interactive_submission_common_data.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/interactive/interactive_submission_common_data.js +0 -85
- package/dist/_proto/com/daml/ledger/api/v2/interactive/interactive_submission_service.client.d.ts +0 -100
- package/dist/_proto/com/daml/ledger/api/v2/interactive/interactive_submission_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/interactive/interactive_submission_service.client.js +0 -59
- package/dist/_proto/com/daml/ledger/api/v2/interactive/interactive_submission_service.d.ts +0 -877
- package/dist/_proto/com/daml/ledger/api/v2/interactive/interactive_submission_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/interactive/interactive_submission_service.js +0 -1768
- package/dist/_proto/com/daml/ledger/api/v2/interactive/transaction/v1/interactive_submission_data.d.ts +0 -259
- package/dist/_proto/com/daml/ledger/api/v2/interactive/transaction/v1/interactive_submission_data.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/interactive/transaction/v1/interactive_submission_data.js +0 -667
- package/dist/_proto/com/daml/ledger/api/v2/offset_checkpoint.d.ts +0 -69
- package/dist/_proto/com/daml/ledger/api/v2/offset_checkpoint.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/offset_checkpoint.js +0 -133
- package/dist/_proto/com/daml/ledger/api/v2/package_reference.d.ts +0 -41
- package/dist/_proto/com/daml/ledger/api/v2/package_reference.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/package_reference.js +0 -84
- package/dist/_proto/com/daml/ledger/api/v2/package_service.client.d.ts +0 -68
- package/dist/_proto/com/daml/ledger/api/v2/package_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/package_service.client.js +0 -43
- package/dist/_proto/com/daml/ledger/api/v2/package_service.d.ts +0 -181
- package/dist/_proto/com/daml/ledger/api/v2/package_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/package_service.js +0 -395
- package/dist/_proto/com/daml/ledger/api/v2/reassignment.d.ts +0 -308
- package/dist/_proto/com/daml/ledger/api/v2/reassignment.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/reassignment.js +0 -521
- package/dist/_proto/com/daml/ledger/api/v2/reassignment_commands.d.ts +0 -193
- package/dist/_proto/com/daml/ledger/api/v2/reassignment_commands.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/reassignment_commands.js +0 -350
- package/dist/_proto/com/daml/ledger/api/v2/state_service.client.d.ts +0 -91
- package/dist/_proto/com/daml/ledger/api/v2/state_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/state_service.client.js +0 -56
- package/dist/_proto/com/daml/ledger/api/v2/state_service.d.ts +0 -448
- package/dist/_proto/com/daml/ledger/api/v2/state_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/state_service.js +0 -874
- package/dist/_proto/com/daml/ledger/api/v2/testing/time_service.client.d.ts +0 -54
- package/dist/_proto/com/daml/ledger/api/v2/testing/time_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/testing/time_service.client.js +0 -34
- package/dist/_proto/com/daml/ledger/api/v2/testing/time_service.d.ts +0 -78
- package/dist/_proto/com/daml/ledger/api/v2/testing/time_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/testing/time_service.js +0 -168
- package/dist/_proto/com/daml/ledger/api/v2/topology_transaction.d.ts +0 -211
- package/dist/_proto/com/daml/ledger/api/v2/topology_transaction.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/topology_transaction.js +0 -447
- package/dist/_proto/com/daml/ledger/api/v2/trace_context.d.ts +0 -33
- package/dist/_proto/com/daml/ledger/api/v2/trace_context.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/trace_context.js +0 -69
- package/dist/_proto/com/daml/ledger/api/v2/transaction.d.ts +0 -252
- package/dist/_proto/com/daml/ledger/api/v2/transaction.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/transaction.js +0 -410
- package/dist/_proto/com/daml/ledger/api/v2/transaction_filter.d.ts +0 -453
- package/dist/_proto/com/daml/ledger/api/v2/transaction_filter.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/transaction_filter.js +0 -815
- package/dist/_proto/com/daml/ledger/api/v2/update_service.client.d.ts +0 -199
- package/dist/_proto/com/daml/ledger/api/v2/update_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/update_service.client.js +0 -121
- package/dist/_proto/com/daml/ledger/api/v2/update_service.d.ts +0 -424
- package/dist/_proto/com/daml/ledger/api/v2/update_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/update_service.js +0 -853
- package/dist/_proto/com/daml/ledger/api/v2/value.d.ts +0 -500
- package/dist/_proto/com/daml/ledger/api/v2/value.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/value.js +0 -937
- package/dist/_proto/com/daml/ledger/api/v2/version_service.client.d.ts +0 -40
- package/dist/_proto/com/daml/ledger/api/v2/version_service.client.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/version_service.client.js +0 -25
- package/dist/_proto/com/daml/ledger/api/v2/version_service.d.ts +0 -190
- package/dist/_proto/com/daml/ledger/api/v2/version_service.d.ts.map +0 -1
- package/dist/_proto/com/daml/ledger/api/v2/version_service.js +0 -400
- package/dist/_proto/com/digitalasset/canton/crypto/v30/crypto.d.ts +0 -1028
- package/dist/_proto/com/digitalasset/canton/crypto/v30/crypto.d.ts.map +0 -1
- package/dist/_proto/com/digitalasset/canton/crypto/v30/crypto.js +0 -2110
- package/dist/_proto/com/digitalasset/canton/protocol/v30/sequencing_parameters.d.ts +0 -30
- package/dist/_proto/com/digitalasset/canton/protocol/v30/sequencing_parameters.d.ts.map +0 -1
- package/dist/_proto/com/digitalasset/canton/protocol/v30/sequencing_parameters.js +0 -62
- package/dist/_proto/com/digitalasset/canton/protocol/v30/synchronizer_parameters.d.ts +0 -168
- package/dist/_proto/com/digitalasset/canton/protocol/v30/synchronizer_parameters.d.ts.map +0 -1
- package/dist/_proto/com/digitalasset/canton/protocol/v30/synchronizer_parameters.js +0 -395
- package/dist/_proto/com/digitalasset/canton/protocol/v30/topology.d.ts +0 -1105
- package/dist/_proto/com/digitalasset/canton/protocol/v30/topology.d.ts.map +0 -1
- package/dist/_proto/com/digitalasset/canton/protocol/v30/topology.js +0 -2294
- package/dist/_proto/com/digitalasset/canton/protocol/v30/traffic_control_parameters.d.ts +0 -278
- package/dist/_proto/com/digitalasset/canton/protocol/v30/traffic_control_parameters.d.ts.map +0 -1
- package/dist/_proto/com/digitalasset/canton/protocol/v30/traffic_control_parameters.js +0 -654
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/common.d.ts +0 -166
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/common.d.ts.map +0 -1
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/common.js +0 -379
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_read_service.client.d.ts +0 -199
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_read_service.client.d.ts.map +0 -1
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_read_service.client.js +0 -136
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_read_service.d.ts +0 -1195
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_read_service.d.ts.map +0 -1
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_read_service.js +0 -3342
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_write_service.client.d.ts +0 -119
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_write_service.client.d.ts.map +0 -1
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_write_service.client.js +0 -76
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_write_service.d.ts +0 -607
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_write_service.d.ts.map +0 -1
- package/dist/_proto/com/digitalasset/canton/topology/admin/v30/topology_manager_write_service.js +0 -1292
- package/dist/_proto/google/protobuf/any.d.ts +0 -177
- package/dist/_proto/google/protobuf/any.d.ts.map +0 -1
- package/dist/_proto/google/protobuf/any.js +0 -175
- package/dist/_proto/google/protobuf/descriptor.d.ts +0 -1638
- package/dist/_proto/google/protobuf/descriptor.d.ts.map +0 -1
- package/dist/_proto/google/protobuf/descriptor.js +0 -2999
- package/dist/_proto/google/protobuf/duration.d.ts +0 -114
- package/dist/_proto/google/protobuf/duration.d.ts.map +0 -1
- package/dist/_proto/google/protobuf/duration.js +0 -113
- package/dist/_proto/google/protobuf/empty.d.ts +0 -33
- package/dist/_proto/google/protobuf/empty.d.ts.map +0 -1
- package/dist/_proto/google/protobuf/empty.js +0 -41
- package/dist/_proto/google/protobuf/field_mask.d.ts +0 -240
- package/dist/_proto/google/protobuf/field_mask.d.ts.map +0 -1
- package/dist/_proto/google/protobuf/field_mask.js +0 -95
- package/dist/_proto/google/protobuf/struct.d.ts +0 -187
- package/dist/_proto/google/protobuf/struct.d.ts.map +0 -1
- package/dist/_proto/google/protobuf/struct.js +0 -417
- package/dist/_proto/google/protobuf/timestamp.d.ts +0 -159
- package/dist/_proto/google/protobuf/timestamp.d.ts.map +0 -1
- package/dist/_proto/google/protobuf/timestamp.js +0 -157
- package/dist/_proto/google/rpc/code.d.ts +0 -219
- package/dist/_proto/google/rpc/code.d.ts.map +0 -1
- package/dist/_proto/google/rpc/code.js +0 -237
- package/dist/_proto/google/rpc/context/attribute_context.d.ts +0 -594
- package/dist/_proto/google/rpc/context/attribute_context.d.ts.map +0 -1
- package/dist/_proto/google/rpc/context/attribute_context.js +0 -1007
- package/dist/_proto/google/rpc/context/audit_context.d.ts +0 -62
- package/dist/_proto/google/rpc/context/audit_context.d.ts.map +0 -1
- package/dist/_proto/google/rpc/context/audit_context.js +0 -111
- package/dist/_proto/google/rpc/error_details.d.ts +0 -549
- package/dist/_proto/google/rpc/error_details.d.ts.map +0 -1
- package/dist/_proto/google/rpc/error_details.js +0 -918
- package/dist/_proto/google/rpc/status.d.ts +0 -55
- package/dist/_proto/google/rpc/status.d.ts.map +0 -1
- package/dist/_proto/google/rpc/status.js +0 -79
- package/dist/_proto/scalapb/scalapb.d.ts +0 -779
- package/dist/_proto/scalapb/scalapb.d.ts.map +0 -1
- package/dist/_proto/scalapb/scalapb.js +0 -1658
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { TokenStandardClient, } from '@canton-network/core-token-standard';
|
|
4
|
-
import {
|
|
5
|
-
import { ensureInterfaceViewIsPresent,
|
|
3
|
+
import { TokenStandardClient, HOLDING_INTERFACE_ID, ALLOCATION_FACTORY_INTERFACE_ID, ALLOCATION_INTERFACE_ID, ALLOCATION_REQUEST_INTERFACE_ID, ALLOCATION_INSTRUCTION_INTERFACE_ID, TRANSFER_INSTRUCTION_INTERFACE_ID, TRANSFER_FACTORY_INTERFACE_ID, } from '@canton-network/core-token-standard';
|
|
4
|
+
import { TokenStandardTransactionInterfaces } from './constants.js';
|
|
5
|
+
import { ensureInterfaceViewIsPresent, TransactionFilterBySetup, EventFilterBySetup, } from './ledger-api-utils.js';
|
|
6
6
|
import { TransactionParser } from './txparse/parser.js';
|
|
7
7
|
import { renderTransaction, } from './txparse/types.js';
|
|
8
8
|
const MEMO_KEY = 'splice.lfdecentralizedtrust.org/reason';
|
|
@@ -11,11 +11,13 @@ export class TokenStandardService {
|
|
|
11
11
|
scanProxyClient;
|
|
12
12
|
logger;
|
|
13
13
|
accessToken;
|
|
14
|
-
|
|
14
|
+
isMasterUser;
|
|
15
|
+
constructor(ledgerClient, scanProxyClient, logger, accessToken, isMasterUser) {
|
|
15
16
|
this.ledgerClient = ledgerClient;
|
|
16
17
|
this.scanProxyClient = scanProxyClient;
|
|
17
18
|
this.logger = logger;
|
|
18
19
|
this.accessToken = accessToken;
|
|
20
|
+
this.isMasterUser = isMasterUser;
|
|
19
21
|
}
|
|
20
22
|
getTokenStandardClient(registryUrl) {
|
|
21
23
|
return new TokenStandardClient(registryUrl, this.logger, this.accessToken);
|
|
@@ -28,14 +30,22 @@ export class TokenStandardService {
|
|
|
28
30
|
});
|
|
29
31
|
return transfer_preapproval;
|
|
30
32
|
}
|
|
31
|
-
async
|
|
33
|
+
async getFeaturedAppsByParty(partyId) {
|
|
34
|
+
const { featured_app_right } = await this.scanProxyClient.get('/v0/scan-proxy/featured-apps/{provider_party_id}', {
|
|
35
|
+
path: {
|
|
36
|
+
provider_party_id: partyId,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
return featured_app_right;
|
|
40
|
+
}
|
|
41
|
+
async getInstrumentById(registryUrl, instrumentId) {
|
|
32
42
|
try {
|
|
33
43
|
const params = {
|
|
34
44
|
path: {
|
|
35
45
|
instrumentId,
|
|
36
46
|
},
|
|
37
47
|
};
|
|
38
|
-
const client = this.getTokenStandardClient(
|
|
48
|
+
const client = this.getTokenStandardClient(registryUrl);
|
|
39
49
|
return client.get('/registry/metadata/v1/instruments/{instrumentId}', params);
|
|
40
50
|
}
|
|
41
51
|
catch (e) {
|
|
@@ -43,16 +53,21 @@ export class TokenStandardService {
|
|
|
43
53
|
throw new Error(`Instrument id ${instrumentId} does not exist for this instrument admin.`);
|
|
44
54
|
}
|
|
45
55
|
}
|
|
46
|
-
async
|
|
56
|
+
async getInstrumentAdmin(registryUrl) {
|
|
57
|
+
const client = this.getTokenStandardClient(registryUrl);
|
|
58
|
+
const info = await client.get('/registry/metadata/v1/info');
|
|
59
|
+
return info.adminId;
|
|
60
|
+
}
|
|
61
|
+
async createAcceptTransferInstruction(transferInstructionCid, registryUrl) {
|
|
47
62
|
try {
|
|
48
|
-
const client = this.getTokenStandardClient(
|
|
63
|
+
const client = this.getTokenStandardClient(registryUrl);
|
|
49
64
|
const choiceContext = await client.post('/registry/transfer-instruction/v1/{transferInstructionId}/choice-contexts/accept', {}, {
|
|
50
65
|
path: {
|
|
51
66
|
transferInstructionId: transferInstructionCid,
|
|
52
67
|
},
|
|
53
68
|
});
|
|
54
69
|
const exercise = {
|
|
55
|
-
templateId:
|
|
70
|
+
templateId: TRANSFER_INSTRUCTION_INTERFACE_ID,
|
|
56
71
|
contractId: transferInstructionCid,
|
|
57
72
|
choice: 'TransferInstruction_Accept',
|
|
58
73
|
choiceArgument: {
|
|
@@ -69,21 +84,16 @@ export class TokenStandardService {
|
|
|
69
84
|
throw e;
|
|
70
85
|
}
|
|
71
86
|
}
|
|
72
|
-
async
|
|
73
|
-
const client = this.getTokenStandardClient(transferFactoryRegistryUrl);
|
|
74
|
-
const info = await client.get('/registry/metadata/v1/info');
|
|
75
|
-
return info.adminId;
|
|
76
|
-
}
|
|
77
|
-
async createRejectTransferInstruction(transferInstructionCid, transferFactoryRegistryUrl) {
|
|
87
|
+
async createRejectTransferInstruction(transferInstructionCid, registryUrl) {
|
|
78
88
|
try {
|
|
79
|
-
const client = this.getTokenStandardClient(
|
|
89
|
+
const client = this.getTokenStandardClient(registryUrl);
|
|
80
90
|
const choiceContext = await client.post('/registry/transfer-instruction/v1/{transferInstructionId}/choice-contexts/reject', {}, {
|
|
81
91
|
path: {
|
|
82
92
|
transferInstructionId: transferInstructionCid,
|
|
83
93
|
},
|
|
84
94
|
});
|
|
85
95
|
const exercise = {
|
|
86
|
-
templateId:
|
|
96
|
+
templateId: TRANSFER_INSTRUCTION_INTERFACE_ID,
|
|
87
97
|
contractId: transferInstructionCid,
|
|
88
98
|
choice: 'TransferInstruction_Reject',
|
|
89
99
|
choiceArgument: {
|
|
@@ -100,16 +110,16 @@ export class TokenStandardService {
|
|
|
100
110
|
throw e;
|
|
101
111
|
}
|
|
102
112
|
}
|
|
103
|
-
async createWithdrawTransferInstruction(transferInstructionCid,
|
|
113
|
+
async createWithdrawTransferInstruction(transferInstructionCid, registryUrl) {
|
|
104
114
|
try {
|
|
105
|
-
const client = this.getTokenStandardClient(
|
|
115
|
+
const client = this.getTokenStandardClient(registryUrl);
|
|
106
116
|
const choiceContext = await client.post('/registry/transfer-instruction/v1/{transferInstructionId}/choice-contexts/withdraw', {}, {
|
|
107
117
|
path: {
|
|
108
118
|
transferInstructionId: transferInstructionCid,
|
|
109
119
|
},
|
|
110
120
|
});
|
|
111
121
|
const exercise = {
|
|
112
|
-
templateId:
|
|
122
|
+
templateId: TRANSFER_INSTRUCTION_INTERFACE_ID,
|
|
113
123
|
contractId: transferInstructionCid,
|
|
114
124
|
choice: 'TransferInstruction_Withdraw',
|
|
115
125
|
choiceArgument: {
|
|
@@ -126,15 +136,194 @@ export class TokenStandardService {
|
|
|
126
136
|
throw e;
|
|
127
137
|
}
|
|
128
138
|
}
|
|
139
|
+
async createAllocationInstruction(allocationSpecification, expectedAdmin, registryUrl, inputUtxos, requestedAt, extraContext) {
|
|
140
|
+
const allocationSpecificationNormalized = {
|
|
141
|
+
...allocationSpecification,
|
|
142
|
+
settlement: {
|
|
143
|
+
...allocationSpecification.settlement,
|
|
144
|
+
meta: allocationSpecification.settlement.meta ?? { values: {} },
|
|
145
|
+
},
|
|
146
|
+
transferLeg: {
|
|
147
|
+
...allocationSpecification.transferLeg,
|
|
148
|
+
meta: allocationSpecification.transferLeg.meta ?? {
|
|
149
|
+
values: {},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
const inputHoldingCids = await this.getInputHoldingsCids(allocationSpecificationNormalized.transferLeg.sender, inputUtxos);
|
|
154
|
+
const choiceArgs = {
|
|
155
|
+
expectedAdmin: expectedAdmin,
|
|
156
|
+
allocation: allocationSpecificationNormalized,
|
|
157
|
+
requestedAt: requestedAt ?? new Date().toISOString(),
|
|
158
|
+
inputHoldingCids,
|
|
159
|
+
extraArgs: {
|
|
160
|
+
context: { values: { ...(extraContext ?? {}) } },
|
|
161
|
+
meta: { values: {} },
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
const allocationFactory = await this.getTokenStandardClient(registryUrl).post('/registry/allocation-instruction/v1/allocation-factory', {
|
|
165
|
+
choiceArguments: choiceArgs,
|
|
166
|
+
});
|
|
167
|
+
choiceArgs.extraArgs.context = {
|
|
168
|
+
...allocationFactory.choiceContext.choiceContextData,
|
|
169
|
+
values: allocationFactory.choiceContext.choiceContextData?.values ?? {},
|
|
170
|
+
};
|
|
171
|
+
const exercise = {
|
|
172
|
+
templateId: ALLOCATION_FACTORY_INTERFACE_ID,
|
|
173
|
+
contractId: allocationFactory.factoryId,
|
|
174
|
+
choice: 'AllocationFactory_Allocate',
|
|
175
|
+
choiceArgument: choiceArgs,
|
|
176
|
+
};
|
|
177
|
+
return [exercise, allocationFactory.choiceContext.disclosedContracts];
|
|
178
|
+
}
|
|
179
|
+
async getAllocationExecuteTransferChoiceContext(allocationId, registryUrl) {
|
|
180
|
+
return this.getTokenStandardClient(registryUrl).post('/registry/allocations/v1/{allocationId}/choice-contexts/execute-transfer', {}, {
|
|
181
|
+
path: {
|
|
182
|
+
allocationId,
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
async createExecuteTransferAllocation(allocationCid, registryUrl) {
|
|
187
|
+
try {
|
|
188
|
+
const choiceContext = await this.getAllocationExecuteTransferChoiceContext(allocationCid, registryUrl);
|
|
189
|
+
const exercise = {
|
|
190
|
+
templateId: ALLOCATION_INTERFACE_ID,
|
|
191
|
+
contractId: allocationCid,
|
|
192
|
+
choice: 'Allocation_ExecuteTransfer',
|
|
193
|
+
choiceArgument: {
|
|
194
|
+
extraArgs: {
|
|
195
|
+
context: choiceContext.choiceContextData,
|
|
196
|
+
meta: { values: {} },
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
return [exercise, choiceContext.disclosedContracts];
|
|
201
|
+
}
|
|
202
|
+
catch (e) {
|
|
203
|
+
this.logger.error('Failed to create allocation execute transfer:', e);
|
|
204
|
+
throw e;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
async createWithdrawAllocation(allocationCid, registryUrl) {
|
|
208
|
+
try {
|
|
209
|
+
const client = this.getTokenStandardClient(registryUrl);
|
|
210
|
+
const choiceContext = await client.post('/registry/allocations/v1/{allocationId}/choice-contexts/withdraw', {}, {
|
|
211
|
+
path: {
|
|
212
|
+
allocationId: allocationCid,
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
const exercise = {
|
|
216
|
+
templateId: ALLOCATION_INTERFACE_ID,
|
|
217
|
+
contractId: allocationCid,
|
|
218
|
+
choice: 'Allocation_Withdraw',
|
|
219
|
+
choiceArgument: {
|
|
220
|
+
extraArgs: {
|
|
221
|
+
context: choiceContext.choiceContextData,
|
|
222
|
+
meta: { values: {} },
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
return [exercise, choiceContext.disclosedContracts];
|
|
227
|
+
}
|
|
228
|
+
catch (e) {
|
|
229
|
+
this.logger.error('Failed to create withdraw allocation:', e);
|
|
230
|
+
throw e;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
async createCancelAllocation(allocationCid, registryUrl) {
|
|
234
|
+
try {
|
|
235
|
+
const client = this.getTokenStandardClient(registryUrl);
|
|
236
|
+
const choiceContext = await client.post('/registry/allocations/v1/{allocationId}/choice-contexts/cancel', {}, {
|
|
237
|
+
path: {
|
|
238
|
+
allocationId: allocationCid,
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
const exercise = {
|
|
242
|
+
templateId: ALLOCATION_INTERFACE_ID,
|
|
243
|
+
contractId: allocationCid,
|
|
244
|
+
choice: 'Allocation_Cancel',
|
|
245
|
+
choiceArgument: {
|
|
246
|
+
extraArgs: {
|
|
247
|
+
context: choiceContext.choiceContextData,
|
|
248
|
+
meta: { values: {} },
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
return [exercise, choiceContext.disclosedContracts];
|
|
253
|
+
}
|
|
254
|
+
catch (e) {
|
|
255
|
+
this.logger.error('Failed to create withdraw transfer instruction:', e);
|
|
256
|
+
throw e;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
async createWithdrawAllocationInstruction(registryUrl) {
|
|
260
|
+
const exercise = {
|
|
261
|
+
templateId: ALLOCATION_INSTRUCTION_INTERFACE_ID,
|
|
262
|
+
contractId: registryUrl,
|
|
263
|
+
choice: 'AllocationInstruction_Withdraw',
|
|
264
|
+
choiceArgument: {
|
|
265
|
+
extraArgs: {
|
|
266
|
+
context: { values: {} },
|
|
267
|
+
meta: { values: {} },
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
return [exercise, []];
|
|
272
|
+
}
|
|
273
|
+
async createUpdateAllocationInstruction(allocationInstructionCid, extraActors = [], extraArgsContext = {}, extraArgsMeta = {}) {
|
|
274
|
+
const exercise = {
|
|
275
|
+
templateId: ALLOCATION_INSTRUCTION_INTERFACE_ID,
|
|
276
|
+
contractId: allocationInstructionCid,
|
|
277
|
+
choice: 'AllocationInstruction_Update',
|
|
278
|
+
choiceArgument: {
|
|
279
|
+
extraActors,
|
|
280
|
+
extraArgs: {
|
|
281
|
+
context: { values: extraArgsContext },
|
|
282
|
+
meta: { values: extraArgsMeta },
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
return [exercise, []];
|
|
287
|
+
}
|
|
288
|
+
async createRejectAllocationRequest(allocationRequestCid, actor) {
|
|
289
|
+
const exercise = {
|
|
290
|
+
templateId: ALLOCATION_REQUEST_INTERFACE_ID,
|
|
291
|
+
contractId: allocationRequestCid,
|
|
292
|
+
choice: 'AllocationRequest_Reject',
|
|
293
|
+
choiceArgument: {
|
|
294
|
+
actor,
|
|
295
|
+
extraArgs: {
|
|
296
|
+
context: { values: {} },
|
|
297
|
+
meta: { values: {} },
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
return [exercise, []];
|
|
302
|
+
}
|
|
303
|
+
async createWithdrawAllocationRequest(allocationRequestCid) {
|
|
304
|
+
const exercise = {
|
|
305
|
+
templateId: ALLOCATION_REQUEST_INTERFACE_ID,
|
|
306
|
+
contractId: allocationRequestCid,
|
|
307
|
+
choice: 'AllocationRequest_Withdraw',
|
|
308
|
+
choiceArgument: {
|
|
309
|
+
extraArgs: {
|
|
310
|
+
context: { values: {} },
|
|
311
|
+
meta: { values: {} },
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
};
|
|
315
|
+
return [exercise, []];
|
|
316
|
+
}
|
|
129
317
|
// <T> is shape of viewValue related to queried interface.
|
|
130
318
|
// i.e. when querying by TransferInstruction interfaceId, <T> would be TransferInstructionView from daml codegen
|
|
131
319
|
async listContractsByInterface(interfaceId, partyId) {
|
|
132
320
|
try {
|
|
133
321
|
const ledgerEnd = await this.ledgerClient.get('/v2/state/ledger-end');
|
|
134
322
|
const acsResponses = await this.ledgerClient.post('/v2/state/active-contracts', {
|
|
135
|
-
filter: {
|
|
136
|
-
|
|
137
|
-
|
|
323
|
+
filter: TransactionFilterBySetup(interfaceId, {
|
|
324
|
+
isMasterUser: this.isMasterUser,
|
|
325
|
+
partyId: partyId,
|
|
326
|
+
}),
|
|
138
327
|
verbose: false,
|
|
139
328
|
activeAtOffset: ledgerEnd.offset,
|
|
140
329
|
});
|
|
@@ -167,10 +356,11 @@ export class TokenStandardService {
|
|
|
167
356
|
const updatesResponse = await this.ledgerClient.post('/v2/updates/flats', {
|
|
168
357
|
updateFormat: {
|
|
169
358
|
includeTransactions: {
|
|
170
|
-
eventFormat: {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
359
|
+
eventFormat: EventFilterBySetup(TokenStandardTransactionInterfaces, {
|
|
360
|
+
includeWildcard: true,
|
|
361
|
+
isMasterUser: this.isMasterUser,
|
|
362
|
+
partyId: partyId,
|
|
363
|
+
}),
|
|
174
364
|
transactionShape: 'TRANSACTION_SHAPE_LEDGER_EFFECTS',
|
|
175
365
|
},
|
|
176
366
|
},
|
|
@@ -186,12 +376,12 @@ export class TokenStandardService {
|
|
|
186
376
|
}
|
|
187
377
|
}
|
|
188
378
|
async getTransactionById(updateId, partyId) {
|
|
189
|
-
const filter = filtersByParty(partyId, TokenStandardTransactionInterfaces, true);
|
|
190
379
|
const transactionFormat = {
|
|
191
|
-
eventFormat: {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
380
|
+
eventFormat: EventFilterBySetup(TokenStandardTransactionInterfaces, {
|
|
381
|
+
includeWildcard: true,
|
|
382
|
+
isMasterUser: this.isMasterUser,
|
|
383
|
+
partyId: partyId,
|
|
384
|
+
}),
|
|
195
385
|
transactionShape: 'TRANSACTION_SHAPE_LEDGER_EFFECTS',
|
|
196
386
|
};
|
|
197
387
|
const getTransactionResponse = await this.ledgerClient.post('/v2/updates/transaction-by-id', {
|
|
@@ -200,36 +390,36 @@ export class TokenStandardService {
|
|
|
200
390
|
});
|
|
201
391
|
return this.toPrettyTransaction(getTransactionResponse, partyId, this.ledgerClient);
|
|
202
392
|
}
|
|
393
|
+
async getInputHoldingsCids(sender, inputUtxos) {
|
|
394
|
+
const now = new Date();
|
|
395
|
+
if (inputUtxos && inputUtxos.length > 0) {
|
|
396
|
+
return inputUtxos;
|
|
397
|
+
}
|
|
398
|
+
const senderHoldings = await this.listContractsByInterface(HOLDING_INTERFACE_ID, sender);
|
|
399
|
+
if (senderHoldings.length === 0) {
|
|
400
|
+
throw new Error("Sender has no holdings, so transfer can't be executed.");
|
|
401
|
+
}
|
|
402
|
+
return senderHoldings
|
|
403
|
+
.filter((utxo) => {
|
|
404
|
+
//filter out locked holdings
|
|
405
|
+
const lock = utxo.interfaceViewValue.lock;
|
|
406
|
+
if (!lock)
|
|
407
|
+
return true;
|
|
408
|
+
const expiresAt = lock.expiresAt;
|
|
409
|
+
if (!expiresAt)
|
|
410
|
+
return false;
|
|
411
|
+
const expiresAtDate = new Date(expiresAt);
|
|
412
|
+
return expiresAtDate <= now;
|
|
413
|
+
})
|
|
414
|
+
.map((h) => h.contractId);
|
|
415
|
+
/* TODO: optimize input holding selection, currently if you transfer 10 CC and have 10 inputs of 1000 CC,
|
|
416
|
+
then all 10 of those are chose as input.
|
|
417
|
+
*/
|
|
418
|
+
}
|
|
203
419
|
async createTransfer(sender, receiver, amount, instrumentAdmin, // TODO (#907): replace with registry call
|
|
204
|
-
instrumentId,
|
|
420
|
+
instrumentId, registryUrl, inputUtxos, memo, expiryDate, meta) {
|
|
205
421
|
try {
|
|
206
|
-
|
|
207
|
-
const now = new Date();
|
|
208
|
-
if (inputUtxos && inputUtxos.length > 0) {
|
|
209
|
-
inputHoldingCids = inputUtxos;
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
const senderHoldings = await this.listContractsByInterface(HoldingInterface, sender);
|
|
213
|
-
if (senderHoldings.length === 0) {
|
|
214
|
-
throw new Error("Sender has no holdings, so transfer can't be executed.");
|
|
215
|
-
}
|
|
216
|
-
inputHoldingCids = senderHoldings
|
|
217
|
-
.filter((utxo) => {
|
|
218
|
-
//filter out locked holdings
|
|
219
|
-
const lock = utxo.interfaceViewValue.lock;
|
|
220
|
-
if (!lock)
|
|
221
|
-
return true;
|
|
222
|
-
const expiresAt = lock.expiresAt;
|
|
223
|
-
if (!expiresAt)
|
|
224
|
-
return false;
|
|
225
|
-
const expiresAtDate = new Date(expiresAt);
|
|
226
|
-
return expiresAtDate <= now;
|
|
227
|
-
})
|
|
228
|
-
.map((h) => h.contractId);
|
|
229
|
-
/* TODO: optimize input holding selection, currently if you transfer 10 CC and have 10 inputs of 1000 CC,
|
|
230
|
-
then all 10 of those are chose as input.
|
|
231
|
-
*/
|
|
232
|
-
}
|
|
422
|
+
const inputHoldingCids = await this.getInputHoldingsCids(sender, inputUtxos);
|
|
233
423
|
const choiceArgs = {
|
|
234
424
|
expectedAdmin: instrumentAdmin,
|
|
235
425
|
transfer: {
|
|
@@ -238,7 +428,7 @@ export class TokenStandardService {
|
|
|
238
428
|
amount,
|
|
239
429
|
instrumentId: { admin: instrumentAdmin, id: instrumentId },
|
|
240
430
|
lock: null,
|
|
241
|
-
requestedAt: now.toISOString(),
|
|
431
|
+
requestedAt: new Date(Date.now() - 60 * 1000).toISOString(),
|
|
242
432
|
//given expiryDate or 24 hours
|
|
243
433
|
executeBefore: (expiryDate ?? new Date(Date.now() + 24 * 60 * 60 * 1000)).toISOString(),
|
|
244
434
|
inputHoldingCids,
|
|
@@ -250,7 +440,7 @@ export class TokenStandardService {
|
|
|
250
440
|
},
|
|
251
441
|
};
|
|
252
442
|
this.logger.debug('Creating transfer factory...');
|
|
253
|
-
const transferFactory = await this.getTokenStandardClient(
|
|
443
|
+
const transferFactory = await this.getTokenStandardClient(registryUrl).post('/registry/transfer-instruction/v1/transfer-factory', {
|
|
254
444
|
choiceArguments: choiceArgs,
|
|
255
445
|
});
|
|
256
446
|
this.logger.debug(transferFactory, 'Transfer factory created');
|
|
@@ -260,7 +450,7 @@ export class TokenStandardService {
|
|
|
260
450
|
{},
|
|
261
451
|
};
|
|
262
452
|
const exercise = {
|
|
263
|
-
templateId:
|
|
453
|
+
templateId: TRANSFER_FACTORY_INTERFACE_ID,
|
|
264
454
|
contractId: transferFactory.factoryId,
|
|
265
455
|
choice: 'TransferFactory_Transfer',
|
|
266
456
|
choiceArgument: choiceArgs,
|
|
@@ -273,7 +463,7 @@ export class TokenStandardService {
|
|
|
273
463
|
}
|
|
274
464
|
}
|
|
275
465
|
async createTap(receiver, amount, instrumentAdmin, // TODO (#907): replace with registry call
|
|
276
|
-
instrumentId,
|
|
466
|
+
instrumentId, registryUrl) {
|
|
277
467
|
const now = new Date();
|
|
278
468
|
const tomorrow = new Date(now);
|
|
279
469
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
@@ -295,7 +485,7 @@ export class TokenStandardService {
|
|
|
295
485
|
meta: { values: {} },
|
|
296
486
|
},
|
|
297
487
|
};
|
|
298
|
-
const transferFactory = await this.getTokenStandardClient(
|
|
488
|
+
const transferFactory = await this.getTokenStandardClient(registryUrl).post('/registry/transfer-instruction/v1/transfer-factory', {
|
|
299
489
|
choiceArguments: choiceArgs,
|
|
300
490
|
});
|
|
301
491
|
const disclosedContracts = transferFactory.choiceContext.disclosedContracts;
|
|
@@ -332,6 +522,33 @@ export class TokenStandardService {
|
|
|
332
522
|
disclosedContracts,
|
|
333
523
|
];
|
|
334
524
|
}
|
|
525
|
+
async selfGrantFeatureAppRight(providerPartyId, synchronizerId) {
|
|
526
|
+
const amuletRules = await this.scanProxyClient.getAmuletRules();
|
|
527
|
+
const disclosedContracts = {
|
|
528
|
+
templateId: amuletRules.template_id,
|
|
529
|
+
contractId: amuletRules.contract_id,
|
|
530
|
+
createdEventBlob: amuletRules.created_event_blob,
|
|
531
|
+
synchronizerId: synchronizerId,
|
|
532
|
+
};
|
|
533
|
+
return [
|
|
534
|
+
{
|
|
535
|
+
templateId: amuletRules.template_id,
|
|
536
|
+
contractId: amuletRules.contract_id,
|
|
537
|
+
choice: 'AmuletRules_DevNet_FeatureApp',
|
|
538
|
+
choiceArgument: {
|
|
539
|
+
provider: providerPartyId,
|
|
540
|
+
},
|
|
541
|
+
},
|
|
542
|
+
[disclosedContracts],
|
|
543
|
+
];
|
|
544
|
+
}
|
|
545
|
+
async toPrettyTransactionsPerParty(updates, parties, ledgerClient) {
|
|
546
|
+
const all = await Promise.all(parties.map(async (partyId) => [
|
|
547
|
+
partyId,
|
|
548
|
+
await this.toPrettyTransactions(updates, partyId, ledgerClient),
|
|
549
|
+
]));
|
|
550
|
+
return new Map(all);
|
|
551
|
+
}
|
|
335
552
|
async toPrettyTransactions(updates, partyId, ledgerClient) {
|
|
336
553
|
// Runtime filters that also let TS know which of OneOfs types to check against
|
|
337
554
|
const isOffsetCheckpointUpdate = (updateResponse) => !!updateResponse?.update?.OffsetCheckpoint;
|
|
@@ -345,7 +562,7 @@ export class TokenStandardService {
|
|
|
345
562
|
.filter(isTransactionUpdate)
|
|
346
563
|
.map(async (update) => {
|
|
347
564
|
const tx = update.update.Transaction.value;
|
|
348
|
-
const parser = new TransactionParser(tx, ledgerClient, partyId);
|
|
565
|
+
const parser = new TransactionParser(tx, ledgerClient, partyId, this.isMasterUser);
|
|
349
566
|
return await parser.parseTransaction();
|
|
350
567
|
}));
|
|
351
568
|
return {
|
|
@@ -358,7 +575,7 @@ export class TokenStandardService {
|
|
|
358
575
|
}
|
|
359
576
|
async toPrettyTransaction(getTransactionResponse, partyId, ledgerClient) {
|
|
360
577
|
const tx = getTransactionResponse.transaction;
|
|
361
|
-
const parser = new TransactionParser(tx, ledgerClient, partyId);
|
|
578
|
+
const parser = new TransactionParser(tx, ledgerClient, partyId, this.isMasterUser);
|
|
362
579
|
const parsedTx = await parser.parseTransaction();
|
|
363
580
|
return renderTransaction(parsedTx);
|
|
364
581
|
}
|
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
import { LedgerClient } from './ledger-client.js';
|
|
2
|
-
import { SigningPublicKey, Enums_ParticipantPermission, SignedTopologyTransaction, AuthorizeResponse, GenerateTransactionsResponse } from '@canton-network/core-ledger-proto';
|
|
3
2
|
import { PartyId } from '@canton-network/core-types';
|
|
3
|
+
import { SigningPublicKey, Enums_ParticipantPermission, SignedTopologyTransaction, AuthorizeResponse, GenerateTransactionsResponse } from '@canton-network/core-ledger-proto';
|
|
4
4
|
export declare class TopologyWriteService {
|
|
5
|
+
private synchronizerId;
|
|
5
6
|
private userAdminToken;
|
|
6
7
|
private topologyClient;
|
|
7
8
|
private topologyReadService;
|
|
8
9
|
private ledgerClient;
|
|
9
|
-
private
|
|
10
|
+
private storeId;
|
|
10
11
|
constructor(synchronizerId: string, userAdminUrl: string, userAdminToken: string, ledgerClient: LedgerClient);
|
|
11
12
|
static combineHashes(hashes: Buffer[]): string;
|
|
12
|
-
static createFingerprintFromKey
|
|
13
|
+
static createFingerprintFromKey(publicKey: string): string;
|
|
14
|
+
/** @deprecated using the protobuf publickey is no longer supported -- use the string parameter instead */
|
|
15
|
+
static createFingerprintFromKey(publicKey: SigningPublicKey): string;
|
|
16
|
+
/** @deprecated using the protobuf publickey is no longer supported -- use the string parameter instead */
|
|
17
|
+
static createFingerprintFromKey(publicKey: SigningPublicKey | string): string;
|
|
18
|
+
/** @deprecated only for grpc/protobuf implementation */
|
|
13
19
|
static toSignedTopologyTransaction(txHashes: Buffer<ArrayBuffer>[], serializedTransaction: Uint8Array<ArrayBufferLike>, signature: string, namespace: string): SignedTopologyTransaction;
|
|
20
|
+
/** @deprecated */
|
|
14
21
|
private generateTransactionsRequest;
|
|
22
|
+
/** @deprecated use allocateExternalParty() instead */
|
|
15
23
|
submitExternalPartyTopology(signedTopologyTxs: SignedTopologyTransaction[], partyId: PartyId): Promise<void>;
|
|
24
|
+
/** @deprecated use generateTopology() */
|
|
16
25
|
generateTransactions(publicKey: string, partyId: PartyId, confirmingThreshold?: number, hostingParticipantRights?: Map<string, Enums_ParticipantPermission>): Promise<GenerateTransactionsResponse>;
|
|
26
|
+
/** @deprecated */
|
|
17
27
|
private addTransactions;
|
|
28
|
+
/** @deprecated */
|
|
18
29
|
waitForPartyToParticipantProposal(partyId: PartyId): Promise<Uint8Array | undefined>;
|
|
30
|
+
/** @deprecated */
|
|
19
31
|
authorizePartyToParticipant(partyId: PartyId): Promise<AuthorizeResponse>;
|
|
20
32
|
}
|
|
21
33
|
//# sourceMappingURL=topology-write-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topology-write-service.d.ts","sourceRoot":"","sources":["../src/topology-write-service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"topology-write-service.d.ts","sourceRoot":"","sources":["../src/topology-write-service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAIH,gBAAgB,EAOhB,2BAA2B,EAM3B,yBAAyB,EAMzB,iBAAiB,EAGjB,4BAA4B,EAK/B,MAAM,mCAAmC,CAAA;AAiC1C,qBAAa,oBAAoB;IAgBzB,OAAO,CAAC,cAAc;IAEtB,OAAO,CAAC,cAAc;IAjB1B,OAAO,CAAC,cAAc,CAAmC;IACzD,OAAO,CAAC,mBAAmB,CAAkC;IAC7D,OAAO,CAAC,YAAY,CAAc;IAElC,OAAO,CAAC,OAAO,CAQT;gBAGM,cAAc,EAAE,MAAM,EAC9B,YAAY,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EAC9B,YAAY,EAAE,YAAY;IAc9B,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM;IAgC9C,MAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAC1D,0GAA0G;IAC1G,MAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM;IACpE,0GAA0G;IAC1G,MAAM,CAAC,wBAAwB,CAC3B,SAAS,EAAE,gBAAgB,GAAG,MAAM,GACrC,MAAM;IAoBT,wDAAwD;IACxD,MAAM,CAAC,2BAA2B,CAC9B,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,EAC/B,qBAAqB,EAAE,UAAU,CAAC,eAAe,CAAC,EAClD,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAClB,yBAAyB;IAqB5B,kBAAkB;IAClB,OAAO,CAAC,2BAA2B;IAoEnC,sDAAsD;IAChD,2BAA2B,CAC7B,iBAAiB,EAAE,yBAAyB,EAAE,EAC9C,OAAO,EAAE,OAAO;IAMpB,yCAAyC;IACnC,oBAAoB,CACtB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAChB,mBAAmB,GAAE,MAAU,EAC/B,wBAAwB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,2BAA2B,CAAC,GACpE,OAAO,CAAC,4BAA4B,CAAC;IAkCxC,kBAAkB;YACJ,eAAe;IAgB7B,kBAAkB;IACZ,iCAAiC,CACnC,OAAO,EAAE,OAAO,GACjB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAiClC,kBAAkB;IACZ,2BAA2B,CAC7B,OAAO,EAAE,OAAO,GACjB,OAAO,CAAC,iBAAiB,CAAC;CAqBhC"}
|