Skip to content

Commit

Permalink
Update docs [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekn committed Feb 6, 2017
1 parent a4ed805 commit cd43025
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 5 additions & 7 deletions docs/reference/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,24 @@ In this example you must ensure that the destination account exists
// 1. Secret key of a funded account to be the source account
// 2. Public key of an existing account as a recipient
// These two keys can be created and funded by the friendbot at
// https://www.stellar.org/developers/ under the heading "Quick Start: Test Account"
// https://www.stellar.org/laboratory/ under the heading "Quick Start: Test Account"
// 3. Access to JS Stellar SDK (https://github.com/stellar/js-stellar-sdk)
// either through Node.js or in the browser.

// This code can be run in the browser at https://www.stellar.org/developers/
// This code can be run in the browser at https://www.stellar.org/laboratory/
// That site exposes a global StellarSdk object you can use.
// To run this code in the Chrome, open the console tab in the DevTools.
// The hotkey to open the DevTools console is Ctrl+Shift+J or (Cmd+Opt+J on Mac).

// To use in node, do `npm install stellar-sdk` and uncomment the following line.
var StellarSdk = require('stellar-sdk');

StellarSdk.
// var StellarSdk = require('stellar-sdk');

// The source account is the account we will be signing and sending from.
var sourceSecretKey = 'SAKRB7EE6H23EF733WFU76RPIYOPEWVOMBBUXDQYQ3OF4NF6ZY6B6VLW';

// Derive Keypair object and public key (that starts with a G) from the secret
var sourceKeypair = StellarSdk.Keypair.fromSeed(sourceSecretKey);
var sourcePublicKey = sourceKeypair.accountId();
var sourceKeypair = StellarSdk.Keypair.fromSecret(sourceSecretKey);
var sourcePublicKey = sourceKeypair.publicKey();

var receiverPublicKey = 'GAIRISXKPLOWZBMFRPU5XRGUUX3VMA3ZEWKBM5MSNRU3CHV6P4PYZ74D';

Expand Down
3 changes: 2 additions & 1 deletion docs/reference/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ See the [Building Transactions](https://www.stellar.org/developers/js-stellar-ba
Once you have built your transaction, you can submit it to the Stellar network with `Server.submitTransaction()`.
```js
var StellarSdk = require('stellar-sdk')
StellarSdk.Network.useTestNetwork();
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');

var transaction = new StellarSdk.TransactionBuilder(account)
Expand All @@ -111,7 +112,7 @@ var transaction = new StellarSdk.TransactionBuilder(account)
}))
.build();

transaction.sign(StellarSdk.Keypair.fromSeed(seedString)); // sign the transaction
transaction.sign(StellarSdk.Keypair.fromSecret(secretString)); // sign the transaction

server.submitTransaction(transaction)
.then(function (transactionResult) {
Expand Down

0 comments on commit cd43025

Please sign in to comment.