okx/js-wallet-sdk

The entire balance is charged as transaction fees

Closed this issue · 2 comments

When I call the doge transfer method, it seems that the change address is not set, causing the entire balance to be treated as mining fees. How should I set it?
Uploading 1969CDC9-8499-4C08-BBA6-64E174502E2C.png…

const outputs = [{
address: toAddress,
amount: transAmount
}];
let btcTxParams = {
inputs: inputs,
outputs: outputs,
address: fromAddress,
feePerB: 1
};
let signParams = {
privateKey: privateKey,
data: btcTxParams
};
rawTx = await wallet.signTransaction(signParams);

default change address is "address: fromAddress"