Skip to content

Commit

Permalink
Pointing examples at rest v2 instead of v1
Browse files Browse the repository at this point in the history
  • Loading branch information
christroutner committed Feb 11, 2019
1 parent 97d836c commit 2341294
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/check-balance/check-balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const SLPSDK = require("../../lib/SLP").default
// Instantiate SLP based on the network.
let SLP
if (NETWORK === `mainnet`)
SLP = new SLPSDK({ restURL: `https://rest.bitcoin.com/v1/` })
else SLP = new SLPSDK({ restURL: `https://trest.bitcoin.com/v1/` })
SLP = new SLPSDK({ restURL: `https://rest.bitcoin.com/v2/` })
else SLP = new SLPSDK({ restURL: `https://trest.bitcoin.com/v2/` })

// Open the wallet generated with create-wallet.
let walletInfo
Expand Down
4 changes: 2 additions & 2 deletions examples/create-token/create-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ util.inspect.defaultOptions = { depth: 1 }
// Instantiate SLP based on the network.
let SLP
if (NETWORK === `mainnet`)
SLP = new SLPSDK({ restURL: `https://rest.bitcoin.com/v1/` })
else SLP = new SLPSDK({ restURL: `https://trest.bitcoin.com/v1/` })
SLP = new SLPSDK({ restURL: `https://rest.bitcoin.com/v2/` })
else SLP = new SLPSDK({ restURL: `https://trest.bitcoin.com/v2/` })

// Open the wallet generated with create-wallet.
let walletInfo
Expand Down
4 changes: 2 additions & 2 deletions examples/create-wallet/create-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const SLPSDK = require("../../lib/SLP").default
// Instantiate SLP based on the network.
let SLP
if (NETWORK === `mainnet`)
SLP = new SLPSDK({ restURL: `https://rest.bitcoin.com/v1/` })
else SLP = new SLPSDK({ restURL: `https://trest.bitcoin.com/v1/` })
SLP = new SLPSDK({ restURL: `https://rest.bitcoin.com/v2/` })
else SLP = new SLPSDK({ restURL: `https://trest.bitcoin.com/v2/` })

const fs = require("fs")

Expand Down
12 changes: 7 additions & 5 deletions examples/lookup-token/lookup-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

"use strict"

// EDIT THIS WITH THE TOKEN ID YOU WANT TO LOOK UP
const TOKENID =
"259908ae44f46ef585edef4bcc1e50dc06e4c391ac4be929fae27235b8158cf1"

// Set NETWORK to either testnet or mainnet
const NETWORK = `mainnet`

Expand All @@ -12,14 +16,12 @@ const SLPSDK = require("../../lib/SLP").default
// Instantiate SLP based on the network.
let SLP
if (NETWORK === `mainnet`)
SLP = new SLPSDK({ restURL: `https://rest.bitcoin.com/v1/` })
else SLP = new SLPSDK({ restURL: `https://trest.bitcoin.com/v1/` })
SLP = new SLPSDK({ restURL: `https://rest.bitcoin.com/v2/` })
else SLP = new SLPSDK({ restURL: `https://trest.bitcoin.com/v2/` })

async function lookupToken() {
try {
const properties = await SLP.Utils.list(
"259908ae44f46ef585edef4bcc1e50dc06e4c391ac4be929fae27235b8158cf1"
)
const properties = await SLP.Utils.list(TOKENID)
console.log(properties)
} catch (err) {
console.error(`Error in getTokenInfo: `, err)
Expand Down

0 comments on commit 2341294

Please sign in to comment.