4 added 58 characters in body
source | link
   // Create an object to represent the new asset
   var fritokennew = new Stellar.Asset('FRICA', 'GDPSCSBLYQU4TXNPLTDFB2JUIZRQQ5CL2E2NYT5J76MUFEO2CP7S3MMF');



   server.loadAccount(admin.publicKey())
 .then(function(receiver) {
  var tx1 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
 transaction.sign(customer);

 var tx2 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customerreceivingKeyscurrentfirst.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
 tx2.sign(customerreceivingKeyslockfirst);

 var tx3 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customerreceivingKeyscurrentsecond.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
  tx3.sign(customerreceivingKeyslocksecond);


  return server.submitTransaction(transaction);
 })

 }
   // Create an object to represent the new asset
   var fritokennew = new Stellar.Asset('FRICA', 'GDPSCSBLYQU4TXNPLTDFB2JUIZRQQ5CL2E2NYT5J76MUFEO2CP7S3MMF');



   server.loadAccount(admin.publicKey())
 .then(function(receiver) {
  var tx1 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
 transaction.sign(customer);

 var tx2 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
 tx2.sign(customer);

 var tx3 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
  tx3.sign(customer);


  return server.submitTransaction(transaction);
 })

 }
   // Create an object to represent the new asset
   var fritokennew = new Stellar.Asset('FRICA', 'GDPSCSBLYQU4TXNPLTDFB2JUIZRQQ5CL2E2NYT5J76MUFEO2CP7S3MMF');



   server.loadAccount(admin.publicKey())
 .then(function(receiver) {
  var tx1 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
 transaction.sign(customer);

 var tx2 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: receivingKeyscurrentfirst.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
 tx2.sign(receivingKeyslockfirst);

 var tx3 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: receivingKeyscurrentsecond.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
  tx3.sign(receivingKeyslocksecond);


  return server.submitTransaction(transaction);
 })

 }
3 added 2981 characters in body
source | link

3 operations need to compltet which is getting triggered on one event. Now we are trying to send token from multiple distributor to multiple account and those accounts have already trusted the distributor. Whether the below approach is correct or not? also i want to know that if any of the operation will fail then the entire transaction will fail? because my requirement is that all the transaction should get failed

   function finalSubmittion(){
   // Keys for accounts to issue and receive the new asset
   var admin = Stellar.Keypair

.fromSecret('SASIIJUEX7DRBTE6IXP3OPCYEXTTBUP6DEIUBWGGCPOKPIEJ35P4XK3T');

    var receivingKeyslockfirst = Stellar.Keypair

.fromSecret('SDQRQ2PVCHZZ2SI4XXWLVKEBUEZI3QABTYB2ZI2YUQ4T6HZLYLYAFOX4');

    var receivingKeyslocksecond = Stellar.Keypair

.fromSecret('SA7CUIF52CAPWQZISPKXMYSBHWPXXC55ZKOXFQCY7T6ZNFJQDSCVCQXK');

   var receivingKeyscurrentfirst = Stellar.Keypair

.fromSecret('SAA2ZPZNHJWA543NRTPUPYTGW7PL7EWNGNRQQ6HAFRY5QIVKFSJAQPSH');

           var receivingKeyscurrentsecond = Stellar.Keypair

.fromSecret('SA27KZR3DFTNAKBQPF3BX6NH5SSRX77CBNJKMUC4UWDXXXF7I5354CKM');

   var customer = Stellar.Keypair

.fromSecret('SCKMZXBEEPWTURZ3NMKQTLSOHSQSJZU4EGJRWSKLLS42VJSYWWIS2XJP');

   // Create an object to represent the new asset
   var fritokennew = new Stellar.Asset('FRICA', 'GDPSCSBLYQU4TXNPLTDFB2JUIZRQQ5CL2E2NYT5J76MUFEO2CP7S3MMF');



   server.loadAccount(admin.publicKey())
 .then(function(receiver) {
  var tx1 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
 transaction.sign(customer);

 var tx2 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
 tx2.sign(customer);

 var tx3 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
  tx3.sign(customer);


  return server.submitTransaction(transaction);
 })

 }

3 operations need to compltet which is getting triggered on one event. Now we are trying to send token from multiple distributor to multiple account and those accounts have already trusted the distributor. Whether the below approach is correct or not? also i want to know that if any of the operation will fail then the entire transaction will fail? because my requirement is that all the transaction should get failed

   function finalSubmittion(){
   // Keys for accounts to issue and receive the new asset
   var admin = Stellar.Keypair

.fromSecret('SASIIJUEX7DRBTE6IXP3OPCYEXTTBUP6DEIUBWGGCPOKPIEJ35P4XK3T');

    var receivingKeyslockfirst = Stellar.Keypair

.fromSecret('SDQRQ2PVCHZZ2SI4XXWLVKEBUEZI3QABTYB2ZI2YUQ4T6HZLYLYAFOX4');

    var receivingKeyslocksecond = Stellar.Keypair

.fromSecret('SA7CUIF52CAPWQZISPKXMYSBHWPXXC55ZKOXFQCY7T6ZNFJQDSCVCQXK');

   var receivingKeyscurrentfirst = Stellar.Keypair

.fromSecret('SAA2ZPZNHJWA543NRTPUPYTGW7PL7EWNGNRQQ6HAFRY5QIVKFSJAQPSH');

           var receivingKeyscurrentsecond = Stellar.Keypair

.fromSecret('SA27KZR3DFTNAKBQPF3BX6NH5SSRX77CBNJKMUC4UWDXXXF7I5354CKM');

   var customer = Stellar.Keypair

.fromSecret('SCKMZXBEEPWTURZ3NMKQTLSOHSQSJZU4EGJRWSKLLS42VJSYWWIS2XJP');

   // Create an object to represent the new asset
   var fritokennew = new Stellar.Asset('FRICA', 'GDPSCSBLYQU4TXNPLTDFB2JUIZRQQ5CL2E2NYT5J76MUFEO2CP7S3MMF');



   server.loadAccount(admin.publicKey())
 .then(function(receiver) {
  var tx1 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
 transaction.sign(customer);

 var tx2 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
 tx2.sign(customer);

 var tx3 = new Stellar.TransactionBuilder(receiver, opts={fee:1})
// The `changeTrust` operation creates (or alters) a trustline
// The `limit` parameter below is optional
.addOperation(Stellar.Operation.payment({
  destination: customer.publicKey(),
  asset: fritokennew,
  amount: '10'
}))
// setTimeout is required for a transaction
.setTimeout(100)
.build();
  tx3.sign(customer);


  return server.submitTransaction(transaction);
 })

 }
2 edited tags
| link
1
source | link