@xyo-network/xl1-protocol-sdk 1.16.23 → 1.16.24
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/config/Config.d.ts +9 -4
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/Producer.d.ts +0 -1
- package/dist/neutral/config/Producer.d.ts.map +1 -1
- package/dist/neutral/config/Services.d.ts +6 -0
- package/dist/neutral/config/Services.d.ts.map +1 -0
- package/dist/neutral/config/Telemetry.d.ts +16 -0
- package/dist/neutral/config/Telemetry.d.ts.map +1 -1
- package/dist/neutral/index.mjs +83 -70
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/viewer/XyoViewer.d.ts +2 -2
- package/dist/neutral/provider/viewer/XyoViewer.d.ts.map +1 -1
- package/dist/neutral/viewers/AccountBalance.d.ts +2 -2
- package/dist/neutral/viewers/AccountBalance.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/config/Config.ts +2 -2
- package/src/config/Producer.ts +0 -6
- package/src/config/Services.ts +12 -0
- package/src/config/Telemetry.ts +19 -0
- package/src/provider/viewer/XyoViewer.ts +2 -1
- package/src/viewers/AccountBalance.ts +4 -4
- package/dist/neutral/config/App.d.ts +0 -6
- package/dist/neutral/config/App.d.ts.map +0 -1
- package/src/config/App.ts +0 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AccountBalanceViewerMethods, BlockViewierMethods, ChainViewerMethods, ForkViewerMethods, NetworkStakeStepRewardViewer, StakeViewerMethods, TransactionViewerMethods, TransferBalanceViewerMethods } from '../../viewers/index.ts';
|
|
1
|
+
import type { AccountBalanceViewer, AccountBalanceViewerMethods, BlockViewierMethods, ChainViewerMethods, ForkViewerMethods, NetworkStakeStepRewardViewer, StakeViewerMethods, TransactionViewerMethods, TransferBalanceViewerMethods } from '../../viewers/index.ts';
|
|
2
2
|
import type { NetworkStakeViewer } from './NetworkStake/index.ts';
|
|
3
3
|
import type { StepViewer } from './StepViewer.ts';
|
|
4
|
-
export interface XyoViewerMethods extends AccountBalanceViewerMethods, TransferBalanceViewerMethods, NetworkStakeStepRewardViewer, ChainViewerMethods, BlockViewierMethods, TransactionViewerMethods, StakeViewerMethods, ForkViewerMethods {
|
|
4
|
+
export interface XyoViewerMethods extends AccountBalanceViewerMethods, TransferBalanceViewerMethods, NetworkStakeStepRewardViewer, AccountBalanceViewer, ChainViewerMethods, BlockViewierMethods, TransactionViewerMethods, StakeViewerMethods, ForkViewerMethods {
|
|
5
5
|
}
|
|
6
6
|
export interface XyoViewer extends XyoViewerMethods {
|
|
7
7
|
networkStake?: NetworkStakeViewer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoViewer.d.ts","sourceRoot":"","sources":["../../../../src/provider/viewer/XyoViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,gBAAiB,SAAQ,2BAA2B,EAAE,4BAA4B,EACjG,4BAA4B,
|
|
1
|
+
{"version":3,"file":"XyoViewer.d.ts","sourceRoot":"","sources":["../../../../src/provider/viewer/XyoViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,gBAAiB,SAAQ,2BAA2B,EAAE,4BAA4B,EACjG,4BAA4B,EAAE,oBAAoB,EAClD,kBAAkB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,iBAAiB;CACzG;AAED,MAAM,WAAW,SAAU,SAAQ,gBAAgB;IACjD,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB"}
|
|
@@ -58,11 +58,11 @@ export declare const AccountBalanceHistoryItemZod: z.ZodTuple<[z.ZodObject<{
|
|
|
58
58
|
}, z.z.core.$strip>], null>;
|
|
59
59
|
export type AccountBalanceHistoryItem = z.infer<typeof AccountBalanceHistoryItemZod>;
|
|
60
60
|
export interface AccountBalanceViewerMethods {
|
|
61
|
-
accountBalance(address: Address, headOrRange?: Hash | XL1BlockRange): Promisable<AttoXL1>;
|
|
62
|
-
accountBalanceHistory(address: Address, headOrRange?: Hash | XL1BlockRange): Promisable<AccountBalanceHistoryItem[]>;
|
|
63
61
|
accountsBalances(address: Address[], headOrRange?: Hash | XL1BlockRange): Promisable<Partial<Record<Address, AttoXL1>>>;
|
|
64
62
|
accountsBalancesHistory(address: Address[], headOrRange?: Hash | XL1BlockRange): Promisable<Partial<Record<Address, AccountBalanceHistoryItem[]>>>;
|
|
65
63
|
}
|
|
66
64
|
export interface AccountBalanceViewer extends AccountBalanceViewerMethods {
|
|
65
|
+
accountBalance(address: Address, headOrRange?: Hash | XL1BlockRange): Promisable<AttoXL1>;
|
|
66
|
+
accountBalanceHistory(address: Address, headOrRange?: Hash | XL1BlockRange): Promisable<AccountBalanceHistoryItem[]>;
|
|
67
67
|
}
|
|
68
68
|
//# sourceMappingURL=AccountBalance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../src/viewers/AccountBalance.ts"],"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O,EAAE,yBAAyB,EAAE,CAAC,CAAC,CAAC,CAAA;CACnJ;AAED,MAAM,WAAW,oBAAqB,SAAQ,2BAA2B;IACvE,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,IAAI,GAAG,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IACzF,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,IAAI,GAAG,aAAa,GAAG,UAAU,CAAC,yBAAyB,EAAE,CAAC,CAAA;CACrH"}
|
package/package.json
CHANGED
package/src/config/Config.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod'
|
|
2
2
|
|
|
3
3
|
import { ApiConfigZod } from './Api.ts'
|
|
4
|
-
import { AppConfigZod } from './App.ts'
|
|
5
4
|
import { BridgeConfigZod } from './Bridge.ts'
|
|
6
5
|
import { ChainConfigZod } from './Chain.ts'
|
|
7
6
|
import { EvmConfigZod } from './Evm.ts'
|
|
@@ -9,6 +8,7 @@ import { LogConfigZod } from './Log.ts'
|
|
|
9
8
|
import { MempoolConfigZod } from './Mempool.ts'
|
|
10
9
|
import { ProducerConfigZod } from './Producer.ts'
|
|
11
10
|
import { RewardRedemptionApiConfigZod } from './RewardRedemptionApi.ts'
|
|
11
|
+
import { ServicesConfigZod } from './Services.ts'
|
|
12
12
|
import { StorageConfigZod } from './storage/index.ts'
|
|
13
13
|
import { TelemetryConfigZod } from './Telemetry.ts'
|
|
14
14
|
import { ValidationConfigZod } from './Validation.ts'
|
|
@@ -18,13 +18,13 @@ export const Xl1CommonConfigSchema = z.object({ ...LogConfigZod.shape }).describ
|
|
|
18
18
|
export const ConfigZod = z.object({
|
|
19
19
|
...Xl1CommonConfigSchema.shape,
|
|
20
20
|
api: ApiConfigZod.default(ApiConfigZod.parse({})).describe('Configuration for the API node'),
|
|
21
|
-
app: AppConfigZod.default(AppConfigZod.parse({})).describe('Configuration for the application'),
|
|
22
21
|
bridge: BridgeConfigZod.default(BridgeConfigZod.parse({})).describe('Configuration for the Bridge node'),
|
|
23
22
|
chain: ChainConfigZod.default(ChainConfigZod.parse({})).describe('Configuration for the chain'),
|
|
24
23
|
evm: EvmConfigZod.default(EvmConfigZod.parse({})).describe('Configuration for EVM-backed services'),
|
|
25
24
|
mempool: MempoolConfigZod.default(MempoolConfigZod.parse({})).describe('Configuration for the mempool'),
|
|
26
25
|
producer: ProducerConfigZod.default(ProducerConfigZod.parse({})).describe('Configuration for the producer'),
|
|
27
26
|
rewardRedemptionApi: RewardRedemptionApiConfigZod.default(RewardRedemptionApiConfigZod.parse({})).describe('Configuration for the rewards redemption API'),
|
|
27
|
+
services: ServicesConfigZod.default(ServicesConfigZod.parse({})).describe('Configuration for the global services'),
|
|
28
28
|
storage: StorageConfigZod.default(StorageConfigZod.parse({})).describe('Configuration for the storage'),
|
|
29
29
|
telemetry: TelemetryConfigZod.default(TelemetryConfigZod.parse({})).describe('Configuration for telemetry'),
|
|
30
30
|
validation: ValidationConfigZod.default(ValidationConfigZod.parse({})).describe('Configuration for validation'),
|
package/src/config/Producer.ts
CHANGED
|
@@ -16,12 +16,6 @@ export const ProducerConfigZod = z.object({
|
|
|
16
16
|
type: 'array',
|
|
17
17
|
})),
|
|
18
18
|
|
|
19
|
-
apiEndpoint: z.string().optional().register(globalRegistry, {
|
|
20
|
-
description: 'Endpoint of the API to use for chain data',
|
|
21
|
-
title: 'producer.apiEndpoint',
|
|
22
|
-
type: 'string',
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
19
|
disableIntentRedeclaration: z.boolean().optional().register(globalRegistry, {
|
|
26
20
|
description: 'Should the producer skip redeclaring their intent to continue producing blocks',
|
|
27
21
|
title: 'producer.disableIntentRedeclaration',
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { globalRegistry } from 'zod'
|
|
2
|
+
import * as z from 'zod'
|
|
3
|
+
|
|
4
|
+
export const ServicesConfigZod = z.object({
|
|
5
|
+
accountBalanceViewerEndpoint: z.string().optional().register(globalRegistry, {
|
|
6
|
+
description: 'Endpoint of the API to use for instantiating an external AccountBalanceViewer',
|
|
7
|
+
title: 'services.accountBalanceViewerEndpoint',
|
|
8
|
+
type: 'string',
|
|
9
|
+
}),
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export type ServicesConfig = z.infer<typeof ServicesConfigZod>
|
package/src/config/Telemetry.ts
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { globalRegistry } from 'zod'
|
|
2
2
|
import * as z from 'zod'
|
|
3
3
|
|
|
4
|
+
export const MetricsScrapeConfigZod = z.object({
|
|
5
|
+
path: z.string().default('/metrics').register(globalRegistry, {
|
|
6
|
+
default: '/metrics',
|
|
7
|
+
description: 'Path for the metrics scrape endpoint',
|
|
8
|
+
title: 'telemetry.metrics.scrape.path',
|
|
9
|
+
type: 'string',
|
|
10
|
+
}),
|
|
11
|
+
port: z.coerce.number().default(9464).register(globalRegistry, {
|
|
12
|
+
default: 9464,
|
|
13
|
+
description: 'Port for the metrics scrape endpoint',
|
|
14
|
+
title: 'telemetry.metrics.scrape.port',
|
|
15
|
+
type: 'number',
|
|
16
|
+
}),
|
|
17
|
+
}).describe('Metrics scrape configuration')
|
|
18
|
+
|
|
19
|
+
export const MetricsConfigZod = z.object({ scrape: MetricsScrapeConfigZod }).describe('Metrics configuration options')
|
|
20
|
+
|
|
4
21
|
export const OpenTelemetryConfigZod = z.object({
|
|
5
22
|
// OpenTelemetry options
|
|
6
23
|
otlpEndpoint: z.url().optional().register(globalRegistry, {
|
|
@@ -11,6 +28,8 @@ export const OpenTelemetryConfigZod = z.object({
|
|
|
11
28
|
})
|
|
12
29
|
|
|
13
30
|
export const TelemetryConfigZod = z.object({
|
|
31
|
+
// Metrics configuration
|
|
32
|
+
metrics: MetricsConfigZod.optional().describe('Metrics configuration'),
|
|
14
33
|
// OpenTelemetry configuration
|
|
15
34
|
otel: OpenTelemetryConfigZod.optional().describe('OpenTelemetry configuration'),
|
|
16
35
|
}).describe('Telemetry configuration options')
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
AccountBalanceViewer,
|
|
2
3
|
AccountBalanceViewerMethods,
|
|
3
4
|
BlockViewierMethods,
|
|
4
5
|
ChainViewerMethods,
|
|
@@ -12,7 +13,7 @@ import type { NetworkStakeViewer } from './NetworkStake/index.ts'
|
|
|
12
13
|
import type { StepViewer } from './StepViewer.ts'
|
|
13
14
|
|
|
14
15
|
export interface XyoViewerMethods extends AccountBalanceViewerMethods, TransferBalanceViewerMethods,
|
|
15
|
-
NetworkStakeStepRewardViewer,
|
|
16
|
+
NetworkStakeStepRewardViewer, AccountBalanceViewer,
|
|
16
17
|
ChainViewerMethods, BlockViewierMethods, TransactionViewerMethods, StakeViewerMethods, ForkViewerMethods {
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -20,11 +20,11 @@ export const AccountBalanceHistoryItemZod = z.tuple([
|
|
|
20
20
|
export type AccountBalanceHistoryItem = z.infer<typeof AccountBalanceHistoryItemZod>
|
|
21
21
|
|
|
22
22
|
export interface AccountBalanceViewerMethods {
|
|
23
|
-
accountBalance(address: Address, headOrRange?: Hash | XL1BlockRange): Promisable<AttoXL1>
|
|
24
|
-
accountBalanceHistory(address: Address, headOrRange?: Hash | XL1BlockRange): Promisable<AccountBalanceHistoryItem[]>
|
|
25
|
-
|
|
26
23
|
accountsBalances(address: Address[], headOrRange?: Hash | XL1BlockRange): Promisable<Partial<Record<Address, AttoXL1>>>
|
|
27
24
|
accountsBalancesHistory(address: Address[], headOrRange?: Hash | XL1BlockRange): Promisable<Partial<Record<Address, AccountBalanceHistoryItem[]>>>
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
export interface AccountBalanceViewer extends AccountBalanceViewerMethods {
|
|
27
|
+
export interface AccountBalanceViewer extends AccountBalanceViewerMethods {
|
|
28
|
+
accountBalance(address: Address, headOrRange?: Hash | XL1BlockRange): Promisable<AttoXL1>
|
|
29
|
+
accountBalanceHistory(address: Address, headOrRange?: Hash | XL1BlockRange): Promisable<AccountBalanceHistoryItem[]>
|
|
30
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../src/config/App.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,YAAY;;iBAOvB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
package/src/config/App.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { globalRegistry } from 'zod'
|
|
2
|
-
import * as z from 'zod'
|
|
3
|
-
|
|
4
|
-
export const AppConfigZod = z.object({
|
|
5
|
-
port: z.coerce.number().default(3000).register(globalRegistry, {
|
|
6
|
-
default: 3000,
|
|
7
|
-
description: 'Port for the application',
|
|
8
|
-
title: 'app.port',
|
|
9
|
-
type: 'number',
|
|
10
|
-
}),
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
export type AppConfig = z.infer<typeof AppConfigZod>
|