@ledgerhq/coin-canton 0.5.0-nightly.3 → 0.5.0-nightly.5
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +24 -0
- package/lib/api/getBalance.integ.test.js +8 -4
- package/lib/api/getBalance.integ.test.js.map +1 -1
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.js +20 -28
- package/lib/api/index.js.map +1 -1
- package/lib/api/lastBlock.integ.test.js +1 -1
- package/lib/api/lastBlock.integ.test.js.map +1 -1
- package/lib/api/listOperations.integ.test.js +1 -1
- package/lib/api/listOperations.integ.test.js.map +1 -1
- package/lib/bridge/broadcast.d.ts.map +1 -1
- package/lib/bridge/broadcast.js +2 -2
- package/lib/bridge/broadcast.js.map +1 -1
- package/lib/bridge/broadcast.test.js +9 -0
- package/lib/bridge/broadcast.test.js.map +1 -1
- package/lib/bridge/createTransaction.js +1 -1
- package/lib/bridge/createTransaction.js.map +1 -1
- package/lib/bridge/getTransactionStatus.js +1 -1
- package/lib/bridge/getTransactionStatus.js.map +1 -1
- package/lib/bridge/index.d.ts.map +1 -1
- package/lib/bridge/index.js +3 -0
- package/lib/bridge/index.js.map +1 -1
- package/lib/bridge/onboard.d.ts +7 -5
- package/lib/bridge/onboard.d.ts.map +1 -1
- package/lib/bridge/onboard.integ.test.js +13 -10
- package/lib/bridge/onboard.integ.test.js.map +1 -1
- package/lib/bridge/onboard.js +110 -42
- package/lib/bridge/onboard.js.map +1 -1
- package/lib/bridge/prepareTransaction.js +1 -1
- package/lib/bridge/prepareTransaction.js.map +1 -1
- package/lib/bridge/serialization.d.ts +4 -0
- package/lib/bridge/serialization.d.ts.map +1 -0
- package/lib/bridge/serialization.js +31 -0
- package/lib/bridge/serialization.js.map +1 -0
- package/lib/bridge/signOperation.d.ts.map +1 -1
- package/lib/bridge/signOperation.js +10 -5
- package/lib/bridge/signOperation.js.map +1 -1
- package/lib/bridge/sync.d.ts +2 -1
- package/lib/bridge/sync.d.ts.map +1 -1
- package/lib/bridge/sync.integ.test.js +2 -2
- package/lib/bridge/sync.integ.test.js.map +1 -1
- package/lib/bridge/sync.js +33 -20
- package/lib/bridge/sync.js.map +1 -1
- package/lib/common-logic/account/getBalance.d.ts +2 -1
- package/lib/common-logic/account/getBalance.d.ts.map +1 -1
- package/lib/common-logic/account/getBalance.js +7 -7
- package/lib/common-logic/account/getBalance.js.map +1 -1
- package/lib/common-logic/account/getBalance.unit.test.js +6 -3
- package/lib/common-logic/account/getBalance.unit.test.js.map +1 -1
- package/lib/common-logic/history/lastBlock.d.ts +2 -1
- package/lib/common-logic/history/lastBlock.d.ts.map +1 -1
- package/lib/common-logic/history/lastBlock.js +3 -3
- package/lib/common-logic/history/lastBlock.js.map +1 -1
- package/lib/common-logic/history/lastBlock.test.js +5 -2
- package/lib/common-logic/history/lastBlock.test.js.map +1 -1
- package/lib/common-logic/history/listOperations.d.ts +2 -1
- package/lib/common-logic/history/listOperations.d.ts.map +1 -1
- package/lib/common-logic/history/listOperations.js +2 -2
- package/lib/common-logic/history/listOperations.js.map +1 -1
- package/lib/common-logic/transaction/broadcast.d.ts +2 -1
- package/lib/common-logic/transaction/broadcast.d.ts.map +1 -1
- package/lib/common-logic/transaction/broadcast.js +4 -4
- package/lib/common-logic/transaction/broadcast.js.map +1 -1
- package/lib/common-logic/transaction/broadcast.test.js +6 -3
- package/lib/common-logic/transaction/broadcast.test.js.map +1 -1
- package/lib/common-logic/transaction/craftTransaction.d.ts +3 -1
- package/lib/common-logic/transaction/craftTransaction.d.ts.map +1 -1
- package/lib/common-logic/transaction/craftTransaction.js +8 -4
- package/lib/common-logic/transaction/craftTransaction.js.map +1 -1
- package/lib/common-logic/transaction/estimateFees.d.ts +2 -1
- package/lib/common-logic/transaction/estimateFees.d.ts.map +1 -1
- package/lib/common-logic/transaction/estimateFees.js +7 -3
- package/lib/common-logic/transaction/estimateFees.js.map +1 -1
- package/lib/config.d.ts +1 -0
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js.map +1 -1
- package/lib/network/gateway.d.ts +28 -26
- package/lib/network/gateway.d.ts.map +1 -1
- package/lib/network/gateway.integ.test.js +19 -15
- package/lib/network/gateway.integ.test.js.map +1 -1
- package/lib/network/gateway.js +40 -33
- package/lib/network/gateway.js.map +1 -1
- package/lib/signer/getAddress.d.ts.map +1 -1
- package/lib/signer/getAddress.js +2 -2
- package/lib/signer/getAddress.js.map +1 -1
- package/lib/types/bridge.d.ts +18 -3
- package/lib/types/bridge.d.ts.map +1 -1
- package/lib/types/onboard.d.ts +2 -0
- package/lib/types/onboard.d.ts.map +1 -1
- package/lib/types/onboard.js.map +1 -1
- package/lib/types/signer.d.ts +2 -1
- package/lib/types/signer.d.ts.map +1 -1
- package/lib-es/api/getBalance.integ.test.js +8 -4
- package/lib-es/api/getBalance.integ.test.js.map +1 -1
- package/lib-es/api/index.d.ts.map +1 -1
- package/lib-es/api/index.js +19 -27
- package/lib-es/api/index.js.map +1 -1
- package/lib-es/api/lastBlock.integ.test.js +1 -1
- package/lib-es/api/lastBlock.integ.test.js.map +1 -1
- package/lib-es/api/listOperations.integ.test.js +1 -1
- package/lib-es/api/listOperations.integ.test.js.map +1 -1
- package/lib-es/bridge/broadcast.d.ts.map +1 -1
- package/lib-es/bridge/broadcast.js +2 -2
- package/lib-es/bridge/broadcast.js.map +1 -1
- package/lib-es/bridge/broadcast.test.js +9 -0
- package/lib-es/bridge/broadcast.test.js.map +1 -1
- package/lib-es/bridge/createTransaction.js +1 -1
- package/lib-es/bridge/createTransaction.js.map +1 -1
- package/lib-es/bridge/getTransactionStatus.js +1 -1
- package/lib-es/bridge/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/index.d.ts.map +1 -1
- package/lib-es/bridge/index.js +3 -0
- package/lib-es/bridge/index.js.map +1 -1
- package/lib-es/bridge/onboard.d.ts +7 -5
- package/lib-es/bridge/onboard.d.ts.map +1 -1
- package/lib-es/bridge/onboard.integ.test.js +13 -10
- package/lib-es/bridge/onboard.integ.test.js.map +1 -1
- package/lib-es/bridge/onboard.js +107 -42
- package/lib-es/bridge/onboard.js.map +1 -1
- package/lib-es/bridge/prepareTransaction.js +1 -1
- package/lib-es/bridge/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/serialization.d.ts +4 -0
- package/lib-es/bridge/serialization.d.ts.map +1 -0
- package/lib-es/bridge/serialization.js +27 -0
- package/lib-es/bridge/serialization.js.map +1 -0
- package/lib-es/bridge/signOperation.d.ts.map +1 -1
- package/lib-es/bridge/signOperation.js +10 -5
- package/lib-es/bridge/signOperation.js.map +1 -1
- package/lib-es/bridge/sync.d.ts +2 -1
- package/lib-es/bridge/sync.d.ts.map +1 -1
- package/lib-es/bridge/sync.integ.test.js +2 -2
- package/lib-es/bridge/sync.integ.test.js.map +1 -1
- package/lib-es/bridge/sync.js +34 -21
- package/lib-es/bridge/sync.js.map +1 -1
- package/lib-es/common-logic/account/getBalance.d.ts +2 -1
- package/lib-es/common-logic/account/getBalance.d.ts.map +1 -1
- package/lib-es/common-logic/account/getBalance.js +7 -7
- package/lib-es/common-logic/account/getBalance.js.map +1 -1
- package/lib-es/common-logic/account/getBalance.unit.test.js +6 -3
- package/lib-es/common-logic/account/getBalance.unit.test.js.map +1 -1
- package/lib-es/common-logic/history/lastBlock.d.ts +2 -1
- package/lib-es/common-logic/history/lastBlock.d.ts.map +1 -1
- package/lib-es/common-logic/history/lastBlock.js +3 -3
- package/lib-es/common-logic/history/lastBlock.js.map +1 -1
- package/lib-es/common-logic/history/lastBlock.test.js +5 -2
- package/lib-es/common-logic/history/lastBlock.test.js.map +1 -1
- package/lib-es/common-logic/history/listOperations.d.ts +2 -1
- package/lib-es/common-logic/history/listOperations.d.ts.map +1 -1
- package/lib-es/common-logic/history/listOperations.js +2 -2
- package/lib-es/common-logic/history/listOperations.js.map +1 -1
- package/lib-es/common-logic/transaction/broadcast.d.ts +2 -1
- package/lib-es/common-logic/transaction/broadcast.d.ts.map +1 -1
- package/lib-es/common-logic/transaction/broadcast.js +4 -4
- package/lib-es/common-logic/transaction/broadcast.js.map +1 -1
- package/lib-es/common-logic/transaction/broadcast.test.js +6 -3
- package/lib-es/common-logic/transaction/broadcast.test.js.map +1 -1
- package/lib-es/common-logic/transaction/craftTransaction.d.ts +3 -1
- package/lib-es/common-logic/transaction/craftTransaction.d.ts.map +1 -1
- package/lib-es/common-logic/transaction/craftTransaction.js +9 -5
- package/lib-es/common-logic/transaction/craftTransaction.js.map +1 -1
- package/lib-es/common-logic/transaction/estimateFees.d.ts +2 -1
- package/lib-es/common-logic/transaction/estimateFees.d.ts.map +1 -1
- package/lib-es/common-logic/transaction/estimateFees.js +4 -3
- package/lib-es/common-logic/transaction/estimateFees.js.map +1 -1
- package/lib-es/config.d.ts +1 -0
- package/lib-es/config.d.ts.map +1 -1
- package/lib-es/config.js.map +1 -1
- package/lib-es/network/gateway.d.ts +28 -26
- package/lib-es/network/gateway.d.ts.map +1 -1
- package/lib-es/network/gateway.integ.test.js +19 -15
- package/lib-es/network/gateway.integ.test.js.map +1 -1
- package/lib-es/network/gateway.js +40 -33
- package/lib-es/network/gateway.js.map +1 -1
- package/lib-es/signer/getAddress.d.ts.map +1 -1
- package/lib-es/signer/getAddress.js +2 -2
- package/lib-es/signer/getAddress.js.map +1 -1
- package/lib-es/types/bridge.d.ts +18 -3
- package/lib-es/types/bridge.d.ts.map +1 -1
- package/lib-es/types/onboard.d.ts +2 -0
- package/lib-es/types/onboard.d.ts.map +1 -1
- package/lib-es/types/onboard.js.map +1 -1
- package/lib-es/types/signer.d.ts +2 -1
- package/lib-es/types/signer.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/getBalance.integ.test.ts +8 -4
- package/src/api/index.ts +22 -51
- package/src/api/lastBlock.integ.test.ts +1 -1
- package/src/api/listOperations.integ.test.ts +1 -1
- package/src/bridge/broadcast.test.ts +11 -0
- package/src/bridge/broadcast.ts +5 -2
- package/src/bridge/createTransaction.ts +1 -1
- package/src/bridge/getTransactionStatus.ts +1 -1
- package/src/bridge/index.ts +3 -0
- package/src/bridge/onboard.integ.test.ts +24 -12
- package/src/bridge/onboard.ts +143 -51
- package/src/bridge/prepareTransaction.ts +1 -1
- package/src/bridge/serialization.ts +36 -0
- package/src/bridge/signOperation.ts +20 -7
- package/src/bridge/sync.integ.test.ts +2 -2
- package/src/bridge/sync.ts +40 -29
- package/src/common-logic/account/getBalance.ts +12 -7
- package/src/common-logic/account/getBalance.unit.test.ts +8 -3
- package/src/common-logic/history/lastBlock.test.ts +7 -2
- package/src/common-logic/history/lastBlock.ts +5 -3
- package/src/common-logic/history/listOperations.ts +3 -2
- package/src/common-logic/transaction/broadcast.test.ts +8 -3
- package/src/common-logic/transaction/broadcast.ts +6 -3
- package/src/common-logic/transaction/craftTransaction.ts +22 -5
- package/src/common-logic/transaction/estimateFees.ts +7 -3
- package/src/config.ts +1 -0
- package/src/network/gateway.integ.test.ts +31 -12
- package/src/network/gateway.ts +78 -53
- package/src/signer/getAddress.ts +6 -4
- package/src/types/bridge.ts +21 -0
- package/src/types/onboard.ts +3 -0
- package/src/types/signer.ts +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Operation, Pagination } from "@ledgerhq/coin-framework/api/index";
|
|
2
2
|
import { getOperations } from "../../network/gateway";
|
|
3
|
-
import
|
|
3
|
+
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Returns list of operations associated to an account.
|
|
@@ -10,10 +10,11 @@ import coinConfig from "../../config";
|
|
|
10
10
|
* Impl to finalize when backend is ready
|
|
11
11
|
*/
|
|
12
12
|
export async function listOperations(
|
|
13
|
+
currency: CryptoCurrency,
|
|
13
14
|
partyId: string,
|
|
14
15
|
page: Pagination,
|
|
15
16
|
): Promise<[Operation[], string]> {
|
|
16
|
-
const { operations, next } = await getOperations(partyId, {
|
|
17
|
+
const { operations, next } = await getOperations(currency, partyId, {
|
|
17
18
|
cursor: page.pagingToken !== undefined ? parseInt(page.pagingToken) : undefined,
|
|
18
19
|
minOffset: page.minHeight,
|
|
19
20
|
limit: page.limit,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { submit } from "../../network/gateway";
|
|
2
2
|
import * as coinConfigModule from "../../config";
|
|
3
3
|
import { broadcast } from "./broadcast";
|
|
4
|
+
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
4
5
|
|
|
5
6
|
jest.mock("../../network/gateway", () => ({
|
|
6
7
|
submit: jest.fn(),
|
|
@@ -11,6 +12,10 @@ const mockSerialized = JSON.stringify({
|
|
|
11
12
|
signature: "signature__PARTY__alice:123",
|
|
12
13
|
});
|
|
13
14
|
|
|
15
|
+
const mockCurrency = {
|
|
16
|
+
id: "canton_network",
|
|
17
|
+
} as unknown as CryptoCurrency;
|
|
18
|
+
|
|
14
19
|
describe("broadcast", () => {
|
|
15
20
|
const mockGetCoinConfig = jest.spyOn(coinConfigModule.default, "getCoinConfig");
|
|
16
21
|
|
|
@@ -25,9 +30,9 @@ describe("broadcast", () => {
|
|
|
25
30
|
|
|
26
31
|
(submit as jest.Mock).mockResolvedValue({ update_id: "my-update-id" });
|
|
27
32
|
|
|
28
|
-
const result = await broadcast(mockSerialized);
|
|
33
|
+
const result = await broadcast(mockCurrency, mockSerialized);
|
|
29
34
|
|
|
30
|
-
expect(submit).toHaveBeenCalledWith("alice:123", "serialized-tx", "signature");
|
|
35
|
+
expect(submit).toHaveBeenCalledWith(mockCurrency, "alice:123", "serialized-tx", "signature");
|
|
31
36
|
expect(result).toEqual("my-update-id");
|
|
32
37
|
});
|
|
33
38
|
|
|
@@ -36,7 +41,7 @@ describe("broadcast", () => {
|
|
|
36
41
|
useGateway: false,
|
|
37
42
|
} as any);
|
|
38
43
|
|
|
39
|
-
await expect(broadcast(mockSerialized)).rejects.toThrow("Not implemented");
|
|
44
|
+
await expect(broadcast(mockCurrency, mockSerialized)).rejects.toThrow("Not implemented");
|
|
40
45
|
expect(submit).not.toHaveBeenCalled();
|
|
41
46
|
});
|
|
42
47
|
});
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import coinConfig from "../../config";
|
|
2
2
|
import { submit } from "../../network/gateway";
|
|
3
|
+
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
4
|
|
|
4
|
-
const useGateway = () =>
|
|
5
|
+
const useGateway = (currency: CryptoCurrency) =>
|
|
6
|
+
coinConfig.getCoinConfig(currency).useGateway === true;
|
|
5
7
|
|
|
6
|
-
export async function broadcast(signedTx: string): Promise<string> {
|
|
8
|
+
export async function broadcast(currency: CryptoCurrency, signedTx: string): Promise<string> {
|
|
7
9
|
const parsed: { serialized: string; signature: string } = JSON.parse(signedTx);
|
|
8
10
|
const [sig, party] = parsed.signature.split("__PARTY__");
|
|
9
|
-
if (useGateway())
|
|
11
|
+
if (useGateway(currency))
|
|
12
|
+
return (await submit(currency, party, parsed.serialized, sig)).update_id;
|
|
10
13
|
else throw new Error("Not implemented");
|
|
11
14
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import BigNumber from "bignumber.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
PrepareTransferRequest,
|
|
4
|
+
prepareTransferRequest,
|
|
5
|
+
PrepareTransferResponse,
|
|
6
|
+
} from "../../network/gateway";
|
|
7
|
+
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
8
|
|
|
4
9
|
export async function craftTransaction(
|
|
10
|
+
currency: CryptoCurrency,
|
|
5
11
|
account: {
|
|
6
12
|
address: string;
|
|
7
13
|
nextSequenceNumber?: number;
|
|
@@ -12,19 +18,30 @@ export async function craftTransaction(
|
|
|
12
18
|
amount: BigNumber;
|
|
13
19
|
tokenId: string;
|
|
14
20
|
expireInSeconds: number;
|
|
21
|
+
memo?: string;
|
|
15
22
|
},
|
|
16
23
|
): Promise<{
|
|
17
24
|
nativeTransaction: PrepareTransferResponse;
|
|
18
25
|
serializedTransaction: string;
|
|
19
26
|
hash: string;
|
|
20
27
|
}> {
|
|
21
|
-
const
|
|
28
|
+
const params: PrepareTransferRequest = {
|
|
22
29
|
recipient: transaction.recipient || "",
|
|
23
|
-
amount: transaction.amount.
|
|
24
|
-
type: "token-transfer-request",
|
|
30
|
+
amount: transaction.amount.toString(),
|
|
31
|
+
type: "token-transfer-request" as const,
|
|
25
32
|
execute_before_secs: transaction.expireInSeconds,
|
|
26
33
|
instrument_id: transaction.tokenId,
|
|
27
|
-
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
if (transaction.memo) {
|
|
37
|
+
params.reason = transaction.memo;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const { serialized, json, hash } = await prepareTransferRequest(
|
|
41
|
+
currency,
|
|
42
|
+
account.address,
|
|
43
|
+
params,
|
|
44
|
+
);
|
|
28
45
|
|
|
29
46
|
return {
|
|
30
47
|
nativeTransaction: json,
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import coinConfig from "../../config";
|
|
2
|
+
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
|
+
|
|
4
|
+
const feeValue = (currency: CryptoCurrency) => coinConfig.getCoinConfig(currency).fee ?? 1;
|
|
5
|
+
|
|
6
|
+
export async function estimateFees(currency: CryptoCurrency): Promise<bigint> {
|
|
7
|
+
return Promise.resolve(BigInt(feeValue(currency)));
|
|
4
8
|
}
|
package/src/config.ts
CHANGED
|
@@ -13,6 +13,11 @@ import {
|
|
|
13
13
|
preparePreApprovalTransaction,
|
|
14
14
|
submitPreApprovalTransaction,
|
|
15
15
|
} from "./gateway";
|
|
16
|
+
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
17
|
+
|
|
18
|
+
const mockCurrency = {
|
|
19
|
+
id: "canton_network",
|
|
20
|
+
} as unknown as CryptoCurrency;
|
|
16
21
|
|
|
17
22
|
describe("gateway (devnet)", () => {
|
|
18
23
|
let onboardedAccount: {
|
|
@@ -50,7 +55,7 @@ describe("gateway (devnet)", () => {
|
|
|
50
55
|
};
|
|
51
56
|
|
|
52
57
|
// WHEN
|
|
53
|
-
const response = await prepareOnboarding(keyPair.publicKeyHex, "ed25519");
|
|
58
|
+
const response = await prepareOnboarding(mockCurrency, keyPair.publicKeyHex, "ed25519");
|
|
54
59
|
|
|
55
60
|
// THEN
|
|
56
61
|
expect(response).toHaveProperty("party_id");
|
|
@@ -58,7 +63,8 @@ describe("gateway (devnet)", () => {
|
|
|
58
63
|
expect(response).toHaveProperty("public_key_fingerprint");
|
|
59
64
|
expect(response).toHaveProperty("transactions");
|
|
60
65
|
expect(response.transactions).toHaveProperty("combined_hash");
|
|
61
|
-
expect(response.party_name).
|
|
66
|
+
expect(response.party_name).toBeDefined();
|
|
67
|
+
expect(typeof response.party_name).toBe("string");
|
|
62
68
|
|
|
63
69
|
expect(response.public_key_fingerprint).toBe(keyPair.fingerprint);
|
|
64
70
|
}, 30000);
|
|
@@ -69,11 +75,20 @@ describe("gateway (devnet)", () => {
|
|
|
69
75
|
// GIVEN
|
|
70
76
|
const { keyPair } = getOnboardedAccount();
|
|
71
77
|
const prepareRequest = { public_key: keyPair.publicKeyHex, public_key_type: "ed25519" };
|
|
72
|
-
const prepareResponse = await prepareOnboarding(
|
|
78
|
+
const prepareResponse = await prepareOnboarding(
|
|
79
|
+
mockCurrency,
|
|
80
|
+
keyPair.publicKeyHex,
|
|
81
|
+
"ed25519",
|
|
82
|
+
);
|
|
73
83
|
const signature = keyPair.sign(prepareResponse.transactions.combined_hash);
|
|
74
84
|
|
|
75
85
|
// WHEN
|
|
76
|
-
const response = await submitOnboarding(
|
|
86
|
+
const response = await submitOnboarding(
|
|
87
|
+
mockCurrency,
|
|
88
|
+
prepareRequest,
|
|
89
|
+
prepareResponse,
|
|
90
|
+
signature,
|
|
91
|
+
);
|
|
77
92
|
|
|
78
93
|
// Save onboarded account for all tests that need a valid party ID
|
|
79
94
|
onboardedAccount = {
|
|
@@ -91,7 +106,7 @@ describe("gateway (devnet)", () => {
|
|
|
91
106
|
|
|
92
107
|
describe("getLedgerEnd", () => {
|
|
93
108
|
it("should return ledger end", async () => {
|
|
94
|
-
const end = await getLedgerEnd();
|
|
109
|
+
const end = await getLedgerEnd(mockCurrency);
|
|
95
110
|
expect(end).toBeGreaterThanOrEqual(0);
|
|
96
111
|
});
|
|
97
112
|
});
|
|
@@ -99,7 +114,7 @@ describe("gateway (devnet)", () => {
|
|
|
99
114
|
describe("getBalance", () => {
|
|
100
115
|
it("should return user balance", async () => {
|
|
101
116
|
const { partyId } = getOnboardedAccount();
|
|
102
|
-
const balance = await getBalance(partyId);
|
|
117
|
+
const balance = await getBalance(mockCurrency, partyId);
|
|
103
118
|
expect(balance.length).toBeGreaterThanOrEqual(0);
|
|
104
119
|
if (balance.length > 0) {
|
|
105
120
|
expect(balance[0].amount).toBeGreaterThanOrEqual(0);
|
|
@@ -110,7 +125,7 @@ describe("gateway (devnet)", () => {
|
|
|
110
125
|
|
|
111
126
|
describe("getPartyById", () => {
|
|
112
127
|
it.skip("should return party info", async () => {
|
|
113
|
-
const party = await getPartyById("4f2e1485107adf5f");
|
|
128
|
+
const party = await getPartyById(mockCurrency, "4f2e1485107adf5f");
|
|
114
129
|
expect(party).toBeDefined();
|
|
115
130
|
});
|
|
116
131
|
});
|
|
@@ -118,6 +133,7 @@ describe("gateway (devnet)", () => {
|
|
|
118
133
|
describe("getPartyByPubKey", () => {
|
|
119
134
|
it.skip("should return party info", async () => {
|
|
120
135
|
const party = await getPartyByPubKey(
|
|
136
|
+
mockCurrency,
|
|
121
137
|
"122027c6dbbbdbffe0fa3122ae05175f3b9328e879e9ce96b670354deb64a45683c1",
|
|
122
138
|
);
|
|
123
139
|
expect(party).toBeDefined();
|
|
@@ -127,7 +143,9 @@ describe("gateway (devnet)", () => {
|
|
|
127
143
|
describe("getOperations", () => {
|
|
128
144
|
it("should return user transactions", async () => {
|
|
129
145
|
const { operations } = await getOperations(
|
|
146
|
+
mockCurrency,
|
|
130
147
|
"party-5f29bb32e9939939::12202becd8062a1d170209956cfd977fca76fcb4d2a892d08c77a7483f35a11d6440",
|
|
148
|
+
{},
|
|
131
149
|
);
|
|
132
150
|
expect(operations.length).toBeGreaterThanOrEqual(0);
|
|
133
151
|
});
|
|
@@ -140,7 +158,7 @@ describe("gateway (devnet)", () => {
|
|
|
140
158
|
const amount = 1000;
|
|
141
159
|
|
|
142
160
|
// WHEN
|
|
143
|
-
const response = await prepareTapRequest({ partyId, amount });
|
|
161
|
+
const response = await prepareTapRequest(mockCurrency, { partyId, amount });
|
|
144
162
|
|
|
145
163
|
// THEN
|
|
146
164
|
expect(response).toHaveProperty("serialized");
|
|
@@ -154,14 +172,14 @@ describe("gateway (devnet)", () => {
|
|
|
154
172
|
it("should submit tap request with proper signature", async () => {
|
|
155
173
|
// GIVEN
|
|
156
174
|
const { keyPair, partyId } = getOnboardedAccount();
|
|
157
|
-
const tapPrepareResponse = await prepareTapRequest({
|
|
175
|
+
const tapPrepareResponse = await prepareTapRequest(mockCurrency, {
|
|
158
176
|
partyId,
|
|
159
177
|
amount: 1000,
|
|
160
178
|
});
|
|
161
179
|
const tapSignature = keyPair.sign(tapPrepareResponse.hash);
|
|
162
180
|
|
|
163
181
|
// WHEN
|
|
164
|
-
const response = await submitTapRequest({
|
|
182
|
+
const response = await submitTapRequest(mockCurrency, {
|
|
165
183
|
partyId,
|
|
166
184
|
serialized: tapPrepareResponse.serialized,
|
|
167
185
|
signature: tapSignature,
|
|
@@ -181,7 +199,7 @@ describe("gateway (devnet)", () => {
|
|
|
181
199
|
const { partyId } = getOnboardedAccount();
|
|
182
200
|
|
|
183
201
|
// WHEN
|
|
184
|
-
const response = await preparePreApprovalTransaction(partyId);
|
|
202
|
+
const response = await preparePreApprovalTransaction(mockCurrency, partyId);
|
|
185
203
|
|
|
186
204
|
// THEN
|
|
187
205
|
expect(response).toHaveProperty("serialized");
|
|
@@ -195,11 +213,12 @@ describe("gateway (devnet)", () => {
|
|
|
195
213
|
it("should submit pre-approval transaction with proper signature", async () => {
|
|
196
214
|
// GIVEN
|
|
197
215
|
const { keyPair, partyId } = getOnboardedAccount();
|
|
198
|
-
const preparedTransaction = await preparePreApprovalTransaction(partyId);
|
|
216
|
+
const preparedTransaction = await preparePreApprovalTransaction(mockCurrency, partyId);
|
|
199
217
|
const preApprovalSignature = keyPair.sign(preparedTransaction.hash);
|
|
200
218
|
|
|
201
219
|
// WHEN
|
|
202
220
|
const response = await submitPreApprovalTransaction(
|
|
221
|
+
mockCurrency,
|
|
203
222
|
partyId,
|
|
204
223
|
preparedTransaction,
|
|
205
224
|
preApprovalSignature,
|
package/src/network/gateway.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
SubmitTransactionResponse,
|
|
10
10
|
PreApprovalResult,
|
|
11
11
|
} from "../types/onboard";
|
|
12
|
+
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
12
13
|
|
|
13
14
|
type OnboardingPrepareResponse = {
|
|
14
15
|
party_id: string;
|
|
@@ -47,23 +48,13 @@ export type PrepareTransferResponse = {
|
|
|
47
48
|
|
|
48
49
|
export type PrepareTransferRequest = {
|
|
49
50
|
type: "token-transfer-request";
|
|
50
|
-
amount:
|
|
51
|
+
amount: string;
|
|
51
52
|
recipient: string;
|
|
52
53
|
execute_before_secs: number;
|
|
53
54
|
instrument_id: string;
|
|
54
55
|
reason?: string;
|
|
55
56
|
};
|
|
56
57
|
|
|
57
|
-
export type PrepareTapRequest = {
|
|
58
|
-
type: "tap-request";
|
|
59
|
-
amount: number;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export type PreparePreapprovalRequest = {
|
|
63
|
-
type: "transfer-pre-approval-proposal";
|
|
64
|
-
receiver: string;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
58
|
type OnboardingSubmitRequest = {
|
|
68
59
|
prepare_request: OnboardingPrepareRequest;
|
|
69
60
|
prepare_response: OnboardingPrepareResponse;
|
|
@@ -161,6 +152,9 @@ export type OperationInfo =
|
|
|
161
152
|
asset: string;
|
|
162
153
|
details: {
|
|
163
154
|
type: "pre-approval";
|
|
155
|
+
metadata: {
|
|
156
|
+
reason?: string;
|
|
157
|
+
};
|
|
164
158
|
};
|
|
165
159
|
},
|
|
166
160
|
];
|
|
@@ -203,6 +197,9 @@ export type OperationInfo =
|
|
|
203
197
|
asset: string;
|
|
204
198
|
details: {
|
|
205
199
|
type: "tap";
|
|
200
|
+
metadata: {
|
|
201
|
+
reason?: string;
|
|
202
|
+
};
|
|
206
203
|
};
|
|
207
204
|
},
|
|
208
205
|
];
|
|
@@ -245,6 +242,9 @@ export type OperationInfo =
|
|
|
245
242
|
asset: string;
|
|
246
243
|
details: {
|
|
247
244
|
type: "transfer";
|
|
245
|
+
metadata: {
|
|
246
|
+
reason?: string;
|
|
247
|
+
};
|
|
248
248
|
};
|
|
249
249
|
},
|
|
250
250
|
];
|
|
@@ -272,8 +272,10 @@ export type OperationInfo =
|
|
|
272
272
|
};
|
|
273
273
|
};
|
|
274
274
|
|
|
275
|
-
const getGatewayUrl = () => coinConfig.getCoinConfig().gatewayUrl;
|
|
276
|
-
const getNodeId = () =>
|
|
275
|
+
const getGatewayUrl = (currency: CryptoCurrency) => coinConfig.getCoinConfig(currency).gatewayUrl;
|
|
276
|
+
const getNodeId = (currency: CryptoCurrency) =>
|
|
277
|
+
coinConfig.getCoinConfig(currency).nodeId || "ledger-devnet-stg";
|
|
278
|
+
const getNetworkType = (currency: CryptoCurrency) => coinConfig.getCoinConfig(currency).networkType;
|
|
277
279
|
|
|
278
280
|
const gatewayNetwork = <T, U = unknown>(req: LiveNetworkRequest<U>) => {
|
|
279
281
|
const API_KEY = getEnv("CANTON_API_KEY");
|
|
@@ -287,11 +289,12 @@ const gatewayNetwork = <T, U = unknown>(req: LiveNetworkRequest<U>) => {
|
|
|
287
289
|
};
|
|
288
290
|
|
|
289
291
|
export async function prepareOnboarding(
|
|
292
|
+
currency: CryptoCurrency,
|
|
290
293
|
pubKey: string,
|
|
291
294
|
pubKeyType: string,
|
|
292
295
|
): Promise<OnboardingPrepareResponse> {
|
|
293
|
-
const gatewayUrl = getGatewayUrl();
|
|
294
|
-
const nodeId = getNodeId();
|
|
296
|
+
const gatewayUrl = getGatewayUrl(currency);
|
|
297
|
+
const nodeId = getNodeId(currency);
|
|
295
298
|
const fullUrl = `${gatewayUrl}/v1/node/${nodeId}/onboarding/prepare`;
|
|
296
299
|
|
|
297
300
|
const { data } = await gatewayNetwork<OnboardingPrepareResponse, OnboardingPrepareRequest>({
|
|
@@ -307,13 +310,14 @@ export async function prepareOnboarding(
|
|
|
307
310
|
}
|
|
308
311
|
|
|
309
312
|
export async function submitOnboarding(
|
|
313
|
+
currency: CryptoCurrency,
|
|
310
314
|
prepareRequest: OnboardingPrepareRequest,
|
|
311
315
|
prepareResponse: OnboardingPrepareResponse,
|
|
312
316
|
signature: string,
|
|
313
317
|
) {
|
|
314
318
|
const { data } = await gatewayNetwork<OnboardingSubmitResponse, OnboardingSubmitRequest>({
|
|
315
319
|
method: "POST",
|
|
316
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/onboarding/submit`,
|
|
320
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/onboarding/submit`,
|
|
317
321
|
data: {
|
|
318
322
|
prepare_request: prepareRequest,
|
|
319
323
|
prepare_response: prepareResponse,
|
|
@@ -323,10 +327,15 @@ export async function submitOnboarding(
|
|
|
323
327
|
return data;
|
|
324
328
|
}
|
|
325
329
|
|
|
326
|
-
export async function submit(
|
|
330
|
+
export async function submit(
|
|
331
|
+
currency: CryptoCurrency,
|
|
332
|
+
partyId: string,
|
|
333
|
+
serialized: string,
|
|
334
|
+
signature: string,
|
|
335
|
+
) {
|
|
327
336
|
const { data } = await gatewayNetwork<TransactionSubmitResponse, TransactionSubmitRequest>({
|
|
328
337
|
method: "POST",
|
|
329
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/party/${partyId}/transaction/submit`,
|
|
338
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/party/${partyId}/transaction/submit`,
|
|
330
339
|
data: {
|
|
331
340
|
serialized,
|
|
332
341
|
signature,
|
|
@@ -335,32 +344,42 @@ export async function submit(partyId: string, serialized: string, signature: str
|
|
|
335
344
|
return data;
|
|
336
345
|
}
|
|
337
346
|
|
|
338
|
-
export async function getBalance(
|
|
347
|
+
export async function getBalance(
|
|
348
|
+
currency: CryptoCurrency,
|
|
349
|
+
partyId: string,
|
|
350
|
+
): Promise<InstrumentBalance[]> {
|
|
339
351
|
const { data } = await gatewayNetwork<InstrumentBalance[]>({
|
|
340
352
|
method: "GET",
|
|
341
|
-
|
|
342
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/party/${partyId.replace(/_/g, ":")}/balance`,
|
|
353
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/party/${partyId}/balance`,
|
|
343
354
|
});
|
|
344
355
|
return data;
|
|
345
356
|
}
|
|
346
357
|
|
|
347
|
-
export async function getPartyById(partyId: string): Promise<PartyInfo> {
|
|
348
|
-
return await getParty(partyId, "party-id");
|
|
358
|
+
export async function getPartyById(currency: CryptoCurrency, partyId: string): Promise<PartyInfo> {
|
|
359
|
+
return await getParty(currency, partyId, "party-id");
|
|
349
360
|
}
|
|
350
361
|
|
|
351
|
-
export async function getPartyByPubKey(
|
|
352
|
-
|
|
362
|
+
export async function getPartyByPubKey(
|
|
363
|
+
currency: CryptoCurrency,
|
|
364
|
+
pubKey: string,
|
|
365
|
+
): Promise<PartyInfo> {
|
|
366
|
+
return await getParty(currency, pubKey, "public-key");
|
|
353
367
|
}
|
|
354
368
|
|
|
355
|
-
async function getParty(
|
|
369
|
+
async function getParty(
|
|
370
|
+
currency: CryptoCurrency,
|
|
371
|
+
identifier: string,
|
|
372
|
+
by: "party-id" | "public-key",
|
|
373
|
+
): Promise<PartyInfo> {
|
|
356
374
|
const { data } = await gatewayNetwork<PartyInfo>({
|
|
357
375
|
method: "GET",
|
|
358
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/party/${identifier}?by=${by}`,
|
|
376
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/party/${identifier}?by=${by}`,
|
|
359
377
|
});
|
|
360
378
|
return data;
|
|
361
379
|
}
|
|
362
380
|
|
|
363
381
|
export async function getOperations(
|
|
382
|
+
currency: CryptoCurrency,
|
|
364
383
|
partyId: string,
|
|
365
384
|
options?: {
|
|
366
385
|
cursor?: number | undefined;
|
|
@@ -377,21 +396,21 @@ export async function getOperations(
|
|
|
377
396
|
operations: OperationInfo[];
|
|
378
397
|
}>({
|
|
379
398
|
method: "GET",
|
|
380
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/party/${partyId
|
|
399
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/party/${partyId}/operations`,
|
|
381
400
|
params: options,
|
|
382
401
|
});
|
|
383
402
|
return data;
|
|
384
403
|
}
|
|
385
404
|
|
|
386
|
-
type
|
|
405
|
+
type PrepareTapRequest = {
|
|
387
406
|
partyId: string;
|
|
388
407
|
amount?: number;
|
|
389
408
|
};
|
|
390
409
|
|
|
391
|
-
type
|
|
392
|
-
serialized:
|
|
410
|
+
type PrepareTapResponse = {
|
|
411
|
+
serialized: string;
|
|
393
412
|
json: null;
|
|
394
|
-
hash:
|
|
413
|
+
hash: string;
|
|
395
414
|
};
|
|
396
415
|
|
|
397
416
|
enum TransactionType {
|
|
@@ -399,16 +418,20 @@ enum TransactionType {
|
|
|
399
418
|
TRANSFER_PRE_APPROVAL_PROPOSAL = "transfer-pre-approval-proposal",
|
|
400
419
|
}
|
|
401
420
|
|
|
402
|
-
export async function prepareTapRequest(
|
|
403
|
-
|
|
404
|
-
amount = 1000000,
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
421
|
+
export async function prepareTapRequest(
|
|
422
|
+
currency: CryptoCurrency,
|
|
423
|
+
{ partyId, amount = 1000000 }: PrepareTapRequest,
|
|
424
|
+
): Promise<PrepareTapResponse> {
|
|
425
|
+
if (getNetworkType(currency) === "mainnet") {
|
|
426
|
+
return {
|
|
427
|
+
serialized: "",
|
|
428
|
+
json: null,
|
|
429
|
+
hash: "",
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
const { data } = await gatewayNetwork<PrepareTapResponse, { amount: number; type: string }>({
|
|
410
433
|
method: "POST",
|
|
411
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/party/${partyId}/transaction/prepare`,
|
|
434
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/party/${partyId}/transaction/prepare`,
|
|
412
435
|
data: {
|
|
413
436
|
amount: parseInt(amount.toString(), 10), // Convert to integer to avoid scientific notation
|
|
414
437
|
type: TransactionType.TAP_REQUEST,
|
|
@@ -428,17 +451,16 @@ type SubmitTapRequestResponse = {
|
|
|
428
451
|
update_id: string;
|
|
429
452
|
};
|
|
430
453
|
|
|
431
|
-
export async function submitTapRequest(
|
|
432
|
-
|
|
433
|
-
serialized,
|
|
434
|
-
|
|
435
|
-
}: SubmitTapRequestRequest): Promise<SubmitTapRequestResponse> {
|
|
454
|
+
export async function submitTapRequest(
|
|
455
|
+
currency: CryptoCurrency,
|
|
456
|
+
{ partyId, serialized, signature }: SubmitTapRequestRequest,
|
|
457
|
+
): Promise<SubmitTapRequestResponse> {
|
|
436
458
|
const { data } = await gatewayNetwork<
|
|
437
459
|
SubmitTapRequestResponse,
|
|
438
460
|
Omit<SubmitTapRequestRequest, "partyId">
|
|
439
461
|
>({
|
|
440
462
|
method: "POST",
|
|
441
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/party/${partyId}/transaction/submit`,
|
|
463
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/party/${partyId}/transaction/submit`,
|
|
442
464
|
data: {
|
|
443
465
|
serialized,
|
|
444
466
|
signature,
|
|
@@ -448,31 +470,33 @@ export async function submitTapRequest({
|
|
|
448
470
|
}
|
|
449
471
|
|
|
450
472
|
export async function prepareTransferRequest(
|
|
473
|
+
currency: CryptoCurrency,
|
|
451
474
|
partyId: string,
|
|
452
475
|
params: PrepareTransferRequest,
|
|
453
476
|
): Promise<PrepareTransferResponse> {
|
|
454
|
-
const { data } = await
|
|
477
|
+
const { data } = await gatewayNetwork<PrepareTransferResponse, PrepareTransferRequest>({
|
|
455
478
|
method: "POST",
|
|
456
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/party/${partyId}/transaction/prepare`,
|
|
479
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/party/${partyId}/transaction/prepare`,
|
|
457
480
|
data: params,
|
|
458
481
|
});
|
|
459
482
|
return data;
|
|
460
483
|
}
|
|
461
484
|
|
|
462
|
-
export async function getLedgerEnd(): Promise<number> {
|
|
485
|
+
export async function getLedgerEnd(currency: CryptoCurrency): Promise<number> {
|
|
463
486
|
const { data } = await gatewayNetwork<number>({
|
|
464
487
|
method: "GET",
|
|
465
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/ledger-end`,
|
|
488
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/ledger-end`,
|
|
466
489
|
});
|
|
467
490
|
return data;
|
|
468
491
|
}
|
|
469
492
|
|
|
470
493
|
export async function preparePreApprovalTransaction(
|
|
494
|
+
currency: CryptoCurrency,
|
|
471
495
|
partyId: string,
|
|
472
496
|
): Promise<PrepareTransactionResponse> {
|
|
473
497
|
const { data } = await gatewayNetwork<PrepareTransactionResponse, PrepareTransactionRequest>({
|
|
474
498
|
method: "POST",
|
|
475
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/party/${partyId}/transaction/prepare`,
|
|
499
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/party/${partyId}/transaction/prepare`,
|
|
476
500
|
data: {
|
|
477
501
|
type: TransactionType.TRANSFER_PRE_APPROVAL_PROPOSAL,
|
|
478
502
|
receiver: partyId,
|
|
@@ -482,13 +506,14 @@ export async function preparePreApprovalTransaction(
|
|
|
482
506
|
}
|
|
483
507
|
|
|
484
508
|
export async function submitPreApprovalTransaction(
|
|
509
|
+
currency: CryptoCurrency,
|
|
485
510
|
partyId: string,
|
|
486
511
|
{ serialized }: PrepareTransactionResponse,
|
|
487
512
|
signature: string,
|
|
488
513
|
): Promise<PreApprovalResult> {
|
|
489
514
|
const { data } = await gatewayNetwork<SubmitTransactionResponse, SubmitTransactionRequest>({
|
|
490
515
|
method: "POST",
|
|
491
|
-
url: `${getGatewayUrl()}/v1/node/${getNodeId()}/party/${partyId}/transaction/submit`,
|
|
516
|
+
url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/party/${partyId}/transaction/submit`,
|
|
492
517
|
data: {
|
|
493
518
|
serialized,
|
|
494
519
|
signature,
|
package/src/signer/getAddress.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { GetAddressOptions } from "@ledgerhq/coin-framework/derivation";
|
|
2
2
|
import { GetAddressFn } from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
|
|
3
3
|
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
|
4
|
-
import { CantonSigner } from "../types";
|
|
4
|
+
import { CantonSigner, CantonAddress } from "../types";
|
|
5
5
|
|
|
6
6
|
const getAddress = (signerContext: SignerContext<CantonSigner>): GetAddressFn => {
|
|
7
|
-
return async (deviceId: string, { path }: GetAddressOptions) => {
|
|
8
|
-
const { address, publicKey } = await signerContext(deviceId, signer =>
|
|
7
|
+
return async (deviceId: string, { path, verify }: GetAddressOptions) => {
|
|
8
|
+
const { address, publicKey } = await signerContext(deviceId, signer =>
|
|
9
|
+
signer.getAddress(path, verify),
|
|
10
|
+
);
|
|
9
11
|
|
|
10
12
|
return {
|
|
11
13
|
path,
|
|
12
14
|
address,
|
|
13
15
|
publicKey,
|
|
14
|
-
};
|
|
16
|
+
} satisfies CantonAddress;
|
|
15
17
|
};
|
|
16
18
|
};
|
|
17
19
|
|