Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/mssetup', (request, response) => {
- var bobPair = StellarSdk.Keypair.fromSecret("SAN5EIFHBYNOGYNNQWI27DRQ67HHOLEMBM4V3IGSOX2QNNW2O3RBA27Y");
- var alicePair = StellarSdk.Keypair.fromSecret("SDLNYNCBBS5NBGQTWWQR7CMUUADA4NGBUY6WU3TOEKVWET5VGOEKFD4K");
- //
- var fromPair = StellarSdk.Keypair.fromSecret("SACBACXALCZNQJJJ3AW5NGEAQYJHPDRSOLF4HNNSSQ3GMW2GPSEJLTWU");
- server.loadAccount(fromPair.publicKey()).then((account) => {
- var transaction = new StellarSdk.TransactionBuilder(account)
- .addOperation(StellarSdk.Operation.setOptions({
- setFlags: 1,
- signer: {
- ed25519PublicKey: bobPair.publicKey(),
- weight: 1
- },
- signer: {
- ed25519PublicKey: alicePair.publicKey(),
- weight: 1
- },
- masterWeight: 0, // set master key weight
- lowThreshold: 1,
- medThreshold: 1, // a payment is medium threshold
- highThreshold: 1 // make sure to have enough weight to add up to the high threshold!
- }))
- .build();
- transaction.sign(fromPair);
- server.submitTransaction(transaction)
- .then(() => {
- response.send('worked!')
- })
- .catch((err) => {
- console.log(err.response.data.extras.result_codes);
- response.send('An error ocurred!')
- });
- }).catch((err) => {
- console.log(err.response.data.extras.result_codes);
- response.send('An error ocurred2!')
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement