@xyo-network/xl1-protocol 1.5.5 → 1.5.7

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.
@@ -1,10 +1,22 @@
1
+ import type { Hash } from '@xylabs/hex';
2
+ import type { Promisable } from '@xylabs/promise';
3
+ import type { NextOptions } from '@xyo-network/archivist-model';
4
+ import type { Payload, WithStorageMeta } from '@xyo-network/payload-model';
1
5
  export interface ReadRepository<TId, TData> {
2
- get(id: TId): Promise<TData>;
6
+ get(id: TId): Promisable<TData>;
3
7
  }
4
8
  export interface IterableRepository<TId, TData> {
5
- next(id: TId): Promise<TData>;
9
+ next(id: TId): Promisable<TData>;
6
10
  }
7
11
  export interface WriteRepository<TData, TResp> {
8
- insert(data: TData): Promise<TResp>;
12
+ insert(data: TData): Promisable<TResp>;
13
+ }
14
+ export interface PayloadReadRepository<TId = Hash, TData extends Payload = Payload> extends ReadRepository<TId[], WithStorageMeta<TData>[]> {
15
+ }
16
+ export interface PayloadWriteRepository<TData extends Payload = Payload> extends WriteRepository<TData[], WithStorageMeta<TData>[]> {
17
+ }
18
+ export interface PayloadIterableRepository<TId = Hash, TData extends Payload = Payload> extends IterableRepository<NextOptions<TId>, WithStorageMeta<TData>[]> {
19
+ }
20
+ export interface PayloadRepository<TId = Hash, TData extends Payload = Payload> extends PayloadReadRepository<TId, TData>, PayloadWriteRepository<TData>, PayloadIterableRepository<TId, TData> {
9
21
  }
10
22
  //# sourceMappingURL=Repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Repository.d.ts","sourceRoot":"","sources":["../../../src/repository/Repository.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc,CAAC,GAAG,EAAE,KAAK;IACxC,GAAG,CAAC,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;CAC7B;AAED,MAAM,WAAW,kBAAkB,CAAC,GAAG,EAAE,KAAK;IAC5C,IAAI,CAAC,EAAE,EAAE,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,GAAG,IAAI,EAAE,KAAK,SAAS,OAAO,GAAG,OAAO,CACpF,SAAQ,kBAAkB,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;CAAG;AAE3E,MAAM,WAAW,iBAAiB,CAAC,GAAG,GAAG,IAAI,EAAE,KAAK,SAAS,OAAO,GAAG,OAAO,CAC5E,SAAQ,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,sBAAsB,CAAC,KAAK,CAAC,EAAE,yBAAyB,CAAC,GAAG,EAAE,KAAK,CAAC;CAAG"}
@@ -1,4 +1,6 @@
1
1
  import type { Address, Hash, Hex } from '@xylabs/hex';
2
+ import type { Promisable } from '@xylabs/promise';
3
+ import type { AttoXL1 } from '../xl1/index.ts';
2
4
  import type { Service } from './Service.ts';
3
5
  export interface AccountBalanceService extends Service {
4
6
  getBalanceValue?: (address: Address) => bigint;
@@ -7,4 +9,7 @@ export interface AccountBalanceService extends Service {
7
9
  getBalances(): Record<Address, Hex>;
8
10
  sync(head: Hash): Promise<void>;
9
11
  }
12
+ export interface AccountBalanceServiceV2 extends Service {
13
+ balances(head: Hash, addresses: Address[]): Promisable<Partial<Record<Address, AttoXL1>>>;
14
+ }
10
15
  //# sourceMappingURL=AccountBalanceService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccountBalanceService.d.ts","sourceRoot":"","sources":["../../../src/services/AccountBalanceService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,IAAI,EAAE,GAAG,EACnB,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,WAAW,qBAAsB,SAAQ,OAAO;IACpD,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAE1C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,CAAA;IACjC,WAAW,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACnC,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC"}
1
+ {"version":3,"file":"AccountBalanceService.d.ts","sourceRoot":"","sources":["../../../src/services/AccountBalanceService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,IAAI,EAAE,GAAG,EACnB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,WAAW,qBAAsB,SAAQ,OAAO;IACpD,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAE1C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,CAAA;IACjC,WAAW,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACnC,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC;AAED,MAAM,WAAW,uBAAwB,SAAQ,OAAO;IACtD,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;CAC1F"}
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-protocol",
4
- "version": "1.5.5",
4
+ "version": "1.5.7",
5
5
  "description": "XYO Layer One Protocol",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -1,11 +1,25 @@
1
+ import type { Hash } from '@xylabs/hex'
2
+ import type { Promisable } from '@xylabs/promise'
3
+ import type { NextOptions } from '@xyo-network/archivist-model'
4
+ import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
5
+
1
6
  export interface ReadRepository<TId, TData> {
2
- get(id: TId): Promise<TData>
7
+ get(id: TId): Promisable<TData>
3
8
  }
4
9
 
5
10
  export interface IterableRepository<TId, TData> {
6
- next(id: TId): Promise<TData>
11
+ next(id: TId): Promisable<TData>
7
12
  }
8
13
 
9
14
  export interface WriteRepository<TData, TResp> {
10
- insert(data: TData): Promise<TResp>
15
+ insert(data: TData): Promisable<TResp>
11
16
  }
17
+
18
+ export interface PayloadReadRepository<TId = Hash, TData extends Payload = Payload> extends ReadRepository<TId[], WithStorageMeta<TData>[]> {}
19
+ export interface PayloadWriteRepository<TData extends Payload = Payload> extends WriteRepository<TData[], WithStorageMeta<TData>[]> {}
20
+
21
+ export interface PayloadIterableRepository<TId = Hash, TData extends Payload = Payload>
22
+ extends IterableRepository<NextOptions<TId>, WithStorageMeta<TData>[]> {}
23
+
24
+ export interface PayloadRepository<TId = Hash, TData extends Payload = Payload>
25
+ extends PayloadReadRepository<TId, TData>, PayloadWriteRepository<TData>, PayloadIterableRepository<TId, TData> {}
@@ -1,7 +1,9 @@
1
1
  import type {
2
2
  Address, Hash, Hex,
3
3
  } from '@xylabs/hex'
4
+ import type { Promisable } from '@xylabs/promise'
4
5
 
6
+ import type { AttoXL1 } from '../xl1/index.ts'
5
7
  import type { Service } from './Service.ts'
6
8
 
7
9
  export interface AccountBalanceService extends Service {
@@ -12,3 +14,7 @@ export interface AccountBalanceService extends Service {
12
14
  getBalances(): Record<Address, Hex>
13
15
  sync(head: Hash): Promise<void>
14
16
  }
17
+
18
+ export interface AccountBalanceServiceV2 extends Service {
19
+ balances(head: Hash, addresses: Address[]): Promisable<Partial<Record<Address, AttoXL1>>>
20
+ }