@ember-finance/proof-of-reserves 0.0.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.
Files changed (67) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +105 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +48 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/clients/blockvision.d.ts +974 -0
  8. package/dist/clients/blockvision.d.ts.map +1 -0
  9. package/dist/clients/blockvision.js +1942 -0
  10. package/dist/clients/blockvision.js.map +1 -0
  11. package/dist/clients/bluefin.d.ts +78 -0
  12. package/dist/clients/bluefin.d.ts.map +1 -0
  13. package/dist/clients/bluefin.js +138 -0
  14. package/dist/clients/bluefin.js.map +1 -0
  15. package/dist/clients/debank.d.ts +279 -0
  16. package/dist/clients/debank.d.ts.map +1 -0
  17. package/dist/clients/debank.js +211 -0
  18. package/dist/clients/debank.js.map +1 -0
  19. package/dist/clients/sui.d.ts +3 -0
  20. package/dist/clients/sui.d.ts.map +1 -0
  21. package/dist/clients/sui.js +13 -0
  22. package/dist/clients/sui.js.map +1 -0
  23. package/dist/clients/zerion.d.ts +102 -0
  24. package/dist/clients/zerion.d.ts.map +1 -0
  25. package/dist/clients/zerion.js +96 -0
  26. package/dist/clients/zerion.js.map +1 -0
  27. package/dist/config.d.ts +5 -0
  28. package/dist/config.d.ts.map +1 -0
  29. package/dist/config.js +34 -0
  30. package/dist/config.js.map +1 -0
  31. package/dist/generate-report.d.ts +33 -0
  32. package/dist/generate-report.d.ts.map +1 -0
  33. package/dist/generate-report.js +295 -0
  34. package/dist/generate-report.js.map +1 -0
  35. package/dist/index.d.ts +8 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +32 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/interfaces/index.d.ts +116 -0
  40. package/dist/interfaces/index.d.ts.map +1 -0
  41. package/dist/interfaces/index.js +3 -0
  42. package/dist/interfaces/index.js.map +1 -0
  43. package/dist/utils/coin-price.d.ts +6 -0
  44. package/dist/utils/coin-price.d.ts.map +1 -0
  45. package/dist/utils/coin-price.js +87 -0
  46. package/dist/utils/coin-price.js.map +1 -0
  47. package/dist/utils/evm.d.ts +3 -0
  48. package/dist/utils/evm.d.ts.map +1 -0
  49. package/dist/utils/evm.js +104 -0
  50. package/dist/utils/evm.js.map +1 -0
  51. package/dist/utils/index.d.ts +16 -0
  52. package/dist/utils/index.d.ts.map +1 -0
  53. package/dist/utils/index.js +49 -0
  54. package/dist/utils/index.js.map +1 -0
  55. package/dist/utils/logger.d.ts +2 -0
  56. package/dist/utils/logger.d.ts.map +1 -0
  57. package/dist/utils/logger.js +27 -0
  58. package/dist/utils/logger.js.map +1 -0
  59. package/dist/utils/solana.d.ts +11 -0
  60. package/dist/utils/solana.d.ts.map +1 -0
  61. package/dist/utils/solana.js +62 -0
  62. package/dist/utils/solana.js.map +1 -0
  63. package/dist/utils/sui.d.ts +3 -0
  64. package/dist/utils/sui.d.ts.map +1 -0
  65. package/dist/utils/sui.js +104 -0
  66. package/dist/utils/sui.js.map +1 -0
  67. package/package.json +70 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ember Protocol
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # ember-proof-of-reserves
2
+
3
+ A TypeScript library and CLI tool for generating and verifying proof of reserves reports
4
+ for Ember Protocol vaults.
5
+
6
+ ## Installation
7
+
8
+ ### As a CLI tool (global)
9
+
10
+ ```bash
11
+ npm install -g ember-proof-of-reserves
12
+ # or
13
+ yarn global add ember-proof-of-reserves
14
+ ```
15
+
16
+ ### As a library
17
+
18
+ ```bash
19
+ npm install ember-proof-of-reserves
20
+ # or
21
+ yarn add ember-proof-of-reserves
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ### CLI Usage
27
+
28
+ 1. Create a `.env` file:
29
+
30
+ ```bash
31
+ BLOCKVISION_API_KEY=your_blockvision_key_here
32
+ DEBANK_API_KEY=your_debank_key_here
33
+ ZERION_API_KEY=your_zerion_key_here
34
+ SUI_RPC_URL=https://fullnode.mainnet.sui.io:443
35
+ LOG_LEVEL=info
36
+ ```
37
+
38
+ 2. Run the CLI:
39
+
40
+ ```bash
41
+ ember-por
42
+ ```
43
+
44
+ Reports will be generated in the `reports/` directory.
45
+
46
+ ### Library Usage
47
+
48
+ ```typescript
49
+ import { generateProofOfReservesReport, type VaultReport } from 'ember-proof-of-reserves';
50
+
51
+ async function main() {
52
+ // Generate reports programmatically
53
+ const reports = await generateProofOfReservesReport({
54
+ basePath: 'https://vaults.api.sui-prod.bluefin.io',
55
+ suiRpcUrl: 'https://fullnode.mainnet.sui.io:443',
56
+ outputDir: './my-reports'
57
+ });
58
+
59
+ console.log(`Generated ${reports.length} vault reports`);
60
+
61
+ reports.forEach((report: VaultReport) => {
62
+ console.log(`Vault: ${report.vaultName}`);
63
+ console.log(`Health Ratio: ${report.vaultHealthRatio}`);
64
+ console.log(`Total NAV: $${report.systemNavUsd}`);
65
+ });
66
+ }
67
+
68
+ main();
69
+ ```
70
+
71
+ ## Environment Variables
72
+
73
+ | Variable | Required | Default | Description |
74
+ | ---------------------------- | -------- | ------------------------------------- | ------------------------------------------------------ |
75
+ | `BLOCKVISION_API_KEY` | Yes | - | API key for BlockVision (Sui chain data) |
76
+ | `DEBANK_API_KEY` | Yes | - | API key for DeBank (EVM chain data) |
77
+ | `ZERION_API_KEY` | Yes | - | API key for Zerion (Solana chain data) |
78
+ | `SUI_RPC_URL` | No | `https://fullnode.mainnet.sui.io:443` | Sui RPC endpoint |
79
+ | `LOG_LEVEL` | No | `info` | Logging level (trace, debug, info, warn, error, fatal) |
80
+ | `USE_BLUEFIN_PRICE_FEED` | No | `false` | Use Bluefin price feed |
81
+ | `BLOCKVISION_RATE_LIMIT_RPS` | No | `1` | Rate limit for BlockVision API |
82
+
83
+ ## Contributing
84
+
85
+ 1. Fork the repository
86
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
87
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
88
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
89
+ 5. Open a Pull Request
90
+
91
+ ## License
92
+
93
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for
94
+ details.
95
+
96
+ ## Support
97
+
98
+ For issues and questions:
99
+
100
+ - GitHub Issues: https://github.com/fireflyprotocol/ember-por/issues
101
+ - Email: engineering@bluefin.io
102
+
103
+ ## Changelog
104
+
105
+ See [CHANGELOG.md](CHANGELOG.md) for a list of changes.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const commander_1 = require("commander");
5
+ const generate_report_1 = require("./generate-report");
6
+ const logger_1 = require("./utils/logger");
7
+ const program = new commander_1.Command();
8
+ program
9
+ .name("ember-por")
10
+ .command("generate-report")
11
+ .description("Generate proof of capital reports for Ember Protocol vaults")
12
+ .version("0.0.1")
13
+ .option("--vault-service-base-path <url>", "Ember Vaults API base path", "https://vaults.api.sui-prod.bluefin.io")
14
+ .option("--sui-rpc-url <url>", "Sui RPC endpoint URL", "https://fullnode.mainnet.sui.io:443")
15
+ .option("--output-dir <path>", "Directory where reports will be saved", "./reports")
16
+ .option("--excluded-vaults <ids>", "Comma-separated list of vault IDs to exclude", value => value.split(",").map(s => s.trim()))
17
+ .option("--only-process-vault-id <id>", "Process only this specific vault ID")
18
+ .option("--no-write-to-file", "Do not write reports to file system")
19
+ .option("--blockvision-api-key <key>", "API key for Blockvision (or set BLOCKVISION_API_KEY env var)")
20
+ .option("--debank-api-key <key>", "API key for DeBank (or set DEBANK_API_KEY env var)")
21
+ .option("--zerion-api-key <key>", "API key for Zerion (or set ZERION_API_KEY env var)")
22
+ .option("--use-bluefin-price-feed", "Use Bluefin price feed", false)
23
+ .option("--log-level <level>", "Log level: trace, debug, info, warn, error, fatal", "info")
24
+ .option("--blockvision-rate-limit <rps>", "Rate limit for Blockvision API", value => parseInt(value, 10), 1)
25
+ .action(async (options) => {
26
+ try {
27
+ await (0, generate_report_1.generateProofOfCapitalReport)({
28
+ vaultServiceBasePath: options.vaultServiceBasePath,
29
+ suiRpcUrl: options.suiRpcUrl,
30
+ outputDir: options.outputDir,
31
+ excludedVaults: options.excludedVaults,
32
+ onlyProcessVaultId: options.onlyProcessVaultId,
33
+ writeToFile: options.writeToFile,
34
+ blockvisionApiKey: options.blockvisionApiKey || process.env.BLOCKVISION_API_KEY,
35
+ debankApiKey: options.debankApiKey || process.env.DEBANK_API_KEY,
36
+ zerionApiKey: options.zerionApiKey || process.env.ZERION_API_KEY,
37
+ useBluefinPriceFeed: options.useBluefinPriceFeed,
38
+ logLevel: options.logLevel,
39
+ blockvisionRateLimitRps: options.blockvisionRateLimit
40
+ });
41
+ }
42
+ catch (error) {
43
+ logger_1.log.fatal({ error }, "Application failed to complete");
44
+ process.exit(1);
45
+ }
46
+ });
47
+ program.parse();
48
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,uDAAiE;AACjE,2CAAqC;AAErC,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACF,IAAI,CAAC,WAAW,CAAC;KACjB,OAAO,CAAC,iBAAiB,CAAC;KAC1B,WAAW,CAAC,6DAA6D,CAAC;KAC1E,OAAO,CAAC,OAAO,CAAC;KAChB,MAAM,CACH,iCAAiC,EACjC,4BAA4B,EAC5B,wCAAwC,CAC3C;KACA,MAAM,CACH,qBAAqB,EACrB,sBAAsB,EACtB,qCAAqC,CACxC;KACA,MAAM,CAAC,qBAAqB,EAAE,uCAAuC,EAAE,WAAW,CAAC;KACnF,MAAM,CACH,yBAAyB,EACzB,8CAA8C,EAC9C,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAC/C;KACA,MAAM,CAAC,8BAA8B,EAAE,qCAAqC,CAAC;KAC7E,MAAM,CAAC,oBAAoB,EAAE,qCAAqC,CAAC;KACnE,MAAM,CACH,6BAA6B,EAC7B,8DAA8D,CACjE;KACA,MAAM,CACH,wBAAwB,EACxB,oDAAoD,CACvD;KACA,MAAM,CACH,wBAAwB,EACxB,oDAAoD,CACvD;KACA,MAAM,CAAC,0BAA0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