fix: add TypeScript buffer type to nonce-account.ts
This commit is contained in:
committed by
Steven Luscher
parent
477355df3b
commit
c73cdfd6ce
@ -13,12 +13,25 @@ import {toBuffer} from './util/to-buffer';
|
|||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
const NonceAccountLayout = BufferLayout.struct([
|
const NonceAccountLayout = BufferLayout.struct<
|
||||||
|
Readonly<{
|
||||||
|
authorizedPubkey: Uint8Array;
|
||||||
|
feeCalculator: Readonly<{
|
||||||
|
lamportsPerSignature: number;
|
||||||
|
}>;
|
||||||
|
nonce: Uint8Array;
|
||||||
|
state: number;
|
||||||
|
version: number;
|
||||||
|
}>
|
||||||
|
>([
|
||||||
BufferLayout.u32('version'),
|
BufferLayout.u32('version'),
|
||||||
BufferLayout.u32('state'),
|
BufferLayout.u32('state'),
|
||||||
Layout.publicKey('authorizedPubkey'),
|
Layout.publicKey('authorizedPubkey'),
|
||||||
Layout.publicKey('nonce'),
|
Layout.publicKey('nonce'),
|
||||||
BufferLayout.struct([FeeCalculatorLayout], 'feeCalculator'),
|
BufferLayout.struct<Readonly<{lamportsPerSignature: number}>>(
|
||||||
|
[FeeCalculatorLayout],
|
||||||
|
'feeCalculator',
|
||||||
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const NONCE_ACCOUNT_LENGTH = NonceAccountLayout.span;
|
export const NONCE_ACCOUNT_LENGTH = NonceAccountLayout.span;
|
||||||
|
Reference in New Issue
Block a user