@solana/sysvars 2.0.0-20241006045741
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +93 -0
- package/dist/index.browser.cjs +398 -0
- package/dist/index.browser.cjs.map +1 -0
- package/dist/index.browser.mjs +344 -0
- package/dist/index.browser.mjs.map +1 -0
- package/dist/index.native.mjs +344 -0
- package/dist/index.native.mjs.map +1 -0
- package/dist/index.node.cjs +398 -0
- package/dist/index.node.cjs.map +1 -0
- package/dist/index.node.mjs +344 -0
- package/dist/index.node.mjs.map +1 -0
- package/dist/types/clock.d.ts +29 -0
- package/dist/types/clock.d.ts.map +1 -0
- package/dist/types/epoch-rewards.d.ts +42 -0
- package/dist/types/epoch-rewards.d.ts.map +1 -0
- package/dist/types/epoch-schedule.d.ts +29 -0
- package/dist/types/epoch-schedule.d.ts.map +1 -0
- package/dist/types/fees.d.ts +28 -0
- package/dist/types/fees.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/last-restart-slot.d.ts +33 -0
- package/dist/types/last-restart-slot.d.ts.map +1 -0
- package/dist/types/recent-blockhashes.d.ts +29 -0
- package/dist/types/recent-blockhashes.d.ts.map +1 -0
- package/dist/types/rent.d.ts +27 -0
- package/dist/types/rent.d.ts.map +1 -0
- package/dist/types/slot-hashes.d.ts +26 -0
- package/dist/types/slot-hashes.d.ts.map +1 -0
- package/dist/types/slot-history.d.ts +27 -0
- package/dist/types/slot-history.d.ts.map +1 -0
- package/dist/types/stake-history.d.ts +27 -0
- package/dist/types/stake-history.d.ts.map +1 -0
- package/dist/types/sysvar.d.ts +33 -0
- package/dist/types/sysvar.d.ts.map +1 -0
- package/package.json +92 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type FetchAccountConfig } from '@solana/accounts';
|
|
2
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/codecs';
|
|
3
|
+
import type { GetAccountInfoApi } from '@solana/rpc-api';
|
|
4
|
+
import type { Rpc } from '@solana/rpc-spec';
|
|
5
|
+
import type { Slot } from '@solana/rpc-types';
|
|
6
|
+
type SysvarLastRestartSlotSize = 8;
|
|
7
|
+
/**
|
|
8
|
+
* The `LastRestartSlot` sysvar.
|
|
9
|
+
*
|
|
10
|
+
* Information about the last restart slot (hard fork).
|
|
11
|
+
*
|
|
12
|
+
* The `LastRestartSlot` sysvar provides access to the last restart slot kept in the
|
|
13
|
+
* bank fork for the slot on the fork that executes the current transaction.
|
|
14
|
+
* In case there was no fork it returns `0`.
|
|
15
|
+
*/
|
|
16
|
+
export type SysvarLastRestartSlot = Readonly<{
|
|
17
|
+
lastRestartSlot: Slot;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function getSysvarLastRestartSlotEncoder(): FixedSizeEncoder<SysvarLastRestartSlot, SysvarLastRestartSlotSize>;
|
|
20
|
+
export declare function getSysvarLastRestartSlotDecoder(): FixedSizeDecoder<SysvarLastRestartSlot, SysvarLastRestartSlotSize>;
|
|
21
|
+
export declare function getSysvarLastRestartSlotCodec(): FixedSizeCodec<SysvarLastRestartSlot, SysvarLastRestartSlot, SysvarLastRestartSlotSize>;
|
|
22
|
+
/**
|
|
23
|
+
* Fetch the `LastRestartSlot` sysvar.
|
|
24
|
+
*
|
|
25
|
+
* Information about the last restart slot (hard fork).
|
|
26
|
+
*
|
|
27
|
+
* The `LastRestartSlot` sysvar provides access to the last restart slot kept in the
|
|
28
|
+
* bank fork for the slot on the fork that executes the current transaction.
|
|
29
|
+
* In case there was no fork it returns `0`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function fetchSysvarLastRestartSlot(rpc: Rpc<GetAccountInfoApi>, config?: FetchAccountConfig): Promise<SysvarLastRestartSlot>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=last-restart-slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"last-restart-slot.d.ts","sourceRoot":"","sources":["../../src/last-restart-slot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAEH,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAKxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAI9C,KAAK,yBAAyB,GAAG,CAAC,CAAC;AAEnC;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IACzC,eAAe,EAAE,IAAI,CAAC;CACzB,CAAC,CAAC;AAEH,wBAAgB,+BAA+B,IAAI,gBAAgB,CAAC,qBAAqB,EAAE,yBAAyB,CAAC,CAKpH;AAED,wBAAgB,+BAA+B,IAAI,gBAAgB,CAAC,qBAAqB,EAAE,yBAAyB,CAAC,CAKpH;AAED,wBAAgB,6BAA6B,IAAI,cAAc,CAC3D,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,CAC5B,CAEA;AAED;;;;;;;;GAQG;AACH,wBAAsB,0BAA0B,CAC5C,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,MAAM,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAKhC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type FetchAccountConfig } from '@solana/accounts';
|
|
2
|
+
import { type VariableSizeCodec, type VariableSizeDecoder, type VariableSizeEncoder } from '@solana/codecs';
|
|
3
|
+
import type { GetAccountInfoApi } from '@solana/rpc-api';
|
|
4
|
+
import type { Rpc } from '@solana/rpc-spec';
|
|
5
|
+
import { type Blockhash, type LamportsUnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types';
|
|
6
|
+
type FeeCalculator = Readonly<{
|
|
7
|
+
lamportsPerSignature: LamportsUnsafeBeyond2Pow53Minus1;
|
|
8
|
+
}>;
|
|
9
|
+
type Entry = Readonly<{
|
|
10
|
+
blockhash: Blockhash;
|
|
11
|
+
feeCalculator: FeeCalculator;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* The `RecentBlockhashes` sysvar.
|
|
15
|
+
*
|
|
16
|
+
* Information about recent blocks and their fee calculators.
|
|
17
|
+
*/
|
|
18
|
+
export type SysvarRecentBlockhashes = Entry[];
|
|
19
|
+
export declare function getSysvarRecentBlockhashesEncoder(): VariableSizeEncoder<SysvarRecentBlockhashes>;
|
|
20
|
+
export declare function getSysvarRecentBlockhashesDecoder(): VariableSizeDecoder<SysvarRecentBlockhashes>;
|
|
21
|
+
export declare function getSysvarRecentBlockhashesCodec(): VariableSizeCodec<SysvarRecentBlockhashes>;
|
|
22
|
+
/**
|
|
23
|
+
* Fetch the `RecentBlockhashes` sysvar.
|
|
24
|
+
*
|
|
25
|
+
* Information about recent blocks and their fee calculators.
|
|
26
|
+
*/
|
|
27
|
+
export declare function fetchSysvarRecentBlockhashes(rpc: Rpc<GetAccountInfoApi>, config?: FetchAccountConfig): Promise<SysvarRecentBlockhashes>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=recent-blockhashes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recent-blockhashes.d.ts","sourceRoot":"","sources":["../../src/recent-blockhashes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAMH,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACH,KAAK,SAAS,EAKd,KAAK,gCAAgC,EACxC,MAAM,mBAAmB,CAAC;AAI3B,KAAK,aAAa,GAAG,QAAQ,CAAC;IAC1B,oBAAoB,EAAE,gCAAgC,CAAC;CAC1D,CAAC,CAAC;AACH,KAAK,KAAK,GAAG,QAAQ,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;CAChC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,KAAK,EAAE,CAAC;AAE9C,wBAAgB,iCAAiC,IAAI,mBAAmB,CAAC,uBAAuB,CAAC,CAOhG;AAED,wBAAgB,iCAAiC,IAAI,mBAAmB,CAAC,uBAAuB,CAAC,CAOhG;AAED,wBAAgB,+BAA+B,IAAI,iBAAiB,CAAC,uBAAuB,CAAC,CAE5F;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAC9C,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,MAAM,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CAKlC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type FetchAccountConfig } from '@solana/accounts';
|
|
2
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/codecs';
|
|
3
|
+
import type { GetAccountInfoApi } from '@solana/rpc-api';
|
|
4
|
+
import type { Rpc } from '@solana/rpc-spec';
|
|
5
|
+
import { type LamportsUnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types';
|
|
6
|
+
type SysvarRentSize = 17;
|
|
7
|
+
/**
|
|
8
|
+
* The `Rent` sysvar.
|
|
9
|
+
*
|
|
10
|
+
* Configuration for network rent.
|
|
11
|
+
*/
|
|
12
|
+
export type SysvarRent = Readonly<{
|
|
13
|
+
burnPercent: number;
|
|
14
|
+
exemptionThreshold: number;
|
|
15
|
+
lamportsPerByteYear: LamportsUnsafeBeyond2Pow53Minus1;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function getSysvarRentEncoder(): FixedSizeEncoder<SysvarRent, SysvarRentSize>;
|
|
18
|
+
export declare function getSysvarRentDecoder(): FixedSizeDecoder<SysvarRent, SysvarRentSize>;
|
|
19
|
+
export declare function getSysvarRentCodec(): FixedSizeCodec<SysvarRent, SysvarRent, SysvarRentSize>;
|
|
20
|
+
/**
|
|
21
|
+
* Fetch the `Rent` sysvar.
|
|
22
|
+
*
|
|
23
|
+
* Configuration for network rent.
|
|
24
|
+
*/
|
|
25
|
+
export declare function fetchSysvarRent(rpc: Rpc<GetAccountInfoApi>, config?: FetchAccountConfig): Promise<SysvarRent>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=rent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rent.d.ts","sourceRoot":"","sources":["../../src/rent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAEH,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAOxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAGH,KAAK,gCAAgC,EACxC,MAAM,mBAAmB,CAAC;AAI3B,KAAK,cAAc,GAAG,EAAE,CAAC;AAEzB;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,gCAAgC,CAAC;CACzD,CAAC,CAAC;AAEH,wBAAgB,oBAAoB,IAAI,gBAAgB,CAAC,UAAU,EAAE,cAAc,CAAC,CAMnF;AAED,wBAAgB,oBAAoB,IAAI,gBAAgB,CAAC,UAAU,EAAE,cAAc,CAAC,CAMnF;AAED,wBAAgB,kBAAkB,IAAI,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,CAAC,CAE3F;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,CAKnH"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type FetchAccountConfig } from '@solana/accounts';
|
|
2
|
+
import { type VariableSizeCodec, type VariableSizeDecoder, type VariableSizeEncoder } from '@solana/codecs';
|
|
3
|
+
import type { GetAccountInfoApi } from '@solana/rpc-api';
|
|
4
|
+
import type { Rpc } from '@solana/rpc-spec';
|
|
5
|
+
import { type Blockhash, type Slot } from '@solana/rpc-types';
|
|
6
|
+
type Entry = Readonly<{
|
|
7
|
+
hash: Blockhash;
|
|
8
|
+
slot: Slot;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* The `SlotHashes` sysvar.
|
|
12
|
+
*
|
|
13
|
+
* The most recent hashes of a slot's parent banks.
|
|
14
|
+
*/
|
|
15
|
+
export type SysvarSlotHashes = Entry[];
|
|
16
|
+
export declare function getSysvarSlotHashesEncoder(): VariableSizeEncoder<SysvarSlotHashes>;
|
|
17
|
+
export declare function getSysvarSlotHashesDecoder(): VariableSizeDecoder<SysvarSlotHashes>;
|
|
18
|
+
export declare function getSysvarSlotHashesCodec(): VariableSizeCodec<SysvarSlotHashes>;
|
|
19
|
+
/**
|
|
20
|
+
* Fetch the `SlotHashes` sysvar.
|
|
21
|
+
*
|
|
22
|
+
* The most recent hashes of a slot's parent banks.
|
|
23
|
+
*/
|
|
24
|
+
export declare function fetchSysvarSlotHashes(rpc: Rpc<GetAccountInfoApi>, config?: FetchAccountConfig): Promise<SysvarSlotHashes>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=slot-hashes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-hashes.d.ts","sourceRoot":"","sources":["../../src/slot-hashes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAQH,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,SAAS,EAA4C,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAIxG,KAAK,KAAK,GAAG,QAAQ,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC;CACd,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,EAAE,CAAC;AAEvC,wBAAgB,0BAA0B,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,CAOlF;AAED,wBAAgB,0BAA0B,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,CAOlF;AAED,wBAAgB,wBAAwB,IAAI,iBAAiB,CAAC,gBAAgB,CAAC,CAE9E;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACvC,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,MAAM,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAK3B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type FetchAccountConfig } from '@solana/accounts';
|
|
2
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/codecs';
|
|
3
|
+
import type { GetAccountInfoApi } from '@solana/rpc-api';
|
|
4
|
+
import type { Rpc } from '@solana/rpc-spec';
|
|
5
|
+
import type { Slot } from '@solana/rpc-types';
|
|
6
|
+
declare const SLOT_HISTORY_ACCOUNT_DATA_STATIC_SIZE: number;
|
|
7
|
+
type SysvarSlotHistorySize = typeof SLOT_HISTORY_ACCOUNT_DATA_STATIC_SIZE;
|
|
8
|
+
/**
|
|
9
|
+
* The `SlotHistory` sysvar.
|
|
10
|
+
*
|
|
11
|
+
* A bitvector of slots present over the last epoch.
|
|
12
|
+
*/
|
|
13
|
+
export type SysvarSlotHistory = {
|
|
14
|
+
bits: bigint[];
|
|
15
|
+
nextSlot: Slot;
|
|
16
|
+
};
|
|
17
|
+
export declare function getSysvarSlotHistoryEncoder(): FixedSizeEncoder<SysvarSlotHistory, SysvarSlotHistorySize>;
|
|
18
|
+
export declare function getSysvarSlotHistoryDecoder(): FixedSizeDecoder<SysvarSlotHistory, SysvarSlotHistorySize>;
|
|
19
|
+
export declare function getSysvarSlotHistoryCodec(): FixedSizeCodec<SysvarSlotHistory, SysvarSlotHistory, SysvarSlotHistorySize>;
|
|
20
|
+
/**
|
|
21
|
+
* Fetch the `SlotHistory` sysvar.
|
|
22
|
+
*
|
|
23
|
+
* A bitvector of slots present over the last epoch.
|
|
24
|
+
*/
|
|
25
|
+
export declare function fetchSysvarSlotHistory(rpc: Rpc<GetAccountInfoApi>, config?: FetchAccountConfig): Promise<SysvarSlotHistory>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=slot-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-history.d.ts","sourceRoot":"","sources":["../../src/slot-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAIH,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAMxB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAe9C,QAAA,MAAM,qCAAqC,QAKtC,CAAC;AAwBN,KAAK,qBAAqB,GAAG,OAAO,qCAAqC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,gBAAgB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAuBxG;AAED,wBAAgB,2BAA2B,IAAI,gBAAgB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAuDxG;AAED,wBAAgB,yBAAyB,IAAI,cAAc,CACvD,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,CACxB,CAEA;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CACxC,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,MAAM,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAK5B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type FetchAccountConfig } from '@solana/accounts';
|
|
2
|
+
import { type VariableSizeCodec, type VariableSizeDecoder, type VariableSizeEncoder } from '@solana/codecs';
|
|
3
|
+
import type { GetAccountInfoApi } from '@solana/rpc-api';
|
|
4
|
+
import type { Rpc } from '@solana/rpc-spec';
|
|
5
|
+
import { type LamportsUnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types';
|
|
6
|
+
type Entry = Readonly<{
|
|
7
|
+
activating: LamportsUnsafeBeyond2Pow53Minus1;
|
|
8
|
+
deactivating: LamportsUnsafeBeyond2Pow53Minus1;
|
|
9
|
+
effective: LamportsUnsafeBeyond2Pow53Minus1;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* The `StakeHistory` sysvar.
|
|
13
|
+
*
|
|
14
|
+
* History of stake activations and de-activations.
|
|
15
|
+
*/
|
|
16
|
+
export type SysvarStakeHistory = Entry[];
|
|
17
|
+
export declare function getSysvarStakeHistoryEncoder(): VariableSizeEncoder<SysvarStakeHistory>;
|
|
18
|
+
export declare function getSysvarStakeHistoryDecoder(): VariableSizeDecoder<SysvarStakeHistory>;
|
|
19
|
+
export declare function getSysvarStakeHistoryCodec(): VariableSizeCodec<SysvarStakeHistory>;
|
|
20
|
+
/**
|
|
21
|
+
* Fetch the `StakeHistory` sysvar.
|
|
22
|
+
*
|
|
23
|
+
* History of stake activations and de-activations.
|
|
24
|
+
*/
|
|
25
|
+
export declare function fetchSysvarStakeHistory(rpc: Rpc<GetAccountInfoApi>, config?: FetchAccountConfig): Promise<SysvarStakeHistory>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=stake-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stake-history.d.ts","sourceRoot":"","sources":["../../src/stake-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAMH,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAGH,KAAK,gCAAgC,EACxC,MAAM,mBAAmB,CAAC;AAI3B,KAAK,KAAK,GAAG,QAAQ,CAAC;IAClB,UAAU,EAAE,gCAAgC,CAAC;IAC7C,YAAY,EAAE,gCAAgC,CAAC;IAC/C,SAAS,EAAE,gCAAgC,CAAC;CAC/C,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,EAAE,CAAC;AAEzC,wBAAgB,4BAA4B,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CAQtF;AAED,wBAAgB,4BAA4B,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CAQtF;AAED,wBAAgB,0BAA0B,IAAI,iBAAiB,CAAC,kBAAkB,CAAC,CAElF;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CACzC,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,MAAM,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,kBAAkB,CAAC,CAK7B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type FetchAccountConfig, type MaybeAccount, type MaybeEncodedAccount } from '@solana/accounts';
|
|
2
|
+
import type { Address } from '@solana/addresses';
|
|
3
|
+
import type { GetAccountInfoApi } from '@solana/rpc-api';
|
|
4
|
+
import type { JsonParsedSysvarAccount } from '@solana/rpc-parsed-types';
|
|
5
|
+
import type { Rpc } from '@solana/rpc-spec';
|
|
6
|
+
export declare const SYSVAR_CLOCK_ADDRESS: Address<"SysvarC1ock11111111111111111111111111111111">;
|
|
7
|
+
export declare const SYSVAR_EPOCH_REWARDS_ADDRESS: Address<"SysvarEpochRewards1111111111111111111111111">;
|
|
8
|
+
export declare const SYSVAR_EPOCH_SCHEDULE_ADDRESS: Address<"SysvarEpochSchedu1e111111111111111111111111">;
|
|
9
|
+
export declare const SYSVAR_FEES_ADDRESS: Address<"SysvarFees111111111111111111111111111111111">;
|
|
10
|
+
export declare const SYSVAR_INSTRUCTIONS_ADDRESS: Address<"Sysvar1nstructions1111111111111111111111111">;
|
|
11
|
+
export declare const SYSVAR_LAST_RESTART_SLOT_ADDRESS: Address<"SysvarLastRestartS1ot1111111111111111111111">;
|
|
12
|
+
export declare const SYSVAR_RECENT_BLOCKHASHES_ADDRESS: Address<"SysvarRecentB1ockHashes11111111111111111111">;
|
|
13
|
+
export declare const SYSVAR_RENT_ADDRESS: Address<"SysvarRent111111111111111111111111111111111">;
|
|
14
|
+
export declare const SYSVAR_SLOT_HASHES_ADDRESS: Address<"SysvarS1otHashes111111111111111111111111111">;
|
|
15
|
+
export declare const SYSVAR_SLOT_HISTORY_ADDRESS: Address<"SysvarS1otHistory11111111111111111111111111">;
|
|
16
|
+
export declare const SYSVAR_STAKE_HISTORY_ADDRESS: Address<"SysvarStakeHistory1111111111111111111111111">;
|
|
17
|
+
type SysvarAddress = typeof SYSVAR_CLOCK_ADDRESS | typeof SYSVAR_EPOCH_REWARDS_ADDRESS | typeof SYSVAR_EPOCH_SCHEDULE_ADDRESS | typeof SYSVAR_FEES_ADDRESS | typeof SYSVAR_INSTRUCTIONS_ADDRESS | typeof SYSVAR_LAST_RESTART_SLOT_ADDRESS | typeof SYSVAR_RECENT_BLOCKHASHES_ADDRESS | typeof SYSVAR_RENT_ADDRESS | typeof SYSVAR_SLOT_HASHES_ADDRESS | typeof SYSVAR_SLOT_HISTORY_ADDRESS | typeof SYSVAR_STAKE_HISTORY_ADDRESS;
|
|
18
|
+
/**
|
|
19
|
+
* Fetch an encoded sysvar account.
|
|
20
|
+
*
|
|
21
|
+
* Sysvars are special accounts that contain dynamically-updated data about the
|
|
22
|
+
* network cluster, the blockchain history, and the executing transaction.
|
|
23
|
+
*/
|
|
24
|
+
export declare function fetchEncodedSysvarAccount<TAddress extends SysvarAddress>(rpc: Rpc<GetAccountInfoApi>, address: TAddress, config?: FetchAccountConfig): Promise<MaybeEncodedAccount<TAddress>>;
|
|
25
|
+
/**
|
|
26
|
+
* Fetch a JSON-parsed sysvar account.
|
|
27
|
+
*
|
|
28
|
+
* Sysvars are special accounts that contain dynamically-updated data about the
|
|
29
|
+
* network cluster, the blockchain history, and the executing transaction.
|
|
30
|
+
*/
|
|
31
|
+
export declare function fetchJsonParsedSysvarAccount<TAddress extends SysvarAddress>(rpc: Rpc<GetAccountInfoApi>, address: TAddress, config?: FetchAccountConfig): Promise<MaybeAccount<JsonParsedSysvarAccount, TAddress> | MaybeEncodedAccount<TAddress>>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=sysvar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sysvar.d.ts","sourceRoot":"","sources":["../../src/sysvar.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,kBAAkB,EAGvB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAE5C,eAAO,MAAM,oBAAoB,EACoB,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAC5G,eAAO,MAAM,4BAA4B,EACY,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAC5G,eAAO,MAAM,6BAA6B,EACW,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAC5G,eAAO,MAAM,mBAAmB,EACqB,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAC5G,eAAO,MAAM,2BAA2B,EACa,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAC5G,eAAO,MAAM,gCAAgC,EACQ,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAC5G,eAAO,MAAM,iCAAiC,EACO,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAC5G,eAAO,MAAM,mBAAmB,EACqB,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAC5G,eAAO,MAAM,0BAA0B,EACc,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAC5G,eAAO,MAAM,2BAA2B,EACa,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAC5G,eAAO,MAAM,4BAA4B,EACY,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAE5G,KAAK,aAAa,GACZ,OAAO,oBAAoB,GAC3B,OAAO,4BAA4B,GACnC,OAAO,6BAA6B,GACpC,OAAO,mBAAmB,GAC1B,OAAO,2BAA2B,GAClC,OAAO,gCAAgC,GACvC,OAAO,iCAAiC,GACxC,OAAO,mBAAmB,GAC1B,OAAO,0BAA0B,GACjC,OAAO,2BAA2B,GAClC,OAAO,4BAA4B,CAAC;AAE1C;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,QAAQ,SAAS,aAAa,EAC1E,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAExC;AAED;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAAC,QAAQ,SAAS,aAAa,EAC7E,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,YAAY,CAAC,uBAAuB,EAAE,QAAQ,CAAC,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAE1F"}
|
package/package.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@solana/sysvars",
|
|
3
|
+
"version": "2.0.0-20241006045741",
|
|
4
|
+
"description": "An abstraction layer over signing messages and transactions in Solana",
|
|
5
|
+
"exports": {
|
|
6
|
+
"edge-light": {
|
|
7
|
+
"import": "./dist/index.node.mjs",
|
|
8
|
+
"require": "./dist/index.node.cjs"
|
|
9
|
+
},
|
|
10
|
+
"workerd": {
|
|
11
|
+
"import": "./dist/index.node.mjs",
|
|
12
|
+
"require": "./dist/index.node.cjs"
|
|
13
|
+
},
|
|
14
|
+
"browser": {
|
|
15
|
+
"import": "./dist/index.browser.mjs",
|
|
16
|
+
"require": "./dist/index.browser.cjs"
|
|
17
|
+
},
|
|
18
|
+
"node": {
|
|
19
|
+
"import": "./dist/index.node.mjs",
|
|
20
|
+
"require": "./dist/index.node.cjs"
|
|
21
|
+
},
|
|
22
|
+
"react-native": "./dist/index.native.mjs",
|
|
23
|
+
"types": "./dist/types/index.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"browser": {
|
|
26
|
+
"./dist/index.node.cjs": "./dist/index.browser.cjs",
|
|
27
|
+
"./dist/index.node.mjs": "./dist/index.browser.mjs"
|
|
28
|
+
},
|
|
29
|
+
"main": "./dist/index.node.cjs",
|
|
30
|
+
"module": "./dist/index.node.mjs",
|
|
31
|
+
"react-native": "./dist/index.native.mjs",
|
|
32
|
+
"types": "./dist/types/index.d.ts",
|
|
33
|
+
"type": "commonjs",
|
|
34
|
+
"files": [
|
|
35
|
+
"./dist/"
|
|
36
|
+
],
|
|
37
|
+
"sideEffects": false,
|
|
38
|
+
"keywords": [
|
|
39
|
+
"blockchain",
|
|
40
|
+
"solana",
|
|
41
|
+
"web3"
|
|
42
|
+
],
|
|
43
|
+
"author": "Solana Labs Maintainers <maintainers@solanalabs.com>",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/solana-labs/solana-web3.js"
|
|
48
|
+
},
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "http://github.com/solana-labs/solana-web3.js/issues"
|
|
51
|
+
},
|
|
52
|
+
"browserslist": [
|
|
53
|
+
"supports bigint and not dead",
|
|
54
|
+
"maintained node versions"
|
|
55
|
+
],
|
|
56
|
+
"engine": {
|
|
57
|
+
"node": ">=17.4"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@solana/accounts": "2.0.0-20241006045741",
|
|
61
|
+
"@solana/codecs": "2.0.0-20241006045741",
|
|
62
|
+
"@solana/errors": "2.0.0-20241006045741",
|
|
63
|
+
"@solana/rpc-types": "2.0.0-20241006045741"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"typescript": ">=5"
|
|
67
|
+
},
|
|
68
|
+
"bundlewatch": {
|
|
69
|
+
"defaultCompression": "gzip",
|
|
70
|
+
"files": [
|
|
71
|
+
{
|
|
72
|
+
"path": "./dist/index*.js"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
|
|
78
|
+
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
|
|
79
|
+
"dev": "jest -c ../../node_modules/@solana/test-config/jest-dev.config.ts --rootDir . --watch",
|
|
80
|
+
"publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks",
|
|
81
|
+
"publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
|
|
82
|
+
"style:fix": "pnpm eslint --fix src && pnpm prettier --log-level warn --ignore-unknown --write ./*",
|
|
83
|
+
"test:lint": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
84
|
+
"test:prettier": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
85
|
+
"test:treeshakability:browser": "agadoo dist/index.browser.mjs",
|
|
86
|
+
"test:treeshakability:native": "agadoo dist/index.native.mjs",
|
|
87
|
+
"test:treeshakability:node": "agadoo dist/index.node.mjs",
|
|
88
|
+
"test:typecheck": "tsc --noEmit",
|
|
89
|
+
"test:unit:browser": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-unit.config.browser.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent",
|
|
90
|
+
"test:unit:node": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-unit.config.node.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent"
|
|
91
|
+
}
|
|
92
|
+
}
|