-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(RREL-026): avoid using PromiseOrValue type in server (#143)
* fix(RREL-026): avoid using PromiseOrValue type in server * refactor(HttpEnvelopingRequest): await properties * chore(RREL-026): apply PR suggestions --------- Co-authored-by: Francisco Tobar <[email protected]>
- Loading branch information
1 parent
2963dc2
commit 68ed895
Showing
6 changed files
with
106 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { Either } from '@rsksmart/rif-relay-client/dist/common/utility.types'; | ||
import type { BigNumberish } from 'ethers'; | ||
import type { | ||
RelayRequestBody as ClientRelayRequestBody, | ||
DeployRequestBody as ClientDeployRequestBody, | ||
} from '@rsksmart/rif-relay-client'; | ||
|
||
// IMPORTANT: The types defined here mirror the types defined in the client. | ||
// see EnvelopingTxRequest in the rif-relay-client library | ||
|
||
type AwaitedWrapper<T> = { [P in keyof T]: Awaited<T[P]> }; | ||
|
||
export declare type RelayRequestBody = AwaitedWrapper<ClientRelayRequestBody>; | ||
|
||
export declare type DeployRequestBody = AwaitedWrapper<ClientDeployRequestBody>; | ||
|
||
export declare type EnvelopingMetadata = { | ||
relayHubAddress: RelayRequestBody['relayHub']; | ||
relayMaxNonce: number; | ||
signature: string; | ||
}; | ||
|
||
export declare type EnvelopingRequestData = { | ||
gasPrice: BigNumberish; | ||
feesReceiver: string; | ||
callForwarder: string; | ||
callVerifier: string; | ||
}; | ||
|
||
export declare type EnvelopingRequest = { | ||
request: Either<RelayRequestBody, DeployRequestBody>; | ||
relayData: EnvelopingRequestData; | ||
}; | ||
|
||
export declare type HttpEnvelopingRequest = { | ||
relayRequest: EnvelopingRequest; | ||
metadata: EnvelopingMetadata; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.