fix: add rewards to getConfirmedBlock api
This commit is contained in:
committed by
Michael Vines
parent
4998bc4595
commit
de4f20a569
@ -201,6 +201,7 @@ const Version = struct({
|
|||||||
* @property {Blockhash} previousBlockhash Blockhash of this block's parent
|
* @property {Blockhash} previousBlockhash Blockhash of this block's parent
|
||||||
* @property {number} parentSlot Slot index of this block's parent
|
* @property {number} parentSlot Slot index of this block's parent
|
||||||
* @property {Array<object>} transactions Vector of transactions and status metas
|
* @property {Array<object>} transactions Vector of transactions and status metas
|
||||||
|
* @property {Array<object>} rewards Vector of block rewards
|
||||||
*/
|
*/
|
||||||
type ConfirmedBlock = {
|
type ConfirmedBlock = {
|
||||||
blockhash: Blockhash,
|
blockhash: Blockhash,
|
||||||
@ -215,6 +216,10 @@ type ConfirmedBlock = {
|
|||||||
status?: SignatureStatusResult,
|
status?: SignatureStatusResult,
|
||||||
},
|
},
|
||||||
}>,
|
}>,
|
||||||
|
rewards: Array<{
|
||||||
|
pubkey: string,
|
||||||
|
lamports: number,
|
||||||
|
}>,
|
||||||
};
|
};
|
||||||
|
|
||||||
function createRpcRequest(url): RpcRequest {
|
function createRpcRequest(url): RpcRequest {
|
||||||
@ -502,6 +507,15 @@ export const GetConfirmedBlockRpcResult = jsonRpcResult(
|
|||||||
]),
|
]),
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
|
rewards: struct.union([
|
||||||
|
'undefined',
|
||||||
|
struct.array([
|
||||||
|
struct({
|
||||||
|
pubkey: 'string',
|
||||||
|
lamports: 'number',
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
@ -1112,6 +1126,7 @@ export class Connection {
|
|||||||
meta: result.meta,
|
meta: result.meta,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
rewards: result.result.rewards || [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user