Skip to content

Commit

Permalink
fix(response): response result (#543)
Browse files Browse the repository at this point in the history
* fix(response): response result

* fix(type fix): mockJsonRpcGetTransactionByIdResponse
  • Loading branch information
zone-live authored Nov 8, 2023
1 parent f72735c commit d649bd3
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 51 deletions.
26 changes: 13 additions & 13 deletions packages/sdk/src/custodianApi/eca3/ECA3CustodianApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,19 @@ export class ECA3CustodianApi extends EventEmitter implements ICustodianApi {
}

return {
transactionStatus: mapStatusObjectToStatusText(result.status),
transactionStatusDisplayText: result.status?.displayText,
custodian_transactionId: result.id,
from: result.from,
gasLimit: result.gas,
gasPrice: result.gasPrice,
maxFeePerGas: result.maxFeePerGas,
maxPriorityFeePerGas: result.maxPriorityFeePerGas,
nonce: result.nonce,
transactionHash: result.hash,
reason: result.status.reason,
to: result.to,
signedRawTransaction: result.signedRawTransaction,
transactionStatus: mapStatusObjectToStatusText(result.transaction.status),
transactionStatusDisplayText: result.transaction.status?.displayText,
custodian_transactionId: result.transaction.id,
from: result.transaction.from,
gasLimit: result.transaction.gas,
gasPrice: result.transaction.gasPrice,
maxFeePerGas: result.transaction.maxFeePerGas,
maxPriorityFeePerGas: result.transaction.maxPriorityFeePerGas,
nonce: result.transaction.nonce,
transactionHash: result.transaction.hash,
reason: result.transaction.status.reason,
to: result.transaction.to,
signedRawTransaction: result.transaction.signedRawTransaction,
chainId: result.metadata.chainId,
custodianPublishesTransaction: result.metadata.custodianPublishesTransaction,
rpcUrl: result.metadata.rpcUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ export const mockJsonRpcGetTransactionByIdResponse: JsonRpcResult<JsonRpcGetTran
id: 1,
jsonrpc: "2.0",
result: {
id: "ef8cb7af-1a00-4687-9f82-1f1c82fbef54",
type: "0x2",
from: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826",
to: "0xB8c77482e45F1F44dE1745F52C74426C631bDD52",
value: "0x0",
gas: "0x5208",
gasPrice: "0x4A817C800",
nonce: "0x1",
data: "0x",
hash: "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
status: {
finished: true,
submitted: true,
signed: true,
success: true,
displayText: "Mined",
reason: null,
transaction: {
id: "ef8cb7af-1a00-4687-9f82-1f1c82fbef54",
type: "0x2",
from: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826",
to: "0xB8c77482e45F1F44dE1745F52C74426C631bDD52",
value: "0x0",
gas: "0x5208",
gasPrice: "0x4A817C800",
nonce: "0x1",
data: "0x",
hash: "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
status: {
finished: true,
submitted: true,
signed: true,
success: true,
displayText: "Mined",
reason: null,
},
},
},
};
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
export interface JsonRpcGetTransactionByIdResponse {
id: string;
type: string;
from: string;
to: string;
value: string;
gas: string;
gasPrice?: string;
maxPriorityFeePerGas?: string;
maxFeePerGas?: string;
nonce: string;
data: string;
hash: string;
status: {
finished: boolean;
submitted: boolean;
signed: boolean;
success: boolean;
displayText: string;
reason: string;
};
signedRawTransaction?: string;
transaction: {
id: string;
type: string;
from: string;
to: string;
value: string;
gas: string;
gasPrice?: string;
maxPriorityFeePerGas?: string;
maxFeePerGas?: string;
nonce: string;
data: string;
hash: string;
status: {
finished: boolean;
submitted: boolean;
signed: boolean;
success: boolean;
displayText: string;
reason: string;
};
signedRawTransaction?: string;
},
metadata?: {
chainId: number;
custodianPublishesTransaction: boolean;
Expand Down

0 comments on commit d649bd3

Please sign in to comment.