Skip to content

Commit fa93a6f

Browse files
alexbarnsleyfaustbrian
authored andcommitted
feat: crypto endpoint (#54)
1 parent acfdd8e commit fa93a6f

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

__tests__/mocks/node.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export const mockNode = (host: string) => {
1313
.get("/node/configuration")
1414
.reply(200, { data: [] });
1515

16+
nock(host)
17+
.get("/node/configuration/crypto")
18+
.reply(200, { data: [] });
19+
1620
nock(host)
1721
.get("/node/fees")
1822
.query({ days: 30 })

__tests__/resources/node.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ describe("API - 2.0 - Resources - Node", () => {
2222
expect(response.status).toBe(200);
2323
});
2424

25+
it("should call \"crypto\" method", async () => {
26+
const response = await resource.crypto();
27+
28+
expect(response.status).toBe(200);
29+
});
30+
2531
it("should call \"fees\" method", async () => {
2632
const response = await resource.fees(30);
2733

src/resources/node.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export class Node extends Resource {
1414
return this.sendGet("node/configuration");
1515
}
1616

17+
public async crypto<T = any>(): Promise<IResponse<T>> {
18+
return this.sendGet("node/configuration/crypto");
19+
}
20+
1721
public async fees<T = any>(days: number): Promise<IResponse<T>> {
1822
return this.sendGet("node/fees", {
1923
days,

0 commit comments

Comments
 (0)