@xyo-network/xl1-rpc 1.18.0-rc.1 → 1.18.0
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/index.mjs +112 -164
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewer.d.ts +7 -7
- package/dist/neutral/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewer.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.d.ts +97 -69
- package/dist/neutral/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcNetworkStakeViewer/JsonRpcNetworkStakeViewer.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts +16 -20
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/neutral/types/schema/AccountBalanceViewerRpcSchemas.d.ts +36 -8
- package/dist/neutral/types/schema/AccountBalanceViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts +38 -10
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/node/index-node.mjs +112 -164
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewer.d.ts +7 -7
- package/dist/node/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewer.d.ts.map +1 -1
- package/dist/node/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.d.ts +97 -69
- package/dist/node/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.d.ts.map +1 -1
- package/dist/node/provider/viewer/JsonRpcNetworkStakeViewer/JsonRpcNetworkStakeViewer.d.ts.map +1 -1
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts +16 -20
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/node/types/schema/AccountBalanceViewerRpcSchemas.d.ts +36 -8
- package/dist/node/types/schema/AccountBalanceViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/AllRpcSchemas.d.ts +38 -10
- package/dist/node/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewer.ts +13 -11
- package/src/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.ts +10 -13
- package/src/provider/viewer/JsonRpcNetworkStakeViewer/JsonRpcNetworkStakeViewer.ts +3 -3
- package/src/provider/viewer/JsonRpcXyoViewer.ts +7 -26
- package/src/types/schema/AccountBalanceViewerRpcSchemas.ts +12 -11
|
@@ -2425,18 +2425,40 @@ export declare const AllRpcSchemas: {
|
|
|
2425
2425
|
};
|
|
2426
2426
|
accountBalanceViewer_qualifiedAccountBalances: {
|
|
2427
2427
|
params: {
|
|
2428
|
-
to: import("zod").
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
from: import("zod").ZodTuple<[import("zod").
|
|
2428
|
+
to: import("zod").ZodTuple<[import("zod").ZodArray<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Address, string>>>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
2429
|
+
range: import("zod").ZodTuple<[import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>, import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>], null>;
|
|
2430
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
2431
|
+
head: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Hash, string>>;
|
|
2432
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>]>], null>;
|
|
2433
|
+
from: import("zod").ZodTuple<[import("zod").ZodArray<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Address, string>>>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
2434
|
+
range: import("zod").ZodTuple<[import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>, import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>], null>;
|
|
2435
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
2436
|
+
head: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Hash, string>>;
|
|
2437
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>]>], null>;
|
|
2438
|
+
};
|
|
2439
|
+
result: {
|
|
2440
|
+
to: import("zod").ZodTuple<[import("zod").ZodType<Record<import("@xylabs/hex").Address, import("@xylabs/hex").Hex>, unknown, import("zod/v4/core").$ZodTypeInternals<Record<import("@xylabs/hex").Address, import("@xylabs/hex").Hex>, unknown>>, import("zod").ZodObject<{
|
|
2441
|
+
head: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Hash, string>>;
|
|
2442
|
+
range: import("zod").ZodTuple<[import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>, import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>], null>;
|
|
2443
|
+
}, import("zod/v4/core").$strip>], null>;
|
|
2444
|
+
from: import("zod").ZodTuple<[import("zod").ZodType<Record<import("@xylabs/hex").Address, bigint>, unknown, import("zod/v4/core").$ZodTypeInternals<Record<import("@xylabs/hex").Address, bigint>, unknown>>, import("zod").ZodObject<{
|
|
2445
|
+
head: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Hash, string>>;
|
|
2446
|
+
range: import("zod").ZodTuple<[import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>, import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>], null>;
|
|
2447
|
+
}, import("zod/v4/core").$strip>], null>;
|
|
2434
2448
|
};
|
|
2435
2449
|
};
|
|
2436
2450
|
accountBalanceViewer_qualifiedAccountBalanceHistories: {
|
|
2437
2451
|
params: {
|
|
2438
|
-
to: import("zod").
|
|
2439
|
-
|
|
2452
|
+
to: import("zod").ZodTuple<[import("zod").ZodArray<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Address, string>>>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
2453
|
+
range: import("zod").ZodTuple<[import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>, import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>], null>;
|
|
2454
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
2455
|
+
head: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Hash, string>>;
|
|
2456
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>]>], null>;
|
|
2457
|
+
from: import("zod").ZodTuple<[import("zod").ZodArray<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Address, string>>>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
2458
|
+
range: import("zod").ZodTuple<[import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>, import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>], null>;
|
|
2459
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
2460
|
+
head: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Hash, string>>;
|
|
2461
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>]>], null>;
|
|
2440
2462
|
};
|
|
2441
2463
|
result: {
|
|
2442
2464
|
to: import("zod").ZodTuple<[import("zod").ZodType<Record<import("@xylabs/hex").Address, [{
|
|
@@ -2533,7 +2555,10 @@ export declare const AllRpcSchemas: {
|
|
|
2533
2555
|
_hash: import("@xylabs/hex").Hash;
|
|
2534
2556
|
_dataHash: import("@xylabs/hex").Hash;
|
|
2535
2557
|
context?: Record<string, unknown> | undefined;
|
|
2536
|
-
}][]>, unknown>>, import("zod").
|
|
2558
|
+
}][]>, unknown>>, import("zod").ZodObject<{
|
|
2559
|
+
head: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Hash, string>>;
|
|
2560
|
+
range: import("zod").ZodTuple<[import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>, import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>], null>;
|
|
2561
|
+
}, import("zod/v4/core").$strip>], null>;
|
|
2537
2562
|
from: import("zod").ZodTuple<[import("zod").ZodType<Record<import("@xylabs/hex").Address, [{
|
|
2538
2563
|
schema: "network.xyo.boundwitness";
|
|
2539
2564
|
addresses: import("@xylabs/hex").Address[];
|
|
@@ -2628,7 +2653,10 @@ export declare const AllRpcSchemas: {
|
|
|
2628
2653
|
_hash: import("@xylabs/hex").Hash;
|
|
2629
2654
|
_dataHash: import("@xylabs/hex").Hash;
|
|
2630
2655
|
context?: Record<string, unknown> | undefined;
|
|
2631
|
-
}][]>, unknown>>, import("zod").
|
|
2656
|
+
}][]>, unknown>>, import("zod").ZodObject<{
|
|
2657
|
+
head: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@xylabs/hex").Hash, string>>;
|
|
2658
|
+
range: import("zod").ZodTuple<[import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>, import("zod").ZodPipe<import("zod").ZodNumber, import("zod").ZodTransform<import("@xyo-network/xl1-protocol").XL1BlockNumber, number>>], null>;
|
|
2659
|
+
}, import("zod/v4/core").$strip>], null>;
|
|
2632
2660
|
};
|
|
2633
2661
|
};
|
|
2634
2662
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/AllRpcSchemas.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"AllRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/AllRpcSchemas.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBF,CAAA;AAExB,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/xl1-rpc",
|
|
4
|
-
"version": "1.18.0
|
|
4
|
+
"version": "1.18.0",
|
|
5
5
|
"description": "XYO Layer One API",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@xyo-network/node-model": "~5.2.17",
|
|
67
67
|
"@xyo-network/payload-model": "~5.2.17",
|
|
68
68
|
"@xyo-network/xl1-protocol": "~1.14.17",
|
|
69
|
-
"@xyo-network/xl1-protocol-sdk": "~1.18.0
|
|
69
|
+
"@xyo-network/xl1-protocol-sdk": "~1.18.0",
|
|
70
70
|
"axios": "~1.13.2",
|
|
71
71
|
"uuid": "~13.0.0",
|
|
72
72
|
"zod": "~4.1.13"
|
|
@@ -98,6 +98,5 @@
|
|
|
98
98
|
"publishConfig": {
|
|
99
99
|
"access": "public"
|
|
100
100
|
},
|
|
101
|
-
"src": "./src/index.ts"
|
|
102
|
-
"stableVersion": "1.17.7"
|
|
101
|
+
"src": "./src/index.ts"
|
|
103
102
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { Address
|
|
2
|
-
import { type AttoXL1
|
|
3
|
-
import type {
|
|
1
|
+
import type { Address } from '@xylabs/sdk-js'
|
|
2
|
+
import { type AttoXL1 } from '@xyo-network/xl1-protocol'
|
|
3
|
+
import type {
|
|
4
|
+
AccountBalanceHistoryItem, AccountBalanceViewer, ChainQualifiedConfig,
|
|
5
|
+
} from '@xyo-network/xl1-protocol-sdk'
|
|
4
6
|
import { AccountBalanceViewerMoniker } from '@xyo-network/xl1-protocol-sdk'
|
|
5
7
|
|
|
6
8
|
import { JsonRpcAccountBalanceViewerMethods } from './JsonRpcAccountBalanceViewerMethods.ts'
|
|
@@ -10,23 +12,23 @@ export class JsonRpcAccountBalanceViewer extends JsonRpcAccountBalanceViewerMeth
|
|
|
10
12
|
static readonly monikers = [AccountBalanceViewerMoniker]
|
|
11
13
|
moniker = JsonRpcAccountBalanceViewer.defaultMoniker
|
|
12
14
|
|
|
13
|
-
async accountBalance(address: Address,
|
|
14
|
-
const result = await this.accountBalances([address],
|
|
15
|
+
async accountBalance(address: Address, config: ChainQualifiedConfig = {}): Promise<AttoXL1> {
|
|
16
|
+
const result = await this.accountBalances([address], config)
|
|
15
17
|
return result[address]
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
async accountBalanceHistories(address: Address[],
|
|
19
|
-
const [result] = await this.qualifiedAccountBalanceHistories(address,
|
|
20
|
+
async accountBalanceHistories(address: Address[], config: ChainQualifiedConfig = {}): Promise<Record<Address, AccountBalanceHistoryItem[]>> {
|
|
21
|
+
const [result] = await this.qualifiedAccountBalanceHistories(address, config)
|
|
20
22
|
return result
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
async accountBalanceHistory(address: Address,
|
|
24
|
-
const result = await this.accountBalanceHistories([address],
|
|
25
|
+
async accountBalanceHistory(address: Address, config: ChainQualifiedConfig = {}): Promise<AccountBalanceHistoryItem[]> {
|
|
26
|
+
const result = await this.accountBalanceHistories([address], config)
|
|
25
27
|
return result[address]
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
async accountBalances(address: Address[],
|
|
29
|
-
const [result] = await this.qualifiedAccountBalances(address,
|
|
30
|
+
async accountBalances(address: Address[], config: ChainQualifiedConfig = {}): Promise<Record<Address, AttoXL1>> {
|
|
31
|
+
const [result] = await this.qualifiedAccountBalances(address, config)
|
|
30
32
|
return result
|
|
31
33
|
}
|
|
32
34
|
}
|
package/src/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { Address
|
|
1
|
+
import type { Address } from '@xylabs/sdk-js'
|
|
2
|
+
import { type AttoXL1 } from '@xyo-network/xl1-protocol'
|
|
2
3
|
import {
|
|
3
|
-
type
|
|
4
|
-
type XL1BlockRange,
|
|
5
|
-
} from '@xyo-network/xl1-protocol'
|
|
6
|
-
import type {
|
|
7
|
-
AccountBalanceHistoryItem, AccountBalanceViewerMethods, Qualified,
|
|
4
|
+
type AccountBalanceHistoryItem, type AccountBalanceViewerMethods, type ChainQualified, type ChainQualifiedConfig,
|
|
8
5
|
} from '@xyo-network/xl1-protocol-sdk'
|
|
9
6
|
|
|
10
7
|
import { AccountBalanceViewerRpcSchemas } from '../../../types/index.ts'
|
|
@@ -13,22 +10,22 @@ import { AbstractJsonRpcViewer } from '../JsonRpcViewer.ts'
|
|
|
13
10
|
export class JsonRpcAccountBalanceViewerMethods extends AbstractJsonRpcViewer<AccountBalanceViewerRpcSchemas> implements AccountBalanceViewerMethods {
|
|
14
11
|
async qualifiedAccountBalanceHistories(
|
|
15
12
|
addresses: Address[],
|
|
16
|
-
|
|
17
|
-
): Promise<
|
|
13
|
+
config: ChainQualifiedConfig,
|
|
14
|
+
): Promise<ChainQualified<Record<Address, AccountBalanceHistoryItem[]>>> {
|
|
18
15
|
return (await this.transport.sendRequest(
|
|
19
16
|
'accountBalanceViewer_qualifiedAccountBalanceHistories',
|
|
20
|
-
|
|
21
|
-
)) as
|
|
17
|
+
[addresses, config],
|
|
18
|
+
)) as ChainQualified<Record<Address, AccountBalanceHistoryItem[]>>
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
async qualifiedAccountBalances(
|
|
25
22
|
addresses: Address[],
|
|
26
|
-
|
|
23
|
+
config: ChainQualifiedConfig,
|
|
27
24
|
) {
|
|
28
25
|
return await this.transport.sendRequest(
|
|
29
26
|
'accountBalanceViewer_qualifiedAccountBalances',
|
|
30
|
-
|
|
31
|
-
) as
|
|
27
|
+
[addresses, config],
|
|
28
|
+
) as ChainQualified<Record<Address, AttoXL1>>
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
protected schemas() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type NetworkStakeStepRewardsViewer, type NetworkStakeViewer, NetworkStakeViewerMoniker,
|
|
2
|
+
type NetworkStakeStepRewardsViewer, NetworkStakeStepRewardsViewerMoniker, type NetworkStakeViewer, NetworkStakeViewerMoniker,
|
|
3
3
|
} from '@xyo-network/xl1-protocol-sdk'
|
|
4
4
|
|
|
5
|
-
import { JsonRpcNetworkStakingStepRewardsViewer } from '../JsonRpcNetworkStakingStepRewardsViewer/index.ts'
|
|
5
|
+
import type { JsonRpcNetworkStakingStepRewardsViewer } from '../JsonRpcNetworkStakingStepRewardsViewer/index.ts'
|
|
6
6
|
import { JsonRpcNetworkStakeViewerMethods } from './JsonRpcNetworkStakeViewerMethods.ts'
|
|
7
7
|
|
|
8
8
|
export class JsonRpcNetworkStakeViewer extends JsonRpcNetworkStakeViewerMethods implements NetworkStakeViewer {
|
|
@@ -18,6 +18,6 @@ export class JsonRpcNetworkStakeViewer extends JsonRpcNetworkStakeViewerMethods
|
|
|
18
18
|
|
|
19
19
|
override async createHandler() {
|
|
20
20
|
await super.createHandler()
|
|
21
|
-
this._stepRewards = await JsonRpcNetworkStakingStepRewardsViewer
|
|
21
|
+
this._stepRewards = await this.locator.getInstance<JsonRpcNetworkStakingStepRewardsViewer>(NetworkStakeStepRewardsViewerMoniker)
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Address, Hash } from '@xylabs/sdk-js'
|
|
2
|
-
import { isDefined, isHash } from '@xylabs/sdk-js'
|
|
3
2
|
import type {
|
|
4
3
|
AttoXL1,
|
|
5
|
-
BlockRange,
|
|
6
4
|
ChainId,
|
|
7
5
|
HydratedBlock,
|
|
8
6
|
SignedHydratedBlockWithHashMeta,
|
|
@@ -19,6 +17,7 @@ import type {
|
|
|
19
17
|
AccountBalanceHistoryItem,
|
|
20
18
|
AccountBalanceViewer,
|
|
21
19
|
BlockViewer,
|
|
20
|
+
ChainQualifiedConfig,
|
|
22
21
|
ForkHistory,
|
|
23
22
|
MempoolViewer,
|
|
24
23
|
NetworkStakeViewer, Position,
|
|
@@ -90,30 +89,12 @@ export class JsonRpcXyoViewer extends AbstractJsonRpcViewer<XyoViewerRpcSchemas,
|
|
|
90
89
|
return this._timeSyncViewer!
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
async accountBalance(address: Address): Promise<AttoXL1>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return (await this.account.balance.accountBalance(address, headOrRange))
|
|
100
|
-
}
|
|
101
|
-
return (await this.account.balance.accountBalance(address))
|
|
102
|
-
}
|
|
103
|
-
return (await this.account.balance.accountBalance(address, headOrRange))
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
async accountBalanceHistory(address: Address): Promise<AccountBalanceHistoryItem[]>
|
|
107
|
-
async accountBalanceHistory(address: Address, head: Hash): Promise<AccountBalanceHistoryItem[]>
|
|
108
|
-
async accountBalanceHistory(address: Address, range: BlockRange): Promise<AccountBalanceHistoryItem[]>
|
|
109
|
-
async accountBalanceHistory(address: Address, headOrRange?: BlockRange | Hash): Promise<AccountBalanceHistoryItem[]> {
|
|
110
|
-
if (isDefined(headOrRange)) {
|
|
111
|
-
if (isHash(headOrRange)) {
|
|
112
|
-
return (await this.account.balance.accountBalanceHistory(address, headOrRange))
|
|
113
|
-
}
|
|
114
|
-
return (await this.account.balance.accountBalanceHistory(address))
|
|
115
|
-
}
|
|
116
|
-
return (await this.account.balance.accountBalanceHistory(address, headOrRange))
|
|
92
|
+
async accountBalance(address: Address, config: ChainQualifiedConfig = {}): Promise<AttoXL1> {
|
|
93
|
+
return (await this.account.balance.accountBalance(address, config))
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async accountBalanceHistory(address: Address, config: ChainQualifiedConfig = {}): Promise<AccountBalanceHistoryItem[]> {
|
|
97
|
+
return (await this.account.balance.accountBalanceHistory(address, config))
|
|
117
98
|
}
|
|
118
99
|
|
|
119
100
|
async blockByHash(hash: Hash): Promise<SignedHydratedBlockWithHashMeta | null> {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AddressZod,
|
|
3
|
-
BigIntToJsonZod,
|
|
3
|
+
BigIntToJsonZod, JsonToBigIntZod,
|
|
4
4
|
} from '@xylabs/sdk-js'
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
AccountBalanceHistoryItemZod, ChainQualifiedConfigZod, ChainQualifiedZod,
|
|
7
|
+
} from '@xyo-network/xl1-protocol-sdk'
|
|
7
8
|
import * as z from 'zod'
|
|
8
9
|
|
|
9
10
|
import type { AccountBalanceViewerRpcMethodName } from '../AccountBalanceViewerRpc.ts'
|
|
@@ -12,22 +13,22 @@ import type { RpcSchemaMap } from './RpcSchemaMap.ts'
|
|
|
12
13
|
export const AccountBalanceViewerRpcSchemas = {
|
|
13
14
|
accountBalanceViewer_qualifiedAccountBalances: {
|
|
14
15
|
params: {
|
|
15
|
-
to: z.
|
|
16
|
-
from: z.
|
|
16
|
+
to: z.tuple([z.array(AddressZod), ChainQualifiedConfigZod]),
|
|
17
|
+
from: z.tuple([z.array(AddressZod), ChainQualifiedConfigZod]),
|
|
17
18
|
},
|
|
18
19
|
result: {
|
|
19
|
-
to:
|
|
20
|
-
from:
|
|
20
|
+
to: ChainQualifiedZod(z.record(AddressZod, BigIntToJsonZod)),
|
|
21
|
+
from: ChainQualifiedZod(z.record(AddressZod, JsonToBigIntZod)),
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
accountBalanceViewer_qualifiedAccountBalanceHistories: {
|
|
24
25
|
params: {
|
|
25
|
-
to: z.
|
|
26
|
-
from: z.
|
|
26
|
+
to: z.tuple([z.array(AddressZod), ChainQualifiedConfigZod]),
|
|
27
|
+
from: z.tuple([z.array(AddressZod), ChainQualifiedConfigZod]),
|
|
27
28
|
},
|
|
28
29
|
result: {
|
|
29
|
-
to:
|
|
30
|
-
from:
|
|
30
|
+
to: ChainQualifiedZod(z.record(AddressZod, z.array(AccountBalanceHistoryItemZod))),
|
|
31
|
+
from: ChainQualifiedZod(z.record(AddressZod, z.array(AccountBalanceHistoryItemZod))),
|
|
31
32
|
},
|
|
32
33
|
},
|
|
33
34
|
} satisfies RpcSchemaMap<AccountBalanceViewerRpcMethodName>
|