Skip to content

Commit d2c999f

Browse files
Merge pull request #9 from Permissionless-Software-Foundation/ct-unstable
fix(Ninsight): Using POST endpoint only
2 parents fec9d37 + 4d2d8d0 commit d2c999f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/ninsight.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ class Ninsight {
6868
try {
6969
// Handle single address.
7070
if (typeof address === "string") {
71-
const response = await axios.get(
71+
const response = await axios.post(
7272
`${this.ninsightURL}/address/utxo/${address}`,
73+
{
74+
addresses: [address]
75+
},
7376
_this.axiosOptions
7477
)
7578
return response.data

test/unit/ninsight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe(`#Ninsight`, () => {
3131

3232
it(`should GET utxos for a single address`, async () => {
3333
// Stub the network call.
34-
sandbox.stub(axios, "get").resolves({ data: mockData.utxo })
34+
sandbox.stub(axios, "post").resolves({ data: mockData.utxo })
3535

3636
const addr = "bitcoincash:qqh793x9au6ehvh7r2zflzguanlme760wuzehgzjh9"
3737

0 commit comments

Comments
 (0)