@dorafactory/maci-sdk 0.0.25 → 0.0.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dorafactory/maci-sdk",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "SDK for interacting with maci",
5
5
  "keywords": [
6
6
  "maci",
@@ -741,4 +741,9 @@ export class MACI {
741
741
 
742
742
  return client.claim();
743
743
  }
744
+
745
+ async getOracleCertificateConfig() {
746
+ const ecosystems = await this.oracleCertificate.listEcosystems();
747
+ return ecosystems;
748
+ }
744
749
  }
@@ -4,6 +4,7 @@ import {
4
4
  SignatureRequest,
5
5
  SignatureResponse,
6
6
  FeegrantAllowanceResponse,
7
+ EcosystemsResponse,
7
8
  } from './types';
8
9
 
9
10
  export class OracleCertificate {
@@ -49,4 +50,19 @@ export class OracleCertificate {
49
50
  spend_limit: response.allowance.allowance.allowance.spend_limit,
50
51
  };
51
52
  }
53
+
54
+ async listEcosystems(): Promise<EcosystemsResponse> {
55
+ const response = await this.http.fetch(
56
+ `${this.certificateApiEndpoint}/list`,
57
+ {
58
+ method: 'GET',
59
+ headers: {
60
+ 'Content-Type': 'application/json',
61
+ },
62
+ }
63
+ );
64
+ const signatureData = await response.json();
65
+
66
+ return signatureData;
67
+ }
52
68
  }
@@ -27,3 +27,21 @@ export type FeegrantAllowanceResponse = {
27
27
  amount: string;
28
28
  }[];
29
29
  };
30
+
31
+ export interface SnapshotHeightInfo {
32
+ lowestHeight: string;
33
+ latestHeight: string;
34
+ }
35
+
36
+ export interface Ecosystem {
37
+ name: string;
38
+ displayName: string;
39
+ decimals: number;
40
+ apiPath: string;
41
+ snapshotHeightInfo: SnapshotHeightInfo;
42
+ baseSlope: number;
43
+ }
44
+
45
+ export interface EcosystemsResponse {
46
+ ecosystems: Ecosystem[];
47
+ }