From f4651697bb91bfbfe33add452bda50adaad1a0bb Mon Sep 17 00:00:00 2001 From: orbitlens Date: Tue, 23 Aug 2022 00:38:37 +0300 Subject: [PATCH] Add TypeScript interfaces for Ed25519SignedPayload signers --- types/index.d.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 8957edf8b..2bab7819b 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -261,6 +261,10 @@ export namespace Signer { preAuthTx: Buffer; weight: number | undefined; } + interface Ed25519SignedPayload { + ed25519SignedPayload: string; + weight?: number | string; + } } export namespace SignerKeyOptions { interface Ed25519PublicKey { @@ -272,16 +276,21 @@ export namespace SignerKeyOptions { interface PreAuthTx { preAuthTx: Buffer | string; } + interface Ed25519SignedPayload { + ed25519SignedPayload: string; + } } export type Signer = | Signer.Ed25519PublicKey | Signer.Sha256Hash - | Signer.PreAuthTx; + | Signer.PreAuthTx + | Signer.Ed25519SignedPayload; export type SignerKeyOptions = | SignerKeyOptions.Ed25519PublicKey | SignerKeyOptions.Sha256Hash - | SignerKeyOptions.PreAuthTx; + | SignerKeyOptions.PreAuthTx + | SignerKeyOptions.Ed25519SignedPayload; export namespace SignerOptions { interface Ed25519PublicKey { @@ -296,11 +305,16 @@ export namespace SignerOptions { preAuthTx: Buffer | string; weight?: number | string; } + interface Ed25519SignedPayload { + ed25519SignedPayload: string; + weight?: number | string; + } } export type SignerOptions = | SignerOptions.Ed25519PublicKey | SignerOptions.Sha256Hash - | SignerOptions.PreAuthTx; + | SignerOptions.PreAuthTx + | SignerOptions.Ed25519SignedPayload; export namespace OperationType { type CreateAccount = 'createAccount'; @@ -666,6 +680,8 @@ export namespace Operation { ? Signer.Sha256Hash : T extends { preAuthTx: any } ? Signer.PreAuthTx + : T extends { ed25519SignedPayload: any } + ? Signer.Ed25519SignedPayload : never; } function setOptions(