@ledgerhq/coin-canton 0.4.1-nightly.0 → 0.5.0-nightly.2
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/.unimportedrc.json +12 -4
- package/CHANGELOG.md +35 -0
- package/lib/api/getBalance.integ.test.js +1 -1
- package/lib/api/getBalance.integ.test.js.map +1 -1
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.js +12 -9
- package/lib/api/index.js.map +1 -1
- package/lib/bridge/createTransaction.test.js +1 -1
- package/lib/bridge/createTransaction.test.js.map +1 -1
- package/lib/bridge/index.d.ts +3 -3
- package/lib/bridge/index.d.ts.map +1 -1
- package/lib/bridge/index.js +9 -1
- package/lib/bridge/index.js.map +1 -1
- package/lib/bridge/onboard.d.ts +10 -0
- package/lib/bridge/onboard.d.ts.map +1 -0
- package/lib/bridge/onboard.integ.test.d.ts +2 -0
- package/lib/bridge/onboard.integ.test.d.ts.map +1 -0
- package/lib/bridge/onboard.integ.test.js +156 -0
- package/lib/bridge/onboard.integ.test.js.map +1 -0
- package/lib/bridge/onboard.js +139 -0
- package/lib/bridge/onboard.js.map +1 -0
- package/lib/bridge/prepareTransaction.d.ts.map +1 -1
- package/lib/bridge/prepareTransaction.js +5 -7
- package/lib/bridge/prepareTransaction.js.map +1 -1
- package/lib/bridge/signOperation.d.ts.map +1 -1
- package/lib/bridge/signOperation.js +2 -1
- package/lib/bridge/signOperation.js.map +1 -1
- package/lib/bridge/sync.d.ts.map +1 -1
- package/lib/bridge/sync.integ.test.d.ts +2 -0
- package/lib/bridge/sync.integ.test.d.ts.map +1 -0
- package/lib/bridge/sync.integ.test.js +175 -0
- package/lib/bridge/sync.integ.test.js.map +1 -0
- package/lib/bridge/sync.js +39 -36
- package/lib/bridge/sync.js.map +1 -1
- package/lib/bridge/updateTransaction.d.ts.map +1 -1
- package/lib/bridge/updateTransaction.js +0 -4
- package/lib/bridge/updateTransaction.js.map +1 -1
- package/lib/common-logic/history/listOperations.d.ts.map +1 -1
- package/lib/common-logic/history/listOperations.js +19 -31
- package/lib/common-logic/history/listOperations.js.map +1 -1
- package/lib/common-logic/transaction/craftTransaction.d.ts +4 -3
- package/lib/common-logic/transaction/craftTransaction.d.ts.map +1 -1
- package/lib/common-logic/transaction/craftTransaction.js +10 -12
- package/lib/common-logic/transaction/craftTransaction.js.map +1 -1
- package/lib/network/gateway.d.ts +194 -3
- package/lib/network/gateway.d.ts.map +1 -1
- package/lib/network/gateway.integ.test.js +121 -11
- package/lib/network/gateway.integ.test.js.map +1 -1
- package/lib/network/gateway.js +96 -18
- package/lib/network/gateway.js.map +1 -1
- package/lib/network/node.d.ts +2 -2
- package/lib/network/node.d.ts.map +1 -1
- package/lib/network/node.js.map +1 -1
- package/lib/network/types.d.ts +1 -1
- package/lib/network/types.d.ts.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/test/cantonTestUtils.d.ts +33 -0
- package/lib/test/cantonTestUtils.d.ts.map +1 -0
- package/lib/test/cantonTestUtils.js +159 -0
- package/lib/test/cantonTestUtils.js.map +1 -0
- package/lib/types/bridge.d.ts +7 -1
- package/lib/types/bridge.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -10
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/onboard.d.ts +55 -0
- package/lib/types/onboard.d.ts.map +1 -0
- package/lib/types/onboard.js +22 -0
- package/lib/types/onboard.js.map +1 -0
- package/lib-es/api/getBalance.integ.test.js +1 -1
- 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 +13 -10
- package/lib-es/api/index.js.map +1 -1
- package/lib-es/bridge/createTransaction.test.js +1 -1
- package/lib-es/bridge/createTransaction.test.js.map +1 -1
- package/lib-es/bridge/index.d.ts +3 -3
- package/lib-es/bridge/index.d.ts.map +1 -1
- package/lib-es/bridge/index.js +9 -1
- package/lib-es/bridge/index.js.map +1 -1
- package/lib-es/bridge/onboard.d.ts +10 -0
- package/lib-es/bridge/onboard.d.ts.map +1 -0
- package/lib-es/bridge/onboard.integ.test.d.ts +2 -0
- package/lib-es/bridge/onboard.integ.test.d.ts.map +1 -0
- package/lib-es/bridge/onboard.integ.test.js +151 -0
- package/lib-es/bridge/onboard.integ.test.js.map +1 -0
- package/lib-es/bridge/onboard.js +133 -0
- package/lib-es/bridge/onboard.js.map +1 -0
- package/lib-es/bridge/prepareTransaction.d.ts.map +1 -1
- package/lib-es/bridge/prepareTransaction.js +6 -8
- package/lib-es/bridge/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/signOperation.d.ts.map +1 -1
- package/lib-es/bridge/signOperation.js +2 -1
- package/lib-es/bridge/signOperation.js.map +1 -1
- package/lib-es/bridge/sync.d.ts.map +1 -1
- package/lib-es/bridge/sync.integ.test.d.ts +2 -0
- package/lib-es/bridge/sync.integ.test.d.ts.map +1 -0
- package/lib-es/bridge/sync.integ.test.js +137 -0
- package/lib-es/bridge/sync.integ.test.js.map +1 -0
- package/lib-es/bridge/sync.js +38 -35
- package/lib-es/bridge/sync.js.map +1 -1
- package/lib-es/bridge/updateTransaction.d.ts.map +1 -1
- package/lib-es/bridge/updateTransaction.js +0 -4
- package/lib-es/bridge/updateTransaction.js.map +1 -1
- package/lib-es/common-logic/history/listOperations.d.ts.map +1 -1
- package/lib-es/common-logic/history/listOperations.js +20 -29
- package/lib-es/common-logic/history/listOperations.js.map +1 -1
- package/lib-es/common-logic/transaction/craftTransaction.d.ts +4 -3
- package/lib-es/common-logic/transaction/craftTransaction.d.ts.map +1 -1
- package/lib-es/common-logic/transaction/craftTransaction.js +10 -12
- package/lib-es/common-logic/transaction/craftTransaction.js.map +1 -1
- package/lib-es/network/gateway.d.ts +194 -3
- package/lib-es/network/gateway.d.ts.map +1 -1
- package/lib-es/network/gateway.integ.test.js +122 -12
- package/lib-es/network/gateway.integ.test.js.map +1 -1
- package/lib-es/network/gateway.js +90 -17
- package/lib-es/network/gateway.js.map +1 -1
- package/lib-es/network/node.d.ts +2 -2
- package/lib-es/network/node.d.ts.map +1 -1
- package/lib-es/network/node.js.map +1 -1
- package/lib-es/network/types.d.ts +1 -1
- package/lib-es/network/types.d.ts.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/test/cantonTestUtils.d.ts +33 -0
- package/lib-es/test/cantonTestUtils.d.ts.map +1 -0
- package/lib-es/test/cantonTestUtils.js +151 -0
- package/lib-es/test/cantonTestUtils.js.map +1 -0
- package/lib-es/types/bridge.d.ts +7 -1
- package/lib-es/types/bridge.d.ts.map +1 -1
- package/lib-es/types/index.d.ts +1 -10
- package/lib-es/types/index.d.ts.map +1 -1
- package/lib-es/types/index.js +1 -0
- package/lib-es/types/index.js.map +1 -1
- package/lib-es/types/onboard.d.ts +55 -0
- package/lib-es/types/onboard.d.ts.map +1 -0
- package/lib-es/types/onboard.js +19 -0
- package/lib-es/types/onboard.js.map +1 -0
- package/package.json +6 -6
- package/src/api/getBalance.integ.test.ts +1 -2
- package/src/api/index.ts +33 -25
- package/src/bridge/createTransaction.test.ts +1 -1
- package/src/bridge/index.ts +14 -4
- package/src/bridge/onboard.integ.test.ts +219 -0
- package/src/bridge/onboard.ts +220 -0
- package/src/bridge/prepareTransaction.ts +6 -15
- package/src/bridge/signOperation.ts +3 -2
- package/src/bridge/sync.integ.test.ts +180 -0
- package/src/bridge/sync.ts +57 -49
- package/src/bridge/updateTransaction.ts +0 -5
- package/src/common-logic/history/listOperations.ts +20 -31
- package/src/common-logic/transaction/craftTransaction.ts +13 -17
- package/src/network/gateway.integ.test.ts +156 -17
- package/src/network/gateway.ts +333 -26
- package/src/network/node.ts +3 -3
- package/src/network/types.ts +1 -1
- package/src/signer/getAddress.ts +3 -5
- package/src/test/cantonTestUtils.ts +181 -0
- package/src/types/bridge.ts +20 -0
- package/src/types/index.ts +1 -11
- package/src/types/onboard.ts +65 -0
package/src/types/bridge.ts
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import type { BigNumber } from "bignumber.js";
|
|
2
|
+
import type { Observable } from "rxjs";
|
|
2
3
|
import type {
|
|
4
|
+
CurrencyBridge,
|
|
3
5
|
TransactionCommon,
|
|
4
6
|
TransactionCommonRaw,
|
|
5
7
|
TransactionStatusCommon,
|
|
6
8
|
TransactionStatusCommonRaw,
|
|
7
9
|
} from "@ledgerhq/types-live";
|
|
10
|
+
import type {
|
|
11
|
+
CantonOnboardProgress,
|
|
12
|
+
CantonOnboardResult,
|
|
13
|
+
CantonPreApprovalProgress,
|
|
14
|
+
CantonPreApprovalResult,
|
|
15
|
+
} from "./onboard";
|
|
16
|
+
|
|
17
|
+
export interface CantonCurrencyBridge extends CurrencyBridge {
|
|
18
|
+
onboardAccount: (
|
|
19
|
+
deviceId: string,
|
|
20
|
+
derivationPath: string,
|
|
21
|
+
) => Observable<CantonOnboardProgress | CantonOnboardResult>;
|
|
22
|
+
authorizePreapproval: (
|
|
23
|
+
deviceId: string,
|
|
24
|
+
derivationPath: string,
|
|
25
|
+
partyId: string,
|
|
26
|
+
) => Observable<CantonPreApprovalProgress | CantonPreApprovalResult>;
|
|
27
|
+
}
|
|
8
28
|
|
|
9
29
|
export type NetworkInfo = {
|
|
10
30
|
family: "canton";
|
package/src/types/index.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
1
|
export * from "./bridge";
|
|
2
|
+
export * from "./onboard";
|
|
2
3
|
export * from "./signer";
|
|
3
|
-
|
|
4
|
-
export type BoilerplateNativeTransaction = {
|
|
5
|
-
TransactionType: "Payment";
|
|
6
|
-
Account: string;
|
|
7
|
-
Amount: string;
|
|
8
|
-
Destination: string;
|
|
9
|
-
Fee: string;
|
|
10
|
-
Sequence: number;
|
|
11
|
-
SigningPubKey?: string;
|
|
12
|
-
TxnSignature?: string;
|
|
13
|
-
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export enum OnboardStatus {
|
|
2
|
+
INIT,
|
|
3
|
+
PREPARE,
|
|
4
|
+
SIGN,
|
|
5
|
+
SUBMIT,
|
|
6
|
+
SUCCESS,
|
|
7
|
+
ERROR,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum PreApprovalStatus {
|
|
11
|
+
INIT,
|
|
12
|
+
PREPARE,
|
|
13
|
+
SIGN,
|
|
14
|
+
SUBMIT,
|
|
15
|
+
SUCCESS,
|
|
16
|
+
ERROR,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type CantonOnboardProgress = {
|
|
20
|
+
status: OnboardStatus;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type CantonOnboardResult = {
|
|
24
|
+
partyId: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type CantonPreApprovalProgress = {
|
|
28
|
+
status: PreApprovalStatus;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type CantonPreApprovalResult = {
|
|
32
|
+
isApproved: boolean;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Types for Canton Gateway Transaction API
|
|
37
|
+
* Based on the API endpoints in canton-gateway
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
export interface PrepareTransactionRequest {
|
|
41
|
+
type: "transfer-pre-approval-proposal";
|
|
42
|
+
receiver: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface PrepareTransactionResponse {
|
|
46
|
+
serialized: string; // Hex-encoded serialized protobuf
|
|
47
|
+
json: any; // JSON representation
|
|
48
|
+
hash: string; // Transaction hash for signing
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface SubmitTransactionRequest {
|
|
52
|
+
serialized: string; // Hex-encoded serialized protobuf
|
|
53
|
+
signature: string; // Hex-encoded signature
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface SubmitTransactionResponse {
|
|
57
|
+
submission_id: string;
|
|
58
|
+
update_id: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface PreApprovalResult {
|
|
62
|
+
isApproved: boolean;
|
|
63
|
+
submissionId: string;
|
|
64
|
+
updateId: string;
|
|
65
|
+
}
|