I am trying to issue an asset in stellar using the following code
var StellarSdk = require('stellar-sdk');
StellarSdk.Network.useTestNetwork();
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');
// Keys for accounts to issue and receive the new asset
var issuingKeys = StellarSdk.Keypair.fromSecret('SB3VKUYOWTOZKN3IUTLKE4IMEDEMPVPY6ZRQTPP74XZKRxxxNCIKExxx');
//console.log(issuingKeys);
var receivingKeys = StellarSdk.Keypair.fromSecret('SB3Q65ARACYPDK5FxxxLG2KPPFZT7R3SVPPBQAPW6FC75XNxxx3LNLGB');
// Create an object to represent the new asset
var astroDollar = new StellarSdk.Asset('AstroDollar', issuingKeys.publicKey());
// First, the receiving account must trust the asset
server.loadAccount(receivingKeys.publicKey())
.then(function(receiver) {
const fee = server.fetchBaseFee();
var transaction = new StellarSdk.TransactionBuilder(receiver, {fee} )
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(StellarSdk.Operation.changeTrust({
asset: astroDollar,
limit: '1000'
}))
.setTimeout(30)
.build();
transaction.sign(receivingKeys);
return server.submitTransaction(transaction);
});
But I'm getting the following error (node:9922) UnhandledPromiseRejectionWarning: Error: XDR Write Error: not an integer
,
Can anyone tell me how to resolve this issue?