fix: convert uint8Array to Buffer (#1679)

This commit is contained in:
Nathan Nichols
2021-09-28 18:01:03 -07:00
committed by Mayukha Vadari
parent a1dce6b1e0
commit 578f35dd35

View File

@@ -48,10 +48,12 @@ async function generateFaucetWallet(
: Wallet.generate()
// Create the POST request body
const postBody = new TextEncoder().encode(
JSON.stringify({
destination: fundWallet.classicAddress,
}),
const postBody = Buffer.from(
new TextEncoder().encode(
JSON.stringify({
destination: fundWallet.classicAddress,
}),
),
)
let startingBalance = 0
@@ -75,7 +77,7 @@ async function returnPromise(
client: Client,
startingBalance: number,
fundWallet: Wallet,
postBody: Uint8Array,
postBody: Buffer,
): Promise<Wallet> {
return new Promise((resolve, reject) => {
const request = httpsRequest(options, (response) => {