Skip to content

Commit

Permalink
refactor(HttpEnvelopingRequest): await properties
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscotobar committed Apr 3, 2024
1 parent 1ddbb2a commit 2935903
Showing 1 changed file with 5 additions and 37 deletions.
42 changes: 5 additions & 37 deletions src/HttpEnvelopingRequest.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import type {
Either,
Modify,
} from '@rsksmart/rif-relay-client/dist/common/utility.types';
import type { Either } from '@rsksmart/rif-relay-client/dist/common/utility.types';
import type { BigNumberish } from 'ethers';
import type {
RelayRequestBody as ClientRelayRequestBody,
Expand All @@ -11,40 +8,11 @@ import type {
// IMPORTANT: The types defined here mirror the types defined in the client.
// see EnvelopingTxRequest in the rif-relay-client library

export declare type RelayRequestBody = Modify<
ClientRelayRequestBody,
{
relayHub: string;
from: string;
to: string;
tokenContract: string;
value: BigNumberish;
gas: BigNumberish;
nonce: BigNumberish;
tokenAmount: BigNumberish;
tokenGas: BigNumberish;
validUntilTime: BigNumberish;
data: string;
}
>;
type Await<T> = { [P in keyof T]: Awaited<T[P]> };

export declare type RelayRequestBody = Await<ClientRelayRequestBody>;

export declare type DeployRequestBody = Modify<
ClientDeployRequestBody,
{
relayHub: string;
from: string;
to: string;
tokenContract: string;
recoverer: string;
value: BigNumberish;
nonce: BigNumberish;
tokenAmount: BigNumberish;
tokenGas: BigNumberish;
validUntilTime: BigNumberish;
index: BigNumberish;
data: string;
}
>;
export declare type DeployRequestBody = Await<ClientDeployRequestBody>;

export declare type EnvelopingMetadata = {
relayHubAddress: RelayRequestBody['relayHub'];
Expand Down

0 comments on commit 2935903

Please sign in to comment.