@xyo-network/xl1-protocol 1.11.0 → 1.11.1
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/dist/neutral/provider/ForkViewer.d.ts +8 -0
- package/dist/neutral/provider/ForkViewer.d.ts.map +1 -0
- package/dist/neutral/provider/StakeViewer.d.ts +16 -0
- package/dist/neutral/provider/StakeViewer.d.ts.map +1 -0
- package/dist/neutral/provider/XyoViewer.d.ts +2 -2
- package/dist/neutral/provider/XyoViewer.d.ts.map +1 -1
- package/dist/neutral/provider/index.d.ts +2 -0
- package/dist/neutral/provider/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/provider/ForkViewer.ts +9 -0
- package/src/provider/StakeViewer.ts +17 -0
- package/src/provider/XyoViewer.ts +2 -2
- package/src/provider/index.ts +2 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex';
|
|
2
|
+
import type { Promisable } from '@xylabs/promise';
|
|
3
|
+
export type ForkHistory = Record<number, Address>;
|
|
4
|
+
export interface ForkViewer {
|
|
5
|
+
chainIdAtBlock(blockNumber: number): Promisable<Address>;
|
|
6
|
+
forkHistory(): Promisable<ForkHistory>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=ForkViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForkViewer.d.ts","sourceRoot":"","sources":["../../../src/provider/ForkViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEjD,MAAM,WAAW,UAAU;IACzB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IACxD,WAAW,IAAI,UAAU,CAAC,WAAW,CAAC,CAAA;CACvC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex';
|
|
2
|
+
import type { Promisable } from '@xylabs/promise';
|
|
3
|
+
export interface StakeScope {
|
|
4
|
+
staked?: Address;
|
|
5
|
+
staker?: Address;
|
|
6
|
+
status?: 'active' | 'pending' | 'withdrawn' | 'all';
|
|
7
|
+
type?: 'all' | 'network' | 'address';
|
|
8
|
+
}
|
|
9
|
+
export interface StakeViewer {
|
|
10
|
+
stakeAmount(scope?: StakeScope): Promisable<[bigint, number]>;
|
|
11
|
+
stakeCount(scope?: StakeScope): Promisable<[number, number]>;
|
|
12
|
+
stakedCount(scope?: StakeScope): Promisable<[number, number]>;
|
|
13
|
+
stakerCount(scope?: StakeScope): Promisable<[number, number]>;
|
|
14
|
+
stakes(scope?: StakeScope): Promisable<[bigint, number]>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=StakeViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StakeViewer.d.ts","sourceRoot":"","sources":["../../../src/provider/StakeViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,KAAK,CAAA;IACnD,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAA;CACrC;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC,MAAM,EAAe,MAAM,CAA6B,CAAC,CAAA;IACtG,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC,MAAM,EAAe,MAAM,CAA6B,CAAC,CAAA;IACrG,WAAW,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC,MAAM,EAAe,MAAM,CAA6B,CAAC,CAAA;IACtG,WAAW,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC,MAAM,EAAe,MAAM,CAA6B,CAAC,CAAA;IACtG,MAAM,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC,MAAM,EAAe,MAAM,CAA6B,CAAC,CAAA;CAClG"}
|
|
@@ -5,8 +5,8 @@ import type { Chain } from '../model.ts';
|
|
|
5
5
|
import type { Transfer } from '../payload/index.ts';
|
|
6
6
|
import type { SignedHydratedTransaction } from '../transaction/index.ts';
|
|
7
7
|
export interface XyoViewer {
|
|
8
|
-
accountBalance
|
|
9
|
-
accountHistory
|
|
8
|
+
accountBalance(address: Address): Promisable<bigint>;
|
|
9
|
+
accountHistory(address: Address): Promisable<[Hash, Hash, Transfer][]>;
|
|
10
10
|
blockByHash(hash: Hash): Promisable<HydratedBlock | null>;
|
|
11
11
|
blockByNumber(blockNumber: number): Promisable<HydratedBlock | null>;
|
|
12
12
|
blocksByHash(hash: Hash, limit?: number): Promisable<HydratedBlock[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoViewer.d.ts","sourceRoot":"","sources":["../../../src/provider/XyoViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB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A;IAExC,8BAA8B,CAAC,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,GAAG,UAAU,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAA;IACvH,gCAAgC,CAAC,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,UAAU,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAA;IAC7H,iBAAiB,CAAC,eAAe,EAAE,IAAI,GAAG,UAAU,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAA;CACvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAChC,cAAc,2BAA2B,CAAA;AACzC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type { Promisable } from '@xylabs/promise'
|
|
3
|
+
|
|
4
|
+
export type ForkHistory = Record<number, Address>
|
|
5
|
+
|
|
6
|
+
export interface ForkViewer {
|
|
7
|
+
chainIdAtBlock(blockNumber: number): Promisable<Address>
|
|
8
|
+
forkHistory(): Promisable<ForkHistory>
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type { Promisable } from '@xylabs/promise'
|
|
3
|
+
|
|
4
|
+
export interface StakeScope {
|
|
5
|
+
staked?: Address
|
|
6
|
+
staker?: Address
|
|
7
|
+
status?: 'active' | 'pending' | 'withdrawn' | 'all'
|
|
8
|
+
type?: 'all' | 'network' | 'address'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface StakeViewer {
|
|
12
|
+
stakeAmount(scope?: StakeScope): Promisable<[bigint /* amount */, number /* external block number */]>
|
|
13
|
+
stakeCount(scope?: StakeScope): Promisable<[number /* amount */, number /* external block number */]>
|
|
14
|
+
stakedCount(scope?: StakeScope): Promisable<[number /* amount */, number /* external block number */]>
|
|
15
|
+
stakerCount(scope?: StakeScope): Promisable<[number /* amount */, number /* external block number */]>
|
|
16
|
+
stakes(scope?: StakeScope): Promisable<[bigint /* amount */, number /* external block number */]>
|
|
17
|
+
}
|
|
@@ -7,8 +7,8 @@ import type { Transfer } from '../payload/index.ts'
|
|
|
7
7
|
import type { SignedHydratedTransaction } from '../transaction/index.ts'
|
|
8
8
|
|
|
9
9
|
export interface XyoViewer {
|
|
10
|
-
accountBalance
|
|
11
|
-
accountHistory
|
|
10
|
+
accountBalance(address: Address): Promisable<bigint>
|
|
11
|
+
accountHistory(address: Address): Promisable<[Hash /* block */, Hash /* transaction */, Transfer][]>
|
|
12
12
|
|
|
13
13
|
blockByHash(hash: Hash): Promisable<HydratedBlock | null>
|
|
14
14
|
blockByNumber(blockNumber: number): Promisable<HydratedBlock | null>
|