Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#44542 XUMM-API: Add new TX type & API payl…
Browse files Browse the repository at this point in the history
…oad meta options by @WietseWind

* XUMM: Add new TX type & future meta options

* Update tests
  • Loading branch information
WietseWind authored and andreialecu committed May 12, 2020
1 parent 6826351 commit 0cf1c1d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions types/xumm-api/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@ export type XrplTransactionType = "Payment"
| "SignerListSet"
| "TrustSet"
| "EnableAmendment"
| "AccountDelete"
| "SetFee";

export type XummCancelReason = "ALREADY_CANCELLED"
| "ALREADY_RESOLVED"
| "ALREADY_OPENED"
| "ALREADY_EXPIRED";

export type XummTransactionApprovalType = "PIN"
| "BIOMETRIC"
| "PASSPHRASE"
| "OTHER";

export type XummQrQuality = "m" | "q" | "h";

export interface XummJsonTransaction {
Expand Down Expand Up @@ -56,6 +62,8 @@ export interface XummPayloadMeta {
expired: boolean;
pushed: boolean;
app_opened: boolean;
immutable?: boolean;
forceAccount?: boolean;
return_url_app: string | null;
return_url_web: string | null;
}
Expand All @@ -65,6 +73,8 @@ export interface XummPayloadBodyBase {
submit?: boolean;
multisign?: boolean;
expire?: number;
immutable?: boolean;
forceAccount?: boolean;
return_url?: {
app?: string;
web?: string;
Expand Down Expand Up @@ -124,6 +134,7 @@ export interface XummGetPayloadResponse {
dispatched_result: string | null;
multisign_account: string | null;
account: string | null;
approved_with?: XummTransactionApprovalType;
};
custom_meta: XummCustomMeta;
}
Expand Down
9 changes: 8 additions & 1 deletion types/xumm-api/xumm-api-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const payloadBodyToPostWithJsonTx: XummPostPayloadBodyJson = {
submit: true,
multisign: false,
expire: 100,
immutable: true,
forceAccount: false,
return_url: {
app: "https://app.app/?payload={id}&customIdent={cid}&txid={txid}&hex={txblob}",
web: "https://web.web/?payload={id}&customIdent={cid}&txid={txid}&hex={txblob}"
Expand Down Expand Up @@ -79,6 +81,8 @@ const payloadToGet_One: XummGetPayloadResponse = {
expired: true,
pushed: true,
app_opened: false,
immutable: true,
forceAccount: true,
return_url_app: null,
return_url_web: null
},
Expand Down Expand Up @@ -108,7 +112,8 @@ const payloadToGet_One: XummGetPayloadResponse = {
dispatched_to: null,
dispatched_result: null,
multisign_account: null,
account: null
account: null,
approved_with: 'PIN'
},
custom_meta: {
identifier: null,
Expand Down Expand Up @@ -191,6 +196,8 @@ const payloadDeleteBodyToBeReturned: XummDeletePayloadResponse = {
expired: true,
pushed: true,
app_opened: false,
immutable: false,
forceAccount: false,
return_url_app: "https://wietse.com/xrpl?payload=37a56620-3293-4aff-a2fd-cda71b76b1b8",
return_url_web: null
},
Expand Down

0 comments on commit 0cf1c1d

Please sign in to comment.