@tari-project/ootle-ts-bindings 1.44.6 → 1.47.1
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/helpers/helpers.js +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types/FeeSource.d.ts +1 -1
- package/dist/types/Instruction.d.ts +1 -0
- package/dist/types/Permission.d.ts +3 -0
- package/dist/types/TxRequestAction.d.ts +7 -0
- package/dist/types/TxRequestAction.js +2 -0
- package/dist/types/wallet-types/EffectiveStatus.d.ts +5 -0
- package/dist/types/wallet-types/EffectiveStatus.js +2 -0
- package/dist/types/wallet-types/InputSelection.d.ts +7 -2
- package/dist/types/wallet-types/TransactionDetectInputsRequest.d.ts +9 -0
- package/dist/types/wallet-types/TransactionDetectInputsRequest.js +1 -0
- package/dist/types/wallet-types/TransactionDetectInputsResponse.d.ts +7 -0
- package/dist/types/wallet-types/TransactionDetectInputsResponse.js +1 -0
- package/dist/types/wallet-types/TransactionRequestCreateRequest.d.ts +46 -0
- package/dist/types/wallet-types/TransactionRequestCreateRequest.js +1 -0
- package/dist/types/wallet-types/TransactionRequestCreateResponse.d.ts +7 -0
- package/dist/types/wallet-types/TransactionRequestCreateResponse.js +2 -0
- package/dist/types/wallet-types/TransactionRequestDecisionRequest.d.ts +3 -0
- package/dist/types/wallet-types/TransactionRequestDecisionRequest.js +2 -0
- package/dist/types/wallet-types/TransactionRequestDecisionResponse.d.ts +5 -0
- package/dist/types/wallet-types/TransactionRequestDecisionResponse.js +1 -0
- package/dist/types/wallet-types/TransactionRequestGetRequest.d.ts +3 -0
- package/dist/types/wallet-types/TransactionRequestGetRequest.js +2 -0
- package/dist/types/wallet-types/TransactionRequestGetResponse.d.ts +4 -0
- package/dist/types/wallet-types/TransactionRequestGetResponse.js +1 -0
- package/dist/types/wallet-types/TransactionRequestInfo.d.ts +38 -0
- package/dist/types/wallet-types/TransactionRequestInfo.js +1 -0
- package/dist/types/wallet-types/TransactionRequestListRequest.d.ts +7 -0
- package/dist/types/wallet-types/TransactionRequestListRequest.js +1 -0
- package/dist/types/wallet-types/TransactionRequestListResponse.d.ts +4 -0
- package/dist/types/wallet-types/TransactionRequestListResponse.js +1 -0
- package/dist/types/wallet-types/TransactionRequestSubmitRequest.d.ts +3 -0
- package/dist/types/wallet-types/TransactionRequestSubmitRequest.js +2 -0
- package/dist/types/wallet-types/TransactionRequestSubmitResponse.d.ts +4 -0
- package/dist/types/wallet-types/TransactionRequestSubmitResponse.js +1 -0
- package/dist/types/wallet-types/TransactionRequestValueSummary.d.ts +24 -0
- package/dist/types/wallet-types/TransactionRequestValueSummary.js +1 -0
- package/dist/types/wallet-types/TransactionSubmitRequest.d.ts +6 -0
- package/dist/wallet-types.d.ts +15 -0
- package/dist/wallet-types.js +15 -0
- package/package.json +1 -1
package/dist/helpers/helpers.js
CHANGED
|
@@ -152,6 +152,9 @@ export function permissionToString(permission) {
|
|
|
152
152
|
return `settings:${permission.Settings.toLowerCase()}`;
|
|
153
153
|
if ("AddressBook" in permission)
|
|
154
154
|
return `address_book:${permission.AddressBook.toLowerCase()}`;
|
|
155
|
+
if ("TransactionRequests" in permission) {
|
|
156
|
+
return `transaction_requests:${permission.TransactionRequests.toLowerCase()}`;
|
|
157
|
+
}
|
|
155
158
|
// Scoped CRUD resources: { Accounts: ["Read", "component_abc..." | null] }.
|
|
156
159
|
if ("Accounts" in permission)
|
|
157
160
|
return scoped("accounts", permission.Accounts);
|
package/dist/index.d.ts
CHANGED
|
@@ -179,6 +179,7 @@ export * from "./types/TransactionSealSignature";
|
|
|
179
179
|
export * from "./types/TransactionSignature";
|
|
180
180
|
export * from "./types/TransactionStatus";
|
|
181
181
|
export * from "./types/TransactionV1";
|
|
182
|
+
export * from "./types/TxRequestAction";
|
|
182
183
|
export * from "./types/Type";
|
|
183
184
|
export * from "./types/UnsealedTransaction";
|
|
184
185
|
export * from "./types/UnsealedTransactionV1";
|
package/dist/index.js
CHANGED
|
@@ -181,6 +181,7 @@ export * from "./types/TransactionSealSignature";
|
|
|
181
181
|
export * from "./types/TransactionSignature";
|
|
182
182
|
export * from "./types/TransactionStatus";
|
|
183
183
|
export * from "./types/TransactionV1";
|
|
184
|
+
export * from "./types/TxRequestAction";
|
|
184
185
|
export * from "./types/Type";
|
|
185
186
|
export * from "./types/UnsealedTransaction";
|
|
186
187
|
export * from "./types/UnsealedTransactionV1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type FeeSource = "Initial" | "RuntimeCall" | "Storage" | "TransactionWeight" | "SignatureVerification" | "TemplateLoad" | "SubstateCreate" | "WasmExecution" | "TemplatePublish" | "ExhaustBurn";
|
|
1
|
+
export type FeeSource = "Initial" | "RuntimeCall" | "Storage" | "TransactionWeight" | "SignatureVerification" | "TemplateLoad" | "SubstateCreate" | "WasmExecution" | "TemplatePublish" | "ExhaustBurn" | "NativeExecution";
|
|
@@ -2,6 +2,7 @@ import type { ComponentAddress } from "./ComponentAddress";
|
|
|
2
2
|
import type { Crud } from "./Crud";
|
|
3
3
|
import type { ReadOnly } from "./ReadOnly";
|
|
4
4
|
import type { ResourceAddress } from "./ResourceAddress";
|
|
5
|
+
import type { TxRequestAction } from "./TxRequestAction";
|
|
5
6
|
/**
|
|
6
7
|
* A capability the wallet daemon recognises as granted by a caller or required
|
|
7
8
|
* by a handler.
|
|
@@ -18,6 +19,8 @@ export type Permission = "Admin" | {
|
|
|
18
19
|
Keys: Crud;
|
|
19
20
|
} | {
|
|
20
21
|
Transactions: Crud;
|
|
22
|
+
} | {
|
|
23
|
+
TransactionRequests: TxRequestAction;
|
|
21
24
|
} | {
|
|
22
25
|
Transfer: [Crud, ComponentAddress | null];
|
|
23
26
|
} | {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions on a transaction request. Deliberately not [`Crud`]: approving is
|
|
3
|
+
* not a mutation of the request, it is the act that authorises the value
|
|
4
|
+
* transfer the request describes. Modelling it as `Update` would let any
|
|
5
|
+
* grant carrying edit rights approve.
|
|
6
|
+
*/
|
|
7
|
+
export type TxRequestAction = "Read" | "Create" | "Approve";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a caller sees for a request: its stored status, or `Expired` when the
|
|
3
|
+
* approval window has closed on a request that never reached a terminal state.
|
|
4
|
+
*/
|
|
5
|
+
export type EffectiveStatus = "Pending" | "Approved" | "Rejected" | "Submitting" | "Submitted" | "Expired";
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { Amount } from "../Amount";
|
|
2
|
+
import type { UtxoAddress } from "../UtxoAddress";
|
|
2
3
|
import type { UtxoInputSelection } from "../UtxoInputSelection";
|
|
3
4
|
export type InputSelection = {
|
|
4
|
-
FromBucket: {
|
|
5
|
+
"FromBucket": {
|
|
5
6
|
revealed_amount: Amount;
|
|
6
7
|
};
|
|
7
8
|
} | {
|
|
8
|
-
Selection: UtxoInputSelection;
|
|
9
|
+
"Selection": UtxoInputSelection;
|
|
10
|
+
} | {
|
|
11
|
+
"Specific": {
|
|
12
|
+
utxo_addresses: Array<UtxoAddress>;
|
|
13
|
+
};
|
|
9
14
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UnsignedTransaction } from "../UnsignedTransaction";
|
|
2
|
+
export type TransactionDetectInputsRequest = {
|
|
3
|
+
transaction: UnsignedTransaction;
|
|
4
|
+
/**
|
|
5
|
+
* If true (default), detected inputs omit versions so consensus resolves
|
|
6
|
+
* them; if false, walletd pins the versions it currently knows.
|
|
7
|
+
*/
|
|
8
|
+
use_unversioned: boolean;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { TransactionSignature } from "../TransactionSignature";
|
|
2
|
+
import type { UnsignedTransaction } from "../UnsignedTransaction";
|
|
3
|
+
import type { KeyId } from "./KeyId";
|
|
4
|
+
/**
|
|
5
|
+
* Create a transaction request for a separately-permissioned principal to
|
|
6
|
+
* approve (issue #2343).
|
|
7
|
+
*
|
|
8
|
+
* The transaction is stored verbatim and frozen: what the approver views is
|
|
9
|
+
* what submit seals. The caller supplies a complete transaction (inputs
|
|
10
|
+
* resolved, any out-of-band signatures collected); walletd does not alter it.
|
|
11
|
+
*/
|
|
12
|
+
export type TransactionRequestCreateRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* The transaction, stored verbatim. Inputs must already be resolved: the
|
|
15
|
+
* request path does not detect them, so that a caller who has already
|
|
16
|
+
* collected signatures over these exact bytes is not invalidated. Use
|
|
17
|
+
* `transactions.detect_inputs` first if the caller cannot resolve them.
|
|
18
|
+
*/
|
|
19
|
+
transaction: UnsignedTransaction;
|
|
20
|
+
/**
|
|
21
|
+
* Who pays and seals last.
|
|
22
|
+
*/
|
|
23
|
+
seal_signer: KeyId;
|
|
24
|
+
/**
|
|
25
|
+
* Wallet keys walletd signs with at submit.
|
|
26
|
+
*/
|
|
27
|
+
other_signers: Array<KeyId>;
|
|
28
|
+
/**
|
|
29
|
+
* Signatures collected out of band (e.g. from an external co-signer) over
|
|
30
|
+
* `transaction` and `seal_signer`'s public key. Attached verbatim at
|
|
31
|
+
* submit. Their presence means the transaction is final, so nothing about
|
|
32
|
+
* it is altered after creation.
|
|
33
|
+
*/
|
|
34
|
+
signatures: Array<TransactionSignature>;
|
|
35
|
+
/**
|
|
36
|
+
* Locks holding this request's inputs. Their timeouts are extended to
|
|
37
|
+
* outlive the approval window. Stealth spend keys are derived from these
|
|
38
|
+
* at submit -- a caller cannot name them.
|
|
39
|
+
*/
|
|
40
|
+
lock_ids: Array<number>;
|
|
41
|
+
/**
|
|
42
|
+
* How long a human has to approve, in seconds. Defaults to the daemon's
|
|
43
|
+
* configured window.
|
|
44
|
+
*/
|
|
45
|
+
ttl_secs: number | null;
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TransactionId } from "../TransactionId";
|
|
2
|
+
import type { UnsignedTransaction } from "../UnsignedTransaction";
|
|
3
|
+
import type { EffectiveStatus } from "./EffectiveStatus";
|
|
4
|
+
import type { KeyId } from "./KeyId";
|
|
5
|
+
import type { TransactionRequestValueSummary } from "./TransactionRequestValueSummary";
|
|
6
|
+
export type TransactionRequestInfo = {
|
|
7
|
+
request_id: number;
|
|
8
|
+
/**
|
|
9
|
+
* The frozen transaction, decoded for display. These are the exact bytes
|
|
10
|
+
* an approval commits to.
|
|
11
|
+
*/
|
|
12
|
+
transaction: UnsignedTransaction;
|
|
13
|
+
seal_signer: KeyId;
|
|
14
|
+
other_signers: Array<KeyId>;
|
|
15
|
+
/**
|
|
16
|
+
* Admin-assigned name of the API key that created this request, or `None`
|
|
17
|
+
* for a wallet session. Display only -- nothing authorises on it.
|
|
18
|
+
*/
|
|
19
|
+
requested_by: string | null;
|
|
20
|
+
status: EffectiveStatus;
|
|
21
|
+
transaction_id: TransactionId | null;
|
|
22
|
+
/**
|
|
23
|
+
* `None` for an ordinary transaction, whose instructions are readable.
|
|
24
|
+
*/
|
|
25
|
+
value_summary: TransactionRequestValueSummary | null;
|
|
26
|
+
/**
|
|
27
|
+
* Unix timestamp (seconds).
|
|
28
|
+
*/
|
|
29
|
+
expires_at: bigint;
|
|
30
|
+
/**
|
|
31
|
+
* Unix timestamp (seconds). `None` until approved.
|
|
32
|
+
*/
|
|
33
|
+
approved_at: bigint | null;
|
|
34
|
+
/**
|
|
35
|
+
* Unix timestamp (seconds).
|
|
36
|
+
*/
|
|
37
|
+
created_at: bigint;
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ResourceAddress } from "../ResourceAddress";
|
|
2
|
+
/**
|
|
3
|
+
* Net value movement for a stealth or confidential transfer, computed by the
|
|
4
|
+
* wallet from the request's locks.
|
|
5
|
+
*
|
|
6
|
+
* A stealth transfer's instructions are commitments and range proofs, so a
|
|
7
|
+
* human cannot read the amount out of them. The wallet owns the masks and is
|
|
8
|
+
* the only party that can state what leaves the account.
|
|
9
|
+
*/
|
|
10
|
+
export type TransactionRequestValueSummary = {
|
|
11
|
+
resource_address: ResourceAddress;
|
|
12
|
+
/**
|
|
13
|
+
* Total value of the inputs this request spends.
|
|
14
|
+
*/
|
|
15
|
+
inputs_total: bigint;
|
|
16
|
+
/**
|
|
17
|
+
* Total value returning to this wallet as change.
|
|
18
|
+
*/
|
|
19
|
+
change_total: bigint;
|
|
20
|
+
/**
|
|
21
|
+
* `inputs_total - change_total`: what actually leaves, before fees.
|
|
22
|
+
*/
|
|
23
|
+
amount_leaving: bigint;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import type { TransactionSignature } from "../TransactionSignature";
|
|
1
2
|
import type { UnsignedTransaction } from "../UnsignedTransaction";
|
|
2
3
|
import type { KeyId } from "./KeyId";
|
|
3
4
|
export type TransactionSubmitRequest = {
|
|
4
5
|
transaction: UnsignedTransaction;
|
|
5
6
|
seal_signer: KeyId;
|
|
6
7
|
other_signers: Array<KeyId>;
|
|
8
|
+
/**
|
|
9
|
+
* Signatures collected out of band, attached before walletd adds its own
|
|
10
|
+
* and seals.
|
|
11
|
+
*/
|
|
12
|
+
signatures: Array<TransactionSignature>;
|
|
7
13
|
/**
|
|
8
14
|
* Attempt to infer inputs and their dependencies from instructions. If false, the provided transaction must
|
|
9
15
|
* contain the required inputs.
|
package/dist/wallet-types.d.ts
CHANGED
|
@@ -181,3 +181,18 @@ export * from "./types/wallet-types/TemplatesListAuthoredResponse";
|
|
|
181
181
|
export * from "./types/wallet-types/StealthUtxosDecryptValueResponse";
|
|
182
182
|
export * from "./types/wallet-types/StealthUtxosGetValueLookupInfoRequest";
|
|
183
183
|
export * from "./types/wallet-types/StealthUtxosGetValueLookupInfoResponse";
|
|
184
|
+
export * from "./types/wallet-types/EffectiveStatus";
|
|
185
|
+
export * from "./types/wallet-types/TransactionRequestCreateRequest";
|
|
186
|
+
export * from "./types/wallet-types/TransactionRequestCreateResponse";
|
|
187
|
+
export * from "./types/wallet-types/TransactionRequestDecisionRequest";
|
|
188
|
+
export * from "./types/wallet-types/TransactionRequestDecisionResponse";
|
|
189
|
+
export * from "./types/wallet-types/TransactionRequestGetRequest";
|
|
190
|
+
export * from "./types/wallet-types/TransactionRequestGetResponse";
|
|
191
|
+
export * from "./types/wallet-types/TransactionRequestInfo";
|
|
192
|
+
export * from "./types/wallet-types/TransactionRequestListRequest";
|
|
193
|
+
export * from "./types/wallet-types/TransactionRequestListResponse";
|
|
194
|
+
export * from "./types/wallet-types/TransactionRequestSubmitRequest";
|
|
195
|
+
export * from "./types/wallet-types/TransactionRequestSubmitResponse";
|
|
196
|
+
export * from "./types/wallet-types/TransactionRequestValueSummary";
|
|
197
|
+
export * from "./types/wallet-types/TransactionDetectInputsRequest";
|
|
198
|
+
export * from "./types/wallet-types/TransactionDetectInputsResponse";
|
package/dist/wallet-types.js
CHANGED
|
@@ -183,3 +183,18 @@ export * from "./types/wallet-types/TemplatesListAuthoredResponse";
|
|
|
183
183
|
export * from "./types/wallet-types/StealthUtxosDecryptValueResponse";
|
|
184
184
|
export * from "./types/wallet-types/StealthUtxosGetValueLookupInfoRequest";
|
|
185
185
|
export * from "./types/wallet-types/StealthUtxosGetValueLookupInfoResponse";
|
|
186
|
+
export * from "./types/wallet-types/EffectiveStatus";
|
|
187
|
+
export * from "./types/wallet-types/TransactionRequestCreateRequest";
|
|
188
|
+
export * from "./types/wallet-types/TransactionRequestCreateResponse";
|
|
189
|
+
export * from "./types/wallet-types/TransactionRequestDecisionRequest";
|
|
190
|
+
export * from "./types/wallet-types/TransactionRequestDecisionResponse";
|
|
191
|
+
export * from "./types/wallet-types/TransactionRequestGetRequest";
|
|
192
|
+
export * from "./types/wallet-types/TransactionRequestGetResponse";
|
|
193
|
+
export * from "./types/wallet-types/TransactionRequestInfo";
|
|
194
|
+
export * from "./types/wallet-types/TransactionRequestListRequest";
|
|
195
|
+
export * from "./types/wallet-types/TransactionRequestListResponse";
|
|
196
|
+
export * from "./types/wallet-types/TransactionRequestSubmitRequest";
|
|
197
|
+
export * from "./types/wallet-types/TransactionRequestSubmitResponse";
|
|
198
|
+
export * from "./types/wallet-types/TransactionRequestValueSummary";
|
|
199
|
+
export * from "./types/wallet-types/TransactionDetectInputsRequest";
|
|
200
|
+
export * from "./types/wallet-types/TransactionDetectInputsResponse";
|