Global Props
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
/*Public Key
|
||||
GDY2CP7XLBIY65YX7KS72X7JCZJVJ3AEPEEFTW3TYPLGDRWEZKAC7NR3
|
||||
Secret Key
|
||||
SAM4KRGZ4YTAQV3XK3FRKVHZV77AA37KSYZLKZ4OZSX3SBWR6C6NYS4M
|
||||
*/
|
||||
import StellarSdk from 'stellar-sdk'
|
||||
import Swal from "sweetalert2";
|
||||
import '@sweetalert2/theme-dark/dark.css'
|
||||
@@ -23,14 +18,6 @@ export function send(amount, privatekey, destination, memo){
|
||||
if(memo === undefined || memo === null){
|
||||
memo = ".";
|
||||
}
|
||||
let comision = '0.001';
|
||||
if(parseFloat(amount) < 1){
|
||||
comision = '0.001';
|
||||
} else{
|
||||
comision = parseFloat(amount) / 500;
|
||||
comision = comision. toString();
|
||||
}
|
||||
console.log(comision)
|
||||
const keypair = StellarSdk.Keypair.fromSecret(privatekey)
|
||||
server.loadAccount(keypair.publicKey()).then(account => {
|
||||
console.log(account)
|
||||
@@ -45,14 +32,6 @@ const transaction = new StellarSdk.TransactionBuilder(account, {fee, networkPass
|
||||
// the decimal. They are represented in JS Stellar SDK in string format
|
||||
// to avoid errors from the use of the JavaScript Number data structure.
|
||||
amount: amount,
|
||||
})).addOperation(StellarSdk.Operation.payment({
|
||||
destination: "GDY2CP7XLBIY65YX7KS72X7JCZJVJ3AEPEEFTW3TYPLGDRWEZKAC7NR3",
|
||||
// The term native asset refers to lumens
|
||||
asset: new StellarSdk.Asset("BLC", "GBPKUSD5ZGMEXCS5YW7WAOC2QJSJLEX6LHGUTJIMDYYPFLPOT6GYFNNX"),
|
||||
// Specify 350.1234567 lumens. Lumens are divisible to seven digits past
|
||||
// the decimal. They are represented in JS Stellar SDK in string format
|
||||
// to avoid errors from the use of the JavaScript Number data structure.
|
||||
amount: comision,
|
||||
}))
|
||||
// Make this transaction valid for the next 30 seconds only
|
||||
.setTimeout(30)
|
||||
@@ -72,7 +51,7 @@ try {
|
||||
console.log('An error has occured:');
|
||||
console.log(e);
|
||||
}Swal.fire({
|
||||
title: "Payment sent successfully Comision: " + comision+ " BLC",
|
||||
title: "Payment sent successfully",
|
||||
icon: "success",
|
||||
confirmButtonText: "OK",
|
||||
});}
|
||||
|
||||
Reference in New Issue
Block a user