@bitgo-beta/sdk-coin-canton 1.0.0-alpha.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/LICENSE +191 -0
- package/README.md +30 -0
- package/dist/resources/hash/hash.d.ts +5 -0
- package/dist/resources/hash/hash.js +297 -0
- package/dist/resources/proto/damlTransaction.js +100 -0
- package/dist/resources/proto/damlTransactionNode.js +71 -0
- package/dist/resources/proto/damlTransactionNodeSeed.js +56 -0
- package/dist/resources/proto/metadata/metadataGlobalKeyMappingEntry.js +53 -0
- package/dist/resources/proto/metadata/metadataInputContract.js +80 -0
- package/dist/resources/proto/metadata/metadataSubmitterInfo.js +62 -0
- package/dist/resources/proto/metadata.js +189 -0
- package/dist/resources/proto/node/empty.js +36 -0
- package/dist/resources/proto/node/globalKey.js +81 -0
- package/dist/resources/proto/node/identifier.js +73 -0
- package/dist/resources/proto/node/node.js +656 -0
- package/dist/resources/proto/node/timestamp.js +145 -0
- package/dist/resources/proto/node/value.js +824 -0
- package/dist/resources/proto/preparedTransaction.d.ts +8 -0
- package/dist/resources/proto/preparedTransaction.js +66 -0
- package/dist/src/canton.d.ts +37 -0
- package/dist/src/canton.d.ts.map +1 -0
- package/dist/src/canton.js +94 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +20 -0
- package/dist/src/lib/constant.d.ts +12 -0
- package/dist/src/lib/constant.d.ts.map +1 -0
- package/dist/src/lib/constant.js +15 -0
- package/dist/src/lib/iface.d.ts +58 -0
- package/dist/src/lib/iface.d.ts.map +1 -0
- package/dist/src/lib/iface.js +3 -0
- package/dist/src/lib/index.d.ts +8 -0
- package/dist/src/lib/index.d.ts.map +1 -0
- package/dist/src/lib/index.js +49 -0
- package/dist/src/lib/keyPair.d.ts +18 -0
- package/dist/src/lib/keyPair.d.ts.map +1 -0
- package/dist/src/lib/keyPair.js +44 -0
- package/dist/src/lib/oneStepPreApprovalBuilder.d.ts +49 -0
- package/dist/src/lib/oneStepPreApprovalBuilder.d.ts.map +1 -0
- package/dist/src/lib/oneStepPreApprovalBuilder.js +87 -0
- package/dist/src/lib/resourcesInterface.d.ts +214 -0
- package/dist/src/lib/resourcesInterface.d.ts.map +1 -0
- package/dist/src/lib/resourcesInterface.js +3 -0
- package/dist/src/lib/transaction/transaction.d.ts +18 -0
- package/dist/src/lib/transaction/transaction.d.ts.map +1 -0
- package/dist/src/lib/transaction/transaction.js +79 -0
- package/dist/src/lib/transactionBuilder.d.ts +36 -0
- package/dist/src/lib/transactionBuilder.d.ts.map +1 -0
- package/dist/src/lib/transactionBuilder.js +86 -0
- package/dist/src/lib/transactionBuilderFactory.d.ts +12 -0
- package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -0
- package/dist/src/lib/transactionBuilderFactory.js +20 -0
- package/dist/src/lib/transferBuilder.d.ts +10 -0
- package/dist/src/lib/transferBuilder.d.ts.map +1 -0
- package/dist/src/lib/transferBuilder.js +18 -0
- package/dist/src/lib/utils.d.ts +107 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +243 -0
- package/dist/src/lib/walletInitBuilder.d.ts +98 -0
- package/dist/src/lib/walletInitBuilder.d.ts.map +1 -0
- package/dist/src/lib/walletInitBuilder.js +223 -0
- package/dist/src/lib/walletInitialization/walletInitTransaction.d.ts +16 -0
- package/dist/src/lib/walletInitialization/walletInitTransaction.d.ts.map +1 -0
- package/dist/src/lib/walletInitialization/walletInitTransaction.js +59 -0
- package/dist/src/register.d.ts +3 -0
- package/dist/src/register.d.ts.map +1 -0
- package/dist/src/register.js +11 -0
- package/dist/src/tcanton.d.ts +17 -0
- package/dist/src/tcanton.d.ts.map +1 -0
- package/dist/src/tcanton.js +30 -0
- package/dist/test/integration/index.d.ts +1 -0
- package/dist/test/integration/index.d.ts.map +1 -0
- package/dist/test/integration/index.js +1 -0
- package/dist/test/resources.d.ts +40 -0
- package/dist/test/resources.d.ts.map +1 -0
- package/dist/test/resources.js +53 -0
- package/dist/test/unit/builder/oneStepEnablement/oneStepEnablementBuilder.d.ts +2 -0
- package/dist/test/unit/builder/oneStepEnablement/oneStepEnablementBuilder.d.ts.map +1 -0
- package/dist/test/unit/builder/oneStepEnablement/oneStepEnablementBuilder.js +67 -0
- package/dist/test/unit/builder/walletInit/walletInitBuilder.d.ts +2 -0
- package/dist/test/unit/builder/walletInit/walletInitBuilder.d.ts.map +1 -0
- package/dist/test/unit/builder/walletInit/walletInitBuilder.js +66 -0
- package/dist/test/unit/index.d.ts +2 -0
- package/dist/test/unit/index.d.ts.map +1 -0
- package/dist/test/unit/index.js +16 -0
- package/dist/test/unit/keyPair.d.ts +2 -0
- package/dist/test/unit/keyPair.d.ts.map +1 -0
- package/dist/test/unit/keyPair.js +72 -0
- package/dist/test/unit/utils.d.ts +2 -0
- package/dist/test/unit/utils.d.ts.map +1 -0
- package/dist/test/unit/utils.js +35 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { MessageType, UnknownFieldHandler, reflectionMergePartial, WireType } from '@protobuf-ts/runtime';
|
|
2
|
+
import { Node } from './node/node.js';
|
|
3
|
+
|
|
4
|
+
class DamlTransaction_Node$Type extends MessageType {
|
|
5
|
+
constructor() {
|
|
6
|
+
super('com.daml.ledger.api.v2.interactive.DamlTransaction.Node', [
|
|
7
|
+
{
|
|
8
|
+
no: 1,
|
|
9
|
+
name: 'node_id',
|
|
10
|
+
kind: 'scalar',
|
|
11
|
+
T: 9 /*ScalarType.STRING*/,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
no: 1000,
|
|
15
|
+
name: 'v1',
|
|
16
|
+
kind: 'message',
|
|
17
|
+
oneof: 'versionedNode',
|
|
18
|
+
T: () => Node,
|
|
19
|
+
},
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
create(value) {
|
|
23
|
+
const message = Object.create(this.messagePrototype);
|
|
24
|
+
message.nodeId = '';
|
|
25
|
+
message.versionedNode = { oneofKind: undefined };
|
|
26
|
+
if (value !== undefined) reflectionMergePartial(this, message, value);
|
|
27
|
+
return message;
|
|
28
|
+
}
|
|
29
|
+
internalBinaryRead(reader, length, options, target) {
|
|
30
|
+
const message = target ?? this.create(),
|
|
31
|
+
end = reader.pos + length;
|
|
32
|
+
while (reader.pos < end) {
|
|
33
|
+
const [fieldNo, wireType] = reader.tag();
|
|
34
|
+
switch (fieldNo) {
|
|
35
|
+
case /* string node_id */ 1:
|
|
36
|
+
message.nodeId = reader.string();
|
|
37
|
+
break;
|
|
38
|
+
case /* com.daml.ledger.api.v2.interactive.transaction.v1.Node v1 */ 1000:
|
|
39
|
+
message.versionedNode = {
|
|
40
|
+
oneofKind: 'v1',
|
|
41
|
+
v1: Node.internalBinaryRead(reader, reader.uint32(), options, message.versionedNode.v1),
|
|
42
|
+
};
|
|
43
|
+
break;
|
|
44
|
+
default:
|
|
45
|
+
const u = options.readUnknownField;
|
|
46
|
+
if (u === 'throw') throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
47
|
+
const d = reader.skip(wireType);
|
|
48
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return message;
|
|
52
|
+
}
|
|
53
|
+
internalBinaryWrite(message, writer, options) {
|
|
54
|
+
/* string node_id = 1; */
|
|
55
|
+
if (message.nodeId !== '') writer.tag(1, WireType.LengthDelimited).string(message.nodeId);
|
|
56
|
+
/* com.daml.ledger.api.v2.interactive.transaction.v1.Node v1 = 1000; */
|
|
57
|
+
if (message.versionedNode.oneofKind === 'v1')
|
|
58
|
+
Node.internalBinaryWrite(
|
|
59
|
+
message.versionedNode.v1,
|
|
60
|
+
writer.tag(1000, WireType.LengthDelimited).fork(),
|
|
61
|
+
options
|
|
62
|
+
).join();
|
|
63
|
+
const u = options.writeUnknownFields;
|
|
64
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
65
|
+
return writer;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @generated MessageType for protobuf message com.daml.ledger.api.v2.interactive.DamlTransaction.Node
|
|
70
|
+
*/
|
|
71
|
+
export const DamlTransaction_Node = new DamlTransaction_Node$Type();
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { MessageType, UnknownFieldHandler, reflectionMergePartial, WireType } from '@protobuf-ts/runtime';
|
|
2
|
+
|
|
3
|
+
class DamlTransaction_NodeSeed$Type extends MessageType {
|
|
4
|
+
constructor() {
|
|
5
|
+
super('com.daml.ledger.api.v2.interactive.DamlTransaction.NodeSeed', [
|
|
6
|
+
{
|
|
7
|
+
no: 1,
|
|
8
|
+
name: 'node_id',
|
|
9
|
+
kind: 'scalar',
|
|
10
|
+
T: 5 /*ScalarType.INT32*/,
|
|
11
|
+
},
|
|
12
|
+
{ no: 2, name: 'seed', kind: 'scalar', T: 12 /*ScalarType.BYTES*/ },
|
|
13
|
+
]);
|
|
14
|
+
}
|
|
15
|
+
create(value) {
|
|
16
|
+
const message = Object.create(this.messagePrototype);
|
|
17
|
+
message.nodeId = 0;
|
|
18
|
+
message.seed = new Uint8Array(0);
|
|
19
|
+
if (value !== undefined) reflectionMergePartial(this, message, value);
|
|
20
|
+
return message;
|
|
21
|
+
}
|
|
22
|
+
internalBinaryRead(reader, length, options, target) {
|
|
23
|
+
const message = target ?? this.create(),
|
|
24
|
+
end = reader.pos + length;
|
|
25
|
+
while (reader.pos < end) {
|
|
26
|
+
const [fieldNo, wireType] = reader.tag();
|
|
27
|
+
switch (fieldNo) {
|
|
28
|
+
case /* int32 node_id */ 1:
|
|
29
|
+
message.nodeId = reader.int32();
|
|
30
|
+
break;
|
|
31
|
+
case /* bytes seed */ 2:
|
|
32
|
+
message.seed = reader.bytes();
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
const u = options.readUnknownField;
|
|
36
|
+
if (u === 'throw') throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
37
|
+
const d = reader.skip(wireType);
|
|
38
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return message;
|
|
42
|
+
}
|
|
43
|
+
internalBinaryWrite(message, writer, options) {
|
|
44
|
+
/* int32 node_id = 1; */
|
|
45
|
+
if (message.nodeId !== 0) writer.tag(1, WireType.Varint).int32(message.nodeId);
|
|
46
|
+
/* bytes seed = 2; */
|
|
47
|
+
if (message.seed.length) writer.tag(2, WireType.LengthDelimited).bytes(message.seed);
|
|
48
|
+
const u = options.writeUnknownFields;
|
|
49
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
50
|
+
return writer;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @generated MessageType for protobuf message com.daml.ledger.api.v2.interactive.DamlTransaction.NodeSeed
|
|
55
|
+
*/
|
|
56
|
+
export const DamlTransaction_NodeSeed = new DamlTransaction_NodeSeed$Type();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { MessageType, UnknownFieldHandler, reflectionMergePartial, WireType } from '@protobuf-ts/runtime';
|
|
2
|
+
import { Value } from '../node/value.js';
|
|
3
|
+
import { GlobalKey } from '../node/globalKey.js';
|
|
4
|
+
|
|
5
|
+
class Metadata_GlobalKeyMappingEntry$Type extends MessageType {
|
|
6
|
+
constructor() {
|
|
7
|
+
super('com.daml.ledger.api.v2.interactive.Metadata.GlobalKeyMappingEntry', [
|
|
8
|
+
{ no: 1, name: 'key', kind: 'message', T: () => GlobalKey },
|
|
9
|
+
{ no: 2, name: 'value', kind: 'message', T: () => Value },
|
|
10
|
+
]);
|
|
11
|
+
}
|
|
12
|
+
create(value) {
|
|
13
|
+
const message = Object.create(this.messagePrototype);
|
|
14
|
+
if (value !== undefined) reflectionMergePartial(this, message, value);
|
|
15
|
+
return message;
|
|
16
|
+
}
|
|
17
|
+
internalBinaryRead(reader, length, options, target) {
|
|
18
|
+
const message = target ?? this.create(),
|
|
19
|
+
end = reader.pos + length;
|
|
20
|
+
while (reader.pos < end) {
|
|
21
|
+
const [fieldNo, wireType] = reader.tag();
|
|
22
|
+
switch (fieldNo) {
|
|
23
|
+
case /* com.daml.ledger.api.v2.interactive.GlobalKey key */ 1:
|
|
24
|
+
message.key = GlobalKey.internalBinaryRead(reader, reader.uint32(), options, message.key);
|
|
25
|
+
break;
|
|
26
|
+
case /* optional com.daml.ledger.api.v2.Value value */ 2:
|
|
27
|
+
message.value = Value.internalBinaryRead(reader, reader.uint32(), options, message.value);
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
const u = options.readUnknownField;
|
|
31
|
+
if (u === 'throw') throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
32
|
+
const d = reader.skip(wireType);
|
|
33
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return message;
|
|
37
|
+
}
|
|
38
|
+
internalBinaryWrite(message, writer, options) {
|
|
39
|
+
/* com.daml.ledger.api.v2.interactive.GlobalKey key = 1; */
|
|
40
|
+
if (message.key)
|
|
41
|
+
GlobalKey.internalBinaryWrite(message.key, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
42
|
+
/* optional com.daml.ledger.api.v2.Value value = 2; */
|
|
43
|
+
if (message.value)
|
|
44
|
+
Value.internalBinaryWrite(message.value, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
45
|
+
const u = options.writeUnknownFields;
|
|
46
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
47
|
+
return writer;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @generated MessageType for protobuf message com.daml.ledger.api.v2.interactive.Metadata.GlobalKeyMappingEntry
|
|
52
|
+
*/
|
|
53
|
+
export const Metadata_GlobalKeyMappingEntry = new Metadata_GlobalKeyMappingEntry$Type();
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { MessageType, UnknownFieldHandler, reflectionMergePartial, WireType } from '@protobuf-ts/runtime';
|
|
2
|
+
import { Create } from '../node/node.js';
|
|
3
|
+
|
|
4
|
+
class Metadata_InputContract$Type extends MessageType {
|
|
5
|
+
constructor() {
|
|
6
|
+
super('com.daml.ledger.api.v2.interactive.Metadata.InputContract', [
|
|
7
|
+
{
|
|
8
|
+
no: 1,
|
|
9
|
+
name: 'v1',
|
|
10
|
+
kind: 'message',
|
|
11
|
+
oneof: 'contract',
|
|
12
|
+
T: () => Create,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
no: 1000,
|
|
16
|
+
name: 'created_at',
|
|
17
|
+
kind: 'scalar',
|
|
18
|
+
T: 4 /*ScalarType.UINT64*/,
|
|
19
|
+
L: 0 /*LongType.BIGINT*/,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
no: 1002,
|
|
23
|
+
name: 'event_blob',
|
|
24
|
+
kind: 'scalar',
|
|
25
|
+
T: 12 /*ScalarType.BYTES*/,
|
|
26
|
+
},
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
create(value) {
|
|
30
|
+
const message = Object.create(this.messagePrototype);
|
|
31
|
+
message.contract = { oneofKind: undefined };
|
|
32
|
+
message.createdAt = 0n;
|
|
33
|
+
message.eventBlob = new Uint8Array(0);
|
|
34
|
+
if (value !== undefined) reflectionMergePartial(this, message, value);
|
|
35
|
+
return message;
|
|
36
|
+
}
|
|
37
|
+
internalBinaryRead(reader, length, options, target) {
|
|
38
|
+
const message = target ?? this.create(),
|
|
39
|
+
end = reader.pos + length;
|
|
40
|
+
while (reader.pos < end) {
|
|
41
|
+
const [fieldNo, wireType] = reader.tag();
|
|
42
|
+
switch (fieldNo) {
|
|
43
|
+
case /* com.daml.ledger.api.v2.interactive.transaction.v1.Create v1 */ 1:
|
|
44
|
+
message.contract = {
|
|
45
|
+
oneofKind: 'v1',
|
|
46
|
+
v1: Create.internalBinaryRead(reader, reader.uint32(), options, message.contract.v1),
|
|
47
|
+
};
|
|
48
|
+
break;
|
|
49
|
+
case /* uint64 created_at */ 1000:
|
|
50
|
+
message.createdAt = reader.uint64().toBigInt();
|
|
51
|
+
break;
|
|
52
|
+
case /* bytes event_blob */ 1002:
|
|
53
|
+
message.eventBlob = reader.bytes();
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
const u = options.readUnknownField;
|
|
57
|
+
if (u === 'throw') throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
58
|
+
const d = reader.skip(wireType);
|
|
59
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return message;
|
|
63
|
+
}
|
|
64
|
+
internalBinaryWrite(message, writer, options) {
|
|
65
|
+
/* com.daml.ledger.api.v2.interactive.transaction.v1.Create v1 = 1; */
|
|
66
|
+
if (message.contract.oneofKind === 'v1')
|
|
67
|
+
Create.internalBinaryWrite(message.contract.v1, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
68
|
+
/* uint64 created_at = 1000; */
|
|
69
|
+
if (message.createdAt !== 0n) writer.tag(1000, WireType.Varint).uint64(message.createdAt);
|
|
70
|
+
/* bytes event_blob = 1002; */
|
|
71
|
+
if (message.eventBlob.length) writer.tag(1002, WireType.LengthDelimited).bytes(message.eventBlob);
|
|
72
|
+
const u = options.writeUnknownFields;
|
|
73
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
74
|
+
return writer;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @generated MessageType for protobuf message com.daml.ledger.api.v2.interactive.Metadata.InputContract
|
|
79
|
+
*/
|
|
80
|
+
export const Metadata_InputContract = new Metadata_InputContract$Type();
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { MessageType, UnknownFieldHandler, reflectionMergePartial, WireType } from '@protobuf-ts/runtime';
|
|
2
|
+
|
|
3
|
+
class Metadata_SubmitterInfo$Type extends MessageType {
|
|
4
|
+
constructor() {
|
|
5
|
+
super('com.daml.ledger.api.v2.interactive.Metadata.SubmitterInfo', [
|
|
6
|
+
{
|
|
7
|
+
no: 1,
|
|
8
|
+
name: 'act_as',
|
|
9
|
+
kind: 'scalar',
|
|
10
|
+
repeat: 2 /*RepeatType.UNPACKED*/,
|
|
11
|
+
T: 9 /*ScalarType.STRING*/,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
no: 2,
|
|
15
|
+
name: 'command_id',
|
|
16
|
+
kind: 'scalar',
|
|
17
|
+
T: 9 /*ScalarType.STRING*/,
|
|
18
|
+
},
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
create(value) {
|
|
22
|
+
const message = Object.create(this.messagePrototype);
|
|
23
|
+
message.actAs = [];
|
|
24
|
+
message.commandId = '';
|
|
25
|
+
if (value !== undefined) reflectionMergePartial(this, message, value);
|
|
26
|
+
return message;
|
|
27
|
+
}
|
|
28
|
+
internalBinaryRead(reader, length, options, target) {
|
|
29
|
+
const message = target ?? this.create(),
|
|
30
|
+
end = reader.pos + length;
|
|
31
|
+
while (reader.pos < end) {
|
|
32
|
+
const [fieldNo, wireType] = reader.tag();
|
|
33
|
+
switch (fieldNo) {
|
|
34
|
+
case /* repeated string act_as */ 1:
|
|
35
|
+
message.actAs.push(reader.string());
|
|
36
|
+
break;
|
|
37
|
+
case /* string command_id */ 2:
|
|
38
|
+
message.commandId = reader.string();
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
const u = options.readUnknownField;
|
|
42
|
+
if (u === 'throw') throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
43
|
+
const d = reader.skip(wireType);
|
|
44
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return message;
|
|
48
|
+
}
|
|
49
|
+
internalBinaryWrite(message, writer, options) {
|
|
50
|
+
/* repeated string act_as = 1; */
|
|
51
|
+
for (let i = 0; i < message.actAs.length; i++) writer.tag(1, WireType.LengthDelimited).string(message.actAs[i]);
|
|
52
|
+
/* string command_id = 2; */
|
|
53
|
+
if (message.commandId !== '') writer.tag(2, WireType.LengthDelimited).string(message.commandId);
|
|
54
|
+
const u = options.writeUnknownFields;
|
|
55
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
56
|
+
return writer;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @generated MessageType for protobuf message com.daml.ledger.api.v2.interactive.Metadata.SubmitterInfo
|
|
61
|
+
*/
|
|
62
|
+
export const Metadata_SubmitterInfo = new Metadata_SubmitterInfo$Type();
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { MessageType, UnknownFieldHandler, reflectionMergePartial, WireType } from '@protobuf-ts/runtime';
|
|
2
|
+
import { Metadata_GlobalKeyMappingEntry } from './metadata/metadataGlobalKeyMappingEntry.js';
|
|
3
|
+
import { Metadata_InputContract } from './metadata/metadataInputContract.js';
|
|
4
|
+
import { Metadata_SubmitterInfo } from './metadata/metadataSubmitterInfo.js';
|
|
5
|
+
|
|
6
|
+
class Metadata$Type extends MessageType {
|
|
7
|
+
constructor() {
|
|
8
|
+
super('com.daml.ledger.api.v2.interactive.Metadata', [
|
|
9
|
+
{
|
|
10
|
+
no: 2,
|
|
11
|
+
name: 'submitter_info',
|
|
12
|
+
kind: 'message',
|
|
13
|
+
T: () => Metadata_SubmitterInfo,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
no: 3,
|
|
17
|
+
name: 'synchronizer_id',
|
|
18
|
+
kind: 'scalar',
|
|
19
|
+
T: 9 /*ScalarType.STRING*/,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
no: 4,
|
|
23
|
+
name: 'mediator_group',
|
|
24
|
+
kind: 'scalar',
|
|
25
|
+
T: 13 /*ScalarType.UINT32*/,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
no: 5,
|
|
29
|
+
name: 'transaction_uuid',
|
|
30
|
+
kind: 'scalar',
|
|
31
|
+
T: 9 /*ScalarType.STRING*/,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
no: 6,
|
|
35
|
+
name: 'preparation_time',
|
|
36
|
+
kind: 'scalar',
|
|
37
|
+
T: 4 /*ScalarType.UINT64*/,
|
|
38
|
+
L: 0 /*LongType.BIGINT*/,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
no: 7,
|
|
42
|
+
name: 'input_contracts',
|
|
43
|
+
kind: 'message',
|
|
44
|
+
repeat: 2 /*RepeatType.UNPACKED*/,
|
|
45
|
+
T: () => Metadata_InputContract,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
no: 9,
|
|
49
|
+
name: 'min_ledger_effective_time',
|
|
50
|
+
kind: 'scalar',
|
|
51
|
+
opt: true,
|
|
52
|
+
T: 4 /*ScalarType.UINT64*/,
|
|
53
|
+
L: 0 /*LongType.BIGINT*/,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
no: 10,
|
|
57
|
+
name: 'max_ledger_effective_time',
|
|
58
|
+
kind: 'scalar',
|
|
59
|
+
opt: true,
|
|
60
|
+
T: 4 /*ScalarType.UINT64*/,
|
|
61
|
+
L: 0 /*LongType.BIGINT*/,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
no: 8,
|
|
65
|
+
name: 'global_key_mapping',
|
|
66
|
+
kind: 'message',
|
|
67
|
+
repeat: 2 /*RepeatType.UNPACKED*/,
|
|
68
|
+
T: () => Metadata_GlobalKeyMappingEntry,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
no: 11,
|
|
72
|
+
name: 'max_record_time',
|
|
73
|
+
kind: 'scalar',
|
|
74
|
+
opt: true,
|
|
75
|
+
T: 4 /*ScalarType.UINT64*/,
|
|
76
|
+
L: 0 /*LongType.BIGINT*/,
|
|
77
|
+
},
|
|
78
|
+
]);
|
|
79
|
+
}
|
|
80
|
+
create(value) {
|
|
81
|
+
const message = Object.create(this.messagePrototype);
|
|
82
|
+
message.synchronizerId = '';
|
|
83
|
+
message.mediatorGroup = 0;
|
|
84
|
+
message.transactionUuid = '';
|
|
85
|
+
message.preparationTime = 0n;
|
|
86
|
+
message.inputContracts = [];
|
|
87
|
+
message.globalKeyMapping = [];
|
|
88
|
+
if (value !== undefined) reflectionMergePartial(this, message, value);
|
|
89
|
+
return message;
|
|
90
|
+
}
|
|
91
|
+
internalBinaryRead(reader, length, options, target) {
|
|
92
|
+
const message = target ?? this.create(),
|
|
93
|
+
end = reader.pos + length;
|
|
94
|
+
while (reader.pos < end) {
|
|
95
|
+
const [fieldNo, wireType] = reader.tag();
|
|
96
|
+
switch (fieldNo) {
|
|
97
|
+
case /* com.daml.ledger.api.v2.interactive.Metadata.SubmitterInfo submitter_info */ 2:
|
|
98
|
+
message.submitterInfo = Metadata_SubmitterInfo.internalBinaryRead(
|
|
99
|
+
reader,
|
|
100
|
+
reader.uint32(),
|
|
101
|
+
options,
|
|
102
|
+
message.submitterInfo
|
|
103
|
+
);
|
|
104
|
+
break;
|
|
105
|
+
case /* string synchronizer_id */ 3:
|
|
106
|
+
message.synchronizerId = reader.string();
|
|
107
|
+
break;
|
|
108
|
+
case /* uint32 mediator_group */ 4:
|
|
109
|
+
message.mediatorGroup = reader.uint32();
|
|
110
|
+
break;
|
|
111
|
+
case /* string transaction_uuid */ 5:
|
|
112
|
+
message.transactionUuid = reader.string();
|
|
113
|
+
break;
|
|
114
|
+
case /* uint64 preparation_time */ 6:
|
|
115
|
+
message.preparationTime = reader.uint64().toBigInt();
|
|
116
|
+
break;
|
|
117
|
+
case /* repeated com.daml.ledger.api.v2.interactive.Metadata.InputContract input_contracts */ 7:
|
|
118
|
+
message.inputContracts.push(Metadata_InputContract.internalBinaryRead(reader, reader.uint32(), options));
|
|
119
|
+
break;
|
|
120
|
+
case /* optional uint64 min_ledger_effective_time */ 9:
|
|
121
|
+
message.minLedgerEffectiveTime = reader.uint64().toBigInt();
|
|
122
|
+
break;
|
|
123
|
+
case /* optional uint64 max_ledger_effective_time */ 10:
|
|
124
|
+
message.maxLedgerEffectiveTime = reader.uint64().toBigInt();
|
|
125
|
+
break;
|
|
126
|
+
case /* repeated com.daml.ledger.api.v2.interactive.Metadata.GlobalKeyMappingEntry global_key_mapping */ 8:
|
|
127
|
+
message.globalKeyMapping.push(
|
|
128
|
+
Metadata_GlobalKeyMappingEntry.internalBinaryRead(reader, reader.uint32(), options)
|
|
129
|
+
);
|
|
130
|
+
break;
|
|
131
|
+
case /* optional uint64 max_record_time */ 11:
|
|
132
|
+
message.maxRecordTime = reader.uint64().toBigInt();
|
|
133
|
+
break;
|
|
134
|
+
default:
|
|
135
|
+
const u = options.readUnknownField;
|
|
136
|
+
if (u === 'throw') throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
137
|
+
const d = reader.skip(wireType);
|
|
138
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return message;
|
|
142
|
+
}
|
|
143
|
+
internalBinaryWrite(message, writer, options) {
|
|
144
|
+
/* com.daml.ledger.api.v2.interactive.Metadata.SubmitterInfo submitter_info = 2; */
|
|
145
|
+
if (message.submitterInfo)
|
|
146
|
+
Metadata_SubmitterInfo.internalBinaryWrite(
|
|
147
|
+
message.submitterInfo,
|
|
148
|
+
writer.tag(2, WireType.LengthDelimited).fork(),
|
|
149
|
+
options
|
|
150
|
+
).join();
|
|
151
|
+
/* string synchronizer_id = 3; */
|
|
152
|
+
if (message.synchronizerId !== '') writer.tag(3, WireType.LengthDelimited).string(message.synchronizerId);
|
|
153
|
+
/* uint32 mediator_group = 4; */
|
|
154
|
+
if (message.mediatorGroup !== 0) writer.tag(4, WireType.Varint).uint32(message.mediatorGroup);
|
|
155
|
+
/* string transaction_uuid = 5; */
|
|
156
|
+
if (message.transactionUuid !== '') writer.tag(5, WireType.LengthDelimited).string(message.transactionUuid);
|
|
157
|
+
/* uint64 preparation_time = 6; */
|
|
158
|
+
if (message.preparationTime !== 0n) writer.tag(6, WireType.Varint).uint64(message.preparationTime);
|
|
159
|
+
/* repeated com.daml.ledger.api.v2.interactive.Metadata.InputContract input_contracts = 7; */
|
|
160
|
+
for (let i = 0; i < message.inputContracts.length; i++)
|
|
161
|
+
Metadata_InputContract.internalBinaryWrite(
|
|
162
|
+
message.inputContracts[i],
|
|
163
|
+
writer.tag(7, WireType.LengthDelimited).fork(),
|
|
164
|
+
options
|
|
165
|
+
).join();
|
|
166
|
+
/* repeated com.daml.ledger.api.v2.interactive.Metadata.GlobalKeyMappingEntry global_key_mapping = 8; */
|
|
167
|
+
for (let i = 0; i < message.globalKeyMapping.length; i++)
|
|
168
|
+
Metadata_GlobalKeyMappingEntry.internalBinaryWrite(
|
|
169
|
+
message.globalKeyMapping[i],
|
|
170
|
+
writer.tag(8, WireType.LengthDelimited).fork(),
|
|
171
|
+
options
|
|
172
|
+
).join();
|
|
173
|
+
/* optional uint64 min_ledger_effective_time = 9; */
|
|
174
|
+
if (message.minLedgerEffectiveTime !== undefined)
|
|
175
|
+
writer.tag(9, WireType.Varint).uint64(message.minLedgerEffectiveTime);
|
|
176
|
+
/* optional uint64 max_ledger_effective_time = 10; */
|
|
177
|
+
if (message.maxLedgerEffectiveTime !== undefined)
|
|
178
|
+
writer.tag(10, WireType.Varint).uint64(message.maxLedgerEffectiveTime);
|
|
179
|
+
/* optional uint64 max_record_time = 11; */
|
|
180
|
+
if (message.maxRecordTime !== undefined) writer.tag(11, WireType.Varint).uint64(message.maxRecordTime);
|
|
181
|
+
const u = options.writeUnknownFields;
|
|
182
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
183
|
+
return writer;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* @generated MessageType for protobuf message com.daml.ledger.api.v2.interactive.Metadata
|
|
188
|
+
*/
|
|
189
|
+
export const Metadata = new Metadata$Type();
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MessageType, UnknownFieldHandler, reflectionMergePartial } from '@protobuf-ts/runtime';
|
|
2
|
+
|
|
3
|
+
class Empty$Type extends MessageType {
|
|
4
|
+
constructor() {
|
|
5
|
+
super('google.protobuf.Empty', []);
|
|
6
|
+
}
|
|
7
|
+
create(value) {
|
|
8
|
+
const message = Object.create(this.messagePrototype);
|
|
9
|
+
if (value !== undefined) reflectionMergePartial(this, message, value);
|
|
10
|
+
return message;
|
|
11
|
+
}
|
|
12
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13
|
+
const message = target ?? this.create(),
|
|
14
|
+
end = reader.pos + length;
|
|
15
|
+
while (reader.pos < end) {
|
|
16
|
+
const [fieldNo, wireType] = reader.tag();
|
|
17
|
+
switch (fieldNo) {
|
|
18
|
+
default:
|
|
19
|
+
const u = options.readUnknownField;
|
|
20
|
+
if (u === 'throw') throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
21
|
+
const d = reader.skip(wireType);
|
|
22
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return message;
|
|
26
|
+
}
|
|
27
|
+
internalBinaryWrite(message, writer, options) {
|
|
28
|
+
const u = options.writeUnknownFields;
|
|
29
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
30
|
+
return writer;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @generated MessageType for protobuf message google.protobuf.Empty
|
|
35
|
+
*/
|
|
36
|
+
export const Empty = new Empty$Type();
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { MessageType, reflectionMergePartial, UnknownFieldHandler, WireType } from '@protobuf-ts/runtime';
|
|
2
|
+
import { Value } from './value.js';
|
|
3
|
+
import { Identifier } from './identifier.js';
|
|
4
|
+
|
|
5
|
+
class GlobalKey$Type extends MessageType {
|
|
6
|
+
constructor() {
|
|
7
|
+
super('com.daml.ledger.api.v2.interactive.GlobalKey', [
|
|
8
|
+
{
|
|
9
|
+
no: 1,
|
|
10
|
+
name: 'template_id',
|
|
11
|
+
kind: 'message',
|
|
12
|
+
T: () => Identifier,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
no: 2,
|
|
16
|
+
name: 'package_name',
|
|
17
|
+
kind: 'scalar',
|
|
18
|
+
T: 9 /*ScalarType.STRING*/,
|
|
19
|
+
},
|
|
20
|
+
{ no: 3, name: 'key', kind: 'message', T: () => Value },
|
|
21
|
+
{ no: 4, name: 'hash', kind: 'scalar', T: 12 /*ScalarType.BYTES*/ },
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
create(value) {
|
|
25
|
+
const message = Object.create(this.messagePrototype);
|
|
26
|
+
message.packageName = '';
|
|
27
|
+
message.hash = new Uint8Array(0);
|
|
28
|
+
if (value !== undefined) reflectionMergePartial(this, message, value);
|
|
29
|
+
return message;
|
|
30
|
+
}
|
|
31
|
+
internalBinaryRead(reader, length, options, target) {
|
|
32
|
+
const message = target ?? this.create(),
|
|
33
|
+
end = reader.pos + length;
|
|
34
|
+
while (reader.pos < end) {
|
|
35
|
+
const [fieldNo, wireType] = reader.tag();
|
|
36
|
+
switch (fieldNo) {
|
|
37
|
+
case /* com.daml.ledger.api.v2.Identifier template_id */ 1:
|
|
38
|
+
message.templateId = Identifier.internalBinaryRead(reader, reader.uint32(), options, message.templateId);
|
|
39
|
+
break;
|
|
40
|
+
case /* string package_name */ 2:
|
|
41
|
+
message.packageName = reader.string();
|
|
42
|
+
break;
|
|
43
|
+
case /* com.daml.ledger.api.v2.Value key */ 3:
|
|
44
|
+
message.key = Value.internalBinaryRead(reader, reader.uint32(), options, message.key);
|
|
45
|
+
break;
|
|
46
|
+
case /* bytes hash */ 4:
|
|
47
|
+
message.hash = reader.bytes();
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
const u = options.readUnknownField;
|
|
51
|
+
if (u === 'throw') throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
52
|
+
const d = reader.skip(wireType);
|
|
53
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return message;
|
|
57
|
+
}
|
|
58
|
+
internalBinaryWrite(message, writer, options) {
|
|
59
|
+
/* com.daml.ledger.api.v2.Identifier template_id = 1; */
|
|
60
|
+
if (message.templateId)
|
|
61
|
+
Identifier.internalBinaryWrite(
|
|
62
|
+
message.templateId,
|
|
63
|
+
writer.tag(1, WireType.LengthDelimited).fork(),
|
|
64
|
+
options
|
|
65
|
+
).join();
|
|
66
|
+
/* string package_name = 2; */
|
|
67
|
+
if (message.packageName !== '') writer.tag(2, WireType.LengthDelimited).string(message.packageName);
|
|
68
|
+
/* com.daml.ledger.api.v2.Value key = 3; */
|
|
69
|
+
if (message.key)
|
|
70
|
+
Value.internalBinaryWrite(message.key, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
|
71
|
+
/* bytes hash = 4; */
|
|
72
|
+
if (message.hash.length) writer.tag(4, WireType.LengthDelimited).bytes(message.hash);
|
|
73
|
+
const u = options.writeUnknownFields;
|
|
74
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
75
|
+
return writer;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @generated MessageType for protobuf message com.daml.ledger.api.v2.interactive.GlobalKey
|
|
80
|
+
*/
|
|
81
|
+
export const GlobalKey = new GlobalKey$Type();
|