From cd43025cfaaa04bf0f1278ca29fe6313be895090 Mon Sep 17 00:00:00 2001 From: Bartek Nowotarski Date: Mon, 6 Feb 2017 13:02:26 +0100 Subject: [PATCH] Update docs [skip ci] --- docs/reference/examples.md | 12 +++++------- docs/reference/readme.md | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/reference/examples.md b/docs/reference/examples.md index 211232ac3..cecc76ba0 100644 --- a/docs/reference/examples.md +++ b/docs/reference/examples.md @@ -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'; diff --git a/docs/reference/readme.md b/docs/reference/readme.md index b13864f04..c2602d058 100644 --- a/docs/reference/readme.md +++ b/docs/reference/readme.md @@ -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) @@ -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) {