-
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
- Loading branch information
Showing
6 changed files
with
131 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import type { | ||
Either, | ||
Modify, | ||
} 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 | ||
|
||
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; | ||
} | ||
>; | ||
|
||
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 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
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
Oops, something went wrong.