forked from bigearth/rest.bitbox.earth
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from Bitcoin-com/stage
More update from Panda Cash
- Loading branch information
Showing
8 changed files
with
83 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var axios_1 = require("axios"); | ||
var BitboxHTTP = axios_1.default.create({ | ||
baseURL: process.env.RPC_BASEURL | ||
}); | ||
exports.getInstance = function () { return BitboxHTTP; }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var username = process.env.RPC_USERNAME; | ||
var password = process.env.RPC_PASSWORD; | ||
exports.getRequestConfig = function (method, params) { | ||
return { | ||
method: "post", | ||
auth: { | ||
username: username, | ||
password: password | ||
}, | ||
data: { | ||
jsonrpc: "1.0", | ||
id: method, | ||
method: method, | ||
params: params | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import axios from "axios" | ||
|
||
const BitboxHTTP = axios.create({ | ||
baseURL: process.env.RPC_BASEURL | ||
}) | ||
|
||
export const getInstance = () => BitboxHTTP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { IRequestConfig } from "../interfaces/IRequestConfig" | ||
|
||
const username = process.env.RPC_USERNAME | ||
const password = process.env.RPC_PASSWORD | ||
|
||
type RPCMethod = "getblockhash" | ||
|
||
export const getRequestConfig = ( | ||
method: RPCMethod, | ||
params: (string | number)[] | ||
): IRequestConfig => { | ||
return { | ||
method: "post", | ||
auth: { | ||
username, | ||
password | ||
}, | ||
data: { | ||
jsonrpc: "1.0", | ||
id: method, | ||
method, | ||
params | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters