[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-docs] branch master updated: tweak wallet-core doc generation
From: |
gnunet |
Subject: |
[taler-docs] branch master updated: tweak wallet-core doc generation |
Date: |
Tue, 04 Oct 2022 19:07:40 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository docs.
The following commit(s) were added to refs/heads/master by this push:
new f4564b5 tweak wallet-core doc generation
f4564b5 is described below
commit f4564b57acd04dd34751ced8ecb2bd10974452a6
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Oct 4 19:07:36 2022 +0200
tweak wallet-core doc generation
---
extract-tsdefs/extract.ts | 84 ++++++---
wallet/wallet-core.md | 462 ++++++++++++++++++++++++++++------------------
2 files changed, 345 insertions(+), 201 deletions(-)
diff --git a/extract-tsdefs/extract.ts b/extract-tsdefs/extract.ts
index ea133f3..5be8247 100644
--- a/extract-tsdefs/extract.ts
+++ b/extract-tsdefs/extract.ts
@@ -30,7 +30,11 @@ const walletRootDir = process.argv[2];
const outfile = process.argv[3];
const walletCoreDir = path.join(walletRootDir, "packages/taler-wallet-core");
-const excludedNames = new Set(["TalerErrorCode", "WalletBackupContentV1"]);
+const excludedNames = new Set([
+ "TalerErrorCode",
+ "WalletBackupContentV1",
+ "Array",
+]);
const configFile = ts.findConfigFile(
walletCoreDir,
@@ -76,6 +80,10 @@ interface PerOpGatherState {
opName: string;
nameSet: Set<string>;
group: string;
+ /**
+ * Enum member declaration in the form 'Foo = "bar"'.
+ */
+ enumMemberDecl: string | undefined;
}
interface GatherState {
@@ -88,8 +96,12 @@ function gatherDecls(
perOpState: PerOpGatherState
): void {
switch (node.kind) {
+ case ts.SyntaxKind.EnumDeclaration:
+ // Always handled via parent
+ return;
+ case ts.SyntaxKind.Identifier:
case ts.SyntaxKind.TypeReference: {
- console.log(`typeref ${node.getText()}`);
+ console.log(`start typeref-or-id ${node.getText()}`);
const type = checker.getTypeAtLocation(node);
if (type.flags === ts.TypeFlags.String) {
console.log("string!");
@@ -97,41 +109,31 @@ function gatherDecls(
}
const symbol = type.symbol || type.aliasSymbol;
if (!symbol) {
- console.log(`no symbol for ${node.getText()}`);
+ console.log(`no type symbol for ${node.getText()}`);
break;
}
const name = symbol.name;
+ console.log(`symbol name: ${type.symbol?.name}`);
+ console.log(`alias symbol name: ${type.aliasSymbol?.name}`);
if (perOpState.nameSet.has(name)) {
+ console.log("already found!");
break;
}
perOpState.nameSet.add(name);
if (excludedNames.has(name)) {
+ console.log("excluded!");
break;
}
const decls = symbol.getDeclarations();
decls?.forEach((decl) => {
- console.log(`decl kind ${ts.SyntaxKind[node.kind]}`);
- console.log(`decl for ${node.getText()}`);
const sourceFilename = decl.getSourceFile().fileName;
if (path.basename(sourceFilename).startsWith("lib.")) {
return;
}
- console.log(`decl source ${decl.getSourceFile().fileName}`);
- console.log(`mod name ${decl.getSourceFile().moduleName}`);
switch (decl.kind) {
case ts.SyntaxKind.EnumMember: {
- const parentType = checker.getTypeAtLocation(decl.parent);
- const declText = printer.printNode(
- ts.EmitHint.Unspecified,
- decl,
- decl.getSourceFile()!
- );
- gatherState.declTexts.set(
- name,
- `// Enum value:\n// ${
- parentType.symbol.name || parentType.aliasSymbol?.name
- }.${declText}`
- );
+ gatherDecls(decl.parent, gatherState, perOpState);
+ console.log("enum member", decl.getText());
break;
}
case ts.SyntaxKind.InterfaceDeclaration:
@@ -151,16 +153,43 @@ function gatherDecls(
break;
}
gatherDecls(decl, gatherState, perOpState);
+ console.log(`end typeref-or-id ${node.getText()}`);
});
break;
}
default:
- node.forEachChild((child) => {
- gatherDecls(child, gatherState, perOpState);
- });
- //console.log(`// unknown node kind ${ts.SyntaxKind[node.kind]}`);
- return;
+ break;
}
+ console.log(`syntax children for ${node.getText()}`);
+ node.forEachChild((child) => {
+ console.log(`syntax child: ${ts.SyntaxKind[child.kind]}`);
+ gatherDecls(child, gatherState, perOpState);
+ });
+ //console.log(`// unknown node kind ${ts.SyntaxKind[node.kind]}`);
+ return;
+}
+
+function getOpEnumDecl(decl: ts.Declaration): string | undefined {
+ let enumMemberDecl: undefined | string = undefined;
+ function walk(node: ts.Node) {
+ node.forEachChild((x) => {
+ console.log(`child kind: ${ts.SyntaxKind[x.kind]}`);
+ console.log(x.getText());
+ switch (x.kind) {
+ case ts.SyntaxKind.PropertySignature: {
+ const sig = x as ts.PropertySignature;
+ if (sig.name.getText() == "op") {
+ const type = checker.getTypeFromTypeNode(sig.type!);
+ enumMemberDecl = type.symbol.declarations![0]!.getText();
+ }
+ break;
+ }
+ }
+ walk(x);
+ });
+ }
+ walk(decl);
+ return enumMemberDecl;
}
const main = async () => {
@@ -178,11 +207,12 @@ const main = async () => {
}
const decls = v.getDeclarations();
decls?.forEach((decl) => {
+ console.log(`export decl, kind ${ts.SyntaxKind[decl.kind]}`);
+
const commentRanges = ts.getLeadingCommentRanges(
sourceFile.getFullText(),
decl.getFullStart()
);
- console.log(commentRanges);
commentRanges?.forEach((r) => {
const text = sourceFile.getFullText().slice(r.pos, r.end);
console.log("comment text:", text);
@@ -199,12 +229,16 @@ const main = async () => {
opName: v.name,
nameSet: new Set<string>(),
group: currentGroup,
+ enumMemberDecl: getOpEnumDecl(decl),
};
let declText = printer.printNode(
ts.EmitHint.Unspecified,
decl,
decl.getSourceFile()!
);
+ if (perOpState.enumMemberDecl) {
+ declText = declText + `\n// ${perOpState.enumMemberDecl}\n`;
+ }
console.log("replacing group in", declText);
// Remove group comments
declText = declText.replace(/\/\/ group: [^\n]*[\n]/m, "");
diff --git a/wallet/wallet-core.md b/wallet/wallet-core.md
index 331b914..09619dc 100644
--- a/wallet/wallet-core.md
+++ b/wallet/wallet-core.md
@@ -73,11 +73,7 @@ export type InitWalletOp = {
request: {};
response: {};
};
-
-```
-```typescript
-// Enum value:
-// WalletApiOperation.InitWallet = "initWallet"
+// InitWallet = "initWallet"
```
@@ -87,9 +83,11 @@ export type InitWalletOp = {
* Get current wallet balance.
*/
export type GetBalancesOp = {
+ op: WalletApiOperation.GetBalances;
request: {};
response: BalancesResponse;
};
+// GetBalances = "getBalances"
```
```typescript
@@ -115,9 +113,11 @@ export interface Balance {
* Get transactions.
*/
export type GetTransactionsOp = {
+ op: WalletApiOperation.GetTransactions;
request: TransactionsRequest;
response: TransactionsResponse;
};
+// GetTransactions = "getTransactions"
```
```typescript
@@ -173,8 +173,41 @@ export interface TransactionWithdrawal extends
TransactionCommon {
```
```typescript
-// Enum value:
-// TransactionType.Withdrawal = "withdrawal"
+export interface TransactionCommon {
+ transactionId: string;
+ type: TransactionType;
+ timestamp: TalerProtocolTimestamp;
+ pending: boolean;
+ /**
+ * True if the transaction encountered a problem that might be
+ * permanent. A frozen transaction won't be automatically retried.
+ */
+ frozen: boolean;
+ /**
+ * Raw amount of the transaction (exclusive of fees or other extra costs).
+ */
+ amountRaw: AmountString;
+ /**
+ * Amount added or removed from the wallet's balance (including all fees and
other costs).
+ */
+ amountEffective: AmountString;
+ error?: TalerErrorDetail;
+}
+
+```
+```typescript
+export declare enum TransactionType {
+ Withdrawal = "withdrawal",
+ Payment = "payment",
+ Refund = "refund",
+ Refresh = "refresh",
+ Tip = "tip",
+ Deposit = "deposit",
+ PeerPushDebit = "peer-push-debit",
+ PeerPushCredit = "peer-push-credit",
+ PeerPullDebit = "peer-pull-debit",
+ PeerPullCredit = "peer-pull-credit",
+}
```
```typescript
@@ -195,11 +228,6 @@ interface WithdrawalDetailsForManualTransfer {
reservePub: string;
}
-```
-```typescript
-// Enum value:
-// WithdrawalType.ManualTransfer = "manual-transfer"
-
```
```typescript
interface WithdrawalDetailsForTalerBankIntegrationApi {
@@ -218,11 +246,6 @@ interface WithdrawalDetailsForTalerBankIntegrationApi {
reservePub: string;
}
-```
-```typescript
-// Enum value:
-// WithdrawalType.TalerBankIntegrationApi = "taler-bank-integration-api"
-
```
```typescript
export interface TransactionPayment extends TransactionCommon {
@@ -265,11 +288,6 @@ export interface TransactionPayment extends
TransactionCommon {
refunds: RefundInfoShort[];
}
-```
-```typescript
-// Enum value:
-// TransactionType.Payment = "payment"
-
```
```typescript
export declare enum PaymentStatus {
@@ -315,11 +333,6 @@ export interface TransactionRefund extends
TransactionCommon {
amountEffective: AmountString;
}
-```
-```typescript
-// Enum value:
-// TransactionType.Refund = "refund"
-
```
```typescript
export interface TransactionTip extends TransactionCommon {
@@ -332,11 +345,6 @@ export interface TransactionTip extends TransactionCommon {
merchantBaseUrl: string;
}
-```
-```typescript
-// Enum value:
-// TransactionType.Tip = "tip"
-
```
```typescript
export interface TransactionRefresh extends TransactionCommon {
@@ -395,11 +403,6 @@ export interface TransactionPeerPullCredit extends
TransactionCommon {
talerUri: string;
}
-```
-```typescript
-// Enum value:
-// TransactionType.PeerPullCredit = "peer-pull-credit"
-
```
```typescript
export interface PeerInfoShort {
@@ -423,11 +426,6 @@ export interface TransactionPeerPullDebit extends
TransactionCommon {
amountEffective: AmountString;
}
-```
-```typescript
-// Enum value:
-// TransactionType.PeerPullDebit = "peer-pull-debit"
-
```
```typescript
/**
@@ -450,11 +448,6 @@ export interface TransactionPeerPushCredit extends
TransactionCommon {
amountEffective: AmountString;
}
-```
-```typescript
-// Enum value:
-// TransactionType.PeerPushCredit = "peer-push-credit"
-
```
```typescript
/**
@@ -481,11 +474,6 @@ export interface TransactionPeerPushDebit extends
TransactionCommon {
talerUri: string;
}
-```
-```typescript
-// Enum value:
-// TransactionType.PeerPushDebit = "peer-push-debit"
-
```
### DeleteTransactionOp
@@ -494,9 +482,11 @@ export interface TransactionPeerPushDebit extends
TransactionCommon {
* Delete a transaction locally in the wallet.
*/
export type DeleteTransactionOp = {
+ op: WalletApiOperation.DeleteTransaction;
request: DeleteTransactionRequest;
response: {};
};
+// DeleteTransaction = "deleteTransaction"
```
```typescript
@@ -512,9 +502,11 @@ export interface DeleteTransactionRequest {
* Immediately retry a transaction.
*/
export type RetryTransactionOp = {
+ op: WalletApiOperation.RetryTransaction;
request: RetryTransactionRequest;
response: {};
};
+// RetryTransaction = "retryTransaction"
```
```typescript
@@ -530,9 +522,11 @@ export interface RetryTransactionRequest {
* Get details for withdrawing a particular amount (manual withdrawal).
*/
export type GetWithdrawalDetailsForAmountOp = {
+ op: WalletApiOperation.GetWithdrawalDetailsForAmount;
request: GetWithdrawalDetailsForAmountRequest;
response: ManualWithdrawalDetails;
};
+// GetWithdrawalDetailsForAmount = "getWithdrawalDetailsForAmount"
```
```typescript
@@ -572,9 +566,11 @@ export interface ManualWithdrawalDetails {
* Get details for withdrawing via a particular taler:// URI.
*/
export type GetWithdrawalDetailsForUriOp = {
+ op: WalletApiOperation.GetWithdrawalDetailsForUri;
request: GetWithdrawalDetailsForUriRequest;
response: WithdrawUriInfoResponse;
};
+// GetWithdrawalDetailsForUri = "getWithdrawalDetailsForUri"
```
```typescript
@@ -599,9 +595,11 @@ export interface WithdrawUriInfoResponse {
* Accept a bank-integrated withdrawal.
*/
export type AcceptBankIntegratedWithdrawalOp = {
+ op: WalletApiOperation.AcceptBankIntegratedWithdrawal;
request: AcceptBankIntegratedWithdrawalRequest;
response: AcceptWithdrawalResponse;
};
+// AcceptBankIntegratedWithdrawal = "acceptBankIntegratedWithdrawal"
```
```typescript
@@ -628,9 +626,11 @@ export interface AcceptWithdrawalResponse {
* Create a manual withdrawal.
*/
export type AcceptManualWithdrawalOp = {
+ op: WalletApiOperation.AcceptManualWithdrawal;
request: AcceptManualWithdrawalRequest;
response: AcceptManualWithdrawalResult;
};
+// AcceptManualWithdrawal = "acceptManualWithdrawal"
```
```typescript
@@ -666,11 +666,7 @@ export type PreparePayForUriOp = {
request: PreparePayRequest;
response: PreparePayResult;
};
-
-```
-```typescript
-// Enum value:
-// WalletApiOperation.PreparePayForUri = "preparePayForUri"
+// PreparePayForUri = "preparePayForUri"
```
```typescript
@@ -710,11 +706,6 @@ export interface PreparePayResultAlreadyConfirmed {
proposalId: string;
}
-```
-```typescript
-// Enum value:
-// PreparePayResultType.AlreadyConfirmed = "already-confirmed"
-
```
```typescript
/**
@@ -730,11 +721,6 @@ export interface PreparePayResultPaymentPossible {
noncePriv: string;
}
-```
-```typescript
-// Enum value:
-// PreparePayResultType.PaymentPossible = "payment-possible"
-
```
### ConfirmPayOp
@@ -748,11 +734,7 @@ export type ConfirmPayOp = {
request: ConfirmPayRequest;
response: ConfirmPayResult;
};
-
-```
-```typescript
-// Enum value:
-// WalletApiOperation.ConfirmPay = "confirmPay"
+// ConfirmPay = "confirmPay"
```
```typescript
@@ -779,11 +761,6 @@ export interface ConfirmPayResultDone {
transactionId: string;
}
-```
-```typescript
-// Enum value:
-// ConfirmPayResultType.Done = "done"
-
```
```typescript
export interface ConfirmPayResultPending {
@@ -800,9 +777,11 @@ export interface ConfirmPayResultPending {
* Abort a pending payment with a refund.
*/
export type AbortPayWithRefundOp = {
+ op: WalletApiOperation.AbortFailedPayWithRefund;
request: AbortPayWithRefundRequest;
response: {};
};
+// AbortFailedPayWithRefund = "abortFailedPayWithRefund"
```
```typescript
@@ -818,9 +797,11 @@ export interface AbortPayWithRefundRequest {
* Check for a refund based on a taler://refund URI.
*/
export type ApplyRefundOp = {
+ op: WalletApiOperation.ApplyRefund;
request: ApplyRefundRequest;
response: ApplyRefundResponse;
};
+// ApplyRefund = "applyRefund"
```
```typescript
@@ -849,9 +830,11 @@ export interface ApplyRefundResponse {
* Query and store information about a tip.
*/
export type PrepareTipOp = {
+ op: WalletApiOperation.PrepareTip;
request: PrepareTipRequest;
response: PrepareTipResult;
};
+// PrepareTip = "prepareTip"
```
```typescript
@@ -904,9 +887,11 @@ export interface PrepareTipResult {
* Accept a tip.
*/
export type AcceptTipOp = {
+ op: WalletApiOperation.AcceptTip;
request: AcceptTipRequest;
response: {};
};
+// AcceptTip = "acceptTip"
```
```typescript
@@ -922,9 +907,11 @@ export interface AcceptTipRequest {
* List exchanges known to the wallet.
*/
export type ListExchangesOp = {
+ op: WalletApiOperation.ListExchanges;
request: {};
response: ExchangesListResponse;
};
+// ListExchanges = "listExchanges"
```
```typescript
@@ -940,9 +927,11 @@ export interface ExchangesListResponse {
* Add / force-update an exchange.
*/
export type AddExchangeOp = {
+ op: WalletApiOperation.AddExchange;
request: AddExchangeRequest;
response: {};
};
+// AddExchange = "addExchange"
```
```typescript
@@ -959,9 +948,11 @@ export interface AddExchangeRequest {
* Accept a particular version of the exchange terms of service.
*/
export type SetExchangeTosAcceptedOp = {
+ op: WalletApiOperation.SetExchangeTosAccepted;
request: AcceptExchangeTosRequest;
response: {};
};
+// SetExchangeTosAccepted = "setExchangeTosAccepted"
```
```typescript
@@ -978,9 +969,11 @@ export interface AcceptExchangeTosRequest {
* Get the current terms of a service of an exchange.
*/
export type GetExchangeTosOp = {
+ op: WalletApiOperation.GetExchangeTos;
request: GetExchangeTosRequest;
response: GetExchangeTosResult;
};
+// GetExchangeTos = "getExchangeTos"
```
```typescript
@@ -1019,9 +1012,11 @@ export interface GetExchangeTosResult {
* List currencies known to the wallet.
*/
export type ListCurrenciesOp = {
+ op: WalletApiOperation.ListCurrencies;
request: {};
response: WalletCurrencyInfo;
};
+// ListCurrencies = "listCurrencies"
```
```typescript
@@ -1049,9 +1044,11 @@ export interface WalletCurrencyInfo {
* account, usually the wallet user's own bank account.
*/
export type CreateDepositGroupOp = {
+ op: WalletApiOperation.CreateDepositGroup;
request: CreateDepositGroupRequest;
response: CreateDepositGroupResponse;
};
+// CreateDepositGroup = "createDepositGroup"
```
```typescript
@@ -1075,9 +1072,11 @@ export interface CreateDepositGroupResponse {
* Track the status of a deposit group by querying the exchange.
*/
export type TrackDepositGroupOp = {
+ op: WalletApiOperation.TrackDepositGroup;
request: TrackDepositGroupRequest;
response: TrackDepositGroupResponse;
};
+// TrackDepositGroup = "trackDepositGroup"
```
```typescript
@@ -1102,9 +1101,11 @@ export interface TrackDepositGroupResponse {
* Export the recovery information for the wallet.
*/
export type ExportBackupRecoveryOp = {
+ op: WalletApiOperation.ExportBackupRecovery;
request: {};
response: BackupRecovery;
};
+// ExportBackupRecovery = "exportBackupRecovery"
```
@@ -1114,9 +1115,11 @@ export type ExportBackupRecoveryOp = {
* Import recovery information into the wallet.
*/
export type ImportBackupRecoveryOp = {
+ op: WalletApiOperation.ImportBackupRecovery;
request: RecoveryLoadRequest;
response: {};
};
+// ImportBackupRecovery = "importBackupRecovery"
```
```typescript
@@ -1152,9 +1155,11 @@ export declare enum RecoveryMergeStrategy {
* Manually make and upload a backup.
*/
export type RunBackupCycleOp = {
+ op: WalletApiOperation.RunBackupCycle;
request: {};
response: {};
};
+// RunBackupCycle = "runBackupCycle"
```
@@ -1164,9 +1169,11 @@ export type RunBackupCycleOp = {
* Add a new backup provider.
*/
export type AddBackupProviderOp = {
+ op: WalletApiOperation.AddBackupProvider;
request: AddBackupProviderRequest;
response: {};
};
+// AddBackupProvider = "addBackupProvider"
```
```typescript
@@ -1188,9 +1195,11 @@ export interface AddBackupProviderRequest {
* Get some useful stats about the backup state.
*/
export type GetBackupInfoOp = {
+ op: WalletApiOperation.GetBackupInfo;
request: {};
response: BackupInfo;
};
+// GetBackupInfo = "getBackupInfo"
```
```typescript
@@ -1271,11 +1280,6 @@ export interface ProviderPaymentTermsChanged {
newTerms: BackupProviderTerms;
}
-```
-```typescript
-// Enum value:
-// ProviderPaymentType.TermsChanged = "terms-changed"
-
```
```typescript
export interface ProviderPaymentPaid {
@@ -1283,11 +1287,6 @@ export interface ProviderPaymentPaid {
paidUntil: AbsoluteTime;
}
-```
-```typescript
-// Enum value:
-// ProviderPaymentType.Paid = "paid"
-
```
```typescript
export interface ProviderPaymentInsufficientBalance {
@@ -1300,11 +1299,6 @@ export interface ProviderPaymentUnpaid {
type: ProviderPaymentType.Unpaid;
}
-```
-```typescript
-// Enum value:
-// ProviderPaymentType.Unpaid = "unpaid"
-
```
```typescript
export interface ProviderPaymentPending {
@@ -1321,9 +1315,11 @@ export interface ProviderPaymentPending {
* the backup of another wallet.
*/
export type SetWalletDeviceIdOp = {
+ op: WalletApiOperation.SetWalletDeviceId;
request: SetWalletDeviceIdRequest;
response: {};
};
+// SetWalletDeviceId = "setWalletDeviceId"
```
```typescript
@@ -1342,9 +1338,11 @@ export interface SetWalletDeviceIdRequest {
* Export a backup JSON, mostly useful for testing.
*/
export type ExportBackupPlainOp = {
+ op: WalletApiOperation.ExportBackupPlain;
request: {};
response: WalletBackupContentV1;
};
+// ExportBackupPlain = "exportBackupPlain"
```
@@ -1354,9 +1352,11 @@ export type ExportBackupPlainOp = {
* Initiate an outgoing peer push payment.
*/
export type InitiatePeerPushPaymentOp = {
+ op: WalletApiOperation.InitiatePeerPushPayment;
request: InitiatePeerPushPaymentRequest;
response: InitiatePeerPushPaymentResponse;
};
+// InitiatePeerPushPayment = "initiatePeerPushPayment"
```
```typescript
@@ -1384,9 +1384,11 @@ export interface InitiatePeerPushPaymentResponse {
* Check an incoming peer push payment.
*/
export type CheckPeerPushPaymentOp = {
+ op: WalletApiOperation.CheckPeerPushPayment;
request: CheckPeerPushPaymentRequest;
response: CheckPeerPushPaymentResponse;
};
+// CheckPeerPushPayment = "checkPeerPushPayment"
```
```typescript
@@ -1410,9 +1412,11 @@ export interface CheckPeerPushPaymentResponse {
* Accept an incoming peer push payment.
*/
export type AcceptPeerPushPaymentOp = {
+ op: WalletApiOperation.AcceptPeerPushPayment;
request: AcceptPeerPushPaymentRequest;
response: {};
};
+// AcceptPeerPushPayment = "acceptPeerPushPayment"
```
```typescript
@@ -1431,9 +1435,11 @@ export interface AcceptPeerPushPaymentRequest {
* Initiate an outgoing peer pull payment.
*/
export type InitiatePeerPullPaymentOp = {
+ op: WalletApiOperation.InitiatePeerPullPayment;
request: InitiatePeerPullPaymentRequest;
response: InitiatePeerPullPaymentResponse;
};
+// InitiatePeerPullPayment = "initiatePeerPullPayment"
```
```typescript
@@ -1465,9 +1471,11 @@ export interface InitiatePeerPullPaymentResponse {
* Prepare for an incoming peer pull payment.
*/
export type CheckPeerPullPaymentOp = {
+ op: WalletApiOperation.CheckPeerPullPayment;
request: CheckPeerPullPaymentRequest;
response: CheckPeerPullPaymentResponse;
};
+// CheckPeerPullPayment = "checkPeerPullPayment"
```
```typescript
@@ -1491,9 +1499,11 @@ export interface CheckPeerPullPaymentResponse {
* Accept an incoming peer pull payment.
*/
export type AcceptPeerPullPaymentOp = {
+ op: WalletApiOperation.AcceptPeerPullPayment;
request: AcceptPeerPullPaymentRequest;
response: {};
};
+// AcceptPeerPullPayment = "acceptPeerPullPayment"
```
```typescript
@@ -1512,9 +1522,11 @@ export interface AcceptPeerPullPaymentRequest {
* Exoport the wallet database's contents to JSON.
*/
export type ExportDbOp = {
+ op: WalletApiOperation.ExportDb;
request: {};
response: any;
};
+// ExportDb = "exportDb"
```
@@ -1524,9 +1536,11 @@ export type ExportDbOp = {
* Dangerously clear the whole wallet database.
*/
export type ClearDbOp = {
+ op: WalletApiOperation.ClearDb;
request: {};
response: {};
};
+// ClearDb = "clearDb"
```
@@ -1536,9 +1550,11 @@ export type ClearDbOp = {
* Export a backup, clear the database and re-import it.
*/
export type RecycleOp = {
+ op: WalletApiOperation.Recycle;
request: {};
response: {};
};
+// Recycle = "recycle"
```
@@ -1549,9 +1565,11 @@ export type RecycleOp = {
* of the exchange and merchant.
*/
export type RunIntegrationTestOp = {
+ op: WalletApiOperation.RunIntegrationTest;
request: IntegrationTestArgs;
response: {};
};
+// RunIntegrationTest = "runIntegrationTest"
```
```typescript
@@ -1574,9 +1592,11 @@ export interface IntegrationTestArgs {
* and merchant.
*/
export type WithdrawTestBalanceOp = {
+ op: WalletApiOperation.WithdrawTestBalance;
request: WithdrawTestBalanceRequest;
response: {};
};
+// WithdrawTestBalance = "withdrawTestBalance"
```
```typescript
@@ -1603,11 +1623,7 @@ export type WithdrawTestkudosOp = {
request: {};
response: {};
};
-
-```
-```typescript
-// Enum value:
-// WalletApiOperation.WithdrawTestkudos = "withdrawTestkudos"
+// WithdrawTestkudos = "withdrawTestkudos"
```
@@ -1618,9 +1634,11 @@ export type WithdrawTestkudosOp = {
* the exchange and merchant.
*/
export type TestPayOp = {
+ op: WalletApiOperation.TestPay;
request: TestPayArgs;
response: TestPayResult;
};
+// TestPay = "testPay"
```
```typescript
@@ -1702,11 +1720,7 @@ export type WithdrawFakebankOp = {
request: WithdrawFakebankRequest;
response: {};
};
-
-```
-```typescript
-// Enum value:
-// WalletApiOperation.WithdrawFakebank = "withdrawFakebank"
+// WithdrawFakebank = "withdrawFakebank"
```
```typescript
@@ -1724,9 +1738,11 @@ export interface WithdrawFakebankRequest {
* Get wallet-internal pending tasks.
*/
export type GetPendingTasksOp = {
+ op: WalletApiOperation.GetPendingOperations;
request: {};
response: PendingTasksResponse;
};
+// GetPendingOperations = "getPendingOperations"
```
```typescript
@@ -1822,6 +1838,87 @@ export interface RetryPolicy {
readonly maxTimeout: Duration;
}
+```
+```typescript
+// Declare "static" methods in Error
+interface ErrorConstructor {
+ /** Create .stack property on a target object */
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
+ /**
+ * Optional override for formatting stack traces
+ *
+ * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
+ */
+ prepareStackTrace?:
+ | ((err: Error, stackTraces: NodeJS.CallSite[]) => any)
+ | undefined;
+ stackTraceLimit: number;
+}
+
+```
+```typescript
+interface CallSite {
+ /**
+ * Value of "this"
+ */
+ getThis(): unknown;
+ /**
+ * Type of "this" as a string.
+ * This is the name of the function stored in the constructor field of
+ * "this", if available. Otherwise the object's [[Class]] internal
+ * property.
+ */
+ getTypeName(): string | null;
+ /**
+ * Current function
+ */
+ getFunction(): Function | undefined;
+ /**
+ * Name of the current function, typically its name property.
+ * If a name property is not available an attempt will be made to try
+ * to infer a name from the function's context.
+ */
+ getFunctionName(): string | null;
+ /**
+ * Name of the property [of "this" or one of its prototypes] that holds
+ * the current function
+ */
+ getMethodName(): string | null;
+ /**
+ * Name of the script [if this function was defined in a script]
+ */
+ getFileName(): string | null;
+ /**
+ * Current line number [if this function was defined in a script]
+ */
+ getLineNumber(): number | null;
+ /**
+ * Current column number [if this function was defined in a script]
+ */
+ getColumnNumber(): number | null;
+ /**
+ * A call site object representing the location where eval was called
+ * [if this function was created using a call to eval]
+ */
+ getEvalOrigin(): string | undefined;
+ /**
+ * Is this a toplevel invocation, that is, is "this" the global object?
+ */
+ isToplevel(): boolean;
+ /**
+ * Does this call take place in code defined by a call to eval?
+ */
+ isEval(): boolean;
+ /**
+ * Is this call in native V8 code?
+ */
+ isNative(): boolean;
+ /**
+ * Is this a constructor call?
+ */
+ isConstructor(): boolean;
+}
+
```
```typescript
/**
@@ -1833,11 +1930,6 @@ export interface PendingExchangeUpdateTask {
lastError: TalerErrorDetail | undefined;
}
-```
-```typescript
-// Enum value:
-// PendingTaskType.ExchangeUpdate = "exchange-update"
-
```
```typescript
/**
@@ -1849,11 +1941,6 @@ export interface PendingExchangeCheckRefreshTask {
exchangeBaseUrl: string;
}
-```
-```typescript
-// Enum value:
-// PendingTaskType.ExchangeCheckRefresh = "exchange-check-refresh"
-
```
```typescript
/**
@@ -1868,11 +1955,6 @@ export interface PendingPayTask {
lastError: TalerErrorDetail | undefined;
}
-```
-```typescript
-// Enum value:
-// PendingTaskType.Pay = "pay"
-
```
```typescript
/**
@@ -1888,11 +1970,6 @@ export interface PendingProposalDownloadTask {
retryInfo?: RetryInfo;
}
-```
-```typescript
-// Enum value:
-// PendingTaskType.ProposalDownload = "proposal-download"
-
```
```typescript
/**
@@ -1919,11 +1996,6 @@ export interface PendingRefundQueryTask {
lastError: TalerErrorDetail | undefined;
}
-```
-```typescript
-// Enum value:
-// PendingTaskType.RefundQuery = "refund-query"
-
```
```typescript
/**
@@ -1936,11 +2008,6 @@ export interface PendingTipPickupTask {
merchantTipId: string;
}
-```
-```typescript
-// Enum value:
-// PendingTaskType.TipPickup = "tip-pickup"
-
```
```typescript
/**
@@ -1953,11 +2020,6 @@ export interface PendingWithdrawTask {
withdrawalGroupId: string;
}
-```
-```typescript
-// Enum value:
-// PendingTaskType.Withdraw = "withdraw"
-
```
```typescript
export interface PendingRecoupTask {
@@ -1967,11 +2029,6 @@ export interface PendingRecoupTask {
lastError: TalerErrorDetail | undefined;
}
-```
-```typescript
-// Enum value:
-// PendingTaskType.Recoup = "recoup"
-
```
```typescript
/**
@@ -1992,11 +2049,6 @@ export interface PendingBackupTask {
lastError: TalerErrorDetail | undefined;
}
-```
-```typescript
-// Enum value:
-// PendingTaskType.Backup = "backup"
-
```
### DumpCoinsOp
@@ -2005,9 +2057,11 @@ export interface PendingBackupTask {
* Dump all coins of the wallet in a simple JSON format.
*/
export type DumpCoinsOp = {
+ op: WalletApiOperation.DumpCoins;
request: {};
response: CoinDumpJson;
};
+// DumpCoins = "dumpCoins"
```
```typescript
@@ -2066,7 +2120,75 @@ export interface CoinDumpJson {
```
```typescript
-interface Array<T> extends RelativeIndexable<T> {}
+export declare type DenominationPubKey =
+ | RsaDenominationPubKey
+ | CsDenominationPubKey;
+
+```
+```typescript
+export interface RsaDenominationPubKey {
+ readonly cipher: DenomKeyType.Rsa;
+ readonly rsa_public_key: string;
+ readonly age_mask: number;
+}
+
+```
+```typescript
+export interface CsDenominationPubKey {
+ readonly cipher: DenomKeyType.ClauseSchnorr;
+ readonly age_mask: number;
+ readonly cs_public_key: string;
+}
+
+```
+```typescript
+export interface AgeCommitmentProof {
+ commitment: AgeCommitment;
+ proof: AgeProof;
+}
+
+```
+```typescript
+export interface AgeCommitment {
+ mask: number;
+ /**
+ * Public keys, one for each age group specified in the age mask.
+ */
+ publicKeys: Edx25519PublicKeyEnc[];
+}
+
+```
+```typescript
+export declare type Edx25519PublicKeyEnc = FlavorP<
+ string,
+ "Edx25519PublicKeyEnc",
+ 32
+>;
+
+```
+```typescript
+export declare type FlavorP<T, FlavorT extends string, S extends number> = T &
{
+ _flavor?: `taler.${FlavorT}`;
+ _size?: S;
+};
+
+```
+```typescript
+export interface AgeProof {
+ /**
+ * Private keys. Typically smaller than the number of public keys,
+ * because we drop private keys from age groups that are restricted.
+ */
+ privateKeys: Edx25519PrivateKeyEnc[];
+}
+
+```
+```typescript
+export declare type Edx25519PrivateKeyEnc = FlavorP<
+ string,
+ "Edx25519PrivateKeyEnc",
+ 64
+>;
```
@@ -2077,9 +2199,11 @@ interface Array<T> extends RelativeIndexable<T> {}
* Suspended coins won't be used for payments.
*/
export type SetCoinSuspendedOp = {
+ op: WalletApiOperation.SetCoinSuspended;
request: SetCoinSuspendedRequest;
response: {};
};
+// SetCoinSuspended = "setCoinSuspended"
```
```typescript
@@ -2097,9 +2221,11 @@ export interface SetCoinSuspendedRequest {
* be necessary.
*/
export type ForceRefreshOp = {
+ op: WalletApiOperation.ForceRefresh;
request: ForceRefreshRequest;
response: {};
};
+// ForceRefresh = "forceRefresh"
```
```typescript
@@ -2111,6 +2237,18 @@ export interface ForceRefreshRequest {
## Common Declarations
```typescript
+export interface TalerProtocolTimestamp {
+ readonly t_s: number | "never";
+}
+```
+```typescript
+export interface TalerErrorDetail {
+ code: TalerErrorCode;
+ hint?: string;
+ [x: string]: unknown;
+}
+```
+```typescript
export interface OrderShortInfo {
/**
* Order ID, uniquely identifies the order within a merchant instance
@@ -2211,19 +2349,6 @@ export interface Tax {
}
```
```typescript
-export interface TalerProtocolTimestamp {
- readonly t_s: number | "never";
-}
-```
-```typescript
-// Enum value:
-// PendingTaskType.Refresh = "refresh"
-```
-```typescript
-// Enum value:
-// PendingTaskType.Deposit = "deposit"
-```
-```typescript
export interface ExchangeListItem {
exchangeBaseUrl: string;
currency: string;
@@ -2248,10 +2373,6 @@ export interface ForcedDenomSel {
}
```
```typescript
-// Enum value:
-// ProviderPaymentType.InsufficientBalance = "insufficient-balance"
-```
-```typescript
/**
* Contract terms from a merchant.
*/
@@ -2420,17 +2541,6 @@ export interface ForcedCoinSel {
}
```
```typescript
-// Enum value:
-// ProviderPaymentType.Pending = "pending"
-```
-```typescript
-export interface TalerErrorDetail {
- code: TalerErrorCode;
- hint?: string;
- [x: string]: unknown;
-}
-```
-```typescript
export interface BackupRecovery {
walletRootPriv: string;
providers: {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-docs] branch master updated: tweak wallet-core doc generation,
gnunet <=