@helium/distributor-oracle 0.0.50 → 0.0.52
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/lib/cjs/server.js +31 -14
- package/lib/cjs/server.js.map +1 -1
- package/lib/esm/src/server.js +29 -14
- package/lib/esm/src/server.js.map +1 -1
- package/lib/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/src/server.d.ts +3 -0
- package/lib/types/src/server.d.ts.map +1 -1
- package/package.json +9 -8
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { Program } from "@coral-xyz/anchor";
|
|
2
3
|
import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager";
|
|
3
4
|
import { LazyDistributor } from "@helium/idls/lib/types/lazy_distributor";
|
|
@@ -6,6 +7,7 @@ import { Keypair, PublicKey } from "@solana/web3.js";
|
|
|
6
7
|
import { FastifyInstance } from "fastify";
|
|
7
8
|
import { RewardsOracle } from "@helium/idls/lib/types/rewards_oracle";
|
|
8
9
|
export interface Database {
|
|
10
|
+
getCurrentRewardsByEntity: (entityKey: Buffer) => Promise<string>;
|
|
9
11
|
getCurrentRewards: (asset: PublicKey) => Promise<string>;
|
|
10
12
|
getBulkRewards: (entityKeys: string[]) => Promise<Record<string, string>>;
|
|
11
13
|
getActiveDevices(): Promise<number>;
|
|
@@ -17,6 +19,7 @@ export declare class PgDatabase implements Database {
|
|
|
17
19
|
getActiveDevices(): Promise<number>;
|
|
18
20
|
getBulkRewards(entityKeys: string[]): Promise<Record<string, string>>;
|
|
19
21
|
getCurrentRewards(assetId: PublicKey): Promise<string>;
|
|
22
|
+
getCurrentRewardsByEntity(entityKey: Buffer): Promise<string>;
|
|
20
23
|
}
|
|
21
24
|
export declare class OracleServer {
|
|
22
25
|
ldProgram: Program<LazyDistributor>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src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AAC;IAU7B,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAkBrE,iBAAiB,CAAC,OAAO,EAAE,SAAS;IAwBpC,yBAAyB,CAAC,SAAS,EAAE,MAAM;CASlD;AAED,qBAAa,YAAY;IAMd,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC,mBAAmB,CAAC;IAC/C,OAAO,CAAC,MAAM;IACP,EAAE,EAAE,QAAQ;IACnB,QAAQ,CAAC,eAAe,EAAE,SAAS;IAVrC,GAAG,EAAE,eAAe,CAAC;IACrB,IAAI,SAAQ;IACZ,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;gBAGlB,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,EACnC,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,EACjC,UAAU,EAAE,OAAO,CAAC,mBAAmB,CAAC,EACvC,MAAM,EAAE,OAAO,EAChB,EAAE,EAAE,QAAQ,EACV,eAAe,EAAE,SAAS;IAgBxB,KAAK;IAQL,KAAK;IAIlB,OAAO,CAAC,SAAS;YAUH,uBAAuB;YAavB,wBAAwB;YAmCxB,oBAAoB;YAiBpB,sBAAsB;CAmNrC"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"registry": "https://registry.npmjs.org/"
|
|
6
6
|
},
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
|
-
"version": "0.0.
|
|
8
|
+
"version": "0.0.52",
|
|
9
9
|
"description": "Oracle server for the lazy distributor",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -37,16 +37,17 @@
|
|
|
37
37
|
"@coral-xyz/anchor": "^0.26.0",
|
|
38
38
|
"@fastify/cors": "^8.1.1",
|
|
39
39
|
"@helium/address": "^4.6.2",
|
|
40
|
-
"@helium/helium-entity-manager-sdk": "^0.0.
|
|
41
|
-
"@helium/helium-sub-daos-sdk": "^0.0.
|
|
42
|
-
"@helium/idls": "^0.0.
|
|
43
|
-
"@helium/lazy-distributor-sdk": "^0.0.
|
|
44
|
-
"@helium/rewards-oracle-sdk": "^0.0.
|
|
45
|
-
"@helium/spl-utils": "^0.0.
|
|
40
|
+
"@helium/helium-entity-manager-sdk": "^0.0.52",
|
|
41
|
+
"@helium/helium-sub-daos-sdk": "^0.0.52",
|
|
42
|
+
"@helium/idls": "^0.0.52",
|
|
43
|
+
"@helium/lazy-distributor-sdk": "^0.0.52",
|
|
44
|
+
"@helium/rewards-oracle-sdk": "^0.0.52",
|
|
45
|
+
"@helium/spl-utils": "^0.0.52",
|
|
46
46
|
"@types/sequelize": "^4.28.14",
|
|
47
47
|
"aws-sdk": "^2.1313.0",
|
|
48
48
|
"axios": "^0.27.2",
|
|
49
49
|
"bn.js": "^5.2.0",
|
|
50
|
+
"bs58": "^5.0.0",
|
|
50
51
|
"cors": "^2.8.5",
|
|
51
52
|
"dotenv": "^16.0.3",
|
|
52
53
|
"fastify": "^4.9.2",
|
|
@@ -66,5 +67,5 @@
|
|
|
66
67
|
"typescript": "^4.3.4",
|
|
67
68
|
"yarn": "^1.22.18"
|
|
68
69
|
},
|
|
69
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "b77c833d591bbc47b9864af94bea1c52b5e3c4cd"
|
|
70
71
|
}
|