diff --git a/.eslintrc.js b/.eslintrc.js index f6ef1fe3c..4462de45e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,10 +2,10 @@ module.exports = { env: { es6: true }, - extends: ['airbnb-base', 'prettier'], - plugins: ['@babel', 'prettier', 'prefer-import'], - parser: '@babel/eslint-parser', + extends: ["airbnb-base", "prettier"], + plugins: ["@babel", "prettier", "prefer-import"], + parser: "@babel/eslint-parser", rules: { - 'node/no-unpublished-require': 0 + "node/no-unpublished-require": 0 } }; diff --git a/config/karma.conf.js b/config/karma.conf.js index bc54a9a87..8c24fe68d 100644 --- a/config/karma.conf.js +++ b/config/karma.conf.js @@ -1,4 +1,4 @@ -const webpackConfig = require('./webpack.config.browser.js'); +const webpackConfig = require("./webpack.config.browser.js"); delete webpackConfig.output; delete webpackConfig.entry; // karma fills these in @@ -6,17 +6,17 @@ webpackConfig.plugins.shift(); // drop eslinter plugin module.exports = function (config) { config.set({ - frameworks: ['mocha', 'sinon-chai'], - browsers: ['FirefoxHeadless', 'ChromeHeadless'], + frameworks: ["mocha", "sinon-chai"], + browsers: ["FirefoxHeadless", "ChromeHeadless"], files: [ - '../dist/stellar-sdk.js', // webpack should build this first - '../test/test-browser.js', - '../test/unit/**/*.js' + "../dist/stellar-sdk.js", // webpack should build this first + "../test/test-browser.js", + "../test/unit/**/*.js" ], preprocessors: { - '../test/**/*.js': ['webpack'] + "../test/**/*.js": ["webpack"] }, webpack: webpackConfig, @@ -27,9 +27,9 @@ module.exports = function (config) { colors: true, singleRun: true, - reporters: ['dots', 'coverage'], + reporters: ["dots", "coverage"], coverageReporter: { - type: 'text-summary', + type: "text-summary", instrumenterOptions: { istanbul: { noCompact: true } } diff --git a/config/prettier.config.js b/config/prettier.config.js index 40f1444de..38bc67b48 100644 --- a/config/prettier.config.js +++ b/config/prettier.config.js @@ -1,13 +1,13 @@ module.exports = { - arrowParens: 'always', + arrowParens: "always", bracketSpacing: true, bracketSameLine: false, printWidth: 80, - proseWrap: 'always', + proseWrap: "always", semi: true, - singleQuote: true, + singleQuote: false, tabWidth: 2, - parser: 'babel', - trailingComma: 'none', + parser: "babel", + trailingComma: "none", useTabs: false }; diff --git a/config/webpack.config.browser.js b/config/webpack.config.browser.js index b7c704dd0..7da0dc65a 100644 --- a/config/webpack.config.browser.js +++ b/config/webpack.config.browser.js @@ -1,40 +1,40 @@ -var path = require('path'); -var webpack = require('webpack'); +var path = require("path"); +var webpack = require("webpack"); -var ESLintPlugin = require('eslint-webpack-plugin'); -var TerserPlugin = require('terser-webpack-plugin'); -var NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); +var ESLintPlugin = require("eslint-webpack-plugin"); +var TerserPlugin = require("terser-webpack-plugin"); +var NodePolyfillPlugin = require("node-polyfill-webpack-plugin"); const config = { - target: 'web', + target: "web", // https://stackoverflow.com/a/34018909 entry: { - 'stellar-sdk': path.resolve(__dirname, '../src/browser.ts'), - 'stellar-sdk.min': path.resolve(__dirname, '../src/browser.ts') + "stellar-sdk": path.resolve(__dirname, "../src/browser.ts"), + "stellar-sdk.min": path.resolve(__dirname, "../src/browser.ts") }, resolve: { fallback: { - crypto: require.resolve('crypto-browserify'), - stream: require.resolve('stream-browserify'), - buffer: require.resolve('buffer') + crypto: require.resolve("crypto-browserify"), + stream: require.resolve("stream-browserify"), + buffer: require.resolve("buffer") }, - extensions: ['.ts', '.js'] + extensions: [".ts", ".js"] }, output: { clean: true, - library: 'StellarSdk', + library: "StellarSdk", compareBeforeEmit: true, - path: path.resolve(__dirname, '../dist') + path: path.resolve(__dirname, "../dist") }, - mode: process.env.NODE_ENV ?? 'development', - devtool: process.env.NODE_ENV === 'production' ? false : 'inline-source-map', + mode: process.env.NODE_ENV ?? "development", + devtool: process.env.NODE_ENV === "production" ? false : "inline-source-map", module: { rules: [ { test: /\.m?(ts|js)$/, exclude: /node_modules\/(?!(stellar-base|js-xdr))/, use: { - loader: 'babel-loader', + loader: "babel-loader", options: { cacheDirectory: true } @@ -58,15 +58,15 @@ const config = { plugins: [ // this must be first for karma to work (see line 5 of karma.conf.js) new ESLintPlugin({ - overrideConfigFile: path.resolve(__dirname, '../.eslintrc.js') + overrideConfigFile: path.resolve(__dirname, "../.eslintrc.js") }), // Ignore native modules (sodium-native) new webpack.IgnorePlugin({ resourceRegExp: /sodium-native/ }), new NodePolyfillPlugin({ - includeAliases: ['http', 'https'] // others aren't needed + includeAliases: ["http", "https"] // others aren't needed }), new webpack.ProvidePlugin({ - Buffer: ['buffer', 'Buffer'] + Buffer: ["buffer", "Buffer"] }) ], watchOptions: { diff --git a/src/.eslintrc.js b/src/.eslintrc.js index 128adddd7..2a71f4b37 100644 --- a/src/.eslintrc.js +++ b/src/.eslintrc.js @@ -4,36 +4,36 @@ module.exports = { }, rules: { // OFF - 'import/prefer-default-export': 0, - 'node/no-unsupported-features/es-syntax': 0, - 'node/no-unsupported-features/es-builtins': 0, + "import/prefer-default-export": 0, + "node/no-unsupported-features/es-syntax": 0, + "node/no-unsupported-features/es-builtins": 0, camelcase: 0, - 'class-methods-use-this': 0, - 'linebreak-style': 0, - 'new-cap': 0, - 'no-param-reassign': 0, - 'no-underscore-dangle': 0, - 'no-use-before-define': 0, - 'prefer-destructuring': 0, - 'lines-between-class-members': 0, + "class-methods-use-this": 0, + "linebreak-style": 0, + "new-cap": 0, + "no-param-reassign": 0, + "no-underscore-dangle": 0, + "no-use-before-define": 0, + "prefer-destructuring": 0, + "lines-between-class-members": 0, // WARN - 'prefer-import/prefer-import-over-require': [1], - 'no-console': ['warn', { allow: ['assert'] }], - 'no-debugger': 1, - 'no-unused-vars': 1, - 'arrow-body-style': 1, - 'valid-jsdoc': [ + "prefer-import/prefer-import-over-require": [1], + "no-console": ["warn", { allow: ["assert"] }], + "no-debugger": 1, + "no-unused-vars": 1, + "arrow-body-style": 1, + "valid-jsdoc": [ 1, { requireReturnDescription: false } ], - 'prefer-const': 1, - 'object-shorthand': 1, - 'require-await': 1, + "prefer-const": 1, + "object-shorthand": 1, + "require-await": 1, // ERROR - 'no-unused-expressions': [2, { allowTaggedTemplates: true }] + "no-unused-expressions": [2, { allowTaggedTemplates: true }] } }; diff --git a/src/soroban/.eslintrc.js b/src/soroban/.eslintrc.js index 9d226df13..7f182a3d0 100644 --- a/src/soroban/.eslintrc.js +++ b/src/soroban/.eslintrc.js @@ -2,41 +2,41 @@ module.exports = { env: { es6: true }, - parser: '@babel/eslint-parser', - extends: ['airbnb-base', 'prettier'], - plugins: ['prettier', 'prefer-import'], + parser: "@babel/eslint-parser", + extends: ["airbnb-base", "prettier"], + plugins: ["prettier", "prefer-import"], rules: { // OFF - 'import/prefer-default-export': 0, - 'node/no-unsupported-features/es-syntax': 0, - 'node/no-unsupported-features/es-builtins': 0, + "import/prefer-default-export": 0, + "node/no-unsupported-features/es-syntax": 0, + "node/no-unsupported-features/es-builtins": 0, camelcase: 0, - 'class-methods-use-this': 0, - 'linebreak-style': 0, - 'new-cap': 0, - 'no-param-reassign': 0, - 'no-underscore-dangle': 0, - 'no-use-before-define': 0, - 'prefer-destructuring': 0, - 'lines-between-class-members': 0, + "class-methods-use-this": 0, + "linebreak-style": 0, + "new-cap": 0, + "no-param-reassign": 0, + "no-underscore-dangle": 0, + "no-use-before-define": 0, + "prefer-destructuring": 0, + "lines-between-class-members": 0, // WARN - 'prefer-import/prefer-import-over-require': [1], - 'no-console': ['warn', { allow: ['assert'] }], - 'no-debugger': 1, - 'no-unused-vars': 1, - 'arrow-body-style': 1, - 'valid-jsdoc': [ + "prefer-import/prefer-import-over-require": [1], + "no-console": ["warn", { allow: ["assert"] }], + "no-debugger": 1, + "no-unused-vars": 1, + "arrow-body-style": 1, + "valid-jsdoc": [ 1, { requireReturnDescription: false } ], - 'prefer-const': 1, - 'object-shorthand': 1, - 'require-await': 1, + "prefer-const": 1, + "object-shorthand": 1, + "require-await": 1, // ERROR - 'no-unused-expressions': [2, { allowTaggedTemplates: true }] + "no-unused-expressions": [2, { allowTaggedTemplates: true }] } }; diff --git a/test/.eslintrc.js b/test/.eslintrc.js index 8f7d8e0f9..0a729dab1 100644 --- a/test/.eslintrc.js +++ b/test/.eslintrc.js @@ -11,6 +11,6 @@ module.exports = { HorizonAxiosClient: true }, rules: { - 'no-unused-vars': 0 + "no-unused-vars": 0 } }; diff --git a/test/integration/apiary.js b/test/integration/apiary.js index b9e363789..718bdf109 100644 --- a/test/integration/apiary.js +++ b/test/integration/apiary.js @@ -3,20 +3,20 @@ // All endpoints from here are tested: // https://docs.google.com/document/d/1pXL8kr1a2vfYSap9T67R-g72B_WWbaE1YsLMa04OgoU/edit -const _ = require('lodash'); +const _ = require("lodash"); const { HorizonServer } = StellarSdk; -const MOCK_SERVER = 'https://private-d133c-ammmock.apiary-mock.com'; +const MOCK_SERVER = "https://private-d133c-ammmock.apiary-mock.com"; -describe('tests the /liquidity_pools endpoint', function () { +describe("tests the /liquidity_pools endpoint", function () { const lpId = - '0569b19c75d7ecadce50501fffad6fe8ba4652455df9e1cc96dc408141124dd5'; + "0569b19c75d7ecadce50501fffad6fe8ba4652455df9e1cc96dc408141124dd5"; const server = new HorizonServer(MOCK_SERVER, { allowHttp: true }); - it('GET /', function (done) { + it("GET /", function (done) { chai .request(MOCK_SERVER) - .get('/liquidity_pools') + .get("/liquidity_pools") .end(function (err, res) { if (err != null) done(err); expect(res.body).not.to.be.null; @@ -32,7 +32,7 @@ describe('tests the /liquidity_pools endpoint', function () { }); }); - it('GET /', function (done) { + it("GET /", function (done) { chai .request(MOCK_SERVER) .get(`/liquidity_pools/${lpId}`) @@ -78,7 +78,7 @@ describe('tests the /liquidity_pools endpoint', function () { // TransactionRecord values don't map 1-to-1 to the JSON (see // e.g. the ledger vs. ledger_attr properties), so we do a "best // effort" validation by checking that at least the keys exist. - if (suffix === 'transactions') { + if (suffix === "transactions") { record = Object.keys(record); expectedRecord = Object.keys(expectedRecord); } @@ -93,13 +93,13 @@ describe('tests the /liquidity_pools endpoint', function () { }); }); -describe('tests the /accounts endpoint', function () { +describe("tests the /accounts endpoint", function () { const server = new HorizonServer(MOCK_SERVER, { allowHttp: true }); - it('GET /', function (done) { + it("GET /", function (done) { chai .request(MOCK_SERVER) - .get('/accounts') + .get("/accounts") .end(function (err, res) { if (err != null) return done(err); expect(res.body).not.to.be.null; @@ -116,13 +116,13 @@ describe('tests the /accounts endpoint', function () { }); }); - it('GET /?liquidity_pool=', function (done) { + it("GET /?liquidity_pool=", function (done) { const lpId = - '0569b19c75d7ecadce50501fffad6fe8ba4652455df9e1cc96dc408141124dd5'; + "0569b19c75d7ecadce50501fffad6fe8ba4652455df9e1cc96dc408141124dd5"; chai .request(MOCK_SERVER) - .get('/accounts') + .get("/accounts") .query({ liquidity_pool: lpId }) .end(function (err, res) { if (err != null) return done(err); @@ -140,9 +140,9 @@ describe('tests the /accounts endpoint', function () { }); }); - it('GET /', function (done) { + it("GET /", function (done) { const accountId = - 'GDQNY3PBOJOKYZSRMK2S7LHHGWZIUISD4QORETLMXEWXBI7KFZZMKTL3'; + "GDQNY3PBOJOKYZSRMK2S7LHHGWZIUISD4QORETLMXEWXBI7KFZZMKTL3"; chai .request(MOCK_SERVER) @@ -158,7 +158,7 @@ describe('tests the /accounts endpoint', function () { .then((resp) => { // find the pool share balance(s) const poolShares = resp.balances.filter( - (b) => b.asset_type === 'liquidity_pool_shares' + (b) => b.asset_type === "liquidity_pool_shares" ); expect(poolShares).to.have.lengthOf(1); diff --git a/test/integration/client_headers_test.js b/test/integration/client_headers_test.js index 4f3516901..45d4d7eb3 100644 --- a/test/integration/client_headers_test.js +++ b/test/integration/client_headers_test.js @@ -1,23 +1,23 @@ const { HorizonServer } = StellarSdk; -const http = require('http'); -const url = require('url'); +const http = require("http"); +const url = require("url"); const port = 3100; const versionPattern = /^[0-9]+\.[0-9]+\.[0-9]+(-[a-z]+(\.[0-9])?)?$/; -describe('integration tests: client headers', function (done) { - if (typeof window !== 'undefined') { +describe("integration tests: client headers", function (done) { + if (typeof window !== "undefined") { done(); return; } - it('sends client via headers', function (done) { + it("sends client via headers", function (done) { let server; const requestHandler = (request, response) => { - expect(request.headers['x-client-name']).to.be.equal('js-stellar-sdk'); - expect(request.headers['x-client-version']).to.match(versionPattern); + expect(request.headers["x-client-name"]).to.be.equal("js-stellar-sdk"); + expect(request.headers["x-client-version"]).to.match(versionPattern); response.end(); server.close(() => done()); }; @@ -35,15 +35,15 @@ describe('integration tests: client headers', function (done) { }); }); - it('sends client data via get params when streaming', function (done) { + it("sends client data via get params when streaming", function (done) { let server; let closeStream; const requestHandler = (request, response) => { // eslint-disable-next-line node/no-deprecated-api let query = url.parse(request.url, true).query; - expect(query['X-Client-Name']).to.be.equal('js-stellar-sdk'); - expect(query['X-Client-Version']).to.match(versionPattern); + expect(query["X-Client-Name"]).to.be.equal("js-stellar-sdk"); + expect(query["X-Client-Version"]).to.match(versionPattern); response.end(); server.close(() => { closeStream(); diff --git a/test/integration/streaming_test.js b/test/integration/streaming_test.js index a09176c9c..b35b2aa48 100644 --- a/test/integration/streaming_test.js +++ b/test/integration/streaming_test.js @@ -1,15 +1,15 @@ const { HorizonServer } = StellarSdk; -const http = require('http'); +const http = require("http"); const port = 3100; -describe('integration tests: streaming', function (done) { - if (typeof window !== 'undefined') { +describe("integration tests: streaming", function (done) { + if (typeof window !== "undefined") { done(); return; } - it('handles onerror', function (done) { + it("handles onerror", function (done) { let server; let closeStream; @@ -41,7 +41,7 @@ describe('integration tests: streaming', function (done) { }); }); - it('handles close message', function (done) { + it("handles close message", function (done) { let server; let closeStream; @@ -52,18 +52,18 @@ describe('integration tests: streaming', function (done) { return; } - request.once('close', (e) => { + request.once("close", (e) => { closeStream(); server.close(); done(); }); response.writeHead(200, { - 'Content-Type': 'text/event-stream', - 'Cache-Control': 'no-cache', - Connection: 'keep-alive' + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache", + Connection: "keep-alive" }); - response.write('retry: 10\nevent: close\ndata: byebye\n\n'); + response.write("retry: 10\nevent: close\ndata: byebye\n\n"); }; server = http.createServer(requestHandler); @@ -79,7 +79,7 @@ describe('integration tests: streaming', function (done) { .operations() .stream({ onmessage: (m) => { - done('unexpected message ' + JSON.stringify(m)); + done("unexpected message " + JSON.stringify(m)); }, onerror: (err) => { done(err); @@ -89,8 +89,8 @@ describe('integration tests: streaming', function (done) { }); }); -describe('end-to-end tests: real streaming', function (done) { - if (typeof window !== 'undefined') { +describe("end-to-end tests: real streaming", function (done) { + if (typeof window !== "undefined") { done(); return; } @@ -98,9 +98,9 @@ describe('end-to-end tests: real streaming', function (done) { // stream transactions from pubnet for a while and ensure that we cross a // ledger boundary (if streaming is broken, we will get stuck on a single // ledger's transaction batch). - it('streams in perpetuity', function (done) { + it("streams in perpetuity", function (done) { const DURATION = 30; - const server = new HorizonServer('https://horizon.stellar.org'); + const server = new HorizonServer("https://horizon.stellar.org"); this.timeout((DURATION + 5) * 1000); // pad timeout let transactions = []; @@ -119,7 +119,7 @@ describe('end-to-end tests: real streaming', function (done) { let closeHandler = server .transactions() - .cursor('now') + .cursor("now") .stream({ onmessage: (msg) => { transactions.push(msg); diff --git a/test/test-browser.js b/test/test-browser.js index d40311049..92b37653e 100644 --- a/test/test-browser.js +++ b/test/test-browser.js @@ -1,6 +1,6 @@ /* eslint-disable no-undef */ -chai.use(require('chai-as-promised')); +chai.use(require("chai-as-promised")); window.axios = StellarSdk.axios; window.HorizonAxiosClient = StellarSdk.HorizonAxiosClient; window.SorobanAxiosClient = StellarSdk.SorobanAxiosClient; -window.serverUrl = 'https://horizon-live.stellar.org:1337/api/v1/jsonrpc'; +window.serverUrl = "https://horizon-live.stellar.org:1337/api/v1/jsonrpc"; diff --git a/test/test-nodejs.js b/test/test-nodejs.js index ab3d07a88..d33cbe981 100644 --- a/test/test-nodejs.js +++ b/test/test-nodejs.js @@ -1,19 +1,19 @@ /* eslint-disable no-undef */ -require('@babel/register'); -global.StellarSdk = require('../lib/'); +require("@babel/register"); +global.StellarSdk = require("../lib/"); -global.axios = require('axios'); +global.axios = require("axios"); global.HorizonAxiosClient = StellarSdk.HorizonAxiosClient; global.SorobanAxiosClient = StellarSdk.SorobanAxiosClient; -global.serverUrl = 'https://horizon-live.stellar.org:1337/api/v1/jsonrpc'; +global.serverUrl = "https://horizon-live.stellar.org:1337/api/v1/jsonrpc"; -var chaiAsPromised = require('chai-as-promised'); -var chaiHttp = require('chai-http'); -global.chai = require('chai'); +var chaiAsPromised = require("chai-as-promised"); +var chaiHttp = require("chai-http"); +global.chai = require("chai"); global.chai.should(); global.chai.use(chaiAsPromised); global.chai.use(chaiHttp); global.expect = global.chai.expect; -global.sinon = require('sinon'); +global.sinon = require("sinon"); diff --git a/test/unit/browser_test.js b/test/unit/browser_test.js index 426573f4a..eea4c4824 100644 --- a/test/unit/browser_test.js +++ b/test/unit/browser_test.js @@ -1,7 +1,7 @@ -describe('Browser version tests', function () { - it('lodash is not exported globally', function () { - if (typeof window !== 'undefined') { - expect(typeof _ === 'undefined').to.be.true; +describe("Browser version tests", function () { + it("lodash is not exported globally", function () { + if (typeof window !== "undefined") { + expect(typeof _ === "undefined").to.be.true; } }); }); diff --git a/test/unit/call_builders_test.js b/test/unit/call_builders_test.js index e5b4fa4d7..ab00bfc3e 100644 --- a/test/unit/call_builders_test.js +++ b/test/unit/call_builders_test.js @@ -1,17 +1,17 @@ -import URI from 'urijs'; +import URI from "urijs"; // not exported by the library -import { CallBuilder } from '../../lib/horizon/call_builder'; +import { CallBuilder } from "../../lib/horizon/call_builder"; -describe('CallBuilder functions', function () { +describe("CallBuilder functions", function () { it("doesn't mutate the constructor passed url argument (it clones it instead)", function () { - let arg = URI('https://onedom.ain/'); + let arg = URI("https://onedom.ain/"); const builder = new CallBuilder(arg); - builder.url.segment('one_segment'); + builder.url.segment("one_segment"); builder.checkFilter(); - expect(arg.toString()).not.to.be.equal('https://onedom.ain/one_segment'); // https://onedom.ain/ + expect(arg.toString()).not.to.be.equal("https://onedom.ain/one_segment"); // https://onedom.ain/ expect(builder.url.toString()).to.be.equal( - 'https://onedom.ain/one_segment' + "https://onedom.ain/one_segment" ); }); }); diff --git a/test/unit/contract_spec.js b/test/unit/contract_spec.js index ae3010cb9..26d12c995 100644 --- a/test/unit/contract_spec.js +++ b/test/unit/contract_spec.js @@ -1,23 +1,23 @@ -import { xdr, ContractSpec, Address } from '../../lib'; +import { xdr, ContractSpec, Address } from "../../lib"; //@ts-ignore -import spec from '../spec.json'; -import { expect } from 'chai'; -const publicKey = 'GCBVOLOM32I7OD5TWZQCIXCXML3TK56MDY7ZMTAILIBQHHKPCVU42XYW'; +import spec from "../spec.json"; +import { expect } from "chai"; +const publicKey = "GCBVOLOM32I7OD5TWZQCIXCXML3TK56MDY7ZMTAILIBQHHKPCVU42XYW"; const addr = Address.fromString(publicKey); let SPEC; before(() => { SPEC = new ContractSpec(spec); }); -it('throws if no entries', () => { +it("throws if no entries", () => { expect(() => new ContractSpec([])).to.throw( /Contract spec must have at least one entry/i ); }); -describe('Can round trip custom types', function () { +describe("Can round trip custom types", function () { function getResultType(funcName) { let fn = SPEC.findEntry(funcName).value(); if (!(fn instanceof xdr.ScSpecFunctionV0)) { - throw new Error('Not a function'); + throw new Error("Not a function"); } if (fn.outputs().length === 0) { return xdr.ScSpecTypeDef.scSpecTypeVoid(); @@ -33,221 +33,221 @@ describe('Can round trip custom types', function () { let result = SPEC.scValToNative(scVal, type); expect(result).deep.equal(input); } - it('u32', () => { - roundtrip('u32_', 1); + it("u32", () => { + roundtrip("u32_", 1); }); - it('i32', () => { - roundtrip('i32_', -1); + it("i32", () => { + roundtrip("i32_", -1); }); - it('i64', () => { - roundtrip('i64_', 1n); + it("i64", () => { + roundtrip("i64_", 1n); }); - it('strukt', () => { - roundtrip('strukt', { a: 0, b: true, c: 'hello' }); + it("strukt", () => { + roundtrip("strukt", { a: 0, b: true, c: "hello" }); }); - describe('simple', () => { - it('first', () => { - const simple = { tag: 'First', values: undefined }; - roundtrip('simple', simple); + describe("simple", () => { + it("first", () => { + const simple = { tag: "First", values: undefined }; + roundtrip("simple", simple); }); - it('simple second', () => { - const simple = { tag: 'Second', values: undefined }; - roundtrip('simple', simple); + it("simple second", () => { + const simple = { tag: "Second", values: undefined }; + roundtrip("simple", simple); }); - it('simple third', () => { - const simple = { tag: 'Third', values: undefined }; - roundtrip('simple', simple); + it("simple third", () => { + const simple = { tag: "Third", values: undefined }; + roundtrip("simple", simple); }); }); - describe('complex', () => { - it('struct', () => { + describe("complex", () => { + it("struct", () => { const complex = { - tag: 'Struct', - values: [{ a: 0, b: true, c: 'hello' }] + tag: "Struct", + values: [{ a: 0, b: true, c: "hello" }] }; - roundtrip('complex', complex); + roundtrip("complex", complex); }); - it('tuple', () => { + it("tuple", () => { const complex = { - tag: 'Tuple', + tag: "Tuple", values: [ [ - { a: 0, b: true, c: 'hello' }, - { tag: 'First', values: undefined } + { a: 0, b: true, c: "hello" }, + { tag: "First", values: undefined } ] ] }; - roundtrip('complex', complex); + roundtrip("complex", complex); }); - it('enum', () => { + it("enum", () => { const complex = { - tag: 'Enum', - values: [{ tag: 'First', values: undefined }] + tag: "Enum", + values: [{ tag: "First", values: undefined }] }; - roundtrip('complex', complex); + roundtrip("complex", complex); }); - it('asset', () => { - const complex = { tag: 'Asset', values: [addr, 1n] }; - roundtrip('complex', complex); + it("asset", () => { + const complex = { tag: "Asset", values: [addr, 1n] }; + roundtrip("complex", complex); }); - it('void', () => { - const complex = { tag: 'Void', values: undefined }; - roundtrip('complex', complex); + it("void", () => { + const complex = { tag: "Void", values: undefined }; + roundtrip("complex", complex); }); }); - it('addresse', () => { - roundtrip('addresse', addr); + it("addresse", () => { + roundtrip("addresse", addr); }); - it('bytes', () => { - const bytes = Buffer.from('hello'); - roundtrip('bytes', bytes); + it("bytes", () => { + const bytes = Buffer.from("hello"); + roundtrip("bytes", bytes); }); - it('bytes_n', () => { - const bytes_n = Buffer.from('123456789'); // what's the correct way to construct bytes_n? - roundtrip('bytes_n', bytes_n); + it("bytes_n", () => { + const bytes_n = Buffer.from("123456789"); // what's the correct way to construct bytes_n? + roundtrip("bytes_n", bytes_n); }); - it('card', () => { + it("card", () => { const card = 11; - roundtrip('card', card); + roundtrip("card", card); }); - it('boolean', () => { - roundtrip('boolean', true); + it("boolean", () => { + roundtrip("boolean", true); }); - it('not', () => { - roundtrip('boolean', false); + it("not", () => { + roundtrip("boolean", false); }); - it('i128', () => { - roundtrip('i128', -1n); + it("i128", () => { + roundtrip("i128", -1n); }); - it('u128', () => { - roundtrip('u128', 1n); + it("u128", () => { + roundtrip("u128", 1n); }); - it('map', () => { + it("map", () => { const map = new Map(); map.set(1, true); map.set(2, false); - roundtrip('map', map); - map.set(3, 'hahaha'); - expect(() => roundtrip('map', map)).to.throw( + roundtrip("map", map); + map.set(3, "hahaha"); + expect(() => roundtrip("map", map)).to.throw( /invalid type scSpecTypeBool specified for string value/i ); }); - it('vec', () => { + it("vec", () => { const vec = [1, 2, 3]; - roundtrip('vec', vec); + roundtrip("vec", vec); }); - it('tuple', () => { - const tuple = ['hello', 1]; - roundtrip('tuple', tuple); + it("tuple", () => { + const tuple = ["hello", 1]; + roundtrip("tuple", tuple); }); - it('option', () => { - roundtrip('option', 1); - roundtrip('option', undefined); + it("option", () => { + roundtrip("option", 1); + roundtrip("option", undefined); }); - it('u256', () => { - roundtrip('u256', 1n); - expect(() => roundtrip('u256', -1n)).to.throw( + it("u256", () => { + roundtrip("u256", 1n); + expect(() => roundtrip("u256", -1n)).to.throw( /expected a positive value, got: -1/i ); }); - it('i256', () => { - roundtrip('i256', -1n); + it("i256", () => { + roundtrip("i256", -1n); }); - it('string', () => { - roundtrip('string', 'hello'); + it("string", () => { + roundtrip("string", "hello"); }); - it('tuple_strukt', () => { + it("tuple_strukt", () => { const arg = [ - { a: 0, b: true, c: 'hello' }, - { tag: 'First', values: undefined } + { a: 0, b: true, c: "hello" }, + { tag: "First", values: undefined } ]; - roundtrip('tuple_strukt', arg); + roundtrip("tuple_strukt", arg); }); }); -describe('parsing and building ScVals', function () { - it('Can parse entries', function () { +describe("parsing and building ScVals", function () { + it("Can parse entries", function () { let spec = new ContractSpec([GIGA_MAP, func]); - let fn = spec.findEntry('giga_map'); - let gigaMap = spec.findEntry('GigaMap'); + let fn = spec.findEntry("giga_map"); + let gigaMap = spec.findEntry("GigaMap"); expect(gigaMap).deep.equal(GIGA_MAP); expect(fn).deep.equal(func); }); }); export const GIGA_MAP = xdr.ScSpecEntry.scSpecEntryUdtStructV0( new xdr.ScSpecUdtStructV0({ - doc: 'This is a kitchen sink of all the types', - lib: '', - name: 'GigaMap', + doc: "This is a kitchen sink of all the types", + lib: "", + name: "GigaMap", fields: [ new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'bool', + doc: "", + name: "bool", type: xdr.ScSpecTypeDef.scSpecTypeBool() }), new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'i128', + doc: "", + name: "i128", type: xdr.ScSpecTypeDef.scSpecTypeI128() }), new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'u128', + doc: "", + name: "u128", type: xdr.ScSpecTypeDef.scSpecTypeU128() }), new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'i256', + doc: "", + name: "i256", type: xdr.ScSpecTypeDef.scSpecTypeI256() }), new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'u256', + doc: "", + name: "u256", type: xdr.ScSpecTypeDef.scSpecTypeU256() }), new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'i32', + doc: "", + name: "i32", type: xdr.ScSpecTypeDef.scSpecTypeI32() }), new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'u32', + doc: "", + name: "u32", type: xdr.ScSpecTypeDef.scSpecTypeU32() }), new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'i64', + doc: "", + name: "i64", type: xdr.ScSpecTypeDef.scSpecTypeI64() }), new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'u64', + doc: "", + name: "u64", type: xdr.ScSpecTypeDef.scSpecTypeU64() }), new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'symbol', + doc: "", + name: "symbol", type: xdr.ScSpecTypeDef.scSpecTypeSymbol() }), new xdr.ScSpecUdtStructFieldV0({ - doc: '', - name: 'string', + doc: "", + name: "string", type: xdr.ScSpecTypeDef.scSpecTypeString() }) ] }) ); const GIGA_MAP_TYPE = xdr.ScSpecTypeDef.scSpecTypeUdt( - new xdr.ScSpecTypeUdt({ name: 'GigaMap' }) + new xdr.ScSpecTypeUdt({ name: "GigaMap" }) ); let func = xdr.ScSpecEntry.scSpecEntryFunctionV0( new xdr.ScSpecFunctionV0({ - doc: 'Kitchen Sink', - name: 'giga_map', + doc: "Kitchen Sink", + name: "giga_map", inputs: [ new xdr.ScSpecFunctionInputV0({ - doc: '', - name: 'giga_map', + doc: "", + name: "giga_map", type: GIGA_MAP_TYPE }) ], diff --git a/test/unit/federation_server_test.js b/test/unit/federation_server_test.js index c91ba7880..c76596cb7 100644 --- a/test/unit/federation_server_test.js +++ b/test/unit/federation_server_test.js @@ -1,10 +1,10 @@ -const http = require('http'); +const http = require("http"); -describe('federation-server.js tests', function () { +describe("federation-server.js tests", function () { beforeEach(function () { this.server = new StellarSdk.FederationServer( - 'https://acme.com:1337/federation', - 'stellar.org' + "https://acme.com:1337/federation", + "stellar.org" ); this.axiosMock = sinon.mock(axios); @@ -15,68 +15,68 @@ describe('federation-server.js tests', function () { this.axiosMock.verify(); // also restores }); - describe('FederationServer.constructor', function () { - it('throws error for insecure server', function () { + describe("FederationServer.constructor", function () { + it("throws error for insecure server", function () { expect( () => new StellarSdk.FederationServer( - 'http://acme.com:1337/federation', - 'stellar.org' + "http://acme.com:1337/federation", + "stellar.org" ) ).to.throw(/Cannot connect to insecure federation server/); }); - it('allow insecure server when opts.allowHttp flag is set', function () { + it("allow insecure server when opts.allowHttp flag is set", function () { expect( () => new StellarSdk.FederationServer( - 'http://acme.com:1337/federation', - 'stellar.org', + "http://acme.com:1337/federation", + "stellar.org", { allowHttp: true } ) ).to.not.throw(); }); - it('allow insecure server when global Config.allowHttp flag is set', function () { + it("allow insecure server when global Config.allowHttp flag is set", function () { StellarSdk.Config.setAllowHttp(true); expect( () => new StellarSdk.FederationServer( - 'http://acme.com:1337/federation', - 'stellar.org', + "http://acme.com:1337/federation", + "stellar.org", { allowHttp: true } ) ).to.not.throw(); }); }); - describe('FederationServer.resolveAddress', function () { + describe("FederationServer.resolveAddress", function () { beforeEach(function () { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://acme.com:1337/federation?type=name&q=bob%2Astellar.org' + "https://acme.com:1337/federation?type=name&q=bob%2Astellar.org" ) ) .returns( Promise.resolve({ data: { - stellar_address: 'bob*stellar.org', + stellar_address: "bob*stellar.org", account_id: - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS" } }) ); }); - it('requests is correct', function (done) { + it("requests is correct", function (done) { this.server - .resolveAddress('bob*stellar.org') + .resolveAddress("bob*stellar.org") .then((response) => { - expect(response.stellar_address).equals('bob*stellar.org'); + expect(response.stellar_address).equals("bob*stellar.org"); expect(response.account_id).equals( - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS" ); done(); }) @@ -85,13 +85,13 @@ describe('federation-server.js tests', function () { }); }); - it('requests is correct for username as stellar address', function (done) { + it("requests is correct for username as stellar address", function (done) { this.server - .resolveAddress('bob') + .resolveAddress("bob") .then((response) => { - expect(response.stellar_address).equals('bob*stellar.org'); + expect(response.stellar_address).equals("bob*stellar.org"); expect(response.account_id).equals( - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS" ); done(); }) @@ -101,35 +101,35 @@ describe('federation-server.js tests', function () { }); }); - describe('FederationServer.resolveAccountId', function () { + describe("FederationServer.resolveAccountId", function () { beforeEach(function () { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://acme.com:1337/federation?type=id&q=GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS' + "https://acme.com:1337/federation?type=id&q=GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS" ) ) .returns( Promise.resolve({ data: { - stellar_address: 'bob*stellar.org', + stellar_address: "bob*stellar.org", account_id: - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS" } }) ); }); - it('requests is correct', function (done) { + it("requests is correct", function (done) { this.server .resolveAccountId( - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS" ) .then((response) => { - expect(response.stellar_address).equals('bob*stellar.org'); + expect(response.stellar_address).equals("bob*stellar.org"); expect(response.account_id).equals( - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS" ); done(); }) @@ -139,35 +139,35 @@ describe('federation-server.js tests', function () { }); }); - describe('FederationServer.resolveTransactionId', function () { + describe("FederationServer.resolveTransactionId", function () { beforeEach(function () { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://acme.com:1337/federation?type=txid&q=3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889' + "https://acme.com:1337/federation?type=txid&q=3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889" ) ) .returns( Promise.resolve({ data: { - stellar_address: 'bob*stellar.org', + stellar_address: "bob*stellar.org", account_id: - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS" } }) ); }); - it('requests is correct', function (done) { + it("requests is correct", function (done) { this.server .resolveTransactionId( - '3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889' + "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889" ) .then((response) => { - expect(response.stellar_address).equals('bob*stellar.org'); + expect(response.stellar_address).equals("bob*stellar.org"); expect(response.account_id).equals( - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS" ); done(); }) @@ -177,11 +177,11 @@ describe('federation-server.js tests', function () { }); }); - describe('FederationServer.createForDomain', function () { - it('creates correct object', function (done) { + describe("FederationServer.createForDomain", function () { + it("creates correct object", function (done) { this.axiosMock - .expects('get') - .withArgs(sinon.match('https://acme.com/.well-known/stellar.toml')) + .expects("get") + .withArgs(sinon.match("https://acme.com/.well-known/stellar.toml")) .returns( Promise.resolve({ data: ` @@ -192,30 +192,30 @@ FEDERATION_SERVER="https://api.stellar.org/federation" }) ); - StellarSdk.FederationServer.createForDomain('acme.com').then( + StellarSdk.FederationServer.createForDomain("acme.com").then( (federationServer) => { - expect(federationServer.serverURL.protocol()).equals('https'); + expect(federationServer.serverURL.protocol()).equals("https"); expect(federationServer.serverURL.hostname()).equals( - 'api.stellar.org' + "api.stellar.org" ); - expect(federationServer.serverURL.path()).equals('/federation'); - expect(federationServer.domain).equals('acme.com'); + expect(federationServer.serverURL.path()).equals("/federation"); + expect(federationServer.domain).equals("acme.com"); done(); } ); }); - it('fails when stellar.toml does not contain federation server info', function (done) { + it("fails when stellar.toml does not contain federation server info", function (done) { this.axiosMock - .expects('get') - .withArgs(sinon.match('https://acme.com/.well-known/stellar.toml')) + .expects("get") + .withArgs(sinon.match("https://acme.com/.well-known/stellar.toml")) .returns( Promise.resolve({ - data: '' + data: "" }) ); - StellarSdk.FederationServer.createForDomain('acme.com') + StellarSdk.FederationServer.createForDomain("acme.com") .should.be.rejectedWith( /stellar.toml does not contain FEDERATION_SERVER field/ ) @@ -223,27 +223,27 @@ FEDERATION_SERVER="https://api.stellar.org/federation" }); }); - describe('FederationServer.resolve', function () { - it('succeeds for a valid account ID', function (done) { + describe("FederationServer.resolve", function () { + it("succeeds for a valid account ID", function (done) { StellarSdk.FederationServer.resolve( - 'GAFSZ3VPBC2H2DVKCEWLN3PQWZW6BVDMFROWJUDAJ3KWSOKQIJ4R5W4J' + "GAFSZ3VPBC2H2DVKCEWLN3PQWZW6BVDMFROWJUDAJ3KWSOKQIJ4R5W4J" ) .should.eventually.deep.equal({ - account_id: 'GAFSZ3VPBC2H2DVKCEWLN3PQWZW6BVDMFROWJUDAJ3KWSOKQIJ4R5W4J' + account_id: "GAFSZ3VPBC2H2DVKCEWLN3PQWZW6BVDMFROWJUDAJ3KWSOKQIJ4R5W4J" }) .notify(done); }); - it('fails for invalid account ID', function (done) { - StellarSdk.FederationServer.resolve('invalid') + it("fails for invalid account ID", function (done) { + StellarSdk.FederationServer.resolve("invalid") .should.be.rejectedWith(/Invalid Account ID/) .notify(done); }); - it('succeeds for a valid Stellar address', function (done) { + it("succeeds for a valid Stellar address", function (done) { this.axiosMock - .expects('get') - .withArgs(sinon.match('https://stellar.org/.well-known/stellar.toml')) + .expects("get") + .withArgs(sinon.match("https://stellar.org/.well-known/stellar.toml")) .returns( Promise.resolve({ data: ` @@ -255,87 +255,87 @@ FEDERATION_SERVER="https://api.stellar.org/federation" ); this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://api.stellar.org/federation?type=name&q=bob%2Astellar.org' + "https://api.stellar.org/federation?type=name&q=bob%2Astellar.org" ) ) .returns( Promise.resolve({ data: { - stellar_address: 'bob*stellar.org', + stellar_address: "bob*stellar.org", account_id: - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS', - memo_type: 'id', - memo: '100' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS", + memo_type: "id", + memo: "100" } }) ); - StellarSdk.FederationServer.resolve('bob*stellar.org') + StellarSdk.FederationServer.resolve("bob*stellar.org") .should.eventually.deep.equal({ - stellar_address: 'bob*stellar.org', + stellar_address: "bob*stellar.org", account_id: - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS', - memo_type: 'id', - memo: '100' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS", + memo_type: "id", + memo: "100" }) .notify(done); }); - it('fails for invalid Stellar address', function (done) { - StellarSdk.FederationServer.resolve('bob*stellar.org*test') + it("fails for invalid Stellar address", function (done) { + StellarSdk.FederationServer.resolve("bob*stellar.org*test") .should.be.rejectedWith(/Invalid Stellar address/) .notify(done); }); - it('fails when memo is not string', function (done) { + it("fails when memo is not string", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://acme.com:1337/federation?type=name&q=bob%2Astellar.org' + "https://acme.com:1337/federation?type=name&q=bob%2Astellar.org" ) ) .returns( Promise.resolve({ data: { - stellar_address: 'bob*stellar.org', + stellar_address: "bob*stellar.org", account_id: - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS', - memo_type: 'id', + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS", + memo_type: "id", memo: 100 } }) ); this.server - .resolveAddress('bob*stellar.org') + .resolveAddress("bob*stellar.org") .should.be.rejectedWith(/memo value should be of type string/) .notify(done); }); - it('fails when response exceeds the limit', function (done) { + it("fails when response exceeds the limit", function (done) { // Unable to create temp server in a browser - if (typeof window != 'undefined') { + if (typeof window != "undefined") { return done(); } var response = Array(StellarSdk.FEDERATION_RESPONSE_MAX_SIZE + 10).join( - 'a' + "a" ); let tempServer = http .createServer((req, res) => { - res.setHeader('Content-Type', 'application/json; charset=UTF-8'); + res.setHeader("Content-Type", "application/json; charset=UTF-8"); res.end(response); }) .listen(4444, () => { new StellarSdk.FederationServer( - 'http://localhost:4444/federation', - 'stellar.org', + "http://localhost:4444/federation", + "stellar.org", { allowHttp: true } ) - .resolveAddress('bob*stellar.org') + .resolveAddress("bob*stellar.org") .should.be.rejectedWith( /federation response exceeds allowed size of [0-9]+/ ) @@ -345,7 +345,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation" }); }); - describe('FederationServer times out when response lags and timeout set', function () { + describe("FederationServer times out when response lags and timeout set", function () { afterEach(function () { StellarSdk.Config.setDefault(); }); @@ -355,15 +355,15 @@ FEDERATION_SERVER="https://api.stellar.org/federation" for (let i = 0; i < 2; i++) { if (i === 0) { StellarSdk.Config.setTimeout(1000); - message = 'with global config set'; + message = "with global config set"; } else { opts = { allowHttp: true, timeout: 1000 }; - message = 'with instance opts set'; + message = "with instance opts set"; } it(`resolveAddress times out ${message}`, function (done) { // Unable to create temp server in a browser - if (typeof window != 'undefined') { + if (typeof window != "undefined") { return done(); } @@ -373,11 +373,11 @@ FEDERATION_SERVER="https://api.stellar.org/federation" }) .listen(4444, () => { new StellarSdk.FederationServer( - 'http://localhost:4444/federation', - 'stellar.org', + "http://localhost:4444/federation", + "stellar.org", opts ) - .resolveAddress('bob*stellar.org') + .resolveAddress("bob*stellar.org") .should.be.rejectedWith(/timeout of 1000ms exceeded/) .notify(done) .then(() => tempServer.close()); @@ -386,7 +386,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation" it(`resolveAccountId times out ${message}`, function (done) { // Unable to create temp server in a browser - if (typeof window != 'undefined') { + if (typeof window != "undefined") { return done(); } let tempServer = http @@ -395,12 +395,12 @@ FEDERATION_SERVER="https://api.stellar.org/federation" }) .listen(4444, () => { new StellarSdk.FederationServer( - 'http://localhost:4444/federation', - 'stellar.org', + "http://localhost:4444/federation", + "stellar.org", opts ) .resolveAccountId( - 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS' + "GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS" ) .should.be.rejectedWith(/timeout of 1000ms exceeded/) .notify(done) @@ -410,7 +410,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation" it(`resolveTransactionId times out ${message}`, function (done) { // Unable to create temp server in a browser - if (typeof window != 'undefined') { + if (typeof window != "undefined") { return done(); } let tempServer = http @@ -419,12 +419,12 @@ FEDERATION_SERVER="https://api.stellar.org/federation" }) .listen(4444, () => { new StellarSdk.FederationServer( - 'http://localhost:4444/federation', - 'stellar.org', + "http://localhost:4444/federation", + "stellar.org", opts ) .resolveTransactionId( - '3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889' + "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889" ) .should.be.rejectedWith(/timeout of 1000ms exceeded/) .notify(done) @@ -434,7 +434,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation" it(`createForDomain times out ${message}`, function (done) { // Unable to create temp server in a browser - if (typeof window != 'undefined') { + if (typeof window != "undefined") { return done(); } let tempServer = http @@ -442,7 +442,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation" setTimeout(() => {}, 10000); }) .listen(4444, () => { - StellarSdk.FederationServer.createForDomain('localhost:4444', opts) + StellarSdk.FederationServer.createForDomain("localhost:4444", opts) .should.be.rejectedWith(/timeout of 1000ms exceeded/) .notify(done) .then(() => tempServer.close()); @@ -451,7 +451,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation" it(`resolve times out ${message}`, function (done) { // Unable to create temp server in a browser - if (typeof window != 'undefined') { + if (typeof window != "undefined") { return done(); } @@ -460,7 +460,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation" setTimeout(() => {}, 10000); }) .listen(4444, () => { - StellarSdk.FederationServer.resolve('bob*localhost:4444', opts) + StellarSdk.FederationServer.resolve("bob*localhost:4444", opts) .should.eventually.be.rejectedWith(/timeout of 1000ms exceeded/) .notify(done) .then(() => tempServer.close()); diff --git a/test/unit/horizon_axios_client_test.js b/test/unit/horizon_axios_client_test.js index 7abe2eb9f..c2236616c 100644 --- a/test/unit/horizon_axios_client_test.js +++ b/test/unit/horizon_axios_client_test.js @@ -1,7 +1,7 @@ const SERVER_TIME_MAP = StellarSdk.SERVER_TIME_MAP; const getCurrentServerTime = StellarSdk.getCurrentServerTime; -describe('getCurrentServerTime', () => { +describe("getCurrentServerTime", () => { let clock; beforeEach(() => { @@ -14,27 +14,27 @@ describe('getCurrentServerTime', () => { }); it("returns null when the hostname hasn't been hit", () => { - expect(getCurrentServerTime('host')).to.be.null; + expect(getCurrentServerTime("host")).to.be.null; }); - it('returns null when no time is available', () => { + it("returns null when no time is available", () => { SERVER_TIME_MAP.host = {}; - expect(getCurrentServerTime('host')).to.be.null; + expect(getCurrentServerTime("host")).to.be.null; }); - it('returns null when the old time is too old', () => { + it("returns null when the old time is too old", () => { SERVER_TIME_MAP.host = { serverTime: 10, localTimeRecorded: 5 }; - expect(getCurrentServerTime('host')).to.be.null; + expect(getCurrentServerTime("host")).to.be.null; }); - it('returns the delta between then and now', () => { + it("returns the delta between then and now", () => { SERVER_TIME_MAP.host = { serverTime: 10, localTimeRecorded: 5005 }; - expect(getCurrentServerTime('host')).to.equal(55); + expect(getCurrentServerTime("host")).to.equal(55); }); }); diff --git a/test/unit/horizon_path_test.js b/test/unit/horizon_path_test.js index eeb329a03..5235e6a15 100644 --- a/test/unit/horizon_path_test.js +++ b/test/unit/horizon_path_test.js @@ -1,6 +1,6 @@ const { HorizonServer } = StellarSdk; -describe('horizon path tests', function () { +describe("horizon path tests", function () { beforeEach(function () { this.axiosMock = sinon.mock(HorizonAxiosClient); StellarSdk.Config.setDefault(); @@ -18,20 +18,20 @@ describe('horizon path tests', function () { data: { url: serverUrl, random: Math.round(1000 * Math.random()), - endpoint: 'bogus' + endpoint: "bogus" } }; function prepareAxios(axiosMock, endpoint) { randomResult.endpoint = endpoint; axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(serverUrl + endpoint)) .returns(Promise.resolve(randomResult)); } - it('server.accounts() ' + serverUrl, function (done) { - prepareAxios(this.axiosMock, '/accounts'); + it("server.accounts() " + serverUrl, function (done) { + prepareAxios(this.axiosMock, "/accounts"); server .accounts() .call() @@ -42,18 +42,18 @@ describe('horizon path tests', function () { it( "server.accounts().accountId('fooAccountId') " + serverUrl, function (done) { - prepareAxios(this.axiosMock, '/accounts/fooAccountId'); + prepareAxios(this.axiosMock, "/accounts/fooAccountId"); server .accounts() - .accountId('fooAccountId') + .accountId("fooAccountId") .call() .should.eventually.deep.equal(randomResult.data) .notify(done); } ); - it('server.transactions() ' + serverUrl, function (done) { - prepareAxios(this.axiosMock, '/transactions'); + it("server.transactions() " + serverUrl, function (done) { + prepareAxios(this.axiosMock, "/transactions"); server .transactions() .call() @@ -62,9 +62,9 @@ describe('horizon path tests', function () { }); it( - 'server.transactions().includeFailed(true) ' + serverUrl, + "server.transactions().includeFailed(true) " + serverUrl, function (done) { - prepareAxios(this.axiosMock, '/transactions?include_failed=true'); + prepareAxios(this.axiosMock, "/transactions?include_failed=true"); server .transactions() .includeFailed(true) @@ -74,8 +74,8 @@ describe('horizon path tests', function () { } ); - it('server.operations().includeFailed(true) ' + serverUrl, function (done) { - prepareAxios(this.axiosMock, '/operations?include_failed=true'); + it("server.operations().includeFailed(true) " + serverUrl, function (done) { + prepareAxios(this.axiosMock, "/operations?include_failed=true"); server .operations() .includeFailed(true) @@ -87,10 +87,10 @@ describe('horizon path tests', function () { it( "server.transactions().transaction('fooTransactionId') " + serverUrl, function (done) { - prepareAxios(this.axiosMock, '/transactions/fooTransactionId'); + prepareAxios(this.axiosMock, "/transactions/fooTransactionId"); server .transactions() - .transaction('fooTransactionId') + .transaction("fooTransactionId") .call() .should.eventually.deep.equal(randomResult.data) .notify(done); @@ -100,23 +100,23 @@ describe('horizon path tests', function () { it( "server.transactions().forAccount('fooAccountId') " + serverUrl, function (done) { - prepareAxios(this.axiosMock, '/accounts/fooAccountId/transactions'); + prepareAxios(this.axiosMock, "/accounts/fooAccountId/transactions"); server .transactions() - .forAccount('fooAccountId') + .forAccount("fooAccountId") .call() .should.eventually.deep.equal(randomResult.data) .notify(done); } ); - it('server.submitTransaction() ' + serverUrl, function (done) { - randomResult.endpoint = 'post'; + it("server.submitTransaction() " + serverUrl, function (done) { + randomResult.endpoint = "post"; let keypair = StellarSdk.Keypair.random(); let account = new StellarSdk.Account( keypair.publicKey(), - '56199647068161' + "56199647068161" ); let fakeTransaction = new StellarSdk.TransactionBuilder(account, { @@ -127,19 +127,19 @@ describe('horizon path tests', function () { StellarSdk.Operation.payment({ destination: keypair.publicKey(), asset: StellarSdk.Asset.native(), - amount: '100.50' + amount: "100.50" }) ) .setTimeout(StellarSdk.TimeoutInfinite) .build(); fakeTransaction.sign(keypair); let tx = encodeURIComponent( - fakeTransaction.toEnvelope().toXDR().toString('base64') + fakeTransaction.toEnvelope().toXDR().toString("base64") ); this.axiosMock - .expects('post') - .withArgs(sinon.match(serverUrl + '/transactions', `tx=${tx}`)) + .expects("post") + .withArgs(sinon.match(serverUrl + "/transactions", `tx=${tx}`)) .returns(Promise.resolve(randomResult)); server @@ -152,13 +152,13 @@ describe('horizon path tests', function () { let serverUrls = []; //server url without folder path. - serverUrls.push('https://acme.com:1337'); + serverUrls.push("https://acme.com:1337"); //server url folder path. - serverUrls.push('https://acme.com:1337/folder'); + serverUrls.push("https://acme.com:1337/folder"); //server url folder and subfolder path. - serverUrls.push('https://acme.com:1337/folder/subfolder'); + serverUrls.push("https://acme.com:1337/folder/subfolder"); for (var index = 0; index < serverUrls.length; index++) { var serverUrl = serverUrls[index]; diff --git a/test/unit/liquidity_pool_endpoints_test.js b/test/unit/liquidity_pool_endpoints_test.js index 46230b641..29c4ec43e 100644 --- a/test/unit/liquidity_pool_endpoints_test.js +++ b/test/unit/liquidity_pool_endpoints_test.js @@ -1,9 +1,9 @@ const { HorizonServer } = StellarSdk; -const BASE_URL = 'https://horizon-live.stellar.org:1337'; -const LP_URL = BASE_URL + '/liquidity_pools'; +const BASE_URL = "https://horizon-live.stellar.org:1337"; +const LP_URL = BASE_URL + "/liquidity_pools"; -describe('/liquidity_pools tests', function () { +describe("/liquidity_pools tests", function () { beforeEach(function () { this.server = new HorizonServer(BASE_URL); this.axiosMock = sinon.mock(HorizonAxiosClient); @@ -15,61 +15,61 @@ describe('/liquidity_pools tests', function () { this.axiosMock.restore(); }); - it('can create a LiquidityPoolCallBuilder', function () { + it("can create a LiquidityPoolCallBuilder", function () { expect(this.server.liquidityPools()).not.to.be.undefined; }); const rootResponse = { _links: { self: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=asc" }, next: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=asc" }, prev: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=desc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=desc" } }, _embedded: { records: [ { - id: '1', - paging_token: '113725249324879873', + id: "1", + paging_token: "113725249324879873", fee_bp: 30, - type: 'constant_product', - total_trustlines: '300', - total_shares: '5000', + type: "constant_product", + total_trustlines: "300", + total_shares: "5000", reserves: [ { - amount: '1000.0000005', + amount: "1000.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '2000.0000000', + amount: "2000.0000000", asset: - 'PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" } ] }, { - id: '2', - paging_token: '113725249324879874', + id: "2", + paging_token: "113725249324879874", fee_bp: 30, - type: 'constant_product', - total_trustlines: '200', - total_shares: '3500', + type: "constant_product", + total_trustlines: "200", + total_shares: "3500", reserves: [ { - amount: '1000.0000005', + amount: "1000.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '1200.0000000', + amount: "1200.0000000", asset: - 'USDC:GC5W3BH2MQRQK2H4A6LP3SXDSAAY2W2W64OWKKVNQIAOVWSAHFDEUSDC' + "USDC:GC5W3BH2MQRQK2H4A6LP3SXDSAAY2W2W64OWKKVNQIAOVWSAHFDEUSDC" } ] } @@ -84,17 +84,17 @@ describe('/liquidity_pools tests', function () { phpResponse._embedded.records.pop(); // last elem doesn't have PHP asset const EURT = new StellarSdk.Asset( - 'EURT', - 'GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT", + "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" ); const PHP = new StellarSdk.Asset( - 'PHP', - 'GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "PHP", + "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" ); - it('returns the right root response', function (done) { + it("returns the right root response", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(LP_URL)) .returns(Promise.resolve({ data: rootResponse })); @@ -108,7 +108,7 @@ describe('/liquidity_pools tests', function () { .catch(done); }); - describe('filters', function () { + describe("filters", function () { const testCases = [ { assets: [StellarSdk.Asset.native()], @@ -131,14 +131,14 @@ describe('/liquidity_pools tests', function () { testCases.forEach((testCase) => { const queryStr = testCase.assets .map((asset) => asset.toString()) - .join(','); + .join(","); const description = testCase.assets .map((asset) => asset.getCode()) - .join(' + '); + .join(" + "); - it('filters by asset(s) ' + description, function (done) { + it("filters by asset(s) " + description, function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match(`${LP_URL}?reserves=${encodeURIComponent(queryStr)}`) ) @@ -158,11 +158,11 @@ describe('/liquidity_pools tests', function () { }); }); - it('filters by account', function (done) { + it("filters by account", function (done) { const accountId = - 'GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S'; + "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S"; this.axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(`${LP_URL}?account=${accountId}`)) .returns(Promise.resolve({ data: rootResponse })); @@ -178,43 +178,43 @@ describe('/liquidity_pools tests', function () { }); }); - describe('querying a specific pool', function () { + describe("querying a specific pool", function () { const lpId = - 'ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a'; + "ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a"; - it('checks for valid IDs', function () { + it("checks for valid IDs", function () { expect(() => - this.server.liquidityPools().liquidityPoolId('nonsense') + this.server.liquidityPools().liquidityPoolId("nonsense") ).to.throw(); expect(() => this.server.liquidityPools().liquidityPoolId(lpId) ).not.to.throw(); }); - it('filters by specific ID', function (done) { + it("filters by specific ID", function (done) { const poolResponse = { id: lpId, - paging_token: '113725249324879873', + paging_token: "113725249324879873", fee_bp: 30, - type: 'constant_product', - total_trustlines: '300', - total_shares: '5000', + type: "constant_product", + total_trustlines: "300", + total_shares: "5000", reserves: [ { - amount: '1000.0000005', + amount: "1000.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '2000.0000000', + amount: "2000.0000000", asset: - 'PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" } ] }; this.axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(`${LP_URL}/${lpId}`)) .returns(Promise.resolve({ data: poolResponse })); @@ -232,48 +232,48 @@ describe('/liquidity_pools tests', function () { const poolOpsResponse = { _links: { self: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/operations?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/operations?cursor=113725249324879873&limit=10&order=asc" }, next: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/operations?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/operations?cursor=113725249324879873&limit=10&order=asc" }, prev: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/operations?cursor=113725249324879873&limit=10&order=desc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/operations?cursor=113725249324879873&limit=10&order=desc" } }, _embedded: { records: [ { - id: '3697472920621057', - paging_token: '3697472920621057', + id: "3697472920621057", + paging_token: "3697472920621057", transaction_successful: true, source_account: - 'GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L', - type: 'liquidity_pool_deposit', + "GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L", + type: "liquidity_pool_deposit", type_i: 22, - created_at: '2021-11-18T03:47:47Z', + created_at: "2021-11-18T03:47:47Z", transaction_hash: - '43ed5ce19190822ec080b67c3ccbab36a56bc34102b1a21d3ee690ed3bc23378', + "43ed5ce19190822ec080b67c3ccbab36a56bc34102b1a21d3ee690ed3bc23378", liquidity_pool_id: - 'ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a', + "ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a", reserves_max: [ { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '1000.0000005' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "1000.0000005" }, { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '3000.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "3000.0000005" } ], - min_price: '0.2680000', + min_price: "0.2680000", min_price_r: { n: 67, d: 250 }, - max_price: '0.3680000', + max_price: "0.3680000", max_price_r: { n: 73, d: 250 @@ -281,102 +281,102 @@ describe('/liquidity_pools tests', function () { reserves_deposited: [ { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '983.0000005' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "983.0000005" }, { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2378.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2378.0000005" } ], - shares_received: '1000' + shares_received: "1000" }, { - id: '3697472920621057', - paging_token: '3697472920621057', + id: "3697472920621057", + paging_token: "3697472920621057", transaction_successful: true, source_account: - 'GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L', - type: 'liquidity_pool_withdraw', + "GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L", + type: "liquidity_pool_withdraw", type_i: 23, - created_at: '2021-11-18T03:47:47Z', + created_at: "2021-11-18T03:47:47Z", transaction_hash: - '43ed5ce19190822ec080b67c3ccbab36a56bc34102b1a21d3ee690ed3bc23378', + "43ed5ce19190822ec080b67c3ccbab36a56bc34102b1a21d3ee690ed3bc23378", liquidity_pool_id: - 'ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a', + "ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a", reserves_min: [ { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - min: '1000.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + min: "1000.0000005" }, { asset: - 'PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - min: '3000.0000005' + "PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + min: "3000.0000005" } ], - shares: '200', + shares: "200", reserves_received: [ { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '993.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "993.0000005" }, { asset: - 'PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2478.0000005' + "PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2478.0000005" } ] }, { - id: '157639717969326081', - paging_token: '157639717969326081', + id: "157639717969326081", + paging_token: "157639717969326081", transaction_successful: true, source_account: - 'GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG', - type: 'change_trust', + "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG", + type: "change_trust", type_i: 6, - created_at: '2021-08-04T20:01:24Z', + created_at: "2021-08-04T20:01:24Z", transaction_hash: - '941f2fa2101d1265696a3c7d35e7688cd210324114e96b64a386ab55f65e488f', - asset_type: 'liquidity_pool_shares', + "941f2fa2101d1265696a3c7d35e7688cd210324114e96b64a386ab55f65e488f", + asset_type: "liquidity_pool_shares", liquidity_pool_id: - 'ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a', - limit: '1000', - trustor: 'GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG' + "ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a", + limit: "1000", + trustor: "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG" }, { - id: '157235845014249474-0', - paging_token: '157235845014249474-0', - ledger_close_time: '2021-07-29T21:10:53Z', - trade_type: 'liquidity_pool', - base_liquidity_pool_id: 'abcdef', + id: "157235845014249474-0", + paging_token: "157235845014249474-0", + ledger_close_time: "2021-07-29T21:10:53Z", + trade_type: "liquidity_pool", + base_liquidity_pool_id: "abcdef", liquidity_pool_fee_bp: 30, - base_amount: '0.0002007', - base_asset_type: 'native', + base_amount: "0.0002007", + base_asset_type: "native", counter_account: - 'GDW634JZX3VMEF2RZTCJTT34RITIMNX46QOGTYHCJEJL3MM7BLOQ6HOW', - counter_amount: '0.0022300', - counter_asset_type: 'credit_alphanum4', - counter_asset_code: 'VZT', + "GDW634JZX3VMEF2RZTCJTT34RITIMNX46QOGTYHCJEJL3MM7BLOQ6HOW", + counter_amount: "0.0022300", + counter_asset_type: "credit_alphanum4", + counter_asset_code: "VZT", counter_asset_issuer: - 'GBENYXZDFFR2J4F4DB3YPBBAM244TXYOTIOOUQI5DBT3OKUU4ZJ2M7NO', + "GBENYXZDFFR2J4F4DB3YPBBAM244TXYOTIOOUQI5DBT3OKUU4ZJ2M7NO", base_is_seller: false, price: { - n: '10000000', - d: '899997' + n: "10000000", + d: "899997" } } ] } }; - it('retrieves its operations', function (done) { + it("retrieves its operations", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(`${LP_URL}/${lpId}/operations`)) .returns(Promise.resolve({ data: poolOpsResponse })); @@ -396,13 +396,13 @@ describe('/liquidity_pools tests', function () { const poolTxsResponse = { _links: { self: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/transactions?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/transactions?cursor=113725249324879873&limit=10&order=asc" }, next: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/transactions?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/transactions?cursor=113725249324879873&limit=10&order=asc" }, prev: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/transactions?cursor=113725249324879873&limit=10&order=desc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/transactions?cursor=113725249324879873&limit=10&order=desc" } }, _embedded: { @@ -410,65 +410,65 @@ describe('/liquidity_pools tests', function () { { _links: { self: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908' + href: "https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908" }, account: { - href: 'https://private-33c60-amm3.apiary-mock.com/accounts/GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7' + href: "https://private-33c60-amm3.apiary-mock.com/accounts/GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7" }, ledger: { - href: 'https://private-33c60-amm3.apiary-mock.com/ledgers/895788' + href: "https://private-33c60-amm3.apiary-mock.com/ledgers/895788" }, operations: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908/operations', + href: "https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908/operations", templated: true }, effects: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908/effects', + href: "https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908/effects", templated: true }, precedes: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions?order=asc&cursor=3847380164161536' + href: "https://private-33c60-amm3.apiary-mock.com/transactions?order=asc&cursor=3847380164161536" }, succeeds: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions?order=desc&cursor=3847380164161536' + href: "https://private-33c60-amm3.apiary-mock.com/transactions?order=desc&cursor=3847380164161536" }, transaction: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908' + href: "https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908" } }, - id: '2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908', - paging_token: '3847380164161536', + id: "2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908", + paging_token: "3847380164161536", successful: true, - hash: '2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908', + hash: "2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908", ledger: 895788, - created_at: '2021-08-09T20:53:11Z', + created_at: "2021-08-09T20:53:11Z", source_account: - 'GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7', - source_account_sequence: '3847371574214658', + "GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7", + source_account_sequence: "3847371574214658", fee_account: - 'GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7', - fee_charged: '10000', - max_fee: '10001', + "GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7", + fee_charged: "10000", + max_fee: "10001", operation_count: 1, envelope_xdr: - 'AAAAAgAAAAAPBvsNwP2Z/msFScjvzJZtBOdauHdh8iuR6RZc9uVOlAAAJxEADasqAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAADwb7DcD9mf5rBUnI78yWbQTnWrh3YfIrkekWXPblTpQAAAAGAAAAAVNFQwAAAAAAm6XFaVsf8OSuS9C9gMplyTjagE9jAnnqwxSDJ6fin6IAsaK8LsUAAAAAAAAAAAAB9uVOlAAAAECXmRsoXmRiJjUrtbkDZYRnzac5s1CVV4g2RlIgBIuQty21npz3A1VhUcSmAx+GmsyGxVFvIrcdstTawJlmy9kF', - result_xdr: 'AAAAAAAAJxAAAAAAAAAAAQAAAAAAAAAGAAAAAAAAAAA=', + "AAAAAgAAAAAPBvsNwP2Z/msFScjvzJZtBOdauHdh8iuR6RZc9uVOlAAAJxEADasqAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAADwb7DcD9mf5rBUnI78yWbQTnWrh3YfIrkekWXPblTpQAAAAGAAAAAVNFQwAAAAAAm6XFaVsf8OSuS9C9gMplyTjagE9jAnnqwxSDJ6fin6IAsaK8LsUAAAAAAAAAAAAB9uVOlAAAAECXmRsoXmRiJjUrtbkDZYRnzac5s1CVV4g2RlIgBIuQty21npz3A1VhUcSmAx+GmsyGxVFvIrcdstTawJlmy9kF", + result_xdr: "AAAAAAAAJxAAAAAAAAAAAQAAAAAAAAAGAAAAAAAAAAA=", result_meta_xdr: - 'AAAAAgAAAAIAAAADAA2rLAAAAAAAAAAADwb7DcD9mf5rBUnI78yWbQTnWrh3YfIrkekWXPblTpQAAAAAGtJNDAANqyoAAAABAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAA2rLAAAAAAAAAAADwb7DcD9mf5rBUnI78yWbQTnWrh3YfIrkekWXPblTpQAAAAAGtJNDAANqyoAAAACAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAA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YDKZck42oBPYwJ56sMUgyen4p+iAAAAAAAAAAAAsaK8LsUAAAAAAAEAAAAAAAAAAAAAAAA=", fee_meta_xdr: - 'AAAAAgAAAAMADasrAAAAAAAAAAAPBvsNwP2Z/msFScjvzJZtBOdauHdh8iuR6RZc9uVOlAAAAAAa0nQcAA2rKgAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEADassAAAAAAAAAAAPBvsNwP2Z/msFScjvzJZtBOdauHdh8iuR6RZc9uVOlAAAAAAa0k0MAA2rKgAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==', - memo_type: 'none', + "AAAAAgAAAAMADasrAAAAAAAAAAAPBvsNwP2Z/msFScjvzJZtBOdauHdh8iuR6RZc9uVOlAAAAAAa0nQcAA2rKgAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEADassAAAAAAAAAAAPBvsNwP2Z/msFScjvzJZtBOdauHdh8iuR6RZc9uVOlAAAAAAa0k0MAA2rKgAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==", + memo_type: "none", signatures: [ - 'l5kbKF5kYiY1K7W5A2WEZ82nObNQlVeINkZSIASLkLcttZ6c9wNVYVHEpgMfhprMhsVRbyK3HbLU2sCZZsvZBQ==' + "l5kbKF5kYiY1K7W5A2WEZ82nObNQlVeINkZSIASLkLcttZ6c9wNVYVHEpgMfhprMhsVRbyK3HbLU2sCZZsvZBQ==" ] } ] } }; - it('retrieves its transactions', function (done) { + it("retrieves its transactions", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(`${LP_URL}/${lpId}/transactions`)) .returns(Promise.resolve({ data: poolTxsResponse })); @@ -488,13 +488,13 @@ describe('/liquidity_pools tests', function () { const poolEffectsResponse = { _links: { self: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/effects?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/effects?cursor=113725249324879873&limit=10&order=asc" }, next: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/effects?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/effects?cursor=113725249324879873&limit=10&order=asc" }, prev: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/effects?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a/effects?cursor=113725249324879873&limit=10&order=asc" } }, _embedded: { @@ -502,249 +502,249 @@ describe('/liquidity_pools tests', function () { { _links: { operation: { - href: 'https://private-33c60-amm3.apiary-mock.com/operations/3849085266190337' + href: "https://private-33c60-amm3.apiary-mock.com/operations/3849085266190337" }, succeeds: { - href: 'https://private-33c60-amm3.apiary-mock.com/effects?order=desc&cursor=3849085266190337-1' + href: "https://private-33c60-amm3.apiary-mock.com/effects?order=desc&cursor=3849085266190337-1" }, precedes: { - href: 'https://private-33c60-amm3.apiary-mock.com/effects?order=asc&cursor=3849085266190337-1' + href: "https://private-33c60-amm3.apiary-mock.com/effects?order=asc&cursor=3849085266190337-1" } }, - id: '0000000012884905986-0000000001', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_deposited', + id: "0000000012884905986-0000000001", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_deposited", type_i: 81, - created_at: '2021-11-18T03:15:54Z', + created_at: "2021-11-18T03:15:54Z", liquidity_pool: { - id: 'abcdef', + id: "abcdef", fee_bp: 30, - type: 'constant_product', - total_trustlines: '300', - total_shares: '5000', + type: "constant_product", + total_trustlines: "300", + total_shares: "5000", reserves: [ { - amount: '1000.0000005', + amount: "1000.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '2000.0000000', + amount: "2000.0000000", asset: - 'PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP' + "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] }, reserves_deposited: [ { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '983.0000005' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "983.0000005" }, { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2378.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2378.0000005" } ], - shares_received: '1000' + shares_received: "1000" }, { - id: '0000000012884905986-0000000002', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_withdrew', + id: "0000000012884905986-0000000002", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_withdrew", type_i: 82, - created_at: '2021-11-18T03:15:54Z', + created_at: "2021-11-18T03:15:54Z", liquidity_pool: { - id: 'abcdef', + id: "abcdef", fee_bp: 30, - type: 'constant_product', - total_trustlines: '299', - total_shares: '4000', + type: "constant_product", + total_trustlines: "299", + total_shares: "4000", reserves: [ { - amount: '7.0000005', + amount: "7.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '1.0000000', + amount: "1.0000000", asset: - 'PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP' + "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] }, reserves_received: [ { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '993.0000005' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "993.0000005" }, { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2478.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2478.0000005" } ], - shares_redeemed: '1000' + shares_redeemed: "1000" }, { - id: '0000000012884905986-0000000003', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_trade', + id: "0000000012884905986-0000000003", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_trade", type_i: 83, - created_at: '2021-11-18T03:15:54Z', + created_at: "2021-11-18T03:15:54Z", liquidity_pool: { - id: 'abcdef', + id: "abcdef", fee_bp: 30, - type: 'constant_product', - total_trustlines: '300', - total_shares: '5000', + type: "constant_product", + total_trustlines: "300", + total_shares: "5000", reserves: [ { - amount: '1000.0000005', + amount: "1000.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '2000.0000000', + amount: "2000.0000000", asset: - 'PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP' + "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] }, sold: { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '983.0000005' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "983.0000005" }, bought: { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2378.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2378.0000005" } }, { - id: '0000000012884905986-0000000004', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_created', + id: "0000000012884905986-0000000004", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_created", type_i: 84, - created_at: '2021-11-18T03:15:54Z', + created_at: "2021-11-18T03:15:54Z", liquidity_pool: { - id: 'abcdef', + id: "abcdef", fee_bp: 30, - type: 'constant_product', - total_trustlines: '1', - total_shares: '0', + type: "constant_product", + total_trustlines: "1", + total_shares: "0", reserves: [ { - amount: '0', + amount: "0", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '0', + amount: "0", asset: - 'PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP' + "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] } }, { - id: '0000000012884905986-0000000005', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_removed', + id: "0000000012884905986-0000000005", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_removed", type_i: 85, - created_at: '2021-11-18T03:15:54Z', - liquidity_pool_id: 'abcdef' + created_at: "2021-11-18T03:15:54Z", + liquidity_pool_id: "abcdef" }, { - id: '0000000012884905986-0000000006', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_revoked', + id: "0000000012884905986-0000000006", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_revoked", type_i: 86, - created_at: '2021-11-18T03:15:54Z', + created_at: "2021-11-18T03:15:54Z", liquidity_pool: { - id: 'abcdef', + id: "abcdef", fee_bp: 30, - type: 'constant_product', - total_trustlines: '299', - total_shares: '4000', + type: "constant_product", + total_trustlines: "299", + total_shares: "4000", reserves: [ { - amount: '7.0000005', + amount: "7.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '1.0000000', + amount: "1.0000000", asset: - 'PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP' + "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] }, reserves_revoked: [ { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '993.0000005', - claimable_balance_id: 'cbid1235' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "993.0000005", + claimable_balance_id: "cbid1235" }, { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2478.0000005', - claimable_balance_id: 'idcbd1234' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2478.0000005", + claimable_balance_id: "idcbd1234" } ], - shares_revoked: '1000' + shares_revoked: "1000" }, { - id: '0000000012884905986-0000000007', - paging_token: '157639717969326081-1', - account: 'GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG', - type: 'trustline_created', + id: "0000000012884905986-0000000007", + paging_token: "157639717969326081-1", + account: "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG", + type: "trustline_created", type_i: 20, - created_at: '2021-08-04T20:01:24Z', - asset_type: 'liquidity_pool_shares', - liquidity_pool_id: 'abcdef', - limit: '1000' + created_at: "2021-08-04T20:01:24Z", + asset_type: "liquidity_pool_shares", + liquidity_pool_id: "abcdef", + limit: "1000" }, { - id: '0000000012884905986-0000000008', - paging_token: '157639717969326081-1', - account: 'GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG', - type: 'trustline_updated', + id: "0000000012884905986-0000000008", + paging_token: "157639717969326081-1", + account: "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG", + type: "trustline_updated", type_i: 22, - created_at: '2021-08-04T20:01:24Z', - asset_type: 'liquidity_pool_shares', - liquidity_pool_id: 'abcdef', - limit: '2000' + created_at: "2021-08-04T20:01:24Z", + asset_type: "liquidity_pool_shares", + liquidity_pool_id: "abcdef", + limit: "2000" }, { - id: '0000000012884905986-0000000009', - paging_token: '157639717969326081-1', - account: 'GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG', - type: 'trustline_removed', + id: "0000000012884905986-0000000009", + paging_token: "157639717969326081-1", + account: "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG", + type: "trustline_removed", type_i: 21, - created_at: '2021-08-04T20:01:24Z', - asset_type: 'liquidity_pool_shares', - liquidity_pool_id: 'abcdef', - limit: '0.0000000' + created_at: "2021-08-04T20:01:24Z", + asset_type: "liquidity_pool_shares", + liquidity_pool_id: "abcdef", + limit: "0.0000000" } ] } }; - it('retrieves its effects', function (done) { + it("retrieves its effects", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(`${LP_URL}/${lpId}/effects`)) .returns(Promise.resolve({ data: poolEffectsResponse })); @@ -764,13 +764,13 @@ describe('/liquidity_pools tests', function () { const poolTradesResponse = { _links: { self: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=113725249324879873&limit=10&order=asc" }, next: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=113725249324879873&limit=10&order=asc" }, prev: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=113725249324879873&limit=10&order=asc" } }, _embedded: { @@ -778,49 +778,49 @@ describe('/liquidity_pools tests', function () { { _links: { self: { - href: '' + href: "" }, base: { - href: 'https://private-33c60-amm3.apiary-mock.com/accounts/GAVH5JM5OKXGMQDS7YPRJ4MQCPXJUGH26LYQPQJ4SOMOJ4SXY472ZM7G' + href: "https://private-33c60-amm3.apiary-mock.com/accounts/GAVH5JM5OKXGMQDS7YPRJ4MQCPXJUGH26LYQPQJ4SOMOJ4SXY472ZM7G" }, counter: { - href: 'https://private-33c60-amm3.apiary-mock.com/accounts/GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L' + href: "https://private-33c60-amm3.apiary-mock.com/accounts/GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L" }, operation: { - href: 'https://private-33c60-amm3.apiary-mock.com/operations/3697472920621057' + href: "https://private-33c60-amm3.apiary-mock.com/operations/3697472920621057" } }, - id: '3697472920621057-0', - paging_token: '3697472920621057-0', - ledger_close_time: '2015-11-18T03:47:47Z', - offer_id: '9', - base_offer_id: '9', + id: "3697472920621057-0", + paging_token: "3697472920621057-0", + ledger_close_time: "2015-11-18T03:47:47Z", + offer_id: "9", + base_offer_id: "9", base_account: - 'GAVH5JM5OKXGMQDS7YPRJ4MQCPXJUGH26LYQPQJ4SOMOJ4SXY472ZM7G', - base_amount: '10.0000000', - base_asset_type: 'native', + "GAVH5JM5OKXGMQDS7YPRJ4MQCPXJUGH26LYQPQJ4SOMOJ4SXY472ZM7G", + base_amount: "10.0000000", + base_asset_type: "native", counter_liquidity_pool: - '3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4', - liquidity_pool_fee_bp: '30', - counter_amount: '2.6700000', - counter_asset_type: 'credit_alphanum4', - counter_asset_code: 'JPY', + "3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4", + liquidity_pool_fee_bp: "30", + counter_amount: "2.6700000", + counter_asset_type: "credit_alphanum4", + counter_asset_code: "JPY", counter_asset_issuer: - 'GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', + "GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", base_is_seller: true, price: { - n: '267', - d: '1000' + n: "267", + d: "1000" }, - trade_type: 'liquidity_pool' + trade_type: "liquidity_pool" } ] } }; - it('retrieves its trades', function (done) { + it("retrieves its trades", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(`${LP_URL}/${lpId}/trades`)) .returns(Promise.resolve({ data: poolTradesResponse })); @@ -838,55 +838,55 @@ describe('/liquidity_pools tests', function () { }); }); - describe('querying a specific pool', function () { + describe("querying a specific pool", function () { const lpId = - 'ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a'; + "ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a"; const poolOpsResponse = { _links: { self: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/operations?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/operations?cursor=113725249324879873&limit=10&order=asc" }, next: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/operations?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/operations?cursor=113725249324879873&limit=10&order=asc" }, prev: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/operations?cursor=113725249324879873&limit=10&order=desc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/operations?cursor=113725249324879873&limit=10&order=desc" } }, _embedded: { records: [ { - id: '3697472920621057', - paging_token: '3697472920621057', + id: "3697472920621057", + paging_token: "3697472920621057", transaction_successful: true, source_account: - 'GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L', - type: 'liquidity_pool_deposit', + "GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L", + type: "liquidity_pool_deposit", type_i: 22, - created_at: '2021-11-18T03:47:47Z', + created_at: "2021-11-18T03:47:47Z", transaction_hash: - '43ed5ce19190822ec080b67c3ccbab36a56bc34102b1a21d3ee690ed3bc23378', + "43ed5ce19190822ec080b67c3ccbab36a56bc34102b1a21d3ee690ed3bc23378", liquidity_pool_id: - 'ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a', + "ae44a51f6191ce24414fbd1326e93ccb0ae656f07fc1e37602b11d0802f74b9a", reserves_max: [ { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '1000.0000005' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "1000.0000005" }, { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '3000.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "3000.0000005" } ], - min_price: '0.2680000', + min_price: "0.2680000", min_price_r: { n: 67, d: 250 }, - max_price: '0.3680000', + max_price: "0.3680000", max_price_r: { n: 73, d: 250 @@ -894,100 +894,100 @@ describe('/liquidity_pools tests', function () { reserves_deposited: [ { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '983.0000005' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "983.0000005" }, { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2378.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2378.0000005" } ], - shares_received: '1000' + shares_received: "1000" }, { - id: '3697472920621057', - paging_token: '3697472920621057', + id: "3697472920621057", + paging_token: "3697472920621057", transaction_successful: true, source_account: - 'GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L', - type: 'liquidity_pool_withdraw', + "GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L", + type: "liquidity_pool_withdraw", type_i: 23, - created_at: '2021-11-18T03:47:47Z', + created_at: "2021-11-18T03:47:47Z", transaction_hash: - '43ed5ce19190822ec080b67c3ccbab36a56bc34102b1a21d3ee690ed3bc23378', - liquidity_pool_id: '1', + "43ed5ce19190822ec080b67c3ccbab36a56bc34102b1a21d3ee690ed3bc23378", + liquidity_pool_id: "1", reserves_min: [ { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - min: '1000.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + min: "1000.0000005" }, { asset: - 'PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - min: '3000.0000005' + "PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + min: "3000.0000005" } ], - shares: '200', + shares: "200", reserves_received: [ { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '993.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "993.0000005" }, { asset: - 'PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2478.0000005' + "PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2478.0000005" } ] }, { - id: '157639717969326081', - paging_token: '157639717969326081', + id: "157639717969326081", + paging_token: "157639717969326081", transaction_successful: true, source_account: - 'GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG', - type: 'change_trust', + "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG", + type: "change_trust", type_i: 6, - created_at: '2021-08-04T20:01:24Z', + created_at: "2021-08-04T20:01:24Z", transaction_hash: - '941f2fa2101d1265696a3c7d35e7688cd210324114e96b64a386ab55f65e488f', - asset_type: 'liquidity_pool_shares', - liquidity_pool_id: '1', - limit: '1000', - trustor: 'GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG' + "941f2fa2101d1265696a3c7d35e7688cd210324114e96b64a386ab55f65e488f", + asset_type: "liquidity_pool_shares", + liquidity_pool_id: "1", + limit: "1000", + trustor: "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG" }, { - id: '157235845014249474-0', - paging_token: '157235845014249474-0', - ledger_close_time: '2021-07-29T21:10:53Z', - trade_type: 'liquidity_pool', - base_liquidity_pool_id: 'abcdef', + id: "157235845014249474-0", + paging_token: "157235845014249474-0", + ledger_close_time: "2021-07-29T21:10:53Z", + trade_type: "liquidity_pool", + base_liquidity_pool_id: "abcdef", liquidity_pool_fee_bp: 30, - base_amount: '0.0002007', - base_asset_type: 'native', + base_amount: "0.0002007", + base_asset_type: "native", counter_account: - 'GDW634JZX3VMEF2RZTCJTT34RITIMNX46QOGTYHCJEJL3MM7BLOQ6HOW', - counter_amount: '0.0022300', - counter_asset_type: 'credit_alphanum4', - counter_asset_code: 'VZT', + "GDW634JZX3VMEF2RZTCJTT34RITIMNX46QOGTYHCJEJL3MM7BLOQ6HOW", + counter_amount: "0.0022300", + counter_asset_type: "credit_alphanum4", + counter_asset_code: "VZT", counter_asset_issuer: - 'GBENYXZDFFR2J4F4DB3YPBBAM244TXYOTIOOUQI5DBT3OKUU4ZJ2M7NO', + "GBENYXZDFFR2J4F4DB3YPBBAM244TXYOTIOOUQI5DBT3OKUU4ZJ2M7NO", base_is_seller: false, price: { - n: '10000000', - d: '899997' + n: "10000000", + d: "899997" } } ] } }; - it('retrieves its operations', function (done) { + it("retrieves its operations", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(`${LP_URL}/${lpId}/operations`)) .returns(Promise.resolve({ data: poolOpsResponse })); @@ -1007,13 +1007,13 @@ describe('/liquidity_pools tests', function () { const poolTxsResponse = { _links: { self: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/transactions?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/transactions?cursor=113725249324879873&limit=10&order=asc" }, next: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/transactions?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/transactions?cursor=113725249324879873&limit=10&order=asc" }, prev: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/transactions?cursor=113725249324879873&limit=10&order=desc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools/1/transactions?cursor=113725249324879873&limit=10&order=desc" } }, _embedded: { @@ -1021,65 +1021,65 @@ describe('/liquidity_pools tests', function () { { _links: { self: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908' + href: "https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908" }, account: { - href: 'https://private-33c60-amm3.apiary-mock.com/accounts/GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7' + href: "https://private-33c60-amm3.apiary-mock.com/accounts/GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7" }, ledger: { - href: 'https://private-33c60-amm3.apiary-mock.com/ledgers/895788' + href: "https://private-33c60-amm3.apiary-mock.com/ledgers/895788" }, operations: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908/operations', + href: "https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908/operations", templated: true }, effects: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908/effects', + href: "https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908/effects", templated: true }, precedes: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions?order=asc&cursor=3847380164161536' + href: "https://private-33c60-amm3.apiary-mock.com/transactions?order=asc&cursor=3847380164161536" }, succeeds: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions?order=desc&cursor=3847380164161536' + href: "https://private-33c60-amm3.apiary-mock.com/transactions?order=desc&cursor=3847380164161536" }, transaction: { - href: 'https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908' + href: "https://private-33c60-amm3.apiary-mock.com/transactions/2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908" } }, - id: '2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908', - paging_token: '3847380164161536', + id: "2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908", + paging_token: "3847380164161536", successful: true, - hash: '2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908', + hash: "2ff47e1bafe68639276b2a8df0a73597ee0c062fbcc72d121af314fe7851c908", ledger: 895788, - created_at: '2021-08-09T20:53:11Z', + created_at: "2021-08-09T20:53:11Z", source_account: - 'GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7', - source_account_sequence: '3847371574214658', + "GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7", + source_account_sequence: "3847371574214658", fee_account: - 'GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7', - fee_charged: '10000', - max_fee: '10001', + "GAHQN6YNYD6ZT7TLAVE4R36MSZWQJZ22XB3WD4RLSHURMXHW4VHJIDF7", + fee_charged: "10000", + max_fee: "10001", operation_count: 1,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AAAAAAAEAAAAAAAAAAAAAAAA=", fee_meta_xdr: - 'AAAAAgAAAAMADasrAAAAAAAAAAAPBvsNwP2Z/msFScjvzJZtBOdauHdh8iuR6RZc9uVOlAAAAAAa0nQcAA2rKgAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEADassAAAAAAAAAAAPBvsNwP2Z/msFScjvzJZtBOdauHdh8iuR6RZc9uVOlAAAAAAa0k0MAA2rKgAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==', - memo_type: 'none', + "AAAAAgAAAAMADasrAAAAAAAAAAAPBvsNwP2Z/msFScjvzJZtBOdauHdh8iuR6RZc9uVOlAAAAAAa0nQcAA2rKgAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEADassAAAAAAAAAAAPBvsNwP2Z/msFScjvzJZtBOdauHdh8iuR6RZc9uVOlAAAAAAa0k0MAA2rKgAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==", + memo_type: "none", signatures: [ - 'l5kbKF5kYiY1K7W5A2WEZ82nObNQlVeINkZSIASLkLcttZ6c9wNVYVHEpgMfhprMhsVRbyK3HbLU2sCZZsvZBQ==' + "l5kbKF5kYiY1K7W5A2WEZ82nObNQlVeINkZSIASLkLcttZ6c9wNVYVHEpgMfhprMhsVRbyK3HbLU2sCZZsvZBQ==" ] } ] } }; - it('retrieves its transactions', function (done) { + it("retrieves its transactions", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(`${LP_URL}/${lpId}/transactions`)) .returns(Promise.resolve({ data: poolTxsResponse })); @@ -1099,13 +1099,13 @@ describe('/liquidity_pools tests', function () { const poolFxsResponse = { _links: { self: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=asc" }, next: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=asc" }, prev: { - href: 'https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=asc' + href: "https://private-33c60-amm3.apiary-mock.com/liquidity_pools?cursor=113725249324879873&limit=10&order=asc" } }, _embedded: { @@ -1113,249 +1113,249 @@ describe('/liquidity_pools tests', function () { { _links: { operation: { - href: 'https://private-33c60-amm3.apiary-mock.com/operations/3849085266190337' + href: "https://private-33c60-amm3.apiary-mock.com/operations/3849085266190337" }, succeeds: { - href: 'https://private-33c60-amm3.apiary-mock.com/effects?order=desc&cursor=3849085266190337-1' + href: "https://private-33c60-amm3.apiary-mock.com/effects?order=desc&cursor=3849085266190337-1" }, precedes: { - href: 'https://private-33c60-amm3.apiary-mock.com/effects?order=asc&cursor=3849085266190337-1' + href: "https://private-33c60-amm3.apiary-mock.com/effects?order=asc&cursor=3849085266190337-1" } }, - id: '0000000012884905986-0000000001', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_deposited', + id: "0000000012884905986-0000000001", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_deposited", type_i: 81, - created_at: '2021-11-18T03:15:54Z', + created_at: "2021-11-18T03:15:54Z", liquidity_pool: { - id: 'abcdef', + id: "abcdef", fee_bp: 30, - type: 'constant_product', - total_trustlines: '300', - total_shares: '5000', + type: "constant_product", + total_trustlines: "300", + total_shares: "5000", reserves: [ { - amount: '1000.0000005', + amount: "1000.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '2000.0000000', + amount: "2000.0000000", asset: - 'PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP' + "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] }, reserves_deposited: [ { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '983.0000005' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "983.0000005" }, { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2378.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2378.0000005" } ], - shares_received: '1000' + shares_received: "1000" }, { - id: '0000000012884905986-0000000002', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_withdrew', + id: "0000000012884905986-0000000002", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_withdrew", type_i: 82, - created_at: '2021-11-18T03:15:54Z', + created_at: "2021-11-18T03:15:54Z", liquidity_pool: { - id: 'abcdef', + id: "abcdef", fee_bp: 30, - type: 'constant_product', - total_trustlines: '299', - total_shares: '4000', + type: "constant_product", + total_trustlines: "299", + total_shares: "4000", reserves: [ { - amount: '7.0000005', + amount: "7.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '1.0000000', + amount: "1.0000000", asset: - 'PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP' + "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] }, reserves_received: [ { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '993.0000005' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "993.0000005" }, { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2478.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2478.0000005" } ], - shares_redeemed: '1000' + shares_redeemed: "1000" }, { - id: '0000000012884905986-0000000003', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_trade', + id: "0000000012884905986-0000000003", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_trade", type_i: 83, - created_at: '2021-11-18T03:15:54Z', + created_at: "2021-11-18T03:15:54Z", liquidity_pool: { - id: 'abcdef', + id: "abcdef", fee_bp: 30, - type: 'constant_product', - total_trustlines: '300', - total_shares: '5000', + type: "constant_product", + total_trustlines: "300", + total_shares: "5000", reserves: [ { - amount: '1000.0000005', + amount: "1000.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '2000.0000000', + amount: "2000.0000000", asset: - 'PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP' + "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] }, sold: { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '983.0000005' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "983.0000005" }, bought: { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2378.0000005' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2378.0000005" } }, { - id: '0000000012884905986-0000000004', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_created', + id: "0000000012884905986-0000000004", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_created", type_i: 84, - created_at: '2021-11-18T03:15:54Z', + created_at: "2021-11-18T03:15:54Z", liquidity_pool: { - id: 'abcdef', + id: "abcdef", fee_bp: 30, - type: 'constant_product', - total_trustlines: '1', - total_shares: '0', + type: "constant_product", + total_trustlines: "1", + total_shares: "0", reserves: [ { - amount: '0', + amount: "0", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '0', + amount: "0", asset: - 'PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP' + "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] } }, { - id: '0000000012884905986-0000000005', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_removed', + id: "0000000012884905986-0000000005", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_removed", type_i: 85, - created_at: '2021-11-18T03:15:54Z', - liquidity_pool_id: 'abcdef' + created_at: "2021-11-18T03:15:54Z", + liquidity_pool_id: "abcdef" }, { - id: '0000000012884905986-0000000006', - paging_token: '12884905986-2', - account: 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - type: 'liquidity_pool_revoked', + id: "0000000012884905986-0000000006", + paging_token: "12884905986-2", + account: "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + type: "liquidity_pool_revoked", type_i: 86, - created_at: '2021-11-18T03:15:54Z', + created_at: "2021-11-18T03:15:54Z", liquidity_pool: { - id: 'abcdef', + id: "abcdef", fee_bp: 30, - type: 'constant_product', - total_trustlines: '299', - total_shares: '4000', + type: "constant_product", + total_trustlines: "299", + total_shares: "4000", reserves: [ { - amount: '7.0000005', + amount: "7.0000005", asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { - amount: '1.0000000', + amount: "1.0000000", asset: - 'PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP' + "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] }, reserves_revoked: [ { asset: - 'JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', - amount: '993.0000005', - claimable_balance_id: 'cbid1235' + "JPY:GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", + amount: "993.0000005", + claimable_balance_id: "cbid1235" }, { asset: - 'EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S', - amount: '2478.0000005', - claimable_balance_id: 'idcbd1234' + "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", + amount: "2478.0000005", + claimable_balance_id: "idcbd1234" } ], - shares_revoked: '1000' + shares_revoked: "1000" }, { - id: '0000000012884905986-0000000007', - paging_token: '157639717969326081-1', - account: 'GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG', - type: 'trustline_created', + id: "0000000012884905986-0000000007", + paging_token: "157639717969326081-1", + account: "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG", + type: "trustline_created", type_i: 20, - created_at: '2021-08-04T20:01:24Z', - asset_type: 'liquidity_pool_shares', - liquidity_pool_id: 'abcdef', - limit: '1000' + created_at: "2021-08-04T20:01:24Z", + asset_type: "liquidity_pool_shares", + liquidity_pool_id: "abcdef", + limit: "1000" }, { - id: '0000000012884905986-0000000008', - paging_token: '157639717969326081-1', - account: 'GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG', - type: 'trustline_updated', + id: "0000000012884905986-0000000008", + paging_token: "157639717969326081-1", + account: "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG", + type: "trustline_updated", type_i: 22, - created_at: '2021-08-04T20:01:24Z', - asset_type: 'liquidity_pool_shares', - liquidity_pool_id: 'abcdef', - limit: '2000' + created_at: "2021-08-04T20:01:24Z", + asset_type: "liquidity_pool_shares", + liquidity_pool_id: "abcdef", + limit: "2000" }, { - id: '0000000012884905986-0000000009', - paging_token: '157639717969326081-1', - account: 'GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG', - type: 'trustline_removed', + id: "0000000012884905986-0000000009", + paging_token: "157639717969326081-1", + account: "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG", + type: "trustline_removed", type_i: 21, - created_at: '2021-08-04T20:01:24Z', - asset_type: 'liquidity_pool_shares', - liquidity_pool_id: 'abcdef', - limit: '0.0000000' + created_at: "2021-08-04T20:01:24Z", + asset_type: "liquidity_pool_shares", + liquidity_pool_id: "abcdef", + limit: "0.0000000" } ] } }; - it('retrieves its effects', function (done) { + it("retrieves its effects", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(`${LP_URL}/${lpId}/effects`)) .returns(Promise.resolve({ data: poolFxsResponse })); diff --git a/test/unit/server/horizon/claimable_balances.js b/test/unit/server/horizon/claimable_balances.js index 12b72f0b9..446db5566 100644 --- a/test/unit/server/horizon/claimable_balances.js +++ b/test/unit/server/horizon/claimable_balances.js @@ -1,8 +1,8 @@ const { HorizonServer } = StellarSdk; -describe('ClaimableBalanceCallBuilder', function () { +describe("ClaimableBalanceCallBuilder", function () { beforeEach(function () { - this.server = new HorizonServer('https://horizon-live.stellar.org:1337'); + this.server = new HorizonServer("https://horizon-live.stellar.org:1337"); this.axiosMock = sinon.mock(HorizonAxiosClient); StellarSdk.Config.setDefault(); }); @@ -12,36 +12,36 @@ describe('ClaimableBalanceCallBuilder', function () { this.axiosMock.restore(); }); - it('requests the correct endpoint', function (done) { + it("requests the correct endpoint", function (done) { let singleBalanceResponse = { _links: { self: { - href: 'horizon-live.stellar.org:1337/claimable_balances/00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072' + href: "horizon-live.stellar.org:1337/claimable_balances/00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072" } }, - id: '00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072', - asset: 'native', - amount: '200.0000000', - sponsor: 'GBVFLWXYCIGPO3455XVFIKHS66FCT5AI64ZARKS7QJN4NF7K5FOXTJNL', + id: "00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072", + asset: "native", + amount: "200.0000000", + sponsor: "GBVFLWXYCIGPO3455XVFIKHS66FCT5AI64ZARKS7QJN4NF7K5FOXTJNL", last_modified_ledger: 38888, claimants: [ { destination: - 'GBVFLWXYCIGPO3455XVFIKHS66FCT5AI64ZARKS7QJN4NF7K5FOXTJNL', + "GBVFLWXYCIGPO3455XVFIKHS66FCT5AI64ZARKS7QJN4NF7K5FOXTJNL", predicate: { unconditional: true } } ], paging_token: - '38888-00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072' + "38888-00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072" }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/claimable_balances/00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072' + "https://horizon-live.stellar.org:1337/claimable_balances/00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072" ) ) .returns(Promise.resolve({ data: singleBalanceResponse })); @@ -49,7 +49,7 @@ describe('ClaimableBalanceCallBuilder', function () { this.server .claimableBalances() .claimableBalance( - '00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072' + "00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072" ) .call() .then(function (response) { @@ -65,13 +65,13 @@ describe('ClaimableBalanceCallBuilder', function () { const data = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/claimable_balances?sponsor=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc' + href: "https://horizon-live.stellar.org:1337/claimable_balances?sponsor=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc" }, next: { - href: 'https://horizon-live.stellar.org:1337/claimable_balances?sponsor=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc' + href: "https://horizon-live.stellar.org:1337/claimable_balances?sponsor=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc" }, prev: { - href: 'https://horizon-live.stellar.org:1337/claimable_balances?sponsor=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=desc' + href: "https://horizon-live.stellar.org:1337/claimable_balances?sponsor=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=desc" } }, _embedded: { @@ -80,21 +80,21 @@ describe('ClaimableBalanceCallBuilder', function () { }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/claimable_balances?sponsor=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD' + "https://horizon-live.stellar.org:1337/claimable_balances?sponsor=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD" ) ) .returns(Promise.resolve({ data })); this.server .claimableBalances() - .sponsor('GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD') + .sponsor("GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD") .call() .then(function (response) { - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -106,13 +106,13 @@ describe('ClaimableBalanceCallBuilder', function () { const data = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/claimable_balances?claimant=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc' + href: "https://horizon-live.stellar.org:1337/claimable_balances?claimant=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc" }, next: { - href: 'https://horizon-live.stellar.org:1337/claimable_balances?claimant=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc' + href: "https://horizon-live.stellar.org:1337/claimable_balances?claimant=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc" }, prev: { - href: 'https://horizon-live.stellar.org:1337/claimable_balances?claimant=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=desc' + href: "https://horizon-live.stellar.org:1337/claimable_balances?claimant=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=desc" } }, _embedded: { @@ -121,21 +121,21 @@ describe('ClaimableBalanceCallBuilder', function () { }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/claimable_balances?claimant=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD' + "https://horizon-live.stellar.org:1337/claimable_balances?claimant=GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD" ) ) .returns(Promise.resolve({ data })); this.server .claimableBalances() - .claimant('GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD') + .claimant("GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD") .call() .then(function (response) { - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -147,13 +147,13 @@ describe('ClaimableBalanceCallBuilder', function () { const data = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/claimable_balances?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc' + href: "https://horizon-live.stellar.org:1337/claimable_balances?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc" }, next: { - href: 'https://horizon-live.stellar.org:1337/claimable_balances?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc' + href: "https://horizon-live.stellar.org:1337/claimable_balances?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=asc" }, prev: { - href: 'https://horizon-live.stellar.org:1337/claimable_balances?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=desc' + href: "https://horizon-live.stellar.org:1337/claimable_balances?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD&cursor=&limit=10&order=desc" } }, _embedded: { @@ -162,10 +162,10 @@ describe('ClaimableBalanceCallBuilder', function () { }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/claimable_balances?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD' + "https://horizon-live.stellar.org:1337/claimable_balances?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD" ) ) .returns(Promise.resolve({ data })); @@ -174,14 +174,14 @@ describe('ClaimableBalanceCallBuilder', function () { .claimableBalances() .asset( new StellarSdk.Asset( - 'USD', - 'GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD' + "USD", + "GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD" ) ) .call() .then(function (response) { - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { diff --git a/test/unit/server/horizon/join_test.js b/test/unit/server/horizon/join_test.js index 019b98add..fc37178ae 100644 --- a/test/unit/server/horizon/join_test.js +++ b/test/unit/server/horizon/join_test.js @@ -1,8 +1,8 @@ const { HorizonServer } = StellarSdk; -describe('Server - CallBuilder#join', function () { +describe("Server - CallBuilder#join", function () { beforeEach(function () { - this.server = new HorizonServer('https://horizon-live.stellar.org:1337'); + this.server = new HorizonServer("https://horizon-live.stellar.org:1337"); this.axiosMock = sinon.mock(HorizonAxiosClient); }); @@ -11,69 +11,69 @@ describe('Server - CallBuilder#join', function () { this.axiosMock.restore(); }); - describe('#join', function () { + describe("#join", function () { const transaction = { - memo: '', + memo: "", _links: { self: { - href: 'https://horizon-live.stellar.org:1337/transactions/de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5' + href: "https://horizon-live.stellar.org:1337/transactions/de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5" }, account: { - href: 'https://horizon-live.stellar.org:1337/accounts/GBIABVWR2LOKFDMAI6QA2NGT4G54O3BC577GAWDQ6QMOUP5E3ULBBGYX' + href: "https://horizon-live.stellar.org:1337/accounts/GBIABVWR2LOKFDMAI6QA2NGT4G54O3BC577GAWDQ6QMOUP5E3ULBBGYX" }, ledger: { - href: 'https://horizon-live.stellar.org:1337/ledgers/679846' + href: "https://horizon-live.stellar.org:1337/ledgers/679846" }, operations: { - href: 'https://horizon-live.stellar.org:1337/transactions/de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5/operations{?cursor,limit,order}', + href: "https://horizon-live.stellar.org:1337/transactions/de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5/operations{?cursor,limit,order}", templated: true }, effects: { - href: 'https://horizon-live.stellar.org:1337/transactions/de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5/effects{?cursor,limit,order}', + href: "https://horizon-live.stellar.org:1337/transactions/de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5/effects{?cursor,limit,order}", templated: true }, precedes: { - href: 'https://horizon-live.stellar.org:1337/transactions?order=asc\u0026cursor=2919916336320512' + href: "https://horizon-live.stellar.org:1337/transactions?order=asc\u0026cursor=2919916336320512" }, succeeds: { - href: 'https://horizon-live.stellar.org:1337/transactions?order=desc\u0026cursor=2919916336320512' + href: "https://horizon-live.stellar.org:1337/transactions?order=desc\u0026cursor=2919916336320512" } }, - id: 'de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5', - paging_token: '2919916336320512', + id: "de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5", + paging_token: "2919916336320512", successful: true, - hash: 'de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5', + hash: "de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5", ledger: 679846, - created_at: '2019-09-12T14:24:35Z', + created_at: "2019-09-12T14:24:35Z", source_account: - 'GBIABVWR2LOKFDMAI6QA2NGT4G54O3BC577GAWDQ6QMOUP5E3ULBBGYX', - source_account_sequence: '2954696981479425', + "GBIABVWR2LOKFDMAI6QA2NGT4G54O3BC577GAWDQ6QMOUP5E3ULBBGYX", + source_account_sequence: "2954696981479425", fee_charged: 3600, max_fee: 3600, operation_count: 6, envelope_xdr: - 'AAAAAFAA1tHS3KKNgEegDTTT4bvHbCLv/mBYcPQY6j+k3RYQAAAOEAAKf0gAAAABAAAAAAAAAAEAAAAAAAAABgAAAAEAAAAA/vzW27XUS0+Xg+vfq2MERAh2+SdzYshzMcLIcp/NsWwAAAABAAAAAIiGNYyweZIad3hrO4nQqK61U0Rs38vKAESO3qPAncsGAAAAATE4AAAAAAAA/vzW27XUS0+Xg+vfq2MERAh2+SdzYshzMcLIcp/NsWwAAAAAAAAAAwAAAAEAAAAA/vzW27XUS0+Xg+vfq2MERAh2+SdzYshzMcLIcp/NsWwAAAAGAAAAAmJvbmRTaGFyZQAAAAAAAACTGdj4LvjCooulIWoF2ATREiHt8CUE0zFcoY2AYifc9nU43Pt1hkEAAAAAAQAAAABQANbR0tyijYBHoA000+G7x2wi7/5gWHD0GOo/pN0WEAAAAAEAAAAA/vzW27XUS0+Xg+vfq2MERAh2+SdzYshzMcLIcp/NsWwAAAACYm9uZFNoYXJlAAAAAAAAAJMZ2Pgu+MKii6UhagXYBNESIe3wJQTTMVyhjYBiJ9z2AAAAF0h26AAAAAABAAAAAFAA1tHS3KKNgEegDTTT4bvHbCLv/mBYcPQY6j+k3RYQAAAACgAAAB9ySTogICAgICAgM1E5MFVTRCAgICAgICAzUTkwVVNEAAAAAAAAAAABAAAAAFAA1tHS3KKNgEegDTTT4bvHbCLv/mBY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R6ANNNPhu8dsIu/+YFhw9BjqP6TdFhAAAAAEqBe58AAKf0gAAAAAAAAABgAAAAAAAAAAAAAAAAALCwsAAAAEAAAAARPxKcCyleHCDlYJ8z7N/Hf1YTJQnq2SiXma0AyLUk8QAAAAFgAAAAFUU8G5I/PZLExL+32e+e8pi/uSjJ90wpa1AvVtnciwpgAAABUAAAAB0nSqmRd8QThxC7p+bbQ8yQh9aVMngE9riXI3A2xCaxAAAAAXAAAAAd6MoFWveXL4F+nT98egtIDeglk7w3jw5I+DuOMZheTlAAAAGAAAAAAAAAAA", + memo_type: "text", signatures: [ - '5QcaEgzj+krAtiH0+iRho6gjxWIUMkTfVo28FqoBqlraePffIIDL7TiJN1gMrdZxiBTrsAJvpRqoJtmjEjL8AQ==' + "5QcaEgzj+krAtiH0+iRho6gjxWIUMkTfVo28FqoBqlraePffIIDL7TiJN1gMrdZxiBTrsAJvpRqoJtmjEjL8AQ==" ] }; const operationsResponse = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/operations?cursor=\u0026join=transactions\u0026limit=10\u0026order=asc' + href: "https://horizon-live.stellar.org:1337/operations?cursor=\u0026join=transactions\u0026limit=10\u0026order=asc" }, next: { - href: 'https://horizon-live.stellar.org:1337/operations?cursor=2919916336320518\u0026join=transactions\u0026limit=10\u0026order=asc' + href: "https://horizon-live.stellar.org:1337/operations?cursor=2919916336320518\u0026join=transactions\u0026limit=10\u0026order=asc" }, prev: { - href: 'https://horizon-live.stellar.org:1337/operations?cursor=2919916336320518\u0026join=transactions\u0026limit=1\u0026order=asc' + href: "https://horizon-live.stellar.org:1337/operations?cursor=2919916336320518\u0026join=transactions\u0026limit=1\u0026order=asc" } }, _embedded: { @@ -81,81 +81,81 @@ describe('Server - CallBuilder#join', function () { { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/operations/2919916336320518' + href: "https://horizon-live.stellar.org:1337/operations/2919916336320518" }, transaction: { - href: 'https://horizon-live.stellar.org:1337/transactions/de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5' + href: "https://horizon-live.stellar.org:1337/transactions/de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5" }, effects: { - href: 'https://horizon-live.stellar.org:1337/operations/2919916336320518/effects' + href: "https://horizon-live.stellar.org:1337/operations/2919916336320518/effects" }, succeeds: { - href: 'https://horizon-live.stellar.org:1337/effects?order=desc\u0026cursor=2919916336320518' + href: "https://horizon-live.stellar.org:1337/effects?order=desc\u0026cursor=2919916336320518" }, precedes: { - href: 'https://horizon-live.stellar.org:1337/effects?order=asc\u0026cursor=2919916336320518' + href: "https://horizon-live.stellar.org:1337/effects?order=asc\u0026cursor=2919916336320518" } }, - id: '2919916336320518', - paging_token: '2919916336320518', + id: "2919916336320518", + paging_token: "2919916336320518", transaction_successful: true, source_account: - 'GD7PZVW3WXKEWT4XQPV57K3DARCAQ5XZE5ZWFSDTGHBMQ4U7ZWYWZLPC', - type: 'path_payment', + "GD7PZVW3WXKEWT4XQPV57K3DARCAQ5XZE5ZWFSDTGHBMQ4U7ZWYWZLPC", + type: "path_payment", type_i: 2, - created_at: '2019-09-12T14:24:35Z', + created_at: "2019-09-12T14:24:35Z", transaction_hash: - 'de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5', + "de8ca055af7972f817e9d3f7c7a0b480de82593bc378f0e48f83b8e31985e4e5", transaction, - asset_type: 'credit_alphanum4', - asset_code: 'USD', + asset_type: "credit_alphanum4", + asset_code: "USD", asset_issuer: - 'GBXGR3C3VKWAJCWLF7LX5TLS4KWQKPKJ4KUOJ6T6NEBROA62TTUUM6GD', - from: 'GD7PZVW3WXKEWT4XQPV57K3DARCAQ5XZE5ZWFSDTGHBMQ4U7ZWYWZLPC', - to: 'GCC3LGXHBZ6NSJOJCETNRRYTNDQJGCRC3P7YC2ZQ2ER3YWVJJQ2YDUL7', - amount: '10000.0000000', + "GBXGR3C3VKWAJCWLF7LX5TLS4KWQKPKJ4KUOJ6T6NEBROA62TTUUM6GD", + from: "GD7PZVW3WXKEWT4XQPV57K3DARCAQ5XZE5ZWFSDTGHBMQ4U7ZWYWZLPC", + to: "GCC3LGXHBZ6NSJOJCETNRRYTNDQJGCRC3P7YC2ZQ2ER3YWVJJQ2YDUL7", + amount: "10000.0000000", path: [ { - asset_type: 'credit_alphanum4', - asset_code: 'USD', + asset_type: "credit_alphanum4", + asset_code: "USD", asset_issuer: - 'GBXGR3C3VKWAJCWLF7LX5TLS4KWQKPKJ4KUOJ6T6NEBROA62TTUUM6GD' + "GBXGR3C3VKWAJCWLF7LX5TLS4KWQKPKJ4KUOJ6T6NEBROA62TTUUM6GD" }, { - asset_type: 'credit_alphanum4', - asset_code: 'USD', + asset_type: "credit_alphanum4", + asset_code: "USD", asset_issuer: - 'GBXGR3C3VKWAJCWLF7LX5TLS4KWQKPKJ4KUOJ6T6NEBROA62TTUUM6GD' + "GBXGR3C3VKWAJCWLF7LX5TLS4KWQKPKJ4KUOJ6T6NEBROA62TTUUM6GD" } ], - source_amount: '10000.0000000', - source_max: '10000.0000000', - source_asset_type: 'credit_alphanum4', - source_asset_code: 'USD', + source_amount: "10000.0000000", + source_max: "10000.0000000", + source_asset_type: "credit_alphanum4", + source_asset_code: "USD", source_asset_issuer: - 'GBXGR3C3VKWAJCWLF7LX5TLS4KWQKPKJ4KUOJ6T6NEBROA62TTUUM6GD' + "GBXGR3C3VKWAJCWLF7LX5TLS4KWQKPKJ4KUOJ6T6NEBROA62TTUUM6GD" } ] } }; - it('loads resources in join and avoids extra call to server', function (done) { + it("loads resources in join and avoids extra call to server", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/operations?join=transactions' + "https://horizon-live.stellar.org:1337/operations?join=transactions" ) ) .returns(Promise.resolve({ data: operationsResponse })); this.server .operations() - .join('transactions') + .join("transactions") .call() .then((response) => { const record = response.records[0]; - expect(record.transaction).to.be.a('function'); + expect(record.transaction).to.be.a("function"); record.transaction().then((transaction) => { expect(transaction).to.deep.equal(transaction); diff --git a/test/unit/server/soroban/constructor_test.js b/test/unit/server/soroban/constructor_test.js index 419471a42..a4fa2e122 100644 --- a/test/unit/server/soroban/constructor_test.js +++ b/test/unit/server/soroban/constructor_test.js @@ -1,6 +1,6 @@ const { SorobanServer } = StellarSdk; -describe('Server.constructor', function () { +describe("Server.constructor", function () { beforeEach(function () { this.server = new SorobanServer(serverUrl); this.axiosMock = sinon.mock(SorobanAxiosClient); @@ -11,15 +11,15 @@ describe('Server.constructor', function () { this.axiosMock.restore(); }); - let insecureServerUrl = serverUrl.replace('https://', 'http://'); + let insecureServerUrl = serverUrl.replace("https://", "http://"); - it('throws error for insecure server', function () { + it("throws error for insecure server", function () { expect(() => new SorobanServer(insecureServerUrl)).to.throw( /Cannot connect to insecure Soroban RPC server/i ); }); - it('allow insecure server when opts.allowHttp flag is set', function () { + it("allow insecure server when opts.allowHttp flag is set", function () { expect( () => new SorobanServer(insecureServerUrl, { allowHttp: true }) ).to.not.throw(); diff --git a/test/unit/server/soroban/get_account_test.js b/test/unit/server/soroban/get_account_test.js index ea64a0833..403207d74 100644 --- a/test/unit/server/soroban/get_account_test.js +++ b/test/unit/server/soroban/get_account_test.js @@ -1,6 +1,6 @@ const { SorobanServer } = StellarSdk; -describe('Server#getAccount', function () { +describe("Server#getAccount", function () { const { Account, StrKey, xdr } = StellarSdk; beforeEach(function () { @@ -13,25 +13,25 @@ describe('Server#getAccount', function () { this.axiosMock.restore(); }); - it('requests the correct method', function (done) { - const address = 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI'; + it("requests the correct method", function (done) { + const address = "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI"; const accountId = xdr.PublicKey.publicKeyTypeEd25519( StrKey.decodeEd25519PublicKey(address) ); this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getLedgerEntries', + method: "getLedgerEntries", params: [ [ xdr.LedgerKey.account( new xdr.LedgerKeyAccount({ accountId }) - ).toXDR('base64') + ).toXDR("base64") ] ] }) @@ -41,7 +41,7 @@ describe('Server#getAccount', function () { result: { entries: [ { - xdr: 'AAAAAAAAAABzdv3ojkzWHMD7KUoXhrPx0GH18vHKV0ZfqpMiEblG1g3gtpoE608YAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAQAAAAAY9D8iA' + xdr: "AAAAAAAAAABzdv3ojkzWHMD7KUoXhrPx0GH18vHKV0ZfqpMiEblG1g3gtpoE608YAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAQAAAAAY9D8iA" } ] } @@ -49,7 +49,7 @@ describe('Server#getAccount', function () { }) ); - const expected = new Account(address, '1'); + const expected = new Account(address, "1"); this.server .getAccount(address) .then(function (response) { @@ -59,25 +59,25 @@ describe('Server#getAccount', function () { .catch(done); }); - it('throws a useful error when the account is not found', function (done) { - const address = 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI'; + it("throws a useful error when the account is not found", function (done) { + const address = "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI"; const accountId = xdr.PublicKey.publicKeyTypeEd25519( StrKey.decodeEd25519PublicKey(address) ); this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getLedgerEntries', + method: "getLedgerEntries", params: [ [ xdr.LedgerKey.account( new xdr.LedgerKeyAccount({ accountId }) - ).toXDR('base64') + ).toXDR("base64") ] ] }) @@ -94,7 +94,7 @@ describe('Server#getAccount', function () { this.server .getAccount(address) .then(function (_) { - done(new Error('Expected error to be thrown')); + done(new Error("Expected error to be thrown")); }) .catch(function (err) { done( diff --git a/test/unit/server/soroban/get_contract_data_test.js b/test/unit/server/soroban/get_contract_data_test.js index bf69accda..ca39a9878 100644 --- a/test/unit/server/soroban/get_contract_data_test.js +++ b/test/unit/server/soroban/get_contract_data_test.js @@ -1,6 +1,6 @@ const { SorobanServer, xdr } = StellarSdk; -describe('Server#getContractData', function () { +describe("Server#getContractData", function () { beforeEach(function () { this.server = new SorobanServer(serverUrl); this.axiosMock = sinon.mock(SorobanAxiosClient); @@ -11,23 +11,23 @@ describe('Server#getContractData', function () { this.axiosMock.restore(); }); - let address = 'CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5'; + let address = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5"; let key = StellarSdk.xdr.ScVal.scvVec([ - StellarSdk.xdr.ScVal.scvSymbol('Admin') + StellarSdk.xdr.ScVal.scvSymbol("Admin") ]); - it('key found', function (done) { + it("key found", function (done) { let result = { id: address, - sequence: '1' + sequence: "1" }; this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getLedgerEntries', + method: "getLedgerEntries", params: [ [ xdr.LedgerKey.contractData( @@ -38,7 +38,7 @@ describe('Server#getContractData', function () { .toScAddress(), durability: xdr.ContractDataDurability.persistent() }) - ).toXDR('base64') + ).toXDR("base64") ] ] }) @@ -53,7 +53,7 @@ describe('Server#getContractData', function () { ); this.server - .getContractData(address, key, 'persistent') + .getContractData(address, key, "persistent") .then(function (response) { expect(response).to.be.deep.equal(result); done(); @@ -63,13 +63,13 @@ describe('Server#getContractData', function () { }); }); - it('key not found', function (done) { + it("key not found", function (done) { this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getLedgerEntries', + method: "getLedgerEntries", params: [ [ xdr.LedgerKey.contractData( @@ -80,30 +80,30 @@ describe('Server#getContractData', function () { .toScAddress(), durability: xdr.ContractDataDurability.temporary() }) - ).toXDR('base64') + ).toXDR("base64") ] ] }) .returns(Promise.resolve({ data: { result: { entries: [] } } })); this.server - .getContractData(address, key, 'temporary') + .getContractData(address, key, "temporary") .then(function (_response) { - done(new Error('Expected error')); + done(new Error("Expected error")); }) .catch(function (err) { done( err.code == 404 ? null - : new Error('Expected error code 404, got: ' + err.code) + : new Error("Expected error code 404, got: " + err.code) ); }); }); - it('fails on hex address (was deprecated now unsupported)', function (done) { - let hexAddress = '0'.repeat(63) + '1'; + it("fails on hex address (was deprecated now unsupported)", function (done) { + let hexAddress = "0".repeat(63) + "1"; this.server - .getContractData(hexAddress, key, 'persistent') + .getContractData(hexAddress, key, "persistent") .then((reply) => done(new Error(`should fail, got: ${reply}`))) .catch((error) => { expect(error).to.contain(/unsupported contract id/i); diff --git a/test/unit/server/soroban/get_events_test.js b/test/unit/server/soroban/get_events_test.js index bf2505886..dd5527b54 100644 --- a/test/unit/server/soroban/get_events_test.js +++ b/test/unit/server/soroban/get_events_test.js @@ -1,6 +1,6 @@ const { SorobanServer } = StellarSdk; -describe('Server#getEvents', function () { +describe("Server#getEvents", function () { beforeEach(function () { this.server = new SorobanServer(serverUrl); this.axiosMock = sinon.mock(SorobanAxiosClient); @@ -11,14 +11,14 @@ describe('Server#getEvents', function () { this.axiosMock.restore(); }); - it('requests the correct endpoint', function (done) { + it("requests the correct endpoint", function (done) { let result = { events: [] }; setupMock( this.axiosMock, { filters: [], pagination: {}, - startLedger: '1' + startLedger: "1" }, result ); @@ -34,16 +34,16 @@ describe('Server#getEvents', function () { }); }); - it('can build wildcard filters', function (done) { - let result = filterEvents(getEventsResponseFixture, '*/*'); + it("can build wildcard filters", function (done) { + let result = filterEvents(getEventsResponseFixture, "*/*"); setupMock( this.axiosMock, { - startLedger: '1', + startLedger: "1", filters: [ { - topics: [['*', '*']] + topics: [["*", "*"]] } ], pagination: {} @@ -56,7 +56,7 @@ describe('Server#getEvents', function () { startLedger: 1, filters: [ { - topics: [['*', '*']] + topics: [["*", "*"]] } ] }) @@ -67,19 +67,19 @@ describe('Server#getEvents', function () { .catch(done); }); - it('can build matching filters', function (done) { + it("can build matching filters", function (done) { let result = filterEvents( getEventsResponseFixture, - 'AAAABQAAAAh0cmFuc2Zlcg==/AAAAAQB6Mcc=' + "AAAABQAAAAh0cmFuc2Zlcg==/AAAAAQB6Mcc=" ); setupMock( this.axiosMock, { - startLedger: '1', + startLedger: "1", filters: [ { - topics: [['AAAABQAAAAh0cmFuc2Zlcg==', 'AAAAAQB6Mcc=']] + topics: [["AAAABQAAAAh0cmFuc2Zlcg==", "AAAAAQB6Mcc="]] } ], pagination: {} @@ -92,7 +92,7 @@ describe('Server#getEvents', function () { startLedger: 1, filters: [ { - topics: [['AAAABQAAAAh0cmFuc2Zlcg==', 'AAAAAQB6Mcc=']] + topics: [["AAAABQAAAAh0cmFuc2Zlcg==", "AAAAAQB6Mcc="]] } ] }) @@ -103,19 +103,19 @@ describe('Server#getEvents', function () { .catch(done); }); - it('can build mixed filters', function (done) { + it("can build mixed filters", function (done) { let result = filterEventsByLedger( - filterEvents(getEventsResponseFixture, 'AAAABQAAAAh0cmFuc2Zlcg==/*'), + filterEvents(getEventsResponseFixture, "AAAABQAAAAh0cmFuc2Zlcg==/*"), 1 ); setupMock( this.axiosMock, { - startLedger: '1', + startLedger: "1", filters: [ { - topics: [['AAAABQAAAAh0cmFuc2Zlcg==', '*']] + topics: [["AAAABQAAAAh0cmFuc2Zlcg==", "*"]] } ], pagination: {} @@ -128,7 +128,7 @@ describe('Server#getEvents', function () { startLedger: 1, filters: [ { - topics: [['AAAABQAAAAh0cmFuc2Zlcg==', '*']] + topics: [["AAAABQAAAAh0cmFuc2Zlcg==", "*"]] } ] }) @@ -139,9 +139,9 @@ describe('Server#getEvents', function () { .catch(done); }); - it('can paginate', function (done) { + it("can paginate", function (done) { let result = filterEventsByLedger( - filterEvents(getEventsResponseFixture, '*/*'), + filterEvents(getEventsResponseFixture, "*/*"), 1 ); @@ -150,12 +150,12 @@ describe('Server#getEvents', function () { { filters: [ { - topics: [['*', '*']] + topics: [["*", "*"]] } ], pagination: { limit: 10, - cursor: '0164090849041387521-0000000000' + cursor: "0164090849041387521-0000000000" } }, result @@ -165,10 +165,10 @@ describe('Server#getEvents', function () { .getEvents({ filters: [ { - topics: [['*', '*']] + topics: [["*", "*"]] } ], - cursor: '0164090849041387521-0000000000', + cursor: "0164090849041387521-0000000000", limit: 10 }) .then(function (response) { @@ -183,7 +183,7 @@ function filterEvents(events, filter) { return events.filter( (e, i) => e.topic.length == filter.length && - e.topic.every((s, j) => s === filter[j] || s === '*') + e.topic.every((s, j) => s === filter[j] || s === "*") ); } @@ -195,11 +195,11 @@ function filterEventsByLedger(events, start) { function setupMock(axiosMock, params, result) { axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getEvents', + method: "getEvents", params: params }) .returns(Promise.resolve({ data: { result } })); @@ -207,59 +207,59 @@ function setupMock(axiosMock, params, result) { let getEventsResponseFixture = [ { - type: 'system', - ledger: '1', - ledgerClosedAt: '2022-11-16T16:10:41Z', + type: "system", + ledger: "1", + ledgerClosedAt: "2022-11-16T16:10:41Z", contractId: - 'e3e82a76cc316f6289fd1ffbdf315da0f2c6be9582b84b9983a402f02ea0fff7', - id: '0164090849041387521-0000000003', - pagingToken: '164090849041387521-3', - topic: ['AAAABQAAAAh0cmFuc2Zlcg==', 'AAAAAQB6Mcc='], + "e3e82a76cc316f6289fd1ffbdf315da0f2c6be9582b84b9983a402f02ea0fff7", + id: "0164090849041387521-0000000003", + pagingToken: "164090849041387521-3", + topic: ["AAAABQAAAAh0cmFuc2Zlcg==", "AAAAAQB6Mcc="], inSuccessfulContractCall: true, value: { - xdr: 'AAAABQAAAApHaWJNb255UGxzAAA=' + xdr: "AAAABQAAAApHaWJNb255UGxzAAA=" } }, { - type: 'contract', - ledger: '2', - ledgerClosedAt: '2022-11-16T16:10:41Z', + type: "contract", + ledger: "2", + ledgerClosedAt: "2022-11-16T16:10:41Z", contractId: - 'e3e82a76cc316f6289fd1ffbdf315da0f2c6be9582b84b9983a402f02ea0fff7', - id: '0164090849041387521-0000000003', - pagingToken: '164090849041387521-3', - topic: ['AAAAAQB6Mcc=', 'AAAABQAAAAh0cmFuc2Zlcg=='], + "e3e82a76cc316f6289fd1ffbdf315da0f2c6be9582b84b9983a402f02ea0fff7", + id: "0164090849041387521-0000000003", + pagingToken: "164090849041387521-3", + topic: ["AAAAAQB6Mcc=", "AAAABQAAAAh0cmFuc2Zlcg=="], inSuccessfulContractCall: true, value: { - xdr: 'AAAABQAAAApHaWJNb255UGxzAAA=' + xdr: "AAAABQAAAApHaWJNb255UGxzAAA=" } }, { - type: 'diagnostic', - ledger: '2', - ledgerClosedAt: '2022-11-16T16:10:41Z', + type: "diagnostic", + ledger: "2", + ledgerClosedAt: "2022-11-16T16:10:41Z", contractId: - 'a3e82a76cc316f6289fd1ffbdf315da0f2c6be9582b84b9983a402f02ea0fff7', - id: '0164090849041387521-0000000003', - pagingToken: '164090849041387521-3', + "a3e82a76cc316f6289fd1ffbdf315da0f2c6be9582b84b9983a402f02ea0fff7", + id: "0164090849041387521-0000000003", + pagingToken: "164090849041387521-3", inSuccessfulContractCall: true, - topic: ['AAAAAQB6Mcc='], + topic: ["AAAAAQB6Mcc="], value: { - xdr: 'AAAABQAAAApHaWJNb255UGxzAAA=' + xdr: "AAAABQAAAApHaWJNb255UGxzAAA=" } }, { - type: 'contract', - ledger: '3', - ledgerClosedAt: '2022-12-14T01:01:20Z', + type: "contract", + ledger: "3", + ledgerClosedAt: "2022-12-14T01:01:20Z", contractId: - '6ebe0114ae15f72f187f05d06dcb66b22bd97218755c9b4646b034ab961fc1d5', - id: '0000000171798695936-0000000001', - pagingToken: '0000000171798695936-0000000001', + "6ebe0114ae15f72f187f05d06dcb66b22bd97218755c9b4646b034ab961fc1d5", + id: "0000000171798695936-0000000001", + pagingToken: "0000000171798695936-0000000001", inSuccessfulContractCall: true, - topic: ['AAAABQAAAAdDT1VOVEVSAA==', 'AAAABQAAAAlpbmNyZW1lbnQAAAA='], + topic: ["AAAABQAAAAdDT1VOVEVSAA==", "AAAABQAAAAlpbmNyZW1lbnQAAAA="], value: { - xdr: 'AAAAAQAAAAE=' + xdr: "AAAAAQAAAAE=" } } ]; diff --git a/test/unit/server/soroban/get_health_test.js b/test/unit/server/soroban/get_health_test.js index 258310303..2a4aa3cda 100644 --- a/test/unit/server/soroban/get_health_test.js +++ b/test/unit/server/soroban/get_health_test.js @@ -1,6 +1,6 @@ const { SorobanServer } = StellarSdk; -describe('Server#getHealth', function () { +describe("Server#getHealth", function () { beforeEach(function () { this.server = new SorobanServer(serverUrl); this.axiosMock = sinon.mock(SorobanAxiosClient); @@ -11,17 +11,17 @@ describe('Server#getHealth', function () { this.axiosMock.restore(); }); - it('requests the correct endpoint', function (done) { + it("requests the correct endpoint", function (done) { let result = { - status: 'healthy' + status: "healthy" }; this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getHealth', + method: "getHealth", params: null }) .returns(Promise.resolve({ data: { result } })); diff --git a/test/unit/server/soroban/get_latest_ledger_test.js b/test/unit/server/soroban/get_latest_ledger_test.js index 67ccd1d14..70945dcdc 100644 --- a/test/unit/server/soroban/get_latest_ledger_test.js +++ b/test/unit/server/soroban/get_latest_ledger_test.js @@ -1,6 +1,6 @@ const { SorobanServer } = StellarSdk; -describe('Server#getLatestLedger', function () { +describe("Server#getLatestLedger", function () { beforeEach(function () { this.server = new SorobanServer(serverUrl); this.axiosMock = sinon.mock(SorobanAxiosClient); @@ -11,18 +11,18 @@ describe('Server#getLatestLedger', function () { this.axiosMock.restore(); }); - it('requests the correct method', function (done) { + it("requests the correct method", function (done) { const result = { - id: 'hashed_id', + id: "hashed_id", sequence: 123, protocolVersion: 20 }; this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getLatestLedger', + method: "getLatestLedger", params: null }) .returns(Promise.resolve({ data: { result } })); diff --git a/test/unit/server/soroban/get_network_test.js b/test/unit/server/soroban/get_network_test.js index 859a90cf4..0ec49b3f1 100644 --- a/test/unit/server/soroban/get_network_test.js +++ b/test/unit/server/soroban/get_network_test.js @@ -1,6 +1,6 @@ const { SorobanServer } = StellarSdk; -describe('Server#getNetwork', function () { +describe("Server#getNetwork", function () { beforeEach(function () { this.server = new SorobanServer(serverUrl); this.axiosMock = sinon.mock(SorobanAxiosClient); @@ -11,18 +11,18 @@ describe('Server#getNetwork', function () { this.axiosMock.restore(); }); - it('requests the correct method', function (done) { + it("requests the correct method", function (done) { const result = { - friendbotUrl: 'https://friendbot.stellar.org', - passphrase: 'Soroban Testnet ; December 2018', + friendbotUrl: "https://friendbot.stellar.org", + passphrase: "Soroban Testnet ; December 2018", protocolVersion: 20 }; this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getNetwork', + method: "getNetwork", params: null }) .returns(Promise.resolve({ data: { result } })); diff --git a/test/unit/server/soroban/get_transaction_test.js b/test/unit/server/soroban/get_transaction_test.js index be4556488..bd4c189bd 100644 --- a/test/unit/server/soroban/get_transaction_test.js +++ b/test/unit/server/soroban/get_transaction_test.js @@ -8,9 +8,9 @@ const { XdrLargeInt } = StellarSdk; -describe('Server#getTransaction', function () { +describe("Server#getTransaction", function () { let keypair = Keypair.random(); - let account = new StellarSdk.Account(keypair.publicKey(), '56199647068161'); + let account = new StellarSdk.Account(keypair.publicKey(), "56199647068161"); beforeEach(function () { this.server = new SorobanServer(serverUrl); @@ -23,9 +23,9 @@ describe('Server#getTransaction', function () { .addOperation( StellarSdk.Operation.payment({ destination: - 'GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW', + "GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW", asset: StellarSdk.Asset.native(), - amount: '100.50' + amount: "100.50" }) ) .setTimeout(StellarSdk.TimeoutInfinite) @@ -33,15 +33,15 @@ describe('Server#getTransaction', function () { transaction.sign(keypair); this.transaction = transaction; - this.hash = this.transaction.hash().toString('hex'); - this.blob = transaction.toEnvelope().toXDR().toString('base64'); + this.hash = this.transaction.hash().toString("hex"); + this.blob = transaction.toEnvelope().toXDR().toString("base64"); this.prepareAxios = (result) => { this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getTransaction', + method: "getTransaction", params: [this.hash] }) .returns(Promise.resolve({ data: { id: 1, result } })); @@ -53,8 +53,8 @@ describe('Server#getTransaction', function () { this.axiosMock.restore(); }); - it('transaction not found', function (done) { - const result = makeTxResult('NOT_FOUND'); + it("transaction not found", function (done) { + const result = makeTxResult("NOT_FOUND"); this.prepareAxios(result); this.server @@ -66,17 +66,17 @@ describe('Server#getTransaction', function () { .catch((err) => done(err)); }); - it('transaction success', function (done) { - const result = makeTxResult('SUCCESS', true); + it("transaction success", function (done) { + const result = makeTxResult("SUCCESS", true); this.prepareAxios(result); let expected = JSON.parse(JSON.stringify(result)); [ - ['envelopeXdr', xdr.TransactionEnvelope], - ['resultXdr', xdr.TransactionResult], - ['resultMetaXdr', xdr.TransactionMeta] + ["envelopeXdr", xdr.TransactionEnvelope], + ["resultXdr", xdr.TransactionResult], + ["resultMetaXdr", xdr.TransactionMeta] ].forEach(([field, struct]) => { - expected[field] = struct.fromXDR(result[field], 'base64'); + expected[field] = struct.fromXDR(result[field], "base64"); }); expected.returnValue = expected.resultMetaXdr .v3() @@ -88,14 +88,14 @@ describe('Server#getTransaction', function () { .then((resp) => { expect(Object.keys(resp)).to.eql(Object.keys(expected)); expect(resp).to.eql(expected); - expect(resp.returnValue).to.eql(new XdrLargeInt('u64', 1234).toScVal()); + expect(resp.returnValue).to.eql(new XdrLargeInt("u64", 1234).toScVal()); done(); }) .catch((err) => done(err)); }); - xit('non-Soroban transaction success', function (done) { - const result = makeTxResult('SUCCESS', false); + xit("non-Soroban transaction success", function (done) { + const result = makeTxResult("SUCCESS", false); this.prepareAxios(result); this.server @@ -107,8 +107,8 @@ describe('Server#getTransaction', function () { .catch((err) => done(err)); }); - xit('transaction pending', function (done) {}); - xit('transaction error', function (done) {}); + xit("transaction pending", function (done) {}); + xit("transaction error", function (done) {}); }); function makeTxResult(status, addSoroban = true) { @@ -138,16 +138,16 @@ function makeTxResult(status, addSoroban = true) { applicationOrder: 2, feeBump: false, envelopeXdr: - 'AAAAAgAAAAAT/LQZdYz0FcQ4Xwyg8IM17rkUx3pPCCWLu+SowQ/T+gBLB24poiQa9iwAngAAAAEAAAAAAAAAAAAAAABkwdeeAAAAAAAAAAEAAAABAAAAAC/9E8hDhnktyufVBS5tqA734Yz5XrLX2XNgBgH/YEkiAAAADQAAAAAAAAAAAAA1/gAAAAAv/RPIQ4Z5Lcrn1QUubagO9+GM+V6y19lzYAYB/2BJIgAAAAAAAAAAAAA1/gAAAAQAAAACU0lMVkVSAAAAAAAAAAAAAFDutWuu6S6UPJBrotNSgfmXa27M++63OT7TYn1qjgy+AAAAAVNHWAAAAAAAUO61a67pLpQ8kGui01KB+Zdrbsz77rc5PtNifWqODL4AAAACUEFMTEFESVVNAAAAAAAAAFDutWuu6S6UPJBrotNSgfmXa27M++63OT7TYn1qjgy+AAAAAlNJTFZFUgAAAAAAAAAAAABQ7rVrrukulDyQa6LTUoH5l2tuzPvutzk+02J9ao4MvgAAAAAAAAACwQ/T+gAAAEA+ztVEKWlqHXNnqy6FXJeHr7TltHzZE6YZm5yZfzPIfLaqpp+5cyKot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MvgAAGlGnIJrXAAAAAlNJTFZFUgAAAAAAAAAAAABQ7rVrrukulDyQa6LTUoH5l2tuzPvutzk+02J9ao4MvgAAGFtLaC9oAAAAApmc7UgUBInrDvij8HMSridx2n1w3I8TVEn4sLr1LSpmAAAAAlBBTExBRElVTQAAAAAAAABQ7rVrrukulDyQa6LTUoH5l2tuzPvutzk+02J9ao4MvgAAIUz88EqYAAAAAVNHWAAAAAAAUO61a67pLpQ8kGui01KB+Zdrbsz77rc5PtNifWqODL4AABpRpyCa1wAAAAKYUsaaCZ233xB1p+lG7YksShJWfrjsmItbokiR3ifa0gAAAAJTSUxWRVIAAAAAAAAAAAAAUO61a67pLpQ8kGui01KB+Zdrbsz77rc5PtNifWqODL4AABv52PPa5wAAAAJQQUxMQURJVU0AAAAAAAAAUO61a67pLpQ8kGui01KB+Zdrbsz77rc5PtNifWqODL4AACFM/PBKmAAAAAJnhbp+Y3re6FWphFwcRP4PY0S0m+EIhh+UWH0aq1j4DAAAAAAAAAAAAAA9pAAAAAJTSUxWRVIAAAAAAAAAAAAAUO61a67pLpQ8kGui01KB+Zdrbsz77rc5PtNifWqODL4AABv52PPa5wAAAAAv/RPIQ4Z5Lcrn1QUubagO9+GM+V6y19lzYAYB/2BJIgAAAAAAAAAAAAA9pAAAAAA=", + resultMetaXdr: metaV3.toXDR("base64") }; if (!addSoroban) { // replace the V3 Soroban meta with a "classic" V2 version successInfo.resultMetaXdr = - 'AAAAAgAAAAIAAAADAtL5awAAAAAAAAAAS0CFMhOtWUKJWerx66zxkxORaiH6/3RUq7L8zspD5RoAAAAAAcm9QAKVkpMAAHpMAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAC0vi5AAAAAGTB02oAAAAAAAAAAQLS+WsAAAAAAAAAAEtAhTITrVlCiVnq8eus8ZMTkWoh+v90VKuy/M7KQ+UaAAAAAAHJvUAClZKTAAB6TQ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AAAAJCVVNJTkVTUwAAAAAAAAAAtyXw3qPb63iLSjT6Hu+BJBSKlsm3lEDRby71EYR7bJAAAAAAAABAL3//////////AAAAAQAAAAEAE3H3TnhnuQAAAAAAAAAAAAAAAAAAAAAAAAABAtL5awAAAAEAAAAAbhzC7vXMc1fHeMcLNEY4i2Fyd/BGB83Z/8CgcUssxyUAAAACQlVTSU5FU1MAAAAAAAAAALcl8N6j2+t4i0o0+h7vgSQUipbJt5RA0W8u9RGEe2yQAAAAAAAAQC9//////////wAAAAEAAAABABNx9J6Z4RkAAAAAAAAAAAAAAAAAAAAAAAAAAwLS+WsAAAAAAAAAAG4cwu71zHNXx3jHCzRGOIthcnfwRgfN2f/AoHFLLMclAAAAH37+zXQCXdRTAAASZAAAApIAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAABbBXKIigAAABhZWyiOAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAAtL0awAAAABkwbqrAAAAAAAAAAEC0vlrAAAAAAAAAABuHMLu9cxzV8d4xws0RjiLYXJ38EYHzdn/wKBxSyzHJQAAAB9+/s10Al3UUwAAEmQAAAKSAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAWwVyiIoAAAAYWVsojgAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAALS9GsAAAAAZMG6qwAAAAAAAAAA"; } return { @@ -156,6 +156,6 @@ function makeTxResult(status, addSoroban = true) { latestLedgerCloseTime: 12345, oldestLedger: 50, oldestLedgerCloseTime: 500, - ...(status === 'SUCCESS' && successInfo) + ...(status === "SUCCESS" && successInfo) }; } diff --git a/test/unit/server/soroban/request_airdrop_test.js b/test/unit/server/soroban/request_airdrop_test.js index 022e428de..269b6490d 100644 --- a/test/unit/server/soroban/request_airdrop_test.js +++ b/test/unit/server/soroban/request_airdrop_test.js @@ -1,6 +1,6 @@ const { SorobanServer } = StellarSdk; -describe('Server#requestAirdrop', function () { +describe("Server#requestAirdrop", function () { const { Account, StrKey, xdr } = StellarSdk; function accountLedgerEntryData(accountId, sequence) { @@ -9,14 +9,14 @@ describe('Server#requestAirdrop', function () { accountId: xdr.AccountId.publicKeyTypeEd25519( StrKey.decodeEd25519PublicKey(accountId) ), - balance: xdr.Int64.fromString('1'), + balance: xdr.Int64.fromString("1"), seqNum: xdr.SequenceNumber.fromString(sequence), numSubEntries: 0, inflationDest: null, flags: 0, - homeDomain: '', + homeDomain: "", // Taken from a real response. idk. - thresholds: Buffer.from('AQAAAA==', 'base64'), + thresholds: Buffer.from("AQAAAA==", "base64"), signers: [], ext: new xdr.AccountEntryExt(0) }) @@ -54,38 +54,38 @@ describe('Server#requestAirdrop', function () { function mockGetNetwork(friendbotUrl) { const result = { friendbotUrl, - passphrase: 'Soroban Testnet ; December 2018', + passphrase: "Soroban Testnet ; December 2018", protocolVersion: 20 }; this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getNetwork', + method: "getNetwork", params: null }) .returns(Promise.resolve({ data: { result } })); } - it('returns true when the account is created', function (done) { - const friendbotUrl = 'https://friendbot.stellar.org'; + it("returns true when the account is created", function (done) { + const friendbotUrl = "https://friendbot.stellar.org"; const accountId = - 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI'; + "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI"; mockGetNetwork.call(this, friendbotUrl); - const result_meta_xdr = transactionMetaFor(accountId, '1234').toXDR( - 'base64' + const result_meta_xdr = transactionMetaFor(accountId, "1234").toXDR( + "base64" ); this.axiosMock - .expects('post') + .expects("post") .withArgs(`${friendbotUrl}?addr=${accountId}`) .returns(Promise.resolve({ data: { result_meta_xdr } })); this.server .requestAirdrop(accountId) .then(function (response) { - expect(response).to.be.deep.equal(new Account(accountId, '1234')); + expect(response).to.be.deep.equal(new Account(accountId, "1234")); done(); }) .catch(function (err) { @@ -93,31 +93,31 @@ describe('Server#requestAirdrop', function () { }); }); - it('returns false if the account already exists', function (done) { - const friendbotUrl = 'https://friendbot.stellar.org'; + it("returns false if the account already exists", function (done) { + const friendbotUrl = "https://friendbot.stellar.org"; const accountId = - 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI'; + "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI"; mockGetNetwork.call(this, friendbotUrl); this.axiosMock - .expects('post') + .expects("post") .withArgs(`${friendbotUrl}?addr=${accountId}`) .returns( Promise.reject({ response: { status: 400, detail: - 'createAccountAlreadyExist (AAAAAAAAAGT/////AAAAAQAAAAAAAAAA/////AAAAAA=)' + "createAccountAlreadyExist (AAAAAAAAAGT/////AAAAAQAAAAAAAAAA/////AAAAAA=)" } }) ); this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'getLedgerEntries', + method: "getLedgerEntries", params: [ [ xdr.LedgerKey.account( @@ -126,7 +126,7 @@ describe('Server#requestAirdrop', function () { StrKey.decodeEd25519PublicKey(accountId) ) }) - ).toXDR('base64') + ).toXDR("base64") ] ] }) @@ -136,7 +136,7 @@ describe('Server#requestAirdrop', function () { result: { entries: [ { - xdr: accountLedgerEntryData(accountId, '1234').toXDR('base64') + xdr: accountLedgerEntryData(accountId, "1234").toXDR("base64") } ] } @@ -147,7 +147,7 @@ describe('Server#requestAirdrop', function () { this.server .requestAirdrop(accountId) .then(function (response) { - expect(response).to.be.deep.equal(new Account(accountId, '1234')); + expect(response).to.be.deep.equal(new Account(accountId, "1234")); done(); }) .catch(function (err) { @@ -155,23 +155,23 @@ describe('Server#requestAirdrop', function () { }); }); - it('uses custom friendbotUrl if passed', function (done) { - const friendbotUrl = 'https://custom-friendbot.stellar.org'; + it("uses custom friendbotUrl if passed", function (done) { + const friendbotUrl = "https://custom-friendbot.stellar.org"; const accountId = - 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI'; + "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI"; - const result_meta_xdr = transactionMetaFor(accountId, '1234').toXDR( - 'base64' + const result_meta_xdr = transactionMetaFor(accountId, "1234").toXDR( + "base64" ); this.axiosMock - .expects('post') + .expects("post") .withArgs(`${friendbotUrl}?addr=${accountId}`) .returns(Promise.resolve({ data: { result_meta_xdr } })); this.server .requestAirdrop(accountId, friendbotUrl) .then(function (response) { - expect(response).to.be.deep.equal(new Account(accountId, '1234')); + expect(response).to.be.deep.equal(new Account(accountId, "1234")); done(); }) .catch(function (err) { @@ -179,25 +179,25 @@ describe('Server#requestAirdrop', function () { }); }); - it('rejects invalid addresses', function (done) { - const friendbotUrl = 'https://friendbot.stellar.org'; - const accountId = 'addr&injected=1'; + it("rejects invalid addresses", function (done) { + const friendbotUrl = "https://friendbot.stellar.org"; + const accountId = "addr&injected=1"; mockGetNetwork.call(this, friendbotUrl); this.axiosMock - .expects('post') + .expects("post") .withArgs(`${friendbotUrl}?addr=addr%26injected%3D1`) .returns( Promise.reject({ response: { status: 400, - type: 'https://stellar.org/horizon-errors/bad_request', - title: 'Bad Request', - detail: 'The request you sent was invalid in some way.', + type: "https://stellar.org/horizon-errors/bad_request", + title: "Bad Request", + detail: "The request you sent was invalid in some way.", extras: { - invalid_field: 'addr', + invalid_field: "addr", reason: - 'base32 decode failed: illegal base32 data at input byte 7' + "base32 decode failed: illegal base32 data at input byte 7" } } }) @@ -206,49 +206,49 @@ describe('Server#requestAirdrop', function () { this.server .requestAirdrop(accountId) .then(function (_) { - done(new Error('Should have thrown')); + done(new Error("Should have thrown")); }) .catch(function (err) { - expect(err.response.extras.reason).to.include('base32 decode failed'); + expect(err.response.extras.reason).to.include("base32 decode failed"); done(); }); }); - it('throws if there is no friendbotUrl set', function (done) { - const accountId = 'addr&injected=1'; + it("throws if there is no friendbotUrl set", function (done) { + const accountId = "addr&injected=1"; mockGetNetwork.call(this, undefined); this.server .requestAirdrop(accountId) .then(function (_) { - done(new Error('Should have thrown')); + done(new Error("Should have thrown")); }) .catch(function (err) { expect(err.message).to.be.equal( - 'No friendbot URL configured for current network' + "No friendbot URL configured for current network" ); done(); }); }); - it('throws if the request fails', function (done) { - const friendbotUrl = 'https://friendbot.stellar.org'; + it("throws if the request fails", function (done) { + const friendbotUrl = "https://friendbot.stellar.org"; const accountId = - 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI'; + "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI"; mockGetNetwork.call(this, friendbotUrl); this.axiosMock - .expects('post') + .expects("post") .withArgs(`${friendbotUrl}?addr=${accountId}`) - .returns(Promise.reject(new Error('Request failed'))); + .returns(Promise.reject(new Error("Request failed"))); this.server .requestAirdrop(accountId) .then(function (_) { - done(new Error('Should have thrown')); + done(new Error("Should have thrown")); }) .catch(function (err) { - expect(err.message).to.be.equal('Request failed'); + expect(err.message).to.be.equal("Request failed"); done(); }); }); diff --git a/test/unit/server/soroban/send_transaction_test.js b/test/unit/server/soroban/send_transaction_test.js index 5431acf5b..8a3833df6 100644 --- a/test/unit/server/soroban/send_transaction_test.js +++ b/test/unit/server/soroban/send_transaction_test.js @@ -1,8 +1,8 @@ const { SorobanServer } = StellarSdk; -describe('Server#sendTransaction', function () { +describe("Server#sendTransaction", function () { let keypair = StellarSdk.Keypair.random(); - let account = new StellarSdk.Account(keypair.publicKey(), '56199647068161'); + let account = new StellarSdk.Account(keypair.publicKey(), "56199647068161"); beforeEach(function () { this.server = new SorobanServer(serverUrl); @@ -15,9 +15,9 @@ describe('Server#sendTransaction', function () { .addOperation( StellarSdk.Operation.payment({ destination: - 'GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW', + "GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW", asset: StellarSdk.Asset.native(), - amount: '100.50' + amount: "100.50" }) ) .setTimeout(StellarSdk.TimeoutInfinite) @@ -25,8 +25,8 @@ describe('Server#sendTransaction', function () { transaction.sign(keypair); this.transaction = transaction; - this.hash = this.transaction.hash().toString('hex'); - this.blob = transaction.toEnvelope().toXDR().toString('base64'); + this.hash = this.transaction.hash().toString("hex"); + this.blob = transaction.toEnvelope().toXDR().toString("base64"); }); afterEach(function () { @@ -34,18 +34,18 @@ describe('Server#sendTransaction', function () { this.axiosMock.restore(); }); - it('sends a transaction', function (done) { + it("sends a transaction", function (done) { this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'sendTransaction', + method: "sendTransaction", params: [this.blob] }) .returns( Promise.resolve({ - data: { id: 1, result: { id: this.hash, status: 'PENDING' } } + data: { id: 1, result: { id: this.hash, status: "PENDING" } } }) ); @@ -58,11 +58,11 @@ describe('Server#sendTransaction', function () { done(err); }); }); - xit('adds metadata - tx was too small and was immediately deleted'); - xit('adds metadata, order immediately fills'); - xit('adds metadata, order is open'); - xit('adds metadata, partial fill'); - xit('doesnt add metadata to non-offers'); - xit('adds metadata about offers, even if some ops are not'); - xit('submits fee bump transactions'); + xit("adds metadata - tx was too small and was immediately deleted"); + xit("adds metadata, order immediately fills"); + xit("adds metadata, order is open"); + xit("adds metadata, partial fill"); + xit("doesnt add metadata to non-offers"); + xit("adds metadata about offers, even if some ops are not"); + xit("submits fee bump transactions"); }); diff --git a/test/unit/server/soroban/simulate_transaction_test.js b/test/unit/server/soroban/simulate_transaction_test.js index 9e7a0b7e4..f59a00b6a 100644 --- a/test/unit/server/soroban/simulate_transaction_test.js +++ b/test/unit/server/soroban/simulate_transaction_test.js @@ -8,9 +8,9 @@ const { xdr } = StellarSdk; -describe('Server#simulateTransaction', function () { +describe("Server#simulateTransaction", function () { let keypair = Keypair.random(); - let contractId = 'CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM'; + let contractId = "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM"; let contract = new StellarSdk.Contract(contractId); let address = contract.address().toScAddress(); @@ -23,9 +23,9 @@ describe('Server#simulateTransaction', function () { transactionData: new SorobanDataBuilder(simulationResponse.transactionData), result: { auth: simulationResponse.results[0].auth.map((entry) => - xdr.SorobanAuthorizationEntry.fromXDR(entry, 'base64') + xdr.SorobanAuthorizationEntry.fromXDR(entry, "base64") ), - retval: xdr.ScVal.fromXDR(simulationResponse.results[0].xdr, 'base64') + retval: xdr.ScVal.fromXDR(simulationResponse.results[0].xdr, "base64") }, cost: simulationResponse.cost, _parsed: true @@ -35,19 +35,19 @@ describe('Server#simulateTransaction', function () { this.server = new SorobanServer(serverUrl); this.axiosMock = sinon.mock(SorobanAxiosClient); const source = new Account( - 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI', - '1' + "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI", + "1" ); function emptyContractTransaction() { return new StellarSdk.TransactionBuilder(source, { fee: 100 }) - .setNetworkPassphrase('Test') + .setNetworkPassphrase("Test") .setTimeout(StellarSdk.TimeoutInfinite) .addOperation( StellarSdk.Operation.invokeHostFunction({ func: new xdr.HostFunction.hostFunctionTypeInvokeContract( new xdr.InvokeContractArgs({ contractAddress: address, - functionName: 'hello', + functionName: "hello", args: [] }) ), @@ -61,8 +61,8 @@ describe('Server#simulateTransaction', function () { transaction.sign(keypair); this.transaction = transaction; - this.hash = this.transaction.hash().toString('hex'); - this.blob = transaction.toEnvelope().toXDR().toString('base64'); + this.hash = this.transaction.hash().toString("hex"); + this.blob = transaction.toEnvelope().toXDR().toString("base64"); }); afterEach(function () { @@ -70,13 +70,13 @@ describe('Server#simulateTransaction', function () { this.axiosMock.restore(); }); - it('simulates a transaction', function (done) { + it("simulates a transaction", function (done) { this.axiosMock - .expects('post') + .expects("post") .withArgs(serverUrl, { - jsonrpc: '2.0', + jsonrpc: "2.0", id: 1, - method: 'simulateTransaction', + method: "simulateTransaction", params: [this.blob] }) .returns( @@ -94,7 +94,7 @@ describe('Server#simulateTransaction', function () { }); }); - it('works when there are no results', function () { + it("works when there are no results", function () { const simResponse = baseSimulationResponse(); const parsedCopy = cloneSimulation(parsedSimulationResponse); delete parsedCopy.result; @@ -104,7 +104,7 @@ describe('Server#simulateTransaction', function () { expect(StellarSdk.SorobanRpc.isSimulationSuccess(parsed)).to.be.true; }); - it('works with no auth', function () { + it("works with no auth", function () { const simResponse = invokeSimulationResponse(address); delete simResponse.results[0].auth; @@ -122,12 +122,12 @@ describe('Server#simulateTransaction', function () { expect(StellarSdk.SorobanRpc.isSimulationSuccess(parsed)).to.be.true; }); - xit('works with restoration', function () { + xit("works with restoration", function () { const simResponse = invokeSimulationResponseWithRestoration(address); const expected = cloneSimulation(parsedSimulationResponse); expected.restorePreamble = { - minResourceFee: '51', + minResourceFee: "51", transactionData: new SorobanDataBuilder() }; @@ -136,7 +136,7 @@ describe('Server#simulateTransaction', function () { expect(StellarSdk.SorobanRpc.isSimulationRestore(parsed)).to.be.true; }); - it('works with errors', function () { + it("works with errors", function () { let simResponse = simulationResponseError(); const expected = cloneSimulation(parsedSimulationResponse); @@ -145,7 +145,7 @@ describe('Server#simulateTransaction', function () { delete expected.cost; delete expected.transactionData; delete expected.minResourceFee; - expected.error = 'This is an error'; + expected.error = "This is an error"; expected.events = []; const parsed = StellarSdk.parseRawSimulation(simResponse); @@ -153,7 +153,7 @@ describe('Server#simulateTransaction', function () { expect(StellarSdk.SorobanRpc.isSimulationError(parsed)).to.be.true; }); - xit('simulates fee bump transactions'); + xit("simulates fee bump transactions"); }); function cloneSimulation(sim) { @@ -176,7 +176,7 @@ function cloneSimulation(sim) { function buildAuthEntry(address) { if (!address) { - throw new Error('where address?'); + throw new Error("where address?"); } // Basic fake invocation @@ -186,7 +186,7 @@ function buildAuthEntry(address) { xdr.SorobanAuthorizedFunction.sorobanAuthorizedFunctionTypeContractFn( new xdr.InvokeContractArgs({ contractAddress: address, - functionName: 'test', + functionName: "test", args: [] }) ) @@ -199,8 +199,8 @@ function buildAuthEntry(address) { function invokeSimulationResponse(address) { return baseSimulationResponse([ { - auth: [buildAuthEntry(address)].map((entry) => entry.toXDR('base64')), - xdr: xdr.ScVal.scvU32(0).toXDR('base64') + auth: [buildAuthEntry(address)].map((entry) => entry.toXDR("base64")), + xdr: xdr.ScVal.scvU32(0).toXDR("base64") } ]); } @@ -210,7 +210,7 @@ function simulationResponseError(events) { id: 1, ...(events !== undefined && { events }), latestLedger: 3, - error: 'This is an error' + error: "This is an error" }; } @@ -219,12 +219,12 @@ function baseSimulationResponse(results) { id: 1, events: [], latestLedger: 3, - minResourceFee: '15', - transactionData: new SorobanDataBuilder().build().toXDR('base64'), + minResourceFee: "15", + transactionData: new SorobanDataBuilder().build().toXDR("base64"), ...(results !== undefined && { results }), cost: { - cpuInsns: '1', - memBytes: '2' + cpuInsns: "1", + memBytes: "2" } }; } @@ -233,39 +233,39 @@ function invokeSimulationResponseWithRestoration(address) { return { ...invokeSimulationResponse(address), restorePreamble: { - minResourceFee: '51', - transactionData: new SorobanDataBuilder().build().toXDR('base64') + minResourceFee: "51", + transactionData: new SorobanDataBuilder().build().toXDR("base64") } }; } -describe('works with real responses', function () { +describe("works with real responses", function () { const schema = { transactionData: - 'AAAAAAAAAAIAAAAGAAAAAa/6eoLeofDK5ksPljSZ7t/rAj/XR18e40fCB9LBugstAAAAFAAAAAEAAAAHqA0LEZLq3WL+N3rBQLTWuPqdV3Vv6XIAGeBJaz1wMdsAAAAAABg1gAAAAxwAAAAAAAAAAAAAAAk=', - minResourceFee: '27889', + "AAAAAAAAAAIAAAAGAAAAAa/6eoLeofDK5ksPljSZ7t/rAj/XR18e40fCB9LBugstAAAAFAAAAAEAAAAHqA0LEZLq3WL+N3rBQLTWuPqdV3Vv6XIAGeBJaz1wMdsAAAAAABg1gAAAAxwAAAAAAAAAAAAAAAk=", + minResourceFee: "27889", events: [ - 'AAAAAQAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgr/p6gt6h8MrmSw+WNJnu3+sCP9dHXx7jR8IH0sG6Cy0AAAAPAAAABWhlbGxvAAAAAAAADwAAAAVBbG9oYQAAAA==', - 'AAAAAQAAAAAAAAABr/p6gt6h8MrmSw+WNJnu3+sCP9dHXx7jR8IH0sG6Cy0AAAACAAAAAAAAAAIAAAAPAAAACWZuX3JldHVybgAAAAAAAA8AAAAFaGVsbG8AAAAAAAAQAAAAAQAAAAIAAAAPAAAABUhlbGxvAAAAAAAADwAAAAVBbG9oYQAAAA==' + "AAAAAQAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgr/p6gt6h8MrmSw+WNJnu3+sCP9dHXx7jR8IH0sG6Cy0AAAAPAAAABWhlbGxvAAAAAAAADwAAAAVBbG9oYQAAAA==", + "AAAAAQAAAAAAAAABr/p6gt6h8MrmSw+WNJnu3+sCP9dHXx7jR8IH0sG6Cy0AAAACAAAAAAAAAAIAAAAPAAAACWZuX3JldHVybgAAAAAAAA8AAAAFaGVsbG8AAAAAAAAQAAAAAQAAAAIAAAAPAAAABUhlbGxvAAAAAAAADwAAAAVBbG9oYQAAAA==" ], results: [ { auth: [], - xdr: 'AAAAEAAAAAEAAAACAAAADwAAAAVIZWxsbwAAAAAAAA8AAAAFQWxvaGEAAAA=' + xdr: "AAAAEAAAAAEAAAACAAAADwAAAAVIZWxsbwAAAAAAAA8AAAAFQWxvaGEAAAA=" } ], cost: { - cpuInsns: '1322134', - memBytes: '1207047' + cpuInsns: "1322134", + memBytes: "1207047" }, restorePreamble: { - transactionData: '', - minResourceFee: '0' + transactionData: "", + minResourceFee: "0" }, - latestLedger: '2634' + latestLedger: "2634" }; - it('parses the schema', function () { + it("parses the schema", function () { expect(StellarSdk.isSimulationRaw(schema)).to.be.true; const parsed = StellarSdk.parseRawSimulation(schema); diff --git a/test/unit/server_check_memo_required_test.js b/test/unit/server_check_memo_required_test.js index f536264bb..d9af01947 100644 --- a/test/unit/server_check_memo_required_test.js +++ b/test/unit/server_check_memo_required_test.js @@ -8,7 +8,7 @@ function buildTransaction(destination, operations = [], builderOpts = {}) { }; Object.assign(txBuilderOpts, builderOpts); let keypair = StellarSdk.Keypair.random(); - let account = new StellarSdk.Account(keypair.publicKey(), '56199647068161'); + let account = new StellarSdk.Account(keypair.publicKey(), "56199647068161"); let transaction = new StellarSdk.TransactionBuilder( account, txBuilderOpts @@ -16,7 +16,7 @@ function buildTransaction(destination, operations = [], builderOpts = {}) { StellarSdk.Operation.payment({ destination: destination, asset: StellarSdk.Asset.native(), - amount: '100.50' + amount: "100.50" }) ); @@ -28,7 +28,7 @@ function buildTransaction(destination, operations = [], builderOpts = {}) { if (builderOpts.feeBump) { return StellarSdk.TransactionBuilder.buildFeeBumpTransaction( keypair, - '200', + "200", transaction, txBuilderOpts.networkPassphrase ); @@ -47,7 +47,7 @@ function buildAccount(id, data = {}) { }, id: id, account_id: id, - sequence: '3298702387052545', + sequence: "3298702387052545", subentry_count: 1, last_modified_ledger: 768061, thresholds: { @@ -62,17 +62,17 @@ function buildAccount(id, data = {}) { }, balances: [ { - balance: '9999.9999900', - buying_liabilities: '0.0000000', - selling_liabilities: '0.0000000', - asset_type: 'native' + balance: "9999.9999900", + buying_liabilities: "0.0000000", + selling_liabilities: "0.0000000", + asset_type: "native" } ], signers: [ { weight: 1, key: id, - type: 'ed25519_public_key' + type: "ed25519_public_key" } ], data: data @@ -85,12 +85,12 @@ function mockAccountRequest(axiosMock, id, status, data = {}) { switch (status) { case 404: response = Promise.reject({ - response: { status: 404, statusText: 'NotFound', data: {} } + response: { status: 404, statusText: "NotFound", data: {} } }); break; case 400: response = Promise.reject({ - response: { status: 400, statusText: 'BadRequestError', data: {} } + response: { status: 400, statusText: "BadRequestError", data: {} } }); break; default: @@ -99,15 +99,15 @@ function mockAccountRequest(axiosMock, id, status, data = {}) { } axiosMock - .expects('get') + .expects("get") .withArgs(sinon.match(`https://horizon-testnet.stellar.org/accounts/${id}`)) .returns(response) .once(); } -describe('server.js check-memo-required', function () { +describe("server.js check-memo-required", function () { beforeEach(function () { - this.server = new HorizonServer('https://horizon-testnet.stellar.org'); + this.server = new HorizonServer("https://horizon-testnet.stellar.org"); this.axiosMock = sinon.mock(HorizonAxiosClient); }); @@ -116,10 +116,10 @@ describe('server.js check-memo-required', function () { this.axiosMock.restore(); }); - it('fails if memo is required', function (done) { - let accountId = 'GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA'; + it("fails if memo is required", function (done) { + let accountId = "GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA"; mockAccountRequest(this.axiosMock, accountId, 200, { - 'config.memo_required': 'MQ==' + "config.memo_required": "MQ==" }); let transaction = buildTransaction(accountId); @@ -127,7 +127,7 @@ describe('server.js check-memo-required', function () { .checkMemoRequired(transaction) .then( function () { - expect.fail('promise should have failed'); + expect.fail("promise should have failed"); }, function (err) { expect(err).to.be.instanceOf(StellarSdk.AccountRequiresMemoError); @@ -141,10 +141,10 @@ describe('server.js check-memo-required', function () { }); }); - it('fee bump - fails if memo is required', function (done) { - let accountId = 'GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA'; + it("fee bump - fails if memo is required", function (done) { + let accountId = "GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA"; mockAccountRequest(this.axiosMock, accountId, 200, { - 'config.memo_required': 'MQ==' + "config.memo_required": "MQ==" }); let transaction = buildTransaction(accountId, [], { feeBump: true }); @@ -152,7 +152,7 @@ describe('server.js check-memo-required', function () { .checkMemoRequired(transaction) .then( function () { - expect.fail('promise should have failed'); + expect.fail("promise should have failed"); }, function (err) { expect(err).to.be.instanceOf(StellarSdk.AccountRequiresMemoError); @@ -167,7 +167,7 @@ describe('server.js check-memo-required', function () { }); it("returns false if account doesn't exist", function (done) { - let accountId = 'GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA'; + let accountId = "GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA"; mockAccountRequest(this.axiosMock, accountId, 404, {}); let transaction = buildTransaction(accountId); @@ -181,8 +181,8 @@ describe('server.js check-memo-required', function () { }); }); - it('returns false if data field is not present', function (done) { - let accountId = 'GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA'; + it("returns false if data field is not present", function (done) { + let accountId = "GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA"; mockAccountRequest(this.axiosMock, accountId, 200, {}); let transaction = buildTransaction(accountId); @@ -196,8 +196,8 @@ describe('server.js check-memo-required', function () { }); }); - it('returns err with client errors', function (done) { - let accountId = 'GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA'; + it("returns err with client errors", function (done) { + let accountId = "GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA"; mockAccountRequest(this.axiosMock, accountId, 400, {}); let transaction = buildTransaction(accountId); @@ -205,7 +205,7 @@ describe('server.js check-memo-required', function () { .checkMemoRequired(transaction) .then( function () { - expect.fail('promise should have failed'); + expect.fail("promise should have failed"); }, function (err) { expect(err).to.be.instanceOf(StellarSdk.NetworkError); @@ -218,14 +218,14 @@ describe('server.js check-memo-required', function () { }); it("doesn't repeat account check if the destination is more than once", function (done) { - let accountId = 'GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA'; + let accountId = "GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA"; mockAccountRequest(this.axiosMock, accountId, 200, {}); let operations = [ StellarSdk.Operation.payment({ destination: accountId, asset: StellarSdk.Asset.native(), - amount: '100.50' + amount: "100.50" }) ]; @@ -241,23 +241,23 @@ describe('server.js check-memo-required', function () { }); }); - it('other operations', function (done) { - let accountId = 'GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA'; + it("other operations", function (done) { + let accountId = "GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA"; mockAccountRequest(this.axiosMock, accountId, 200, {}); const destinations = [ - 'GASGNGGXDNJE5C2O7LDCATIVYSSTZKB24SHYS6F4RQT4M4IGNYXB4TIV', - 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', - 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' + "GASGNGGXDNJE5C2O7LDCATIVYSSTZKB24SHYS6F4RQT4M4IGNYXB4TIV", + "GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB", + "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ" ]; const usd = new StellarSdk.Asset( - 'USD', - 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB' + "USD", + "GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB" ); const eur = new StellarSdk.Asset( - 'EUR', - 'GDTNXRLOJD2YEBPKK7KCMR7J33AAG5VZXHAJTHIG736D6LVEFLLLKPDL' + "EUR", + "GDTNXRLOJD2YEBPKK7KCMR7J33AAG5VZXHAJTHIG736D6LVEFLLLKPDL" ); const liquidityPoolAsset = new StellarSdk.LiquidityPoolAsset(eur, usd, 30); @@ -267,18 +267,18 @@ describe('server.js check-memo-required', function () { }), StellarSdk.Operation.pathPaymentStrictReceive({ sendAsset: StellarSdk.Asset.native(), - sendMax: '5.0000000', + sendMax: "5.0000000", destination: destinations[1], destAsset: StellarSdk.Asset.native(), - destAmount: '5.50', + destAmount: "5.50", path: [usd, eur] }), StellarSdk.Operation.pathPaymentStrictSend({ sendAsset: StellarSdk.Asset.native(), - sendAmount: '5.0000000', + sendAmount: "5.0000000", destination: destinations[2], destAsset: StellarSdk.Asset.native(), - destMin: '5.50', + destMin: "5.50", path: [usd, eur] }), StellarSdk.Operation.changeTrust({ @@ -302,9 +302,9 @@ describe('server.js check-memo-required', function () { done(err); }); }); - it('checks for memo required by default', function (done) { - let accountId = 'GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA'; - let memo = StellarSdk.Memo.text('42'); + it("checks for memo required by default", function (done) { + let accountId = "GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA"; + let memo = StellarSdk.Memo.text("42"); let transaction = buildTransaction(accountId, [], { memo }); this.server .checkMemoRequired(transaction) diff --git a/test/unit/server_test.js b/test/unit/server_test.js index f89113a2d..64d4fe139 100644 --- a/test/unit/server_test.js +++ b/test/unit/server_test.js @@ -1,9 +1,9 @@ const { HorizonServer } = StellarSdk; -const MockAdapter = require('axios-mock-adapter'); +const MockAdapter = require("axios-mock-adapter"); -describe('server.js non-transaction tests', function () { +describe("server.js non-transaction tests", function () { beforeEach(function () { - this.server = new HorizonServer('https://horizon-live.stellar.org:1337'); + this.server = new HorizonServer("https://horizon-live.stellar.org:1337"); this.axiosMock = sinon.mock(HorizonAxiosClient); StellarSdk.Config.setDefault(); }); @@ -13,31 +13,31 @@ describe('server.js non-transaction tests', function () { this.axiosMock.restore(); }); - describe('Server.constructor', function () { - it('throws error for insecure server', function () { + describe("Server.constructor", function () { + it("throws error for insecure server", function () { expect( - () => new HorizonServer('http://horizon-live.stellar.org:1337') + () => new HorizonServer("http://horizon-live.stellar.org:1337") ).to.throw(/Cannot connect to insecure horizon server/); }); - it('allow insecure server when opts.allowHttp flag is set', function () { + it("allow insecure server when opts.allowHttp flag is set", function () { expect( () => - new HorizonServer('http://horizon-live.stellar.org:1337', { + new HorizonServer("http://horizon-live.stellar.org:1337", { allowHttp: true }) ).to.not.throw(); }); - it('allow insecure server when global Config.allowHttp flag is set', function () { + it("allow insecure server when global Config.allowHttp flag is set", function () { StellarSdk.Config.setAllowHttp(true); expect( - () => new HorizonServer('http://horizon-live.stellar.org:1337') + () => new HorizonServer("http://horizon-live.stellar.org:1337") ).to.not.throw(); }); }); - describe('Server.fetchTimebounds', function () { + describe("Server.fetchTimebounds", function () { let clock; beforeEach(function () { @@ -56,9 +56,9 @@ describe('server.js non-transaction tests', function () { // the next two tests are run in a deliberate order!! // don't change the order!! - it('fetches falls back to local time if fetch is bad', function (done) { + it("fetches falls back to local time if fetch is bad", function (done) { this.axiosMockAdapter - .onGet('https://horizon-live.stellar.org:1337/') + .onGet("https://horizon-live.stellar.org:1337/") .reply(200, {}, {}); this.server @@ -72,14 +72,14 @@ describe('server.js non-transaction tests', function () { }); }); - it('fetches if nothing is recorded', function (done) { + it("fetches if nothing is recorded", function (done) { this.axiosMockAdapter - .onGet('https://horizon-live.stellar.org:1337/') + .onGet("https://horizon-live.stellar.org:1337/") .reply( 200, {}, { - date: 'Wed, 13 Mar 2019 22:15:07 GMT' + date: "Wed, 13 Mar 2019 22:15:07 GMT" } ); @@ -100,50 +100,50 @@ describe('server.js non-transaction tests', function () { }); }); - describe('Server.fetchBaseFee', function () { + describe("Server.fetchBaseFee", function () { let response = { - last_ledger: '256736', - last_ledger_base_fee: '888', - ledger_capacity_usage: '0.18', + last_ledger: "256736", + last_ledger_base_fee: "888", + ledger_capacity_usage: "0.18", max_fee: { - max: '2000', - min: '100', - mode: '2000', - p10: '100', - p20: '100', - p30: '100', - p40: '300', - p50: '650', - p60: '2000', - p70: '2000', - p80: '2000', - p90: '2000', - p95: '2000', - p99: '2000' + max: "2000", + min: "100", + mode: "2000", + p10: "100", + p20: "100", + p30: "100", + p40: "300", + p50: "650", + p60: "2000", + p70: "2000", + p80: "2000", + p90: "2000", + p95: "2000", + p99: "2000" }, fee_charged: { - min: '100', - max: '100', - mode: '100', - p10: '100', - p20: '100', - p30: '100', - p40: '100', - p50: '100', - p60: '100', - p70: '100', - p80: '100', - p90: '100', - p95: '100', - p99: '100' + min: "100", + max: "100", + mode: "100", + p10: "100", + p20: "100", + p30: "100", + p40: "100", + p50: "100", + p60: "100", + p70: "100", + p80: "100", + p90: "100", + p95: "100", + p99: "100" } }; - it('returns the base reserve', function (done) { + it("returns the base reserve", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( - sinon.match('https://horizon-live.stellar.org:1337/fee_stats') + sinon.match("https://horizon-live.stellar.org:1337/fee_stats") ) .returns(Promise.resolve({ data: response })); @@ -158,11 +158,11 @@ describe('server.js non-transaction tests', function () { }); }); - it('returns default value (100) if last_ledger_base_fee is missing', function (done) { + it("returns default value (100) if last_ledger_base_fee is missing", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( - sinon.match('https://horizon-live.stellar.org:1337/fee_stats') + sinon.match("https://horizon-live.stellar.org:1337/fee_stats") ) .returns(Promise.resolve({ data: {} })); @@ -178,50 +178,50 @@ describe('server.js non-transaction tests', function () { }); }); - describe('Server.feeStats', function () { + describe("Server.feeStats", function () { let response = { - last_ledger: '256736', - last_ledger_base_fee: '100', - ledger_capacity_usage: '0.18', + last_ledger: "256736", + last_ledger_base_fee: "100", + ledger_capacity_usage: "0.18", max_fee: { - max: '2000', - min: '100', - mode: '2000', - p10: '100', - p20: '100', - p30: '100', - p40: '300', - p50: '650', - p60: '2000', - p70: '2000', - p80: '2000', - p90: '2000', - p95: '2000', - p99: '2000' + max: "2000", + min: "100", + mode: "2000", + p10: "100", + p20: "100", + p30: "100", + p40: "300", + p50: "650", + p60: "2000", + p70: "2000", + p80: "2000", + p90: "2000", + p95: "2000", + p99: "2000" }, fee_charged: { - min: '100', - max: '100', - mode: '100', - p10: '100', - p20: '100', - p30: '100', - p40: '100', - p50: '100', - p60: '100', - p70: '100', - p80: '100', - p90: '100', - p95: '100', - p99: '100' + min: "100", + max: "100", + mode: "100", + p10: "100", + p20: "100", + p30: "100", + p40: "100", + p50: "100", + p60: "100", + p70: "100", + p80: "100", + p90: "100", + p95: "100", + p99: "100" } }; - it('returns the base reserve', function (done) { + it("returns the base reserve", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( - sinon.match('https://horizon-live.stellar.org:1337/fee_stats') + sinon.match("https://horizon-live.stellar.org:1337/fee_stats") ) .returns(Promise.resolve({ data: response })); @@ -237,7 +237,7 @@ describe('server.js non-transaction tests', function () { }); }); - describe('Server.loadAccount', function () { + describe("Server.loadAccount", function () { //prettier-ignore let accountResponse = { "_links": { @@ -319,36 +319,36 @@ describe('server.js non-transaction tests', function () { "data": {} }; - it('returns AccountResponse object', function (done) { + it("returns AccountResponse object", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts/GBAH7FQMC3CZJ4WD6GE7G7YXCIU36LC2IHXQ7D5MQAUO4PODOWIVLSFS' + "https://horizon-live.stellar.org:1337/accounts/GBAH7FQMC3CZJ4WD6GE7G7YXCIU36LC2IHXQ7D5MQAUO4PODOWIVLSFS" ) ) .returns(Promise.resolve({ data: accountResponse })); this.server - .loadAccount('GBAH7FQMC3CZJ4WD6GE7G7YXCIU36LC2IHXQ7D5MQAUO4PODOWIVLSFS') + .loadAccount("GBAH7FQMC3CZJ4WD6GE7G7YXCIU36LC2IHXQ7D5MQAUO4PODOWIVLSFS") .then((response) => { // Response data expect(response.account_id).to.be.equal( - 'GBAH7FQMC3CZJ4WD6GE7G7YXCIU36LC2IHXQ7D5MQAUO4PODOWIVLSFS' + "GBAH7FQMC3CZJ4WD6GE7G7YXCIU36LC2IHXQ7D5MQAUO4PODOWIVLSFS" ); expect(response.subentry_count).to.be.equal(5); - expect(response.transactions).to.be.a('function'); - expect(response.operations).to.be.a('function'); - expect(response.payments).to.be.a('function'); - expect(response.effects).to.be.a('function'); - expect(response.offers).to.be.a('function'); + expect(response.transactions).to.be.a("function"); + expect(response.operations).to.be.a("function"); + expect(response.payments).to.be.a("function"); + expect(response.effects).to.be.a("function"); + expect(response.offers).to.be.a("function"); expect(Object.keys(response.flags).length).to.be.equal(4); // AccountResponse methods - expect(response.sequenceNumber()).to.be.equal('5387216134078475'); - expect(response.sequence).to.be.equal('5387216134078475'); + expect(response.sequenceNumber()).to.be.equal("5387216134078475"); + expect(response.sequence).to.be.equal("5387216134078475"); response.incrementSequenceNumber(); - expect(response.sequenceNumber()).to.be.equal('5387216134078476'); - expect(response.sequence).to.be.equal('5387216134078476'); + expect(response.sequenceNumber()).to.be.equal("5387216134078476"); + expect(response.sequence).to.be.equal("5387216134078476"); done(); }) .catch(function (err) { @@ -357,59 +357,59 @@ describe('server.js non-transaction tests', function () { }); }); - describe('Server._sendResourceRequest', function () { - describe('requests all ledgers', function () { + describe("Server._sendResourceRequest", function () { + describe("requests all ledgers", function () { let ledgersResponse = { _embedded: { records: [ { _links: { effects: { - href: '/ledgers/1/effects{?cursor,limit,order}', + href: "/ledgers/1/effects{?cursor,limit,order}", templated: true }, operations: { - href: '/ledgers/1/operations{?cursor,limit,order}', + href: "/ledgers/1/operations{?cursor,limit,order}", templated: true }, self: { - href: '/ledgers/1' + href: "/ledgers/1" }, transactions: { - href: '/ledgers/1/transactions{?cursor,limit,order}', + href: "/ledgers/1/transactions{?cursor,limit,order}", templated: true } }, - id: '63d98f536ee68d1b27b5b89f23af5311b7569a24faf1403ad0b52b633b07be99', - paging_token: '4294967296', - hash: '63d98f536ee68d1b27b5b89f23af5311b7569a24faf1403ad0b52b633b07be99', + id: "63d98f536ee68d1b27b5b89f23af5311b7569a24faf1403ad0b52b633b07be99", + paging_token: "4294967296", + hash: "63d98f536ee68d1b27b5b89f23af5311b7569a24faf1403ad0b52b633b07be99", sequence: 1, transaction_count: 0, operation_count: 0, tx_set_operation_count: 0, - closed_at: '1970-01-01T00:00:00Z' + closed_at: "1970-01-01T00:00:00Z" } ] }, _links: { next: { - href: '/ledgers?order=asc\u0026limit=1\u0026cursor=4294967296' + href: "/ledgers?order=asc\u0026limit=1\u0026cursor=4294967296" }, prev: { - href: '/ledgers?order=desc\u0026limit=1\u0026cursor=4294967296' + href: "/ledgers?order=desc\u0026limit=1\u0026cursor=4294967296" }, self: { - href: '/ledgers?order=asc\u0026limit=1\u0026cursor=' + href: "/ledgers?order=asc\u0026limit=1\u0026cursor=" } } }; - describe('without options', function () { - it('requests the correct endpoint', function (done) { + describe("without options", function () { + it("requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( - sinon.match('https://horizon-live.stellar.org:1337/ledgers') + sinon.match("https://horizon-live.stellar.org:1337/ledgers") ) .returns(Promise.resolve({ data: ledgersResponse })); @@ -420,8 +420,8 @@ describe('server.js non-transaction tests', function () { expect(response.records).to.be.deep.equal( ledgersResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -430,58 +430,58 @@ describe('server.js non-transaction tests', function () { }); }); - describe('with options', function () { + describe("with options", function () { beforeEach(function () { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/ledgers?limit=1&cursor=b&order=asc' + "https://horizon-live.stellar.org:1337/ledgers?limit=1&cursor=b&order=asc" ) ) .returns(Promise.resolve({ data: ledgersResponse })); }); - it('requests the correct endpoint', function (done) { + it("requests the correct endpoint", function (done) { this.server .ledgers() - .limit('1') - .cursor('b') - .order('asc') + .limit("1") + .cursor("b") + .order("asc") .call() .then((response) => { expect(response.records).to.be.deep.equal( ledgersResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }); }); - it('can call .next() on the result to retrieve the next page', function (done) { + it("can call .next() on the result to retrieve the next page", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/ledgers?order=asc&limit=1&cursor=4294967296' + "https://horizon-live.stellar.org:1337/ledgers?order=asc&limit=1&cursor=4294967296" ) ) .returns(Promise.resolve({ data: ledgersResponse })); this.server .ledgers() - .limit('1') - .cursor('b') - .order('asc') + .limit("1") + .cursor("b") + .order("asc") .call() .then(function (page) { page.next().then(function (response) { expect(response.records).to.be.deep.equal( ledgersResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }); }); @@ -489,45 +489,45 @@ describe('server.js non-transaction tests', function () { }); }); - describe('requests a single ledger', function () { + describe("requests a single ledger", function () { let singleLedgerResponse = { _links: { effects: { - href: '/ledgers/1/effects{?cursor,limit,order}', + href: "/ledgers/1/effects{?cursor,limit,order}", templated: true }, operations: { - href: '/ledgers/1/operations{?cursor,limit,order}', + href: "/ledgers/1/operations{?cursor,limit,order}", templated: true }, self: { - href: '/ledgers/1' + href: "/ledgers/1" }, transactions: { - href: '/ledgers/1/transactions{?cursor,limit,order}', + href: "/ledgers/1/transactions{?cursor,limit,order}", templated: true } }, - id: '63d98f536ee68d1b27b5b89f23af5311b7569a24faf1403ad0b52b633b07be99', - paging_token: '4294967296', - hash: '63d98f536ee68d1b27b5b89f23af5311b7569a24faf1403ad0b52b633b07be99', + id: "63d98f536ee68d1b27b5b89f23af5311b7569a24faf1403ad0b52b633b07be99", + paging_token: "4294967296", + hash: "63d98f536ee68d1b27b5b89f23af5311b7569a24faf1403ad0b52b633b07be99", sequence: 1, transaction_count: 0, operation_count: 0, tx_set_operation_count: 0, - closed_at: '1970-01-01T00:00:00Z' + closed_at: "1970-01-01T00:00:00Z" }; - describe('for a non existent ledger', function () { - it('throws a NotFoundError', function (done) { + describe("for a non existent ledger", function () { + it("throws a NotFoundError", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( - sinon.match('https://horizon-live.stellar.org:1337/ledgers/1') + sinon.match("https://horizon-live.stellar.org:1337/ledgers/1") ) .returns( Promise.reject({ - response: { status: 404, statusText: 'NotFound', data: {} } + response: { status: 404, statusText: "NotFound", data: {} } }) ); @@ -547,18 +547,18 @@ describe('server.js non-transaction tests', function () { }); }); }); - describe('without options', function () { - it('requests the correct endpoint', function (done) { + describe("without options", function () { + it("requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( - sinon.match('https://horizon-live.stellar.org:1337/ledgers/1') + sinon.match("https://horizon-live.stellar.org:1337/ledgers/1") ) .returns(Promise.resolve({ data: singleLedgerResponse })); this.server .ledgers() - .ledger('1') + .ledger("1") .call() .then(function (response) { expect(response).to.be.deep.equal(singleLedgerResponse); @@ -570,23 +570,23 @@ describe('server.js non-transaction tests', function () { }); }); - describe('with options', function () { - it('requests the correct endpoint', function (done) { + describe("with options", function () { + it("requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/ledgers/1?limit=1&cursor=b&order=asc' + "https://horizon-live.stellar.org:1337/ledgers/1?limit=1&cursor=b&order=asc" ) ) .returns(Promise.resolve({ data: singleLedgerResponse })); this.server .ledgers() - .ledger('1') - .limit('1') - .cursor('b') - .order('asc') + .ledger("1") + .limit("1") + .cursor("b") + .order("asc") .call() .then(function (response) { expect(response).to.be.deep.equal(singleLedgerResponse); @@ -599,17 +599,17 @@ describe('server.js non-transaction tests', function () { }); }); - describe('requests a sub resource', function (done) { + describe("requests a sub resource", function (done) { let transactionsResponse = { _links: { self: { - href: 'https://horizon.stellar.org/transactions?order=desc\u0026limit=1\u0026cursor=' + href: "https://horizon.stellar.org/transactions?order=desc\u0026limit=1\u0026cursor=" }, next: { - href: 'https://horizon.stellar.org/transactions?order=desc\u0026limit=1\u0026cursor=34156680904183808' + href: "https://horizon.stellar.org/transactions?order=desc\u0026limit=1\u0026cursor=34156680904183808" }, prev: { - href: 'https://horizon.stellar.org/transactions?order=asc\u0026limit=1\u0026cursor=34156680904183808' + href: "https://horizon.stellar.org/transactions?order=asc\u0026limit=1\u0026cursor=34156680904183808" } }, _embedded: { @@ -617,70 +617,70 @@ describe('server.js non-transaction tests', function () { { _links: { self: { - href: 'https://horizon.stellar.org/transactions/c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1' + href: "https://horizon.stellar.org/transactions/c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1" }, account: { - href: 'https://horizon.stellar.org/accounts/GBURK32BMC7XORYES62HDKY7VTA5MO7JYBDH7KTML4EPN4BV2MIRQOVR' + href: "https://horizon.stellar.org/accounts/GBURK32BMC7XORYES62HDKY7VTA5MO7JYBDH7KTML4EPN4BV2MIRQOVR" }, ledger: { - href: 'https://horizon.stellar.org/ledgers/7952722' + href: "https://horizon.stellar.org/ledgers/7952722" }, operations: { - href: 'https://horizon.stellar.org/transactions/c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1/operations{?cursor,limit,order}', + href: "https://horizon.stellar.org/transactions/c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1/operations{?cursor,limit,order}", templated: true }, effects: { - href: 'https://horizon.stellar.org/transactions/c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1/effects{?cursor,limit,order}', + href: "https://horizon.stellar.org/transactions/c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1/effects{?cursor,limit,order}", templated: true }, precedes: { - href: 'https://horizon.stellar.org/transactions?order=asc\u0026cursor=34156680904183808' + href: "https://horizon.stellar.org/transactions?order=asc\u0026cursor=34156680904183808" }, succeeds: { - href: 'https://horizon.stellar.org/transactions?order=desc\u0026cursor=34156680904183808' + href: "https://horizon.stellar.org/transactions?order=desc\u0026cursor=34156680904183808" } }, - id: 'c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1', - paging_token: '34156680904183808', - hash: 'c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1', + id: "c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1", + paging_token: "34156680904183808", + hash: "c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1", ledger: 7952722, - created_at: '2016-12-09T12:36:51Z', + created_at: "2016-12-09T12:36:51Z", source_account: - 'GBURK32BMC7XORYES62HDKY7VTA5MO7JYBDH7KTML4EPN4BV2MIRQOVR', - source_account_sequence: '25631492944168311', + "GBURK32BMC7XORYES62HDKY7VTA5MO7JYBDH7KTML4EPN4BV2MIRQOVR", + source_account_sequence: "25631492944168311", fee_charged: 3600, max_fee: 3600, operation_count: 4, envelope_xdr: - 'AAAAAGkVb0Fgv3dHBJe0casfrMHWO+nARn+qbF8I9vA10xEYAAABkABbD7UAAAV3AAAAAAAAAAAAAAAEAAAAAAAAAAMAAAABRlVOVAAAAABpigEf7e9h5IpePeEXCoPJPqY8IRt8hpneL5+OXfZ45QAAAAAAAAAABfXhAEeeSWkAKXANAAAAAAAAB74AAAABAAAAAGkVb0Fgv3dHBJe0casfrMHWO+nARn+qbF8I9vA10xEYAAAAAwAAAAAAAAABRlVOVAAAAABpigEf7e9h5IpePeEXCoPJPqY8IRt8hpneL5+OXfZ45QAAAApNO6TmAEeYrnXHsdUAAAAAAAAHvwAAAAEAAAAAaRVvQWC/d0cEl7Rxqx+swdY76cBGf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AABVVNEAAAAAABpigEf7e9h5IpePeEXCoPJPqY8IRt8hpneL5+OXfZ45QAAAAAAAAAABkQTwCl6AxMAGo+PAAAAAAAAAAAAAAAA", fee_meta_xdr: - 'AAAAAgAAAAMAeVZcAAAAAAAAAABpFW9BYL93RwSXtHGrH6zB1jvpwEZ/qmxfCPbwNdMRGAAAABc+8zU9AFsPtQAABXYAAAASAAAAAAAAAAAAAAAPZnVudHJhY2tlci5zaXRlAAEAAAAAAAAAAAAAAAAAAAAAAAABAHlZUgAAAAAAAAAAaRVvQWC/d0cEl7Rxqx+swdY76cBGf6psXwj28DXTERgAAAAXPvMzrQBbD7UAAAV3AAAAEgAAAAAAAAAAAAAAD2Z1bnRyYWNrZXIuc2l0ZQABAAAAAAAAAAAAAAAAAAAA', - memo_type: 'none', + "AAAAAgAAAAMAeVZcAAAAAAAAAABpFW9BYL93RwSXtHGrH6zB1jvpwEZ/qmxfCPbwNdMRGAAAABc+8zU9AFsPtQAABXYAAAASAAAAAAAAAAAAAAAPZnVudHJhY2tlci5zaXRlAAEAAAAAAAAAAAAAAAAAAAAAAAABAHlZUgAAAAAAAAAAaRVvQWC/d0cEl7Rxqx+swdY76cBGf6psXwj28DXTERgAAAAXPvMzrQBbD7UAAAV3AAAAEgAAAAAAAAAAAAAAD2Z1bnRyYWNrZXIuc2l0ZQABAAAAAAAAAAAAAAAAAAAA", + memo_type: "none", signatures: [ - 'pox1kE2/f2oYQw/PdJZHUk74JVWRHDPwcqzGP+lSJljl6ABBRPqXewP1jAzpgY+vicDeLR/35/HyDyeAG7H0Aw==' + "pox1kE2/f2oYQw/PdJZHUk74JVWRHDPwcqzGP+lSJljl6ABBRPqXewP1jAzpgY+vicDeLR/35/HyDyeAG7H0Aw==" ] } ] } }; - describe('without options', function () { - it('requests the correct endpoint', function (done) { + describe("without options", function () { + it("requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/ledgers/7952722/transactions' + "https://horizon-live.stellar.org:1337/ledgers/7952722/transactions" ) ) .returns(Promise.resolve({ data: transactionsResponse })); this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( /^https:\/\/horizon.stellar.org\/transactions\/c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1\/operations/ @@ -696,10 +696,10 @@ describe('server.js non-transaction tests', function () { expect(response.records).to.be.deep.equal( transactionsResponse._embedded.records ); - expect(response.records[0].ledger).to.be.a('function'); + expect(response.records[0].ledger).to.be.a("function"); expect(response.records[0].ledger_attr).to.be.equal(7952722); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); response.records[0] .operations() @@ -716,19 +716,19 @@ describe('server.js non-transaction tests', function () { }); }); }); - describe('with options', function () { - it('requests the correct endpoint', function (done) { + describe("with options", function () { + it("requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/ledgers/7952722/transactions?cursor=b&limit=1&order=asc' + "https://horizon-live.stellar.org:1337/ledgers/7952722/transactions?cursor=b&limit=1&order=asc" ) ) .returns(Promise.resolve({ data: transactionsResponse })); this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( /^https:\/\/horizon.stellar.org\/transactions\/c585b8764b28be678c482f8b6e87e76e4b5f28043c53f4dcb7b724b4b2efebc1\/operations\?limit=1/ @@ -738,17 +738,17 @@ describe('server.js non-transaction tests', function () { this.server .transactions() - .forLedger('7952722') - .cursor('b') - .limit('1') - .order('asc') + .forLedger("7952722") + .cursor("b") + .limit("1") + .order("asc") .call() .then(function (response) { expect(response.records).to.be.deep.equal( transactionsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); response.records[0] .operations({ limit: 1 }) .then(function (response) { @@ -767,80 +767,80 @@ describe('server.js non-transaction tests', function () { }); }); - describe('Server._parseResult', function () { - it('creates link functions', function () { + describe("Server._parseResult", function () { + it("creates link functions", function () { var callBuilder = this.server.ledgers(); var json = callBuilder._parseResponse({ _links: { test: function () { - return 'hi'; + return "hi"; } } }); - expect(typeof json.test).to.be.equal('function'); + expect(typeof json.test).to.be.equal("function"); }); }); - describe('Smoke tests for the rest of the builders', function () { - describe('TransactionCallBuilder', function () { - it('#transaction - requests the correct endpoint', function (done) { + describe("Smoke tests for the rest of the builders", function () { + describe("TransactionCallBuilder", function () { + it("#transaction - requests the correct endpoint", function (done) { let singleTranssactionResponse = { _links: { self: { - href: 'https://horizon-testnet.stellar.org/transactions/6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0' + href: "https://horizon-testnet.stellar.org/transactions/6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0" }, account: { - href: 'https://horizon-testnet.stellar.org/accounts/GBCCHT5P34DMK2LTN4SPHBAJCXYFNUEWSM7SDSWEXJA7NN6CA3HNHTM6' + href: "https://horizon-testnet.stellar.org/accounts/GBCCHT5P34DMK2LTN4SPHBAJCXYFNUEWSM7SDSWEXJA7NN6CA3HNHTM6" }, ledger: { - href: 'https://horizon-testnet.stellar.org/ledgers/121879' + href: "https://horizon-testnet.stellar.org/ledgers/121879" }, operations: { - href: 'https://horizon-testnet.stellar.org/transactions/6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0/operations{?cursor,limit,order}', + href: "https://horizon-testnet.stellar.org/transactions/6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0/operations{?cursor,limit,order}", templated: true }, effects: { - href: 'https://horizon-testnet.stellar.org/transactions/6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0/effects{?cursor,limit,order}', + href: "https://horizon-testnet.stellar.org/transactions/6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0/effects{?cursor,limit,order}", templated: true }, precedes: { - href: 'https://horizon-testnet.stellar.org/transactions?order=asc&cursor=523466319077376' + href: "https://horizon-testnet.stellar.org/transactions?order=asc&cursor=523466319077376" }, succeeds: { - href: 'https://horizon-testnet.stellar.org/transactions?order=desc&cursor=523466319077376' + href: "https://horizon-testnet.stellar.org/transactions?order=desc&cursor=523466319077376" } }, - id: '6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0', - paging_token: '523466319077376', + id: "6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0", + paging_token: "523466319077376", successful: true, - hash: '6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0', + hash: "6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0", ledger: 121879, - created_at: '2020-02-06T01:57:18Z', + created_at: "2020-02-06T01:57:18Z", source_account: - 'GBCCHT5P34DMK2LTN4SPHBAJCXYFNUEWSM7SDSWEXJA7NN6CA3HNHTM6', - source_account_sequence: '523406189527045', + "GBCCHT5P34DMK2LTN4SPHBAJCXYFNUEWSM7SDSWEXJA7NN6CA3HNHTM6", + source_account_sequence: "523406189527045", fee_paid: 100, fee_charged: 100, max_fee: 100, operation_count: 1, envelope_xdr: - 'AAAAAEQjz6/fBsVpc28k84QJFfBW0JaTPyHKxLpB9rfCBs7TAAAAZAAB3AkAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAMBwd6tPbAYimyr/BzBgOosIbrnrzfxfS/gmfqoDSx0IAAAAAHc1lAAAAAAAAAAABwgbO0wAAAECl/OULPE7Q3ikmwIYeECFtxVH4rh8lmk465QLIeHEeEcbYhaTfgfe8VAwKsYf4YqK+YKiSiI0BqJKDr6CeI3QJ', - result_xdr: 'AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=', + "AAAAAEQjz6/fBsVpc28k84QJFfBW0JaTPyHKxLpB9rfCBs7TAAAAZAAB3AkAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAMBwd6tPbAYimyr/BzBgOosIbrnrzfxfS/gmfqo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sCGHhAhbcVR+K4fJZpOOuUCyHhxHhHG2IWk34H3vFQMCrGH+GKivmCokoiNAaiSg6+gniN0CQ==' + "pfzlCzxO0N4pJsCGHhAhbcVR+K4fJZpOOuUCyHhxHhHG2IWk34H3vFQMCrGH+GKivmCokoiNAaiSg6+gniN0CQ==" ] }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/transactions/6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0' + "https://horizon-live.stellar.org:1337/transactions/6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0" ) ) .returns(Promise.resolve({ data: singleTranssactionResponse })); @@ -848,7 +848,7 @@ describe('server.js non-transaction tests', function () { this.server .transactions() .transaction( - '6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0' + "6bbd8cbd90498a26210a21ec599702bead8f908f412455da300318aba36831b0" ) .call() .then(function (response) { @@ -863,182 +863,182 @@ describe('server.js non-transaction tests', function () { const transactionsResponse = { _links: { self: { - href: 'https://horizon.stellar.org/transactions?cursor=\u0026limit=3\u0026order=asc' + href: "https://horizon.stellar.org/transactions?cursor=\u0026limit=3\u0026order=asc" }, next: { - href: 'https://horizon.stellar.org/transactions?cursor=33736968114176\u0026limit=3\u0026order=asc' + href: "https://horizon.stellar.org/transactions?cursor=33736968114176\u0026limit=3\u0026order=asc" }, prev: { - href: 'https://horizon.stellar.org/transactions?cursor=12884905984\u0026limit=3\u0026order=desc' + href: "https://horizon.stellar.org/transactions?cursor=12884905984\u0026limit=3\u0026order=desc" } }, _embedded: { records: [ { - memo: 'hello world', + memo: "hello world", _links: { self: { - href: 'https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889' + href: "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889" }, account: { - href: 'https://horizon.stellar.org/accounts/GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7' + href: "https://horizon.stellar.org/accounts/GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7" }, ledger: { - href: 'https://horizon.stellar.org/ledgers/3' + href: "https://horizon.stellar.org/ledgers/3" }, operations: { - href: 'https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889/operations{?cursor,limit,order}', + href: "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889/operations{?cursor,limit,order}", templated: true }, effects: { - href: 'https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889/effects{?cursor,limit,order}', + href: "https://horizon.stellar.org/transactions/3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889/effects{?cursor,limit,order}", templated: true }, precedes: { - href: 'https://horizon.stellar.org/transactions?order=asc\u0026cursor=12884905984' + href: "https://horizon.stellar.org/transactions?order=asc\u0026cursor=12884905984" }, succeeds: { - href: 'https://horizon.stellar.org/transactions?order=desc\u0026cursor=12884905984' + href: "https://horizon.stellar.org/transactions?order=desc\u0026cursor=12884905984" } }, - id: '3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889', - paging_token: '12884905984', + id: "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889", + paging_token: "12884905984", successful: true, - hash: '3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889', + hash: "3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889", ledger: 3, - created_at: '2015-09-30T17:15:54Z', + created_at: "2015-09-30T17:15:54Z", source_account: - 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7', - source_account_sequence: '1', + "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", + source_account_sequence: "1", fee_charged: 300, max_fee: 300, operation_count: 3, envelope_xdr: - 'AAAAAAGUcmKO5465JxTSLQOQljwk2SfqAJmZSG6JH6wtqpwhAAABLAAAAAAAAAABAAAAAAAAAAEAAAALaGVsbG8gd29ybGQAAAAAAwAAAAAAAAAAAAAAABbxCy3mLg3hiTqX4VUEEp60pFOrJNxYM1JtxXTwXhY2AAAAAAvrwgAAAAAAAAAAAQAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNgAAAAAN4Lazj4x61AAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLaqcIQAAAEBKwqWy3TaOxoGnfm9eUjfTRBvPf34dvDA0Nf+B8z4zBob90UXtuCqmQqwMCyH+okOI3c05br3khkH0yP4kCwcE', + "AAAAAAGUcmKO5465JxTSLQOQljwk2SfqAJmZSG6JH6wtqpwhAAABLAAAAAAAAAABAAAAAAAAAAEAAAALaGVsbG8gd29ybGQAAAAAAwAAAAAAAAAAAAAAABbxCy3mLg3hiTqX4VUEEp60pFOrJNxYM1JtxXTwXhY2AAAAAAvrwgAAAAAAAAAAAQAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNgAAAAAN4Lazj4x61AAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLaqcIQAAAEBKwqWy3TaOxoGnfm9eUjfTRBvPf34dvDA0Nf+B8z4zBob90UXtuCqmQqwMCyH+okOI3c05br3khkH0yP4kCwcE", result_xdr: - 'AAAAAAAAASwAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAA=', + "AAAAAAAAASwAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAA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AEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==", + memo_type: "text", signatures: [ - 'SsKlst02jsaBp35vXlI300Qbz39+HbwwNDX/gfM+MwaG/dFF7bgqpkKsDAsh/qJDiN3NOW695IZB9Mj+JAsHBA==' + "SsKlst02jsaBp35vXlI300Qbz39+HbwwNDX/gfM+MwaG/dFF7bgqpkKsDAsh/qJDiN3NOW695IZB9Mj+JAsHBA==" ] }, { - memo: 'testpool,faucet,sdf', + memo: "testpool,faucet,sdf", _links: { self: { - href: 'https://horizon.stellar.org/transactions/2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a' + href: "https://horizon.stellar.org/transactions/2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a" }, account: { - href: 'https://horizon.stellar.org/accounts/GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB' + href: "https://horizon.stellar.org/accounts/GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB" }, ledger: { - href: 'https://horizon.stellar.org/ledgers/7841' + href: "https://horizon.stellar.org/ledgers/7841" }, operations: { - href: 'https://horizon.stellar.org/transactions/2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a/operations{?cursor,limit,order}', + href: "https://horizon.stellar.org/transactions/2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a/operations{?cursor,limit,order}", templated: true }, effects: { - href: 'https://horizon.stellar.org/transactions/2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a/effects{?cursor,limit,order}', + href: "https://horizon.stellar.org/transactions/2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a/effects{?cursor,limit,order}", templated: true }, precedes: { - href: 'https://horizon.stellar.org/transactions?order=asc\u0026cursor=33676838572032' + href: "https://horizon.stellar.org/transactions?order=asc\u0026cursor=33676838572032" }, succeeds: { - href: 'https://horizon.stellar.org/transactions?order=desc\u0026cursor=33676838572032' + href: "https://horizon.stellar.org/transactions?order=desc\u0026cursor=33676838572032" } }, - id: '2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a', - paging_token: '33676838572032', + id: "2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a", + paging_token: "33676838572032", successful: true, - hash: '2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a', + hash: "2db4b22ca018119c5027a80578813ffcf582cda4aa9e31cd92b43cf1bda4fc5a", ledger: 7841, - created_at: '2015-10-01T04:15:01Z', + created_at: "2015-10-01T04:15:01Z", source_account: - 'GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB', - source_account_sequence: '12884901890', + "GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB", + source_account_sequence: "12884901890", fee_charged: 300, max_fee: 300, operation_count: 3, envelope_xdr: - 'AAAAABbxCy3mLg3hiTqX4VUEEp60pFOrJNxYM1JtxXTwXhY2AAABLAAAAAMAAAACAAAAAAAAAAEAAAATdGVzdHBvb2wsZmF1Y2V0LHNkZgAAAAADAAAAAAAAAAAAAAAAH6Ue1GOPj6Hb/ROPyIFCJpQPMujihEIvJSfK0UfMDIgAAAAAC+vCAAAAAAAAAAAAAAAAALMw4P7yJTyqj6ptNh7BPyXEoT+zVwTcU4JVbGyonvgbAAAAAAvrwgAAAAAAAAAAAAAAAABJlwu05Op/5x1uyrweYsyR6pTTos33hRNZe5IF6blnzwAAAAAL68IAAAAAAAAAAAHwXhY2AAAAQDSBB5eNEKkWIoQbZ1YQabJuE5mW/AKhrHTxw9H3m/sai90YcaZlsAe3ueO9jExjSZF289ZcR4vc0wFw1p/WyAc=', + "AAAAABbxCy3mLg3hiTqX4VUEEp60pFOrJNxYM1JtxX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d7T0fAAAAAMAAAACAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAA=", fee_meta_xdr: - 'AAAAAgAAAAMAAB55AAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrObeDuoAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAB6hAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrObeDp8AAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==', - memo_type: 'text', + "AAAAAgAAAAMAAB55AAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrObeDuoAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAB6hAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrObeDp8AAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==", + memo_type: "text", signatures: [ - 'NIEHl40QqRYihBtnVhBpsm4TmZb8AqGsdPHD0feb+xqL3RhxpmWwB7e5472MTGNJkXbz1lxHi9zTAXDWn9bIBw==' + "NIEHl40QqRYihBtnVhBpsm4TmZb8AqGsdPHD0feb+xqL3RhxpmWwB7e5472MTGNJkXbz1lxHi9zTAXDWn9bIBw==" ] }, { - memo: '', + memo: "", _links: { self: { - href: 'https://horizon.stellar.org/transactions/3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a' + href: "https://horizon.stellar.org/transactions/3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a" }, account: { - href: 'https://horizon.stellar.org/accounts/GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB' + href: "https://horizon.stellar.org/accounts/GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB" }, ledger: { - href: 'https://horizon.stellar.org/ledgers/7855' + href: "https://horizon.stellar.org/ledgers/7855" }, operations: { - href: 'https://horizon.stellar.org/transactions/3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a/operations{?cursor,limit,order}', + href: "https://horizon.stellar.org/transactions/3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a/operations{?cursor,limit,order}", templated: true }, effects: { - href: 'https://horizon.stellar.org/transactions/3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a/effects{?cursor,limit,order}', + href: "https://horizon.stellar.org/transactions/3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a/effects{?cursor,limit,order}", templated: true }, precedes: { - href: 'https://horizon.stellar.org/transactions?order=asc\u0026cursor=33736968114176' + href: "https://horizon.stellar.org/transactions?order=asc\u0026cursor=33736968114176" }, succeeds: { - href: 'https://horizon.stellar.org/transactions?order=desc\u0026cursor=33736968114176' + href: "https://horizon.stellar.org/transactions?order=desc\u0026cursor=33736968114176" } }, - id: '3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a', - paging_token: '33736968114176', + id: "3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a", + paging_token: "33736968114176", successful: true, - hash: '3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a', + hash: "3ce2aca2fed36da2faea31352c76c5e412348887a4c119b1e90de8d1b937396a", ledger: 7855, - created_at: '2015-10-01T04:16:11Z', + created_at: "2015-10-01T04:16:11Z", source_account: - 'GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB', - source_account_sequence: '12884901891', + "GALPCCZN4YXA3YMJHKL6CVIECKPLJJCTVMSNYWBTKJW4K5HQLYLDMZTB", + source_account_sequence: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BgAAAADAAAAAwAAAAAAAAABAAAAAB+lHtRjj4+h2/0Tj8iBQiaUDzLo4oRCLyUnytFHzAyIAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAA", fee_meta_xdr: - 'AAAAAgAAAAMAAB6hAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrN3tPR8AAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAB6vAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrN3tPQYAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==', - memo_type: 'text', + "AAAAAgAAAAMAAB6hAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrN3tPR8AAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAB6vAAAAAAAAAAAW8Qst5i4N4Yk6l+FVBBKetKRTqyTcWDNSbcV08F4WNg3gtrN3tPQYAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==", + memo_type: "text", signatures: [ - '1sNxaxHezfPxDOpq1x1z+TYvgtdYkwDp5dpzx1teQB1zimkfbmKwYLk7C8bTpXC9zcJ7f+vathwE/e/GHHXwDw==' + "1sNxaxHezfPxDOpq1x1z+TYvgtdYkwDp5dpzx1teQB1zimkfbmKwYLk7C8bTpXC9zcJ7f+vathwE/e/GHHXwDw==" ] } ] } }; - it('forClaimableBalance() requests the correct endpoint', function (done) { + it("forClaimableBalance() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000/transactions' + "https://horizon-live.stellar.org:1337/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000/transactions" ) ) .returns(Promise.resolve({ data: transactionsResponse })); @@ -1046,15 +1046,15 @@ describe('server.js non-transaction tests', function () { this.server .transactions() .forClaimableBalance( - '000000000102030000000000000000000000000000000000000000000000000000000000' + "000000000102030000000000000000000000000000000000000000000000000000000000" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( transactionsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -1063,38 +1063,38 @@ describe('server.js non-transaction tests', function () { }); }); - describe('AccountCallBuilder', function () { - it('requests the correct endpoint', function (done) { + describe("AccountCallBuilder", function () { + it("requests the correct endpoint", function (done) { let singleAccountResponse = { _links: { effects: { - href: '/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/effects{?cursor,limit,order}', + href: "/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/effects{?cursor,limit,order}", templated: true }, offers: { - href: '/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/offers{?cursor,limit,order}', + href: "/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/offers{?cursor,limit,order}", templated: true }, operations: { - href: '/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/operations{?cursor,limit,order}', + href: "/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/operations{?cursor,limit,order}", templated: true }, self: { - href: '/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K' + href: "/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K" }, transactions: { - href: '/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/transactions{?cursor,limit,order}', + href: "/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/transactions{?cursor,limit,order}", templated: true } }, - id: 'GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K', - paging_token: '146028892161', + id: "GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K", + paging_token: "146028892161", account_id: - 'GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K', + "GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K", sequence: 146028888090, subentry_count: 0, inflation_destination: null, - home_domain: '', + home_domain: "", thresholds: { low_threshold: 0, med_threshold: 0, @@ -1108,31 +1108,31 @@ describe('server.js non-transaction tests', function () { }, balances: [ { - asset_type: 'native', - balance: '9760000.3997400' + asset_type: "native", + balance: "9760000.3997400" } ], signers: [ { public_key: - 'GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K', + "GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K", weight: 1 } ] }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K' + "https://horizon-live.stellar.org:1337/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K" ) ) .returns(Promise.resolve({ data: singleAccountResponse })); this.server .accounts() - .accountId('GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K') + .accountId("GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K") .call() .then(function (response) { expect(response).to.be.deep.equal(singleAccountResponse); @@ -1147,13 +1147,13 @@ describe('server.js non-transaction tests', function () { let accountsForSignerResponse = { _links: { self: { - href: '/accounts?cursor=&limit=10&order=asc&signer=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + href: "/accounts?cursor=&limit=10&order=asc&signer=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" }, next: { - href: '/accounts?cursor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42&limit=10&order=asc&signer=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + href: "/accounts?cursor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42&limit=10&order=asc&signer=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" }, prev: { - href: '/accounts?cursor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42&limit=10&order=desc&signer=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + href: "/accounts?cursor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42&limit=10&order=desc&signer=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" } }, _embedded: { @@ -1161,44 +1161,44 @@ describe('server.js non-transaction tests', function () { { _links: { self: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" }, transactions: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/transactions{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/transactions{?cursor,limit,order}", templated: true }, operations: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/operations{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/operations{?cursor,limit,order}", templated: true }, payments: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/payments{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/payments{?cursor,limit,order}", templated: true }, effects: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/effects{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/effects{?cursor,limit,order}", templated: true }, offers: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/offers{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/offers{?cursor,limit,order}", templated: true }, trades: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/trades{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/trades{?cursor,limit,order}", templated: true }, data: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/data/{key}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/data/{key}", templated: true } }, - id: 'GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42', + id: "GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42", account_id: - 'GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42', - sequence: '4233832731508737', + "GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42", + sequence: "4233832731508737", subentry_count: 1, last_modified_ledger: 986912, - last_modified_time: '1970-01-01T00:00:00Z', + last_modified_time: "1970-01-01T00:00:00Z", thresholds: { low_threshold: 0, med_threshold: 0, @@ -1212,58 +1212,58 @@ describe('server.js non-transaction tests', function () { }, balances: [ { - balance: '0.0000000', - limit: '450.0000000', - buying_liabilities: '0.0000000', - selling_liabilities: '0.0000000', + balance: "0.0000000", + limit: "450.0000000", + buying_liabilities: "0.0000000", + selling_liabilities: "0.0000000", last_modified_ledger: 986912, is_authorized: true, - asset_type: 'credit_alphanum4', - asset_code: 'USD', + asset_type: "credit_alphanum4", + asset_code: "USD", asset_issuer: - 'GDUEG67IE5TJUVWRRTMXDP3Q6EMMZJ6HL5OMWLBYOIUIZEUW2T2PBPJH' + "GDUEG67IE5TJUVWRRTMXDP3Q6EMMZJ6HL5OMWLBYOIUIZEUW2T2PBPJH" }, { - balance: '9999.9999900', - buying_liabilities: '0.0000000', - selling_liabilities: '0.0000000', - asset_type: 'native' + balance: "9999.9999900", + buying_liabilities: "0.0000000", + selling_liabilities: "0.0000000", + asset_type: "native" } ], signers: [ { weight: 1, - key: 'GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42', - type: 'ed25519_public_key' + key: "GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42", + type: "ed25519_public_key" } ], data: {}, paging_token: - 'GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + "GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" } ] } }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts?signer=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + "https://horizon-live.stellar.org:1337/accounts?signer=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" ) ) .returns(Promise.resolve({ data: accountsForSignerResponse })); this.server .accounts() - .forSigner('GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42') + .forSigner("GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42") .call() .then(function (response) { expect(response.records).to.be.deep.equal( accountsForSignerResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -1275,13 +1275,13 @@ describe('server.js non-transaction tests', function () { let accountsForAssetResponse = { _links: { self: { - href: '/accounts?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD\u0026cursor=\u0026limit=10\u0026order=asc' + href: "/accounts?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD\u0026cursor=\u0026limit=10\u0026order=asc" }, next: { - href: '/accounts?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD\u0026cursor=GC4J73PTB5WN7MOJWOAECPHRCV2UU3WCY37L3BNY6RZVKE23JGQYJMJ6\u0026limit=10\u0026order=asc' + href: "/accounts?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD\u0026cursor=GC4J73PTB5WN7MOJWOAECPHRCV2UU3WCY37L3BNY6RZVKE23JGQYJMJ6\u0026limit=10\u0026order=asc" }, prev: { - href: '/accounts?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD\u0026cursor=GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667\u0026limit=10\u0026order=desc' + href: "/accounts?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD\u0026cursor=GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667\u0026limit=10\u0026order=desc" } }, _embedded: { @@ -1289,44 +1289,44 @@ describe('server.js non-transaction tests', function () { { _links: { self: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667' + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667" }, transactions: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/transactions{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/transactions{?cursor,limit,order}", templated: true }, operations: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/operations{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/operations{?cursor,limit,order}", templated: true }, payments: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/payments{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/payments{?cursor,limit,order}", templated: true }, effects: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/effects{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/effects{?cursor,limit,order}", templated: true }, offers: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/offers{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/offers{?cursor,limit,order}", templated: true }, trades: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/trades{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/trades{?cursor,limit,order}", templated: true }, data: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/data/{key}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/data/{key}", templated: true } }, - id: 'GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667', + id: "GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667", account_id: - 'GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667', - sequence: '3902600558673934', + "GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667", + sequence: "3902600558673934", subentry_count: 3, last_modified_ledger: 983682, - last_modified_time: '1970-01-01T00:00:00Z', + last_modified_time: "1970-01-01T00:00:00Z", thresholds: { low_threshold: 0, med_threshold: 0, @@ -1340,44 +1340,44 @@ describe('server.js non-transaction tests', function () { }, balances: [ { - balance: '0.0000000', - limit: '25.0000000', - buying_liabilities: '0.0000000', - selling_liabilities: '0.0000000', + balance: "0.0000000", + limit: "25.0000000", + buying_liabilities: "0.0000000", + selling_liabilities: "0.0000000", last_modified_ledger: 983682, is_authorized: true, - asset_type: 'credit_alphanum4', - asset_code: 'USD', + asset_type: "credit_alphanum4", + asset_code: "USD", asset_issuer: - 'GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD' + "GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD" }, { - balance: '9999.9998600', - buying_liabilities: '0.0000000', - selling_liabilities: '0.0000000', - asset_type: 'native' + balance: "9999.9998600", + buying_liabilities: "0.0000000", + selling_liabilities: "0.0000000", + asset_type: "native" } ], signers: [ { weight: 1, - key: 'GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667', - type: 'ed25519_public_key' + key: "GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667", + type: "ed25519_public_key" } ], data: {}, paging_token: - 'GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667' + "GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667" } ] } }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD' + "https://horizon-live.stellar.org:1337/accounts?asset=USD%3AGDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD" ) ) .returns(Promise.resolve({ data: accountsForAssetResponse })); @@ -1386,8 +1386,8 @@ describe('server.js non-transaction tests', function () { .accounts() .forAsset( new StellarSdk.Asset( - 'USD', - 'GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD' + "USD", + "GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD" ) ) .call() @@ -1395,8 +1395,8 @@ describe('server.js non-transaction tests', function () { expect(response.records).to.be.deep.equal( accountsForAssetResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -1408,13 +1408,13 @@ describe('server.js non-transaction tests', function () { let accountsForSponsor = { _links: { self: { - href: '/accounts?cursor=&limit=10&order=asc&sponsor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + href: "/accounts?cursor=&limit=10&order=asc&sponsor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" }, next: { - href: '/accounts?cursor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42&limit=10&order=asc&sponsor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + href: "/accounts?cursor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42&limit=10&order=asc&sponsor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" }, prev: { - href: '/accounts?cursor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42&limit=10&order=desc&sponsor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + href: "/accounts?cursor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42&limit=10&order=desc&sponsor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" } }, _embedded: { @@ -1422,44 +1422,44 @@ describe('server.js non-transaction tests', function () { { _links: { self: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" }, transactions: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/transactions{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/transactions{?cursor,limit,order}", templated: true }, operations: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/operations{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/operations{?cursor,limit,order}", templated: true }, payments: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/payments{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/payments{?cursor,limit,order}", templated: true }, effects: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/effects{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/effects{?cursor,limit,order}", templated: true }, offers: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/offers{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/offers{?cursor,limit,order}", templated: true }, trades: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/trades{?cursor,limit,order}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/trades{?cursor,limit,order}", templated: true }, data: { - href: '/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/data/{key}', + href: "/accounts/GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42/data/{key}", templated: true } }, - id: 'GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42', + id: "GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42", account_id: - 'GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42', - sequence: '4233832731508737', + "GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42", + sequence: "4233832731508737", subentry_count: 1, last_modified_ledger: 986912, - last_modified_time: '1970-01-01T00:00:00Z', + last_modified_time: "1970-01-01T00:00:00Z", thresholds: { low_threshold: 0, med_threshold: 0, @@ -1473,36 +1473,36 @@ describe('server.js non-transaction tests', function () { }, balances: [ { - balance: '0.0000000', - limit: '450.0000000', - buying_liabilities: '0.0000000', - selling_liabilities: '0.0000000', + balance: "0.0000000", + limit: "450.0000000", + buying_liabilities: "0.0000000", + selling_liabilities: "0.0000000", last_modified_ledger: 986912, is_authorized: true, - asset_type: 'credit_alphanum4', - asset_code: 'USD', + asset_type: "credit_alphanum4", + asset_code: "USD", asset_issuer: - 'GDUEG67IE5TJUVWRRTMXDP3Q6EMMZJ6HL5OMWLBYOIUIZEUW2T2PBPJH', + "GDUEG67IE5TJUVWRRTMXDP3Q6EMMZJ6HL5OMWLBYOIUIZEUW2T2PBPJH", sponsor: - 'GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + "GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" }, { - balance: '9999.9999900', - buying_liabilities: '0.0000000', - selling_liabilities: '0.0000000', - asset_type: 'native' + balance: "9999.9999900", + buying_liabilities: "0.0000000", + selling_liabilities: "0.0000000", + asset_type: "native" } ], signers: [ { weight: 1, - key: 'GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42', - type: 'ed25519_public_key' + key: "GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42", + type: "ed25519_public_key" } ], data: {}, paging_token: - 'GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42', + "GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42", num_sponsoring: 0, num_sponsored: 3 } @@ -1511,24 +1511,24 @@ describe('server.js non-transaction tests', function () { }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts?sponsor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42' + "https://horizon-live.stellar.org:1337/accounts?sponsor=GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42" ) ) .returns(Promise.resolve({ data: accountsForSponsor })); this.server .accounts() - .sponsor('GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42') + .sponsor("GBCR5OVQ54S2EKHLBZMK6VYMTXZHXN3T45Y6PRX4PX4FXDMJJGY4FD42") .call() .then(function (response) { expect(response.records).to.be.deep.equal( accountsForSponsor._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -1540,13 +1540,13 @@ describe('server.js non-transaction tests', function () { const accountsForAssetResponse = { _links: { self: { - href: '/accounts?liquidity_pool=dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7&cursor=&limit=10&order=asc' + href: "/accounts?liquidity_pool=dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7&cursor=&limit=10&order=asc" }, next: { - href: '/accounts?liquidity_pool=dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7&cursor=GC4J73PTB5WN7MOJWOAECPHRCV2UU3WCY37L3BNY6RZVKE23JGQYJMJ6&limit=10&order=asc' + href: "/accounts?liquidity_pool=dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7&cursor=GC4J73PTB5WN7MOJWOAECPHRCV2UU3WCY37L3BNY6RZVKE23JGQYJMJ6&limit=10&order=asc" }, prev: { - href: '/accounts?liquidity_pool=dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7&cursor=GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667&limit=10&order=desc' + href: "/accounts?liquidity_pool=dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7&cursor=GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667&limit=10&order=desc" } }, _embedded: { @@ -1554,44 +1554,44 @@ describe('server.js non-transaction tests', function () { { _links: { self: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667' + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667" }, transactions: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/transactions{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/transactions{?cursor,limit,order}", templated: true }, operations: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/operations{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/operations{?cursor,limit,order}", templated: true }, payments: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/payments{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/payments{?cursor,limit,order}", templated: true }, effects: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/effects{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/effects{?cursor,limit,order}", templated: true }, offers: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/offers{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/offers{?cursor,limit,order}", templated: true }, trades: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/trades{?cursor,limit,order}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/trades{?cursor,limit,order}", templated: true }, data: { - href: '/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/data/{key}', + href: "/accounts/GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667/data/{key}", templated: true } }, - id: 'GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667', + id: "GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667", account_id: - 'GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667', - sequence: '3902600558673934', + "GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667", + sequence: "3902600558673934", subentry_count: 3, last_modified_ledger: 983682, - last_modified_time: '1970-01-01T00:00:00Z', + last_modified_time: "1970-01-01T00:00:00Z", thresholds: { low_threshold: 0, med_threshold: 0, @@ -1606,70 +1606,70 @@ describe('server.js non-transaction tests', function () { balances: [ { liquidity_pool_id: - 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7', - asset_type: 'liquidity_pool_shares', - balance: '10', - limit: '10000', + "dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7", + asset_type: "liquidity_pool_shares", + balance: "10", + limit: "10000", last_modified_ledger: 7877447, is_authorized: true, is_authorized_to_maintain_liabilities: false, is_clawback_enabled: false }, { - balance: '0.0000000', - limit: '922337203685.4775807', - buying_liabilities: '0.0000000', - selling_liabilities: '0.0000000', + balance: "0.0000000", + limit: "922337203685.4775807", + buying_liabilities: "0.0000000", + selling_liabilities: "0.0000000", last_modified_ledger: 983682, is_authorized: true, is_authorized_to_maintain_liabilities: false, is_clawback_enabled: false, - asset_type: 'credit_alphanum4', - asset_code: 'ARST', + asset_type: "credit_alphanum4", + asset_code: "ARST", asset_issuer: - 'GB7TAYRUZGE6TVT7NHP5SMIZRNQA6PLM423EYISAOAP3MKYIQMVYP2JO' + "GB7TAYRUZGE6TVT7NHP5SMIZRNQA6PLM423EYISAOAP3MKYIQMVYP2JO" }, { - balance: '0.0000000', - limit: '922337203685.4775807', - buying_liabilities: '0.0000000', - selling_liabilities: '0.0000000', + balance: "0.0000000", + limit: "922337203685.4775807", + buying_liabilities: "0.0000000", + selling_liabilities: "0.0000000", last_modified_ledger: 983682, is_authorized: true, is_authorized_to_maintain_liabilities: false, is_clawback_enabled: false, - asset_type: 'credit_alphanum4', - asset_code: 'USD', + asset_type: "credit_alphanum4", + asset_code: "USD", asset_issuer: - 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' + "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ" }, { - balance: '9999.9998600', - buying_liabilities: '0.0000000', - selling_liabilities: '0.0000000', - asset_type: 'native' + balance: "9999.9998600", + buying_liabilities: "0.0000000", + selling_liabilities: "0.0000000", + asset_type: "native" } ], signers: [ { weight: 1, - key: 'GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667', - type: 'ed25519_public_key' + key: "GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667", + type: "ed25519_public_key" } ], data: {}, paging_token: - 'GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667' + "GBPFGVESMB7HSTQREV354WA4UDGAPS2NCB5DZQ7K2VZM3PSX4TDCV667" } ] } }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts?liquidity_pool=dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7' + "https://horizon-live.stellar.org:1337/accounts?liquidity_pool=dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7" ) ) .returns(Promise.resolve({ data: accountsForAssetResponse })); @@ -1677,15 +1677,15 @@ describe('server.js non-transaction tests', function () { this.server .accounts() .forLiquidityPool( - 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7' + "dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( accountsForAssetResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -1694,43 +1694,43 @@ describe('server.js non-transaction tests', function () { }); }); - describe('OfferCallBuilder', function () { + describe("OfferCallBuilder", function () { const offersResponse = { _embedded: { records: [] }, _links: { next: { - href: '/offers' + href: "/offers" }, prev: { - href: '/offers' + href: "/offers" }, self: { - href: '/offers' + href: "/offers" } } }; - it('without params requests the correct endpoint', function (done) { + it("without params requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/offers?order=asc' + "https://horizon-live.stellar.org:1337/offers?order=asc" ) ) .returns(Promise.resolve({ data: offersResponse })); this.server .offers() - .order('asc') + .order("asc") .call() .then(function (response) { expect(response.records).to.be.deep.equal( offersResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -1738,52 +1738,52 @@ describe('server.js non-transaction tests', function () { }); }); - it('single offer requests the correct endpoint', function (done) { + it("single offer requests the correct endpoint", function (done) { const offerResponse = { _links: { self: { - href: 'https://horizon.stellar.org/offers/12345' + href: "https://horizon.stellar.org/offers/12345" }, offer_maker: { - href: 'https://horizon.stellar.org/accounts/GCK4WSNF3F6ZNCMK6BU77ZCZ3NMF3JGU2U3ZAPKXYBKYYCJA72FDBY7K' + href: "https://horizon.stellar.org/accounts/GCK4WSNF3F6ZNCMK6BU77ZCZ3NMF3JGU2U3ZAPKXYBKYYCJA72FDBY7K" } }, id: 12345, - paging_token: '12345', - seller: 'GCK4WSNF3F6ZNCMK6BU77ZCZ3NMF3JGU2U3ZAPKXYBKYYCJA72FDBY7K', + paging_token: "12345", + seller: "GCK4WSNF3F6ZNCMK6BU77ZCZ3NMF3JGU2U3ZAPKXYBKYYCJA72FDBY7K", selling: { - asset_type: 'credit_alphanum4', - asset_code: 'NGNT', + asset_type: "credit_alphanum4", + asset_code: "NGNT", asset_issuer: - 'GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD' + "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD" }, buying: { - asset_type: 'native' + asset_type: "native" }, - amount: '21611.9486669', + amount: "21611.9486669", price_r: { n: 52836797, d: 1396841783 }, - price: '0.0378259', + price: "0.0378259", last_modified_ledger: 28285404, - last_modified_time: '2020-02-18T17:00:56Z' + last_modified_time: "2020-02-18T17:00:56Z" }; this.axiosMock - .expects('get') + .expects("get") .withArgs( - sinon.match('https://horizon-live.stellar.org:1337/offers/12345') + sinon.match("https://horizon-live.stellar.org:1337/offers/12345") ) .returns(Promise.resolve({ data: offerResponse })); this.server .offers() - .offer('12345') + .offer("12345") .call() .then(function (response) { expect(response).to.be.deep.equal(offerResponse); - expect(response.self).to.be.a('function'); + expect(response.self).to.be.a("function"); done(); }) .catch(function (err) { @@ -1791,12 +1791,12 @@ describe('server.js non-transaction tests', function () { }); }); - it('forAccount requests the correct endpoint', function (done) { + it("forAccount requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/offers?order=asc' + "https://horizon-live.stellar.org:1337/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/offers?order=asc" ) ) .returns(Promise.resolve({ data: offersResponse })); @@ -1804,33 +1804,33 @@ describe('server.js non-transaction tests', function () { this.server .offers() .forAccount( - 'GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K' + "GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K" ) - .order('asc') + .order("asc") .call() .then(function (response) { expect(response.records).to.be.deep.equal( offersResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { done(err); }); }); - it('selling requests the correct endpoint', function (done) { + it("selling requests the correct endpoint", function (done) { const selling = new StellarSdk.Asset( - 'USD', - 'GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG' + "USD", + "GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG" ); this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/offers?selling_asset_type=credit_alphanum4&selling_asset_code=USD&selling_asset_issuer=GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG&order=asc' + "https://horizon-live.stellar.org:1337/offers?selling_asset_type=credit_alphanum4&selling_asset_code=USD&selling_asset_issuer=GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG&order=asc" ) ) .returns(Promise.resolve({ data: offersResponse })); @@ -1838,31 +1838,31 @@ describe('server.js non-transaction tests', function () { this.server .offers() .selling(selling) - .order('asc') + .order("asc") .call() .then(function (response) { expect(response.records).to.be.deep.equal( offersResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { done(err); }); }); - it('buying requests the correct endpoint', function (done) { + it("buying requests the correct endpoint", function (done) { const buying = new StellarSdk.Asset( - 'COP', - 'GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG' + "COP", + "GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG" ); this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/offers?buying_asset_type=credit_alphanum4&buying_asset_code=COP&buying_asset_issuer=GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG&order=asc' + "https://horizon-live.stellar.org:1337/offers?buying_asset_type=credit_alphanum4&buying_asset_code=COP&buying_asset_issuer=GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG&order=asc" ) ) .returns(Promise.resolve({ data: offersResponse })); @@ -1870,41 +1870,41 @@ describe('server.js non-transaction tests', function () { this.server .offers() .buying(buying) - .order('asc') + .order("asc") .call() .then(function (response) { expect(response.records).to.be.deep.equal( offersResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { done(err); }); }); - it('sponsor requests the correct endpoint', function (done) { + it("sponsor requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/offers?sponsor=GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG&order=asc' + "https://horizon-live.stellar.org:1337/offers?sponsor=GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG&order=asc" ) ) .returns(Promise.resolve({ data: offersResponse })); this.server .offers() - .sponsor('GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG') - .order('asc') + .sponsor("GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG") + .order("asc") .call() .then(function (response) { expect(response.records).to.be.deep.equal( offersResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -1913,29 +1913,29 @@ describe('server.js non-transaction tests', function () { }); }); - describe('OrderbookCallBuilder', function () { + describe("OrderbookCallBuilder", function () { let orderBookResponse = { bids: [], asks: [], base: { - asset_type: 'native', - asset_code: '', - asset_issuer: '' + asset_type: "native", + asset_code: "", + asset_issuer: "" }, counter: { - asset_type: 'credit_alphanum4', - asset_code: 'USD', + asset_type: "credit_alphanum4", + asset_code: "USD", asset_issuer: - 'GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG' + "GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG" } }; - it('requests the correct endpoint native/credit', function (done) { + it("requests the correct endpoint native/credit", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/order_book?selling_asset_type=native&buying_asset_type=credit_alphanum4&buying_asset_code=USD&buying_asset_issuer=GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG' + "https://horizon-live.stellar.org:1337/order_book?selling_asset_type=native&buying_asset_type=credit_alphanum4&buying_asset_code=USD&buying_asset_issuer=GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG" ) ) .returns(Promise.resolve({ data: orderBookResponse })); @@ -1944,8 +1944,8 @@ describe('server.js non-transaction tests', function () { .orderbook( StellarSdk.Asset.native(), new StellarSdk.Asset( - 'USD', - 'GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG' + "USD", + "GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG" ) ) .call() @@ -1958,12 +1958,12 @@ describe('server.js non-transaction tests', function () { }); }); - it('requests the correct endpoint credit/native', function (done) { + it("requests the correct endpoint credit/native", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/order_book?selling_asset_type=credit_alphanum4&selling_asset_code=USD&selling_asset_issuer=GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG&buying_asset_type=native' + "https://horizon-live.stellar.org:1337/order_book?selling_asset_type=credit_alphanum4&selling_asset_code=USD&selling_asset_issuer=GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG&buying_asset_type=native" ) ) .returns(Promise.resolve({ data: orderBookResponse })); @@ -1971,8 +1971,8 @@ describe('server.js non-transaction tests', function () { this.server .orderbook( new StellarSdk.Asset( - 'USD', - 'GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG' + "USD", + "GDVDKQFP665JAO7A2LSHNLQIUNYNAAIGJ6FYJVMG4DT3YJQQJSRBLQDG" ), StellarSdk.Asset.native() ) @@ -1987,18 +1987,18 @@ describe('server.js non-transaction tests', function () { }); }); - describe('TradesCallBuilder', function () { - it('trades() requests the correct endpoint (no filters)', function (done) { + describe("TradesCallBuilder", function () { + it("trades() requests the correct endpoint (no filters)", function (done) { let tradesResponse = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&cursor=' + href: "https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&cursor=" }, next: { - href: 'https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&cursor=64199539053039617-0" }, prev: { - href: 'https://horizon-live.stellar.org:1337/trades?order=desc&limit=200&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?order=desc&limit=200&cursor=64199539053039617-0" } }, _embedded: { @@ -2006,35 +2006,35 @@ describe('server.js non-transaction tests', function () { { _links: { base: { - href: 'https://horizon-live.stellar.org:1337/accounts/GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W' + href: "https://horizon-live.stellar.org:1337/accounts/GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W" }, counter: { - href: 'https://horizon-live.stellar.org:1337/accounts/GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN' + href: "https://horizon-live.stellar.org:1337/accounts/GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN" }, operation: { - href: 'https://horizon-live.stellar.org:1337/operations/64199539053039617' + href: "https://horizon-live.stellar.org:1337/operations/64199539053039617" } }, - id: '64199539053039617-0', - paging_token: '64199539053039617-0', - ledger_close_time: '2017-12-07T16:45:19Z', - offer_id: '278232', - trade_type: 'orderbook', + id: "64199539053039617-0", + paging_token: "64199539053039617-0", + ledger_close_time: "2017-12-07T16:45:19Z", + offer_id: "278232", + trade_type: "orderbook", base_account: - 'GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W', - base_amount: '1269.2134875', - base_asset_type: 'native', + "GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W", + base_amount: "1269.2134875", + base_asset_type: "native", counter_account: - 'GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN', - counter_amount: '19637.5167985', - counter_asset_type: 'credit_alphanum4', - counter_asset_code: 'JPY', + "GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN", + counter_amount: "19637.5167985", + counter_asset_type: "credit_alphanum4", + counter_asset_code: "JPY", counter_asset_issuer: - 'GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', + "GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", base_is_seller: true, price: { - n: '1', - d: '2' + n: "1", + d: "2" } } ] @@ -2042,8 +2042,8 @@ describe('server.js non-transaction tests', function () { }; this.axiosMock - .expects('get') - .withArgs(sinon.match('https://horizon-live.stellar.org:1337/trades')) + .expects("get") + .withArgs(sinon.match("https://horizon-live.stellar.org:1337/trades")) .returns(Promise.resolve({ data: tradesResponse })); this.server @@ -2060,17 +2060,17 @@ describe('server.js non-transaction tests', function () { }); }); - it('trades() requests the correct endpoint for assets', function (done) { + it("trades() requests the correct endpoint for assets", function (done) { let tradesResponse = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/trades?base_asset_type=native&counter_asset_type=credit_alphanum4&counter_asset_code=JPY&counter_asset_issuer=GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM&order=asc&limit=10&cursor=' + href: "https://horizon-live.stellar.org:1337/trades?base_asset_type=native&counter_asset_type=credit_alphanum4&counter_asset_code=JPY&counter_asset_issuer=GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM&order=asc&limit=10&cursor=" }, next: { - href: 'https://horizon-live.stellar.org:1337/trades?base_asset_type=native&counter_asset_type=credit_alphanum4&counter_asset_code=JPY&counter_asset_issuer=GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM&order=asc&limit=10&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?base_asset_type=native&counter_asset_type=credit_alphanum4&counter_asset_code=JPY&counter_asset_issuer=GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM&order=asc&limit=10&cursor=64199539053039617-0" }, prev: { - href: 'https://horizon-live.stellar.org:1337/trades?base_asset_type=native&counter_asset_type=credit_alphanum4&counter_asset_code=JPY&counter_asset_issuer=GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM&order=desc&limit=10&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?base_asset_type=native&counter_asset_type=credit_alphanum4&counter_asset_code=JPY&counter_asset_issuer=GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM&order=desc&limit=10&cursor=64199539053039617-0" } }, _embedded: { @@ -2078,35 +2078,35 @@ describe('server.js non-transaction tests', function () { { _links: { base: { - href: 'https://horizon-live.stellar.org:1337/accounts/GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W' + href: "https://horizon-live.stellar.org:1337/accounts/GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W" }, counter: { - href: 'https://horizon-live.stellar.org:1337/accounts/GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN' + href: "https://horizon-live.stellar.org:1337/accounts/GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN" }, operation: { - href: 'https://horizon-live.stellar.org:1337/operations/64199539053039617' + href: "https://horizon-live.stellar.org:1337/operations/64199539053039617" } }, - id: '64199539053039617-0', - paging_token: '64199539053039617-0', - ledger_close_time: '2017-12-07T16:45:19Z', - offer_id: '278232', - trade_type: 'orderbook', + id: "64199539053039617-0", + paging_token: "64199539053039617-0", + ledger_close_time: "2017-12-07T16:45:19Z", + offer_id: "278232", + trade_type: "orderbook", base_account: - 'GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W', - base_amount: '1269.2134875', - base_asset_type: 'native', + "GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W", + base_amount: "1269.2134875", + base_asset_type: "native", counter_account: - 'GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN', - counter_amount: '19637.5167985', - counter_asset_type: 'credit_alphanum4', - counter_asset_code: 'JPY', + "GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN", + counter_amount: "19637.5167985", + counter_asset_type: "credit_alphanum4", + counter_asset_code: "JPY", counter_asset_issuer: - 'GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', + "GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", base_is_seller: true, price: { - n: '1', - d: '2' + n: "1", + d: "2" } } ] @@ -2114,10 +2114,10 @@ describe('server.js non-transaction tests', function () { }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/trades?base_asset_type=native&counter_asset_type=credit_alphanum4&counter_asset_code=JPY&counter_asset_issuer=GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM' + "https://horizon-live.stellar.org:1337/trades?base_asset_type=native&counter_asset_type=credit_alphanum4&counter_asset_code=JPY&counter_asset_issuer=GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM" ) ) .returns(Promise.resolve({ data: tradesResponse })); @@ -2127,8 +2127,8 @@ describe('server.js non-transaction tests', function () { .forAssetPair( StellarSdk.Asset.native(), new StellarSdk.Asset( - 'JPY', - 'GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM' + "JPY", + "GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM" ) ) .call() @@ -2143,17 +2143,17 @@ describe('server.js non-transaction tests', function () { }); }); - it('trades() requests the correct endpoint for offer', function (done) { + it("trades() requests the correct endpoint for offer", function (done) { let tradesResponse = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/trades?offer_id=278232&order=asc&limit=10&cursor=' + href: "https://horizon-live.stellar.org:1337/trades?offer_id=278232&order=asc&limit=10&cursor=" }, next: { - href: 'https://horizon-live.stellar.org:1337/trades?offer_id=278232&order=asc&limit=10&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?offer_id=278232&order=asc&limit=10&cursor=64199539053039617-0" }, prev: { - href: 'https://horizon-live.stellar.org:1337/trades?offer_id=278232&order=desc&limit=10&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?offer_id=278232&order=desc&limit=10&cursor=64199539053039617-0" } }, _embedded: { @@ -2161,35 +2161,35 @@ describe('server.js non-transaction tests', function () { { _links: { base: { - href: 'https://horizon-live.stellar.org:1337/accounts/GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W' + href: "https://horizon-live.stellar.org:1337/accounts/GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W" }, counter: { - href: 'https://horizon-live.stellar.org:1337/accounts/GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN' + href: "https://horizon-live.stellar.org:1337/accounts/GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN" }, operation: { - href: 'https://horizon-live.stellar.org:1337/operations/64199539053039617' + href: "https://horizon-live.stellar.org:1337/operations/64199539053039617" } }, - id: '64199539053039617-0', - paging_token: '64199539053039617-0', - ledger_close_time: '2017-12-07T16:45:19Z', - offer_id: '278232', - trade_type: 'orderbook', + id: "64199539053039617-0", + paging_token: "64199539053039617-0", + ledger_close_time: "2017-12-07T16:45:19Z", + offer_id: "278232", + trade_type: "orderbook", base_account: - 'GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W', - base_amount: '1269.2134875', - base_asset_type: 'native', + "GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W", + base_amount: "1269.2134875", + base_asset_type: "native", counter_account: - 'GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN', - counter_amount: '19637.5167985', - counter_asset_type: 'credit_alphanum4', - counter_asset_code: 'JPY', + "GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN", + counter_amount: "19637.5167985", + counter_asset_type: "credit_alphanum4", + counter_asset_code: "JPY", counter_asset_issuer: - 'GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', + "GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", base_is_seller: true, price: { - n: '1', - d: '2' + n: "1", + d: "2" } } ] @@ -2197,17 +2197,17 @@ describe('server.js non-transaction tests', function () { }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/trades?offer_id=278232' + "https://horizon-live.stellar.org:1337/trades?offer_id=278232" ) ) .returns(Promise.resolve({ data: tradesResponse })); this.server .trades() - .forOffer('278232') + .forOffer("278232") .call() .then(function (response) { expect(response.records).to.be.deep.equal( @@ -2220,17 +2220,17 @@ describe('server.js non-transaction tests', function () { }); }); - it('trades() requests the correct endpoint for account', function (done) { + it("trades() requests the correct endpoint for account", function (done) { let tradesResponse = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/accounts/GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY/trades?cursor=&limit=10&order=asc' + href: "https://horizon-live.stellar.org:1337/accounts/GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY/trades?cursor=&limit=10&order=asc" }, next: { - href: 'https://horizon-live.stellar.org:1337/accounts/GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY/trades?cursor=77434489365606401-1&limit=10&order=asc' + href: "https://horizon-live.stellar.org:1337/accounts/GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY/trades?cursor=77434489365606401-1&limit=10&order=asc" }, prev: { - href: 'https://horizon-live.stellar.org:1337/accounts/GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY/trades?cursor=77434489365606401-1&limit=10&order=desc' + href: "https://horizon-live.stellar.org:1337/accounts/GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY/trades?cursor=77434489365606401-1&limit=10&order=desc" } }, _embedded: { @@ -2238,41 +2238,41 @@ describe('server.js non-transaction tests', function () { { _links: { self: { - href: '' + href: "" }, seller: { - href: 'https://horizon-live.stellar.org:1337/accounts/GBDTBUKFHJOEAFAVNPGIY65CBIH75DYEZ5VQXOE7YHZM7AJKDNEOW5JG' + href: "https://horizon-live.stellar.org:1337/accounts/GBDTBUKFHJOEAFAVNPGIY65CBIH75DYEZ5VQXOE7YHZM7AJKDNEOW5JG" }, buyer: { - href: 'https://horizon-live.stellar.org:1337/accounts/GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY' + href: "https://horizon-live.stellar.org:1337/accounts/GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY" }, operation: { - href: 'https://horizon-live.stellar.org:1337/operations/77434489365606401' + href: "https://horizon-live.stellar.org:1337/operations/77434489365606401" } }, - id: '77434489365606401-1', - paging_token: '77434489365606401-1', - offer_id: '', - trade_type: 'orderbook', + id: "77434489365606401-1", + paging_token: "77434489365606401-1", + offer_id: "", + trade_type: "orderbook", seller: - 'GBDTBUKFHJOEAFAVNPGIY65CBIH75DYEZ5VQXOE7YHZM7AJKDNEOW5JG', - sold_amount: '', - sold_asset_type: '', + "GBDTBUKFHJOEAFAVNPGIY65CBIH75DYEZ5VQXOE7YHZM7AJKDNEOW5JG", + sold_amount: "", + sold_asset_type: "", buyer: - 'GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY', - bought_amount: '', - bought_asset_type: '', - created_at: '2018-05-23T22:42:28Z' + "GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY", + bought_amount: "", + bought_asset_type: "", + created_at: "2018-05-23T22:42:28Z" } ] } }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts/GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY/trades' + "https://horizon-live.stellar.org:1337/accounts/GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY/trades" ) ) .returns(Promise.resolve({ data: tradesResponse })); @@ -2280,7 +2280,7 @@ describe('server.js non-transaction tests', function () { this.server .trades() .forAccount( - 'GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY' + "GABJBA4HI4LVKWAYORE7SOAAZMVXDHI566JBSD25O5TRDM7LVID6YOXY" ) .call() .then(function (response) { @@ -2294,17 +2294,17 @@ describe('server.js non-transaction tests', function () { }); }); - it('trades() requests the correct endpoint for paging', function (done) { + it("trades() requests the correct endpoint for paging", function (done) { let tradesResponse = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/trades?order=asc&limit=1&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?order=asc&limit=1&cursor=64199539053039617-0" }, next: { - href: 'https://horizon-live.stellar.org:1337/trades?order=asc&limit=1&cursor=64199676491993090-0' + href: "https://horizon-live.stellar.org:1337/trades?order=asc&limit=1&cursor=64199676491993090-0" }, prev: { - href: 'https://horizon-live.stellar.org:1337/trades?order=desc&limit=1&cursor=64199676491993090-0' + href: "https://horizon-live.stellar.org:1337/trades?order=desc&limit=1&cursor=64199676491993090-0" } }, _embedded: { @@ -2312,38 +2312,38 @@ describe('server.js non-transaction tests', function () { { _links: { base: { - href: 'https://horizon-live.stellar.org:1337/accounts/GBBHSWC3XSUFKEFDPQO346BCLM3EAJHICWRVSVIQOG4YBIH3A2VCJ6G2' + href: "https://horizon-live.stellar.org:1337/accounts/GBBHSWC3XSUFKEFDPQO346BCLM3EAJHICWRVSVIQOG4YBIH3A2VCJ6G2" }, counter: { - href: 'https://horizon-live.stellar.org:1337/accounts/GDBXANSAUQ5WBFSA6LFQXR5PYVYAQ3T4KI4LHZ3YAAEFI3BS2Z3SFRVG' + href: "https://horizon-live.stellar.org:1337/accounts/GDBXANSAUQ5WBFSA6LFQXR5PYVYAQ3T4KI4LHZ3YAAEFI3BS2Z3SFRVG" }, operation: { - href: 'https://horizon-live.stellar.org:1337/operations/64199676491993090' + href: "https://horizon-live.stellar.org:1337/operations/64199676491993090" } }, - id: '64199676491993090-0', - paging_token: '64199676491993090-0', - ledger_close_time: '2017-12-07T16:47:59Z', - offer_id: '278245', - trade_type: 'orderbook', + id: "64199676491993090-0", + paging_token: "64199676491993090-0", + ledger_close_time: "2017-12-07T16:47:59Z", + offer_id: "278245", + trade_type: "orderbook", base_account: - 'GBBHSWC3XSUFKEFDPQO346BCLM3EAJHICWRVSVIQOG4YBIH3A2VCJ6G2', - base_amount: '0.0000128', - base_asset_type: 'credit_alphanum4', - base_asset_code: 'BTC', + "GBBHSWC3XSUFKEFDPQO346BCLM3EAJHICWRVSVIQOG4YBIH3A2VCJ6G2", + base_amount: "0.0000128", + base_asset_type: "credit_alphanum4", + base_asset_code: "BTC", base_asset_issuer: - 'GBSTRH4QOTWNSVA6E4HFERETX4ZLSR3CIUBLK7AXYII277PFJC4BBYOG', + "GBSTRH4QOTWNSVA6E4HFERETX4ZLSR3CIUBLK7AXYII277PFJC4BBYOG", counter_account: - 'GDBXANSAUQ5WBFSA6LFQXR5PYVYAQ3T4KI4LHZ3YAAEFI3BS2Z3SFRVG', - counter_amount: '0.0005000', - counter_asset_type: 'credit_alphanum4', - counter_asset_code: 'ETH', + "GDBXANSAUQ5WBFSA6LFQXR5PYVYAQ3T4KI4LHZ3YAAEFI3BS2Z3SFRVG", + counter_amount: "0.0005000", + counter_asset_type: "credit_alphanum4", + counter_asset_code: "ETH", counter_asset_issuer: - 'GBSTRH4QOTWNSVA6E4HFERETX4ZLSR3CIUBLK7AXYII277PFJC4BBYOG', + "GBSTRH4QOTWNSVA6E4HFERETX4ZLSR3CIUBLK7AXYII277PFJC4BBYOG", base_is_seller: false, price: { - n: '1', - d: '2' + n: "1", + d: "2" } } ] @@ -2351,19 +2351,19 @@ describe('server.js non-transaction tests', function () { }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/trades?order=asc&limit=1&cursor=64199539053039617-0' + "https://horizon-live.stellar.org:1337/trades?order=asc&limit=1&cursor=64199539053039617-0" ) ) .returns(Promise.resolve({ data: tradesResponse })); this.server .trades() - .order('asc') - .limit('1') - .cursor('64199539053039617-0') + .order("asc") + .limit("1") + .cursor("64199539053039617-0") .call() .then(function (response) { expect(response.records).to.be.deep.equal( @@ -2376,17 +2376,17 @@ describe('server.js non-transaction tests', function () { }); }); - it('trades() requests the correct endpoint for type orderbook', function (done) { + it("trades() requests the correct endpoint for type orderbook", function (done) { let tradesResponse = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&trade_type=orderbook&cursor=' + href: "https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&trade_type=orderbook&cursor=" }, next: { - href: 'https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&trade_type=orderbook&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&trade_type=orderbook&cursor=64199539053039617-0" }, prev: { - href: 'https://horizon-live.stellar.org:1337/trades?order=desc&limit=200&trade_type=orderbook&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?order=desc&limit=200&trade_type=orderbook&cursor=64199539053039617-0" } }, _embedded: { @@ -2394,35 +2394,35 @@ describe('server.js non-transaction tests', function () { { _links: { base: { - href: 'https://horizon-live.stellar.org:1337/accounts/GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W' + href: "https://horizon-live.stellar.org:1337/accounts/GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W" }, counter: { - href: 'https://horizon-live.stellar.org:1337/accounts/GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN' + href: "https://horizon-live.stellar.org:1337/accounts/GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN" }, operation: { - href: 'https://horizon-live.stellar.org:1337/operations/64199539053039617' + href: "https://horizon-live.stellar.org:1337/operations/64199539053039617" } }, - id: '64199539053039617-0', - paging_token: '64199539053039617-0', - ledger_close_time: '2017-12-07T16:45:19Z', - offer_id: '278232', - trade_type: 'orderbook', + id: "64199539053039617-0", + paging_token: "64199539053039617-0", + ledger_close_time: "2017-12-07T16:45:19Z", + offer_id: "278232", + trade_type: "orderbook", base_account: - 'GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W', - base_amount: '1269.2134875', - base_asset_type: 'native', + "GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W", + base_amount: "1269.2134875", + base_asset_type: "native", counter_account: - 'GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN', - counter_amount: '19637.5167985', - counter_asset_type: 'credit_alphanum4', - counter_asset_code: 'JPY', + "GC6APVH2HCFB7QLSTG3U55IYSW7ZRNSCTOZZYZJCNHWX2FONCNJNULYN", + counter_amount: "19637.5167985", + counter_asset_type: "credit_alphanum4", + counter_asset_code: "JPY", counter_asset_issuer: - 'GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', + "GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", base_is_seller: true, price: { - n: '1', - d: '2' + n: "1", + d: "2" } } ] @@ -2430,17 +2430,17 @@ describe('server.js non-transaction tests', function () { }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/trades?trade_type=orderbook' + "https://horizon-live.stellar.org:1337/trades?trade_type=orderbook" ) ) .returns(Promise.resolve({ data: tradesResponse })); this.server .trades() - .forType('orderbook') + .forType("orderbook") .call() .then(function (response) { expect(response.records).to.be.deep.equal( @@ -2453,17 +2453,17 @@ describe('server.js non-transaction tests', function () { }); }); - it('trades() requests the correct endpoint for type liquidity_pool', function (done) { + it("trades() requests the correct endpoint for type liquidity_pool", function (done) { let tradesResponse = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&trade_type=liquidity_pool&cursor=' + href: "https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&trade_type=liquidity_pool&cursor=" }, next: { - href: 'https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&trade_type=liquidity_pool&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?order=asc&limit=200&trade_type=liquidity_pool&cursor=64199539053039617-0" }, prev: { - href: 'https://horizon-live.stellar.org:1337/trades?order=desc&limit=200&trade_type=liquidity_pool&cursor=64199539053039617-0' + href: "https://horizon-live.stellar.org:1337/trades?order=desc&limit=200&trade_type=liquidity_pool&cursor=64199539053039617-0" } }, _embedded: { @@ -2471,36 +2471,36 @@ describe('server.js non-transaction tests', function () { { _links: { base: { - href: 'https://horizon-live.stellar.org:1337/accounts/GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W' + href: "https://horizon-live.stellar.org:1337/accounts/GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W" }, counter: { - href: 'https://horizon-live.stellar.org:1337/liquidity_pool/dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7' + href: "https://horizon-live.stellar.org:1337/liquidity_pool/dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7" }, operation: { - href: 'https://horizon-live.stellar.org:1337/operations/64199539053039617' + href: "https://horizon-live.stellar.org:1337/operations/64199539053039617" } }, - id: '64199539053039617-0', - paging_token: '64199539053039617-0', - ledger_close_time: '2017-12-07T16:45:19Z', - offer_id: '4616800602922426369', - trade_type: 'liquidity_pool', + id: "64199539053039617-0", + paging_token: "64199539053039617-0", + ledger_close_time: "2017-12-07T16:45:19Z", + offer_id: "4616800602922426369", + trade_type: "liquidity_pool", liquidity_pool_fee_bp: 30, base_account: - 'GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W', - base_amount: '1269.2134875', - base_asset_type: 'native', + "GB7JKG66CJN3ACX5DX43FOZTTSOI7GZUP547I3BSXIJVUX3NRYUXHE6W", + base_amount: "1269.2134875", + base_asset_type: "native", counter_liquidity_pool_id: - 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7', - counter_amount: '19637.5167985', - counter_asset_type: 'credit_alphanum4', - counter_asset_code: 'JPY', + "dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7", + counter_amount: "19637.5167985", + counter_asset_type: "credit_alphanum4", + counter_asset_code: "JPY", counter_asset_issuer: - 'GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM', + "GBVAOIACNSB7OVUXJYC5UE2D4YK2F7A24T7EE5YOMN4CE6GCHUTOUQXM", base_is_seller: true, price: { - n: '1', - d: '2' + n: "1", + d: "2" } } ] @@ -2508,17 +2508,17 @@ describe('server.js non-transaction tests', function () { }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/trades?trade_type=liquidity_pool' + "https://horizon-live.stellar.org:1337/trades?trade_type=liquidity_pool" ) ) .returns(Promise.resolve({ data: tradesResponse })); this.server .trades() - .forType('liquidity_pool') + .forType("liquidity_pool") .call() .then(function (response) { expect(response.records).to.be.deep.equal( @@ -2532,116 +2532,116 @@ describe('server.js non-transaction tests', function () { }); }); - describe('StrictReceivePathCallBuilder', function () { + describe("StrictReceivePathCallBuilder", function () { let pathsResponse = { _embedded: { records: [ { - destination_amount: '20.0000000', - destination_asset_code: 'EUR', + destination_amount: "20.0000000", + destination_asset_code: "EUR", destination_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - destination_asset_type: 'credit_alphanum4', + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + destination_asset_type: "credit_alphanum4", path: [], - source_amount: '30.0000000', - source_asset_code: 'USD', + source_amount: "30.0000000", + source_asset_code: "USD", source_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - source_asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + source_asset_type: "credit_alphanum4" }, { - destination_amount: '20.0000000', - destination_asset_code: 'EUR', + destination_amount: "20.0000000", + destination_asset_code: "EUR", destination_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - destination_asset_type: 'credit_alphanum4', + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + destination_asset_type: "credit_alphanum4", path: [ { - asset_code: '1', + asset_code: "1", asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + asset_type: "credit_alphanum4" } ], - source_amount: '20.0000000', - source_asset_code: 'USD', + source_amount: "20.0000000", + source_asset_code: "USD", source_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - source_asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + source_asset_type: "credit_alphanum4" }, { - destination_amount: '20.0000000', - destination_asset_code: 'EUR', + destination_amount: "20.0000000", + destination_asset_code: "EUR", destination_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - destination_asset_type: 'credit_alphanum4', + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + destination_asset_type: "credit_alphanum4", path: [ { - asset_code: '21', + asset_code: "21", asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + asset_type: "credit_alphanum4" }, { - asset_code: '22', + asset_code: "22", asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + asset_type: "credit_alphanum4" } ], - source_amount: '20.0000000', - source_asset_code: 'USD', + source_amount: "20.0000000", + source_asset_code: "USD", source_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - source_asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + source_asset_type: "credit_alphanum4" } ] }, _links: { self: { - href: '/paths/strict-receive' + href: "/paths/strict-receive" } } }; - it('requests the correct endpoint when source is an account', function (done) { + it("requests the correct endpoint when source is an account", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/paths/strict-receive?source_account=GARSFJNXJIHO6ULUBK3DBYKVSIZE7SC72S5DYBCHU7DKL22UXKVD7MXP&destination_amount=20.0&destination_asset_type=credit_alphanum4&destination_asset_code=EUR&destination_asset_issuer=GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "https://horizon-live.stellar.org:1337/paths/strict-receive?source_account=GARSFJNXJIHO6ULUBK3DBYKVSIZE7SC72S5DYBCHU7DKL22UXKVD7MXP&destination_amount=20.0&destination_asset_type=credit_alphanum4&destination_asset_code=EUR&destination_asset_issuer=GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ) ) .returns(Promise.resolve({ data: pathsResponse })); this.server .strictReceivePaths( - 'GARSFJNXJIHO6ULUBK3DBYKVSIZE7SC72S5DYBCHU7DKL22UXKVD7MXP', + "GARSFJNXJIHO6ULUBK3DBYKVSIZE7SC72S5DYBCHU7DKL22UXKVD7MXP", new StellarSdk.Asset( - 'EUR', - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "EUR", + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ), - '20.0' + "20.0" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( pathsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { done(err); }); }); - it('requests the correct endpoint when source is a list of assets', function (done) { + it("requests the correct endpoint when source is a list of assets", function (done) { let destinationAssets = encodeURIComponent( - 'native,EUR:GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN,USD:GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "native,EUR:GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN,USD:GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ); this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( `https://horizon-live.stellar.org:1337/paths/strict-receive?source_assets=${destinationAssets}&destination_amount=20.0&destination_asset_type=credit_alphanum4&destination_asset_code=EUR&destination_asset_issuer=GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN` @@ -2652,12 +2652,12 @@ describe('server.js non-transaction tests', function () { let assets = [ StellarSdk.Asset.native(), new StellarSdk.Asset( - 'EUR', - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "EUR", + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ), new StellarSdk.Asset( - 'USD', - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "USD", + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ) ]; @@ -2665,18 +2665,18 @@ describe('server.js non-transaction tests', function () { .strictReceivePaths( assets, new StellarSdk.Asset( - 'EUR', - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "EUR", + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ), - '20.0' + "20.0" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( pathsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -2685,84 +2685,84 @@ describe('server.js non-transaction tests', function () { }); }); - describe('PathStrictSendCallBuilder', function () { + describe("PathStrictSendCallBuilder", function () { let pathsResponse = { _embedded: { records: [ { - destination_amount: '20.0000000', - destination_asset_code: 'EUR', + destination_amount: "20.0000000", + destination_asset_code: "EUR", destination_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - destination_asset_type: 'credit_alphanum4', + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + destination_asset_type: "credit_alphanum4", path: [], - source_amount: '30.0000000', - source_asset_code: 'USD', + source_amount: "30.0000000", + source_asset_code: "USD", source_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - source_asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + source_asset_type: "credit_alphanum4" }, { - destination_amount: '20.0000000', - destination_asset_code: 'EUR', + destination_amount: "20.0000000", + destination_asset_code: "EUR", destination_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - destination_asset_type: 'credit_alphanum4', + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + destination_asset_type: "credit_alphanum4", path: [ { - asset_code: '1', + asset_code: "1", asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + asset_type: "credit_alphanum4" } ], - source_amount: '20.0000000', - source_asset_code: 'USD', + source_amount: "20.0000000", + source_asset_code: "USD", source_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - source_asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + source_asset_type: "credit_alphanum4" }, { - destination_amount: '20.0000000', - destination_asset_code: 'EUR', + destination_amount: "20.0000000", + destination_asset_code: "EUR", destination_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - destination_asset_type: 'credit_alphanum4', + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + destination_asset_type: "credit_alphanum4", path: [ { - asset_code: '21', + asset_code: "21", asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + asset_type: "credit_alphanum4" }, { - asset_code: '22', + asset_code: "22", asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + asset_type: "credit_alphanum4" } ], - source_amount: '20.0000000', - source_asset_code: 'USD', + source_amount: "20.0000000", + source_asset_code: "USD", source_asset_issuer: - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN', - source_asset_type: 'credit_alphanum4' + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN", + source_asset_type: "credit_alphanum4" } ] }, _links: { self: { - href: '/paths/strict-send' + href: "/paths/strict-send" } } }; - it('requests the correct endpoint when destination is account', function (done) { + it("requests the correct endpoint when destination is account", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/paths/strict-send?source_asset_type=credit_alphanum4&source_asset_code=EUR&source_asset_issuer=GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN&source_amount=20.0&destination_account=GAEDTJ4PPEFVW5XV2S7LUXBEHNQMX5Q2GM562RJGOQG7GVCE5H3HIB4V' + "https://horizon-live.stellar.org:1337/paths/strict-send?source_asset_type=credit_alphanum4&source_asset_code=EUR&source_asset_issuer=GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN&source_amount=20.0&destination_account=GAEDTJ4PPEFVW5XV2S7LUXBEHNQMX5Q2GM562RJGOQG7GVCE5H3HIB4V" ) ) .returns(Promise.resolve({ data: pathsResponse })); @@ -2770,31 +2770,31 @@ describe('server.js non-transaction tests', function () { this.server .strictSendPaths( new StellarSdk.Asset( - 'EUR', - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "EUR", + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ), - '20.0', - 'GAEDTJ4PPEFVW5XV2S7LUXBEHNQMX5Q2GM562RJGOQG7GVCE5H3HIB4V' + "20.0", + "GAEDTJ4PPEFVW5XV2S7LUXBEHNQMX5Q2GM562RJGOQG7GVCE5H3HIB4V" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( pathsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { done(err); }); }); - it('requests the correct endpoint when destination is a list of assets', function (done) { + it("requests the correct endpoint when destination is a list of assets", function (done) { let destinationAssets = encodeURIComponent( - 'native,EUR:GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN,USD:GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "native,EUR:GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN,USD:GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ); this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( `https://horizon-live.stellar.org:1337/paths/strict-send?source_asset_type=credit_alphanum4&source_asset_code=EUR&source_asset_issuer=GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN&source_amount=20.0&destination_assets=${destinationAssets}` @@ -2805,22 +2805,22 @@ describe('server.js non-transaction tests', function () { let assets = [ StellarSdk.Asset.native(), new StellarSdk.Asset( - 'EUR', - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "EUR", + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ), new StellarSdk.Asset( - 'USD', - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "USD", + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ) ]; this.server .strictSendPaths( new StellarSdk.Asset( - 'EUR', - 'GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN' + "EUR", + "GDSBCQO34HWPGUGQSP3QBFEXVTSR2PW46UIGTHVWGWJGQKH3AFNHXHXN" ), - '20.0', + "20.0", assets ) .call() @@ -2828,8 +2828,8 @@ describe('server.js non-transaction tests', function () { expect(response.records).to.be.deep.equal( pathsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -2838,64 +2838,64 @@ describe('server.js non-transaction tests', function () { }); }); - describe('EffectCallBuilder', function () { + describe("EffectCallBuilder", function () { let effectsResponse = { _embedded: { records: [ { _links: { operation: { - href: '/operations/146028892161' + href: "/operations/146028892161" }, precedes: { - href: '/effects?cursor=146028892161-1\u0026order=asc' + href: "/effects?cursor=146028892161-1\u0026order=asc" }, succeeds: { - href: '/effects?cursor=146028892161-1\u0026order=desc' + href: "/effects?cursor=146028892161-1\u0026order=desc" } }, account: - 'GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K', - paging_token: '146028892161-1', - starting_balance: '10000000.0', + "GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K", + paging_token: "146028892161-1", + starting_balance: "10000000.0", type: 0, - type_s: 'account_created' + type_s: "account_created" } ] }, _links: { next: { - href: '/effects?order=asc\u0026limit=1\u0026cursor=146028892161-1' + href: "/effects?order=asc\u0026limit=1\u0026cursor=146028892161-1" }, prev: { - href: '/effects?order=desc\u0026limit=1\u0026cursor=146028892161-1' + href: "/effects?order=desc\u0026limit=1\u0026cursor=146028892161-1" }, self: { - href: '/effects?order=asc\u0026limit=1\u0026cursor=' + href: "/effects?order=asc\u0026limit=1\u0026cursor=" } } }; - it('requests the correct endpoint', function (done) { + it("requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/effects?cursor=b' + "https://horizon-live.stellar.org:1337/effects?cursor=b" ) ) .returns(Promise.resolve({ data: effectsResponse })); this.server .effects() - .cursor('b') + .cursor("b") .call() .then(function (response) { expect(response.records).to.be.deep.equal( effectsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -2903,12 +2903,12 @@ describe('server.js non-transaction tests', function () { }); }); - it('forAccount() requests the correct endpoint', function (done) { + it("forAccount() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts/GCGHCFUB6JKQE42C76BK2LYB3EHKP4WQJE624WTSL3CU2PPDYE5RBMJE/effects' + "https://horizon-live.stellar.org:1337/accounts/GCGHCFUB6JKQE42C76BK2LYB3EHKP4WQJE624WTSL3CU2PPDYE5RBMJE/effects" ) ) .returns(Promise.resolve({ data: effectsResponse })); @@ -2916,15 +2916,15 @@ describe('server.js non-transaction tests', function () { this.server .effects() .forAccount( - 'GCGHCFUB6JKQE42C76BK2LYB3EHKP4WQJE624WTSL3CU2PPDYE5RBMJE' + "GCGHCFUB6JKQE42C76BK2LYB3EHKP4WQJE624WTSL3CU2PPDYE5RBMJE" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( effectsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -2932,12 +2932,12 @@ describe('server.js non-transaction tests', function () { }); }); - it('forTransaction() requests the correct endpoint', function (done) { + it("forTransaction() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/transactions/ef37d6770c40c3bdb6adba80759f2819971396d1c3dfb7b5611f63ad72a9a4ae/effects' + "https://horizon-live.stellar.org:1337/transactions/ef37d6770c40c3bdb6adba80759f2819971396d1c3dfb7b5611f63ad72a9a4ae/effects" ) ) .returns(Promise.resolve({ data: effectsResponse })); @@ -2945,15 +2945,15 @@ describe('server.js non-transaction tests', function () { this.server .effects() .forTransaction( - 'ef37d6770c40c3bdb6adba80759f2819971396d1c3dfb7b5611f63ad72a9a4ae' + "ef37d6770c40c3bdb6adba80759f2819971396d1c3dfb7b5611f63ad72a9a4ae" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( effectsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -2961,82 +2961,82 @@ describe('server.js non-transaction tests', function () { }); }); - it('rejects two filters', function (done) { + it("rejects two filters", function (done) { expect(() => - this.server.effects().forOperation('blah').forLedger('234').call() + this.server.effects().forOperation("blah").forLedger("234").call() ).to.throw(/Too many filters/); done(); }); }); - describe('OperationCallBuilder', function () { + describe("OperationCallBuilder", function () { let operationsResponse = { _embedded: { records: [ { _links: { effects: { - href: '/operations/146028892161/effects{?cursor,limit,order}', + href: "/operations/146028892161/effects{?cursor,limit,order}", templated: true }, precedes: { - href: '/operations?cursor=146028892161\u0026order=asc' + href: "/operations?cursor=146028892161\u0026order=asc" }, self: { - href: '/operations/146028892161' + href: "/operations/146028892161" }, succeeds: { - href: '/operations?cursor=146028892161\u0026order=desc' + href: "/operations?cursor=146028892161\u0026order=desc" }, transaction: { - href: '/transactions/991534d902063b7715cd74207bef4e7bd7aa2f108f62d3eba837ce6023b2d4f3' + href: "/transactions/991534d902063b7715cd74207bef4e7bd7aa2f108f62d3eba837ce6023b2d4f3" } }, account: - 'GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K', + "GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K", funder: - 'GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H', + "GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H", id: 146028892161, - paging_token: '146028892161', - starting_balance: '10000000.0', + paging_token: "146028892161", + starting_balance: "10000000.0", type: 0, - type_s: 'create_account' + type_s: "create_account" } ] }, _links: { next: { - href: '/operations?order=asc\u0026limit=1\u0026cursor=146028892161' + href: "/operations?order=asc\u0026limit=1\u0026cursor=146028892161" }, prev: { - href: '/operations?order=desc\u0026limit=1\u0026cursor=146028892161' + href: "/operations?order=desc\u0026limit=1\u0026cursor=146028892161" }, self: { - href: '/operations?order=asc\u0026limit=1\u0026cursor=' + href: "/operations?order=asc\u0026limit=1\u0026cursor=" } } }; - it('operation() requests the correct endpoint', function (done) { + it("operation() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/operations/123456789' + "https://horizon-live.stellar.org:1337/operations/123456789" ) ) .returns(Promise.resolve({ data: operationsResponse })); this.server .operations() - .operation('123456789') + .operation("123456789") .call() .then(function (response) { expect(response.records).to.be.deep.equal( operationsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -3044,12 +3044,12 @@ describe('server.js non-transaction tests', function () { }); }); - it('forAccount() requests the correct endpoint', function (done) { + it("forAccount() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts/GCGHCFUB6JKQE42C76BK2LYB3EHKP4WQJE624WTSL3CU2PPDYE5RBMJE/operations' + "https://horizon-live.stellar.org:1337/accounts/GCGHCFUB6JKQE42C76BK2LYB3EHKP4WQJE624WTSL3CU2PPDYE5RBMJE/operations" ) ) .returns(Promise.resolve({ data: operationsResponse })); @@ -3057,15 +3057,15 @@ describe('server.js non-transaction tests', function () { this.server .operations() .forAccount( - 'GCGHCFUB6JKQE42C76BK2LYB3EHKP4WQJE624WTSL3CU2PPDYE5RBMJE' + "GCGHCFUB6JKQE42C76BK2LYB3EHKP4WQJE624WTSL3CU2PPDYE5RBMJE" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( operationsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -3073,12 +3073,12 @@ describe('server.js non-transaction tests', function () { }); }); - it('forClaimableBalance() requests the correct endpoint', function (done) { + it("forClaimableBalance() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000/operations' + "https://horizon-live.stellar.org:1337/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000/operations" ) ) .returns(Promise.resolve({ data: operationsResponse })); @@ -3086,15 +3086,15 @@ describe('server.js non-transaction tests', function () { this.server .operations() .forClaimableBalance( - '000000000102030000000000000000000000000000000000000000000000000000000000' + "000000000102030000000000000000000000000000000000000000000000000000000000" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( operationsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -3102,12 +3102,12 @@ describe('server.js non-transaction tests', function () { }); }); - it('forLedger() requests the correct endpoint', function (done) { + it("forLedger() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/ledgers/123456789/operations' + "https://horizon-live.stellar.org:1337/ledgers/123456789/operations" ) ) .returns(Promise.resolve({ data: operationsResponse })); @@ -3120,8 +3120,8 @@ describe('server.js non-transaction tests', function () { expect(response.records).to.be.deep.equal( operationsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -3129,26 +3129,26 @@ describe('server.js non-transaction tests', function () { }); }); - it('forTransaction() requests the correct endpoint', function (done) { + it("forTransaction() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/transactions/blah/operations' + "https://horizon-live.stellar.org:1337/transactions/blah/operations" ) ) .returns(Promise.resolve({ data: operationsResponse })); this.server .operations() - .forTransaction('blah') + .forTransaction("blah") .call() .then(function (response) { expect(response.records).to.be.deep.equal( operationsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -3157,60 +3157,60 @@ describe('server.js non-transaction tests', function () { }); }); - describe('PaymentCallBuilder', function () { + describe("PaymentCallBuilder", function () { let paymentsResponse = { _embedded: { records: [ { _links: { effects: { - href: '/operations/146028892161/effects{?cursor,limit,order}', + href: "/operations/146028892161/effects{?cursor,limit,order}", templated: true }, precedes: { - href: '/operations?cursor=146028892161\u0026order=asc' + href: "/operations?cursor=146028892161\u0026order=asc" }, self: { - href: '/operations/146028892161' + href: "/operations/146028892161" }, succeeds: { - href: '/operations?cursor=146028892161\u0026order=desc' + href: "/operations?cursor=146028892161\u0026order=desc" }, transaction: { - href: '/transactions/991534d902063b7715cd74207bef4e7bd7aa2f108f62d3eba837ce6023b2d4f3' + href: "/transactions/991534d902063b7715cd74207bef4e7bd7aa2f108f62d3eba837ce6023b2d4f3" } }, account: - 'GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K', + "GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K", funder: - 'GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H', + "GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H", id: 146028892161, - paging_token: '146028892161', - starting_balance: '10000000.0', + paging_token: "146028892161", + starting_balance: "10000000.0", type: 0, - type_s: 'create_account' + type_s: "create_account" } ] }, _links: { next: { - href: '/payments?order=asc\u0026limit=1\u0026cursor=146028892161' + href: "/payments?order=asc\u0026limit=1\u0026cursor=146028892161" }, prev: { - href: '/payments?order=desc\u0026limit=1\u0026cursor=146028892161' + href: "/payments?order=desc\u0026limit=1\u0026cursor=146028892161" }, self: { - href: '/payments?order=asc\u0026limit=1\u0026cursor=' + href: "/payments?order=asc\u0026limit=1\u0026cursor=" } } }; - it('forAccount() requests the correct endpoint', function (done) { + it("forAccount() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/payments' + "https://horizon-live.stellar.org:1337/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/payments" ) ) .returns(Promise.resolve({ data: paymentsResponse })); @@ -3218,15 +3218,15 @@ describe('server.js non-transaction tests', function () { this.server .payments() .forAccount( - 'GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K' + "GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( paymentsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -3234,26 +3234,26 @@ describe('server.js non-transaction tests', function () { }); }); - it('forLedger() requests the correct endpoint', function (done) { + it("forLedger() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/ledgers/123456789/payments' + "https://horizon-live.stellar.org:1337/ledgers/123456789/payments" ) ) .returns(Promise.resolve({ data: paymentsResponse })); this.server .payments() - .forLedger('123456789') + .forLedger("123456789") .call() .then(function (response) { expect(response.records).to.be.deep.equal( paymentsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -3261,12 +3261,12 @@ describe('server.js non-transaction tests', function () { }); }); - it('forTransaction() requests the correct endpoint', function (done) { + it("forTransaction() requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/transactions/77277606902d80a03a892536ebff8466726a4e55c3923ec2d3eeb3aa5bdc3731/payments' + "https://horizon-live.stellar.org:1337/transactions/77277606902d80a03a892536ebff8466726a4e55c3923ec2d3eeb3aa5bdc3731/payments" ) ) .returns(Promise.resolve({ data: paymentsResponse })); @@ -3274,15 +3274,15 @@ describe('server.js non-transaction tests', function () { this.server .payments() .forTransaction( - '77277606902d80a03a892536ebff8466726a4e55c3923ec2d3eeb3aa5bdc3731' + "77277606902d80a03a892536ebff8466726a4e55c3923ec2d3eeb3aa5bdc3731" ) .call() .then(function (response) { expect(response.records).to.be.deep.equal( paymentsResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -3291,23 +3291,23 @@ describe('server.js non-transaction tests', function () { }); }); - describe('FriendbotCallBuilder', function () { + describe("FriendbotCallBuilder", function () { let friendbotResponse = { ledger: 2 }; - it('requests the correct endpoint', function (done) { + it("requests the correct endpoint", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/friendbot?addr=GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K' + "https://horizon-live.stellar.org:1337/friendbot?addr=GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K" ) ) .returns(Promise.resolve({ data: friendbotResponse })); this.server - .friendbot('GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K') + .friendbot("GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K") .call() .then(function (response) { expect(response.ledger).to.be.equal(friendbotResponse.ledger); @@ -3319,17 +3319,17 @@ describe('server.js non-transaction tests', function () { }); }); - describe('TradeAggregationCallBuilder', function () { + describe("TradeAggregationCallBuilder", function () { let tradeAggregationResponse = { _links: { self: { - href: 'https://horizon.stellar.org/trade_aggregations?base_asset_type=native\u0026counter_asset_type=credit_alphanum4\u0026counter_asset_code=BTC\u0026counter_asset_issuer=GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH\u0026start_time=1512689100000\u0026end_time=1512775500000\u0026resolution=300000' + href: "https://horizon.stellar.org/trade_aggregations?base_asset_type=native\u0026counter_asset_type=credit_alphanum4\u0026counter_asset_code=BTC\u0026counter_asset_issuer=GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH\u0026start_time=1512689100000\u0026end_time=1512775500000\u0026resolution=300000" }, next: { - href: 'https://horizon.stellar.org/trade_aggregations?base_asset_type=native\u0026counter_asset_code=BTC\u0026counter_asset_issuer=GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH\u0026counter_asset_type=credit_alphanum4\u0026end_time=1512775500000\u0026resolution=300000\u0026start_time=1512765000000' + href: "https://horizon.stellar.org/trade_aggregations?base_asset_type=native\u0026counter_asset_code=BTC\u0026counter_asset_issuer=GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH\u0026counter_asset_type=credit_alphanum4\u0026end_time=1512775500000\u0026resolution=300000\u0026start_time=1512765000000" }, prev: { - href: '' + href: "" } }, _embedded: { @@ -3337,46 +3337,46 @@ describe('server.js non-transaction tests', function () { { timestamp: 1512731100000, trade_count: 2, - base_volume: '341.8032786', - counter_volume: '0.0041700', - avg: '0.0000122', - high: '0.0000122', - low: '0.0000122', - open: '0.0000122', - close: '0.0000122' + base_volume: "341.8032786", + counter_volume: "0.0041700", + avg: "0.0000122", + high: "0.0000122", + low: "0.0000122", + open: "0.0000122", + close: "0.0000122" }, { timestamp: 1512732300000, trade_count: 1, - base_volume: '233.6065573', - counter_volume: '0.0028500', - avg: '0.0000122', - high: '0.0000122', - low: '0.0000122', - open: '0.0000122', - close: '0.0000122' + base_volume: "233.6065573", + counter_volume: "0.0028500", + avg: "0.0000122", + high: "0.0000122", + low: "0.0000122", + open: "0.0000122", + close: "0.0000122" }, { timestamp: 1512764700000, trade_count: 1, - base_volume: '451.0000000', - counter_volume: '0.0027962', - avg: '0.0000062', - high: '0.0000062', - low: '0.0000062', - open: '0.0000062', - close: '0.0000062' + base_volume: "451.0000000", + counter_volume: "0.0027962", + avg: "0.0000062", + high: "0.0000062", + low: "0.0000062", + open: "0.0000062", + close: "0.0000062" } ] } }; - it('requests the correct endpoint native/credit', function (done) { + it("requests the correct endpoint native/credit", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/trade_aggregations?base_asset_type=native&counter_asset_type=credit_alphanum4&counter_asset_code=BTC&counter_asset_issuer=GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH&start_time=1512689100000&end_time=1512775500000&resolution=300000' + "https://horizon-live.stellar.org:1337/trade_aggregations?base_asset_type=native&counter_asset_type=credit_alphanum4&counter_asset_code=BTC&counter_asset_issuer=GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH&start_time=1512689100000&end_time=1512775500000&resolution=300000" ) ) .returns(Promise.resolve({ data: tradeAggregationResponse })); @@ -3385,8 +3385,8 @@ describe('server.js non-transaction tests', function () { .tradeAggregation( StellarSdk.Asset.native(), new StellarSdk.Asset( - 'BTC', - 'GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH' + "BTC", + "GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH" ), 1512689100000, 1512775500000, @@ -3398,8 +3398,8 @@ describe('server.js non-transaction tests', function () { expect(response.records).to.be.deep.equal( tradeAggregationResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -3407,12 +3407,12 @@ describe('server.js non-transaction tests', function () { }); }); - it('requests the correct endpoint credit/native', function (done) { + it("requests the correct endpoint credit/native", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/trade_aggregations?base_asset_type=credit_alphanum4&base_asset_code=BTC&base_asset_issuer=GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH&counter_asset_type=native&start_time=1512689100000&end_time=1512775500000&resolution=300000' + "https://horizon-live.stellar.org:1337/trade_aggregations?base_asset_type=credit_alphanum4&base_asset_code=BTC&base_asset_issuer=GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH&counter_asset_type=native&start_time=1512689100000&end_time=1512775500000&resolution=300000" ) ) .returns(Promise.resolve({ data: tradeAggregationResponse })); @@ -3420,8 +3420,8 @@ describe('server.js non-transaction tests', function () { this.server .tradeAggregation( new StellarSdk.Asset( - 'BTC', - 'GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH' + "BTC", + "GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH" ), StellarSdk.Asset.native(), 1512689100000, @@ -3434,8 +3434,8 @@ describe('server.js non-transaction tests', function () { expect(response.records).to.be.deep.equal( tradeAggregationResponse._embedded.records ); - expect(response.next).to.be.a('function'); - expect(response.prev).to.be.a('function'); + expect(response.next).to.be.a("function"); + expect(response.prev).to.be.a("function"); done(); }) .catch(function (err) { @@ -3444,18 +3444,18 @@ describe('server.js non-transaction tests', function () { }); }); - describe('AssetsCallBuilder', function () { - it('requests the correct endpoint', function (done) { + describe("AssetsCallBuilder", function () { + it("requests the correct endpoint", function (done) { let assetsResponse = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/assets?order=asc\u0026limit=1\u0026cursor=' + href: "https://horizon-live.stellar.org:1337/assets?order=asc\u0026limit=1\u0026cursor=" }, next: { - href: 'https://horizon-live.stellar.org:1337/assets?order=asc\u0026limit=1\u0026cursor=9HORIZONS_GB2HXY7UEDCSHOWZ4553QFGFILNU73OFS2P4HU5IB3UUU66TWPBPVTGW_credit_alphanum12' + href: "https://horizon-live.stellar.org:1337/assets?order=asc\u0026limit=1\u0026cursor=9HORIZONS_GB2HXY7UEDCSHOWZ4553QFGFILNU73OFS2P4HU5IB3UUU66TWPBPVTGW_credit_alphanum12" }, prev: { - href: 'https://horizon-live.stellar.org:1337/assets?order=desc\u0026limit=1\u0026cursor=9HORIZONS_GB2HXY7UEDCSHOWZ4553QFGFILNU73OFS2P4HU5IB3UUU66TWPBPVTGW_credit_alphanum12' + href: "https://horizon-live.stellar.org:1337/assets?order=desc\u0026limit=1\u0026cursor=9HORIZONS_GB2HXY7UEDCSHOWZ4553QFGFILNU73OFS2P4HU5IB3UUU66TWPBPVTGW_credit_alphanum12" } }, _embedded: { @@ -3463,15 +3463,15 @@ describe('server.js non-transaction tests', function () { { _links: { toml: { - href: '' + href: "" } }, - asset_type: 'credit_alphanum12', - asset_code: '9HORIZONS', + asset_type: "credit_alphanum12", + asset_code: "9HORIZONS", asset_issuer: - 'GB2HXY7UEDCSHOWZ4553QFGFILNU73OFS2P4HU5IB3UUU66TWPBPVTGW', + "GB2HXY7UEDCSHOWZ4553QFGFILNU73OFS2P4HU5IB3UUU66TWPBPVTGW", paging_token: - '9HORIZONS_GB2HXY7UEDCSHOWZ4553QFGFILNU73OFS2P4HU5IB3UUU66TWPBPVTGW_credit_alphanum12', + "9HORIZONS_GB2HXY7UEDCSHOWZ4553QFGFILNU73OFS2P4HU5IB3UUU66TWPBPVTGW_credit_alphanum12", accounts: { authorized: 2, authorized_to_maintain_liabilities: 1, @@ -3480,13 +3480,13 @@ describe('server.js non-transaction tests', function () { num_claimable_balances: 3, num_contracts: 2, balances: { - authorized: '1000000.0000000', - authorized_to_maintain_liabilities: '500000.0000000', - unauthorized: '0.0000000' + authorized: "1000000.0000000", + authorized_to_maintain_liabilities: "500000.0000000", + unauthorized: "0.0000000" }, - claimable_balances_amount: '0.0000000', - contracts_amount: '1000.0000000', - amount: '1000000.0000000', + claimable_balances_amount: "0.0000000", + contracts_amount: "1000.0000000", + amount: "1000000.0000000", num_accounts: 2, flags: { auth_required: false, @@ -3500,15 +3500,15 @@ describe('server.js non-transaction tests', function () { }; this.axiosMock - .expects('get') + .expects("get") .withArgs( - sinon.match('https://horizon-live.stellar.org:1337/assets?limit=1') + sinon.match("https://horizon-live.stellar.org:1337/assets?limit=1") ) .returns(Promise.resolve({ data: assetsResponse })); this.server .assets() - .limit('1') + .limit("1") .call() .then(function (response) { expect(response.records).to.be.equal( @@ -3521,17 +3521,17 @@ describe('server.js non-transaction tests', function () { }); }); - it('requests the correct endpoint (asset_code)', function (done) { + it("requests the correct endpoint (asset_code)", function (done) { let assetsCodeResponse = { _links: { self: { - href: 'https://horizon-live.stellar.org:1337/assets?order=asc\u0026limit=1\u0026cursor=\u0026asset_code=USD' + href: "https://horizon-live.stellar.org:1337/assets?order=asc\u0026limit=1\u0026cursor=\u0026asset_code=USD" }, next: { - href: 'https://horizon-live.stellar.org:1337/assets?order=asc\u0026limit=1\u0026cursor=USD_GCYK67DDGBOANS6UODJ62QWGLEB2A7JQ3XUV25HCMLT7CI23PMMK3W6R_credit_alphanum4\u0026asset_code=USD' + href: "https://horizon-live.stellar.org:1337/assets?order=asc\u0026limit=1\u0026cursor=USD_GCYK67DDGBOANS6UODJ62QWGLEB2A7JQ3XUV25HCMLT7CI23PMMK3W6R_credit_alphanum4\u0026asset_code=USD" }, prev: { - href: 'https://horizon-live.stellar.org:1337/assets?order=desc\u0026limit=1\u0026cursor=USD_GCYK67DDGBOANS6UODJ62QWGLEB2A7JQ3XUV25HCMLT7CI23PMMK3W6R_credit_alphanum4\u0026asset_code=USD' + href: "https://horizon-live.stellar.org:1337/assets?order=desc\u0026limit=1\u0026cursor=USD_GCYK67DDGBOANS6UODJ62QWGLEB2A7JQ3XUV25HCMLT7CI23PMMK3W6R_credit_alphanum4\u0026asset_code=USD" } }, _embedded: { @@ -3539,15 +3539,15 @@ describe('server.js non-transaction tests', function () { { _links: { toml: { - href: '' + href: "" } }, - asset_type: 'credit_alphanum4', - asset_code: 'USD', + asset_type: "credit_alphanum4", + asset_code: "USD", asset_issuer: - 'GCYK67DDGBOANS6UODJ62QWGLEB2A7JQ3XUV25HCMLT7CI23PMMK3W6R', + "GCYK67DDGBOANS6UODJ62QWGLEB2A7JQ3XUV25HCMLT7CI23PMMK3W6R", paging_token: - 'USD_GCYK67DDGBOANS6UODJ62QWGLEB2A7JQ3XUV25HCMLT7CI23PMMK3W6R_credit_alphanum4', + "USD_GCYK67DDGBOANS6UODJ62QWGLEB2A7JQ3XUV25HCMLT7CI23PMMK3W6R_credit_alphanum4", accounts: { authorized: 127, authorized_to_maintain_liabilities: 64, @@ -3556,13 +3556,13 @@ describe('server.js non-transaction tests', function () { num_claimable_balances: 3, num_contracts: 2, balances: { - authorized: '111.0010000', - authorized_to_maintain_liabilities: '55.5005000', - unauthorized: '0.0000000' + authorized: "111.0010000", + authorized_to_maintain_liabilities: "55.5005000", + unauthorized: "0.0000000" }, - claimable_balances_amount: '0.0000000', - contracts_amount: '10000.0000000', - amount: '111.0010000', + claimable_balances_amount: "0.0000000", + contracts_amount: "10000.0000000", + amount: "111.0010000", num_accounts: 127, flags: { auth_required: false, @@ -3575,18 +3575,18 @@ describe('server.js non-transaction tests', function () { } }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/assets?asset_code=USD&limit=1' + "https://horizon-live.stellar.org:1337/assets?asset_code=USD&limit=1" ) ) .returns(Promise.resolve({ data: assetsCodeResponse })); this.server .assets() - .forCode('USD') - .limit('1') + .forCode("USD") + .limit("1") .call() .then(function (response) { expect(response.records).to.be.equal( @@ -3599,17 +3599,17 @@ describe('server.js non-transaction tests', function () { }); }); - it('requests the correct endpoint (asset_issuer)', function (done) { + it("requests the correct endpoint (asset_issuer)", function (done) { let assetIssuerResponse = { _links: { self: { - href: 'http://horizon-testnet.stellar.org:1337/assets?order=asc\u0026limit=10\u0026cursor=\u0026asset_issuer=GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN' + href: "http://horizon-testnet.stellar.org:1337/assets?order=asc\u0026limit=10\u0026cursor=\u0026asset_issuer=GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN" }, next: { - href: 'http://horizon-testnet.stellar.org:1337/assets?order=asc\u0026limit=10\u0026cursor=00acc1_GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN_credit_alphanum12\u0026asset_issuer=GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN' + href: "http://horizon-testnet.stellar.org:1337/assets?order=asc\u0026limit=10\u0026cursor=00acc1_GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN_credit_alphanum12\u0026asset_issuer=GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN" }, prev: { - href: 'http://horizon-testnet.stellar.org:1337/assets?order=desc\u0026limit=10\u0026cursor=004d40_GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN_credit_alphanum12\u0026asset_issuer=GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN' + href: "http://horizon-testnet.stellar.org:1337/assets?order=desc\u0026limit=10\u0026cursor=004d40_GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN_credit_alphanum12\u0026asset_issuer=GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN" } }, _embedded: { @@ -3617,15 +3617,15 @@ describe('server.js non-transaction tests', function () { { _links: { toml: { - href: '' + href: "" } }, - asset_type: 'credit_alphanum12', - asset_code: '004d40', + asset_type: "credit_alphanum12", + asset_code: "004d40", asset_issuer: - 'GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN', + "GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN", paging_token: - '004d40_GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN_credit_alphanum12', + "004d40_GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN_credit_alphanum12", accounts: { authorized: 18, authorized_to_maintain_liabilities: 9, @@ -3634,13 +3634,13 @@ describe('server.js non-transaction tests', function () { num_claimable_balances: 3, num_contracts: 2, balances: { - authorized: '757.0000000', - authorized_to_maintain_liabilities: '378.5000000', - unauthorized: '0.0000000' + authorized: "757.0000000", + authorized_to_maintain_liabilities: "378.5000000", + unauthorized: "0.0000000" }, - claimable_balances_amount: '0.0000000', - contracts_amount: '10000.0000000', - amount: '757.0000000', + claimable_balances_amount: "0.0000000", + contracts_amount: "10000.0000000", + amount: "757.0000000", num_accounts: 18, flags: { auth_required: false, @@ -3653,18 +3653,18 @@ describe('server.js non-transaction tests', function () { } }; this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/assets?asset_issuer=GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN&limit=1' + "https://horizon-live.stellar.org:1337/assets?asset_issuer=GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN&limit=1" ) ) .returns(Promise.resolve({ data: assetIssuerResponse })); this.server .assets() - .forIssuer('GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN') - .limit('1') + .forIssuer("GCOGPF7IRVXUCJZAQWXVFQEE4HAOCTDGZI2QZSMKLM5BTTGRLY6GDOJN") + .limit("1") .call() .then(function (response) { expect(response.records).to.be.equal( @@ -3680,13 +3680,13 @@ describe('server.js non-transaction tests', function () { let assetCodeIssuerResponse = { _links: { self: { - href: 'http://horizon-testnet.stellar.org/assets?order=asc\u0026limit=10\u0026cursor=\u0026asset_code=USD\u0026asset_issuer=GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR' + href: "http://horizon-testnet.stellar.org/assets?order=asc\u0026limit=10\u0026cursor=\u0026asset_code=USD\u0026asset_issuer=GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR" }, next: { - href: 'http://horizon-testnet.stellar.org/assets?order=asc\u0026limit=10\u0026cursor=USD_GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR_credit_alphanum4\u0026asset_code=USD\u0026asset_issuer=GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR' + href: "http://horizon-testnet.stellar.org/assets?order=asc\u0026limit=10\u0026cursor=USD_GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR_credit_alphanum4\u0026asset_code=USD\u0026asset_issuer=GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR" }, prev: { - href: 'http://horizon-testnet.stellar.org/assets?order=desc\u0026limit=10\u0026cursor=USD_GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR_credit_alphanum4\u0026asset_code=USD\u0026asset_issuer=GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR' + href: "http://horizon-testnet.stellar.org/assets?order=desc\u0026limit=10\u0026cursor=USD_GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR_credit_alphanum4\u0026asset_code=USD\u0026asset_issuer=GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR" } }, _embedded: { @@ -3694,15 +3694,15 @@ describe('server.js non-transaction tests', function () { { _links: { toml: { - href: 'https://bakalr/.well-known/stellar.toml' + href: "https://bakalr/.well-known/stellar.toml" } }, - asset_type: 'credit_alphanum4', - asset_code: 'USD', + asset_type: "credit_alphanum4", + asset_code: "USD", asset_issuer: - 'GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR', + "GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR", paging_token: - 'USD_GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR_credit_alphanum4', + "USD_GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR_credit_alphanum4", accounts: { authorized: 1, authorized_to_maintain_liabilities: 0, @@ -3711,13 +3711,13 @@ describe('server.js non-transaction tests', function () { num_claimable_balances: 0, num_contracts: 2, balances: { - authorized: '1387.0000000', - authorized_to_maintain_liabilities: '0.0000000', - unauthorized: '0.0000000' + authorized: "1387.0000000", + authorized_to_maintain_liabilities: "0.0000000", + unauthorized: "0.0000000" }, - claimable_balances_amount: '0.0000000', - contracts_amount: '10000.0000000', - amount: '1387.0000000', + claimable_balances_amount: "0.0000000", + contracts_amount: "10000.0000000", + amount: "1387.0000000", num_accounts: 1, flags: { auth_required: true, @@ -3729,20 +3729,20 @@ describe('server.js non-transaction tests', function () { ] } }; - it('requests the correct endpoint (asset_code then asset_issuer)', function (done) { + it("requests the correct endpoint (asset_code then asset_issuer)", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/assets?asset_issuer=GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR&asset_code=USD' + "https://horizon-live.stellar.org:1337/assets?asset_issuer=GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR&asset_code=USD" ) ) .returns(Promise.resolve({ data: assetCodeIssuerResponse })); this.server .assets() - .forIssuer('GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR') - .forCode('USD') + .forIssuer("GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR") + .forCode("USD") .call() .then(function (response) { expect(response.records).to.be.equal( @@ -3755,20 +3755,20 @@ describe('server.js non-transaction tests', function () { }); }); - it('requests the correct endpoint (asset_issuer then asset_code)', function (done) { + it("requests the correct endpoint (asset_issuer then asset_code)", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/assets?asset_code=USD&asset_issuer=GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR' + "https://horizon-live.stellar.org:1337/assets?asset_code=USD&asset_issuer=GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR" ) ) .returns(Promise.resolve({ data: assetCodeIssuerResponse })); this.server .assets() - .forCode('USD') - .forIssuer('GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR') + .forCode("USD") + .forIssuer("GBW3EZBZKRERB4JUDWGQPIBGHKJ4XPOFG2VQ2WTFR4F7TYC5WS7F3XGR") .call() .then(function (response) { expect(response.records).to.be.equal( @@ -3782,21 +3782,21 @@ describe('server.js non-transaction tests', function () { }); }); - describe('Regressions', function () { - it('offers callBuilder does not pollute Server instance URI #379', function (done) { + describe("Regressions", function () { + it("offers callBuilder does not pollute Server instance URI #379", function (done) { this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/effects' + "https://horizon-live.stellar.org:1337/accounts/GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K/effects" ) ) .returns(Promise.resolve({ data: {} })); const account = - 'GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K'; + "GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K"; - const offerCallBuilder = this.server.offers('accounts', account); + const offerCallBuilder = this.server.offers("accounts", account); const effectCallBuilder = this.server .effects() .forAccount(account) diff --git a/test/unit/server_transaction_test.js b/test/unit/server_transaction_test.js index 20feb49c8..1e28a6a9a 100644 --- a/test/unit/server_transaction_test.js +++ b/test/unit/server_transaction_test.js @@ -1,11 +1,11 @@ const { HorizonServer } = StellarSdk; -describe('server.js transaction tests', function () { +describe("server.js transaction tests", function () { let keypair = StellarSdk.Keypair.random(); - let account = new StellarSdk.Account(keypair.publicKey(), '56199647068161'); + let account = new StellarSdk.Account(keypair.publicKey(), "56199647068161"); beforeEach(function () { - this.server = new HorizonServer('https://horizon-live.stellar.org:1337'); + this.server = new HorizonServer("https://horizon-live.stellar.org:1337"); this.axiosMock = sinon.mock(HorizonAxiosClient); let transaction = new StellarSdk.TransactionBuilder(account, { fee: 100, @@ -15,9 +15,9 @@ describe('server.js transaction tests', function () { .addOperation( StellarSdk.Operation.payment({ destination: - 'GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW', + "GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW", asset: StellarSdk.Asset.native(), - amount: '100.50' + amount: "100.50" }) ) .setTimeout(StellarSdk.TimeoutInfinite) @@ -26,7 +26,7 @@ describe('server.js transaction tests', function () { this.transaction = transaction; this.blob = encodeURIComponent( - transaction.toEnvelope().toXDR().toString('base64') + transaction.toEnvelope().toXDR().toString("base64") ); }); @@ -35,11 +35,11 @@ describe('server.js transaction tests', function () { this.axiosMock.restore(); }); - it('sends a transaction', function (done) { + it("sends a transaction", function (done) { this.axiosMock - .expects('post') + .expects("post") .withArgs( - 'https://horizon-live.stellar.org:1337/transactions', + "https://horizon-live.stellar.org:1337/transactions", `tx=${this.blob}` ) .returns(Promise.resolve({ data: {} })); @@ -53,26 +53,26 @@ describe('server.js transaction tests', function () { done(err); }); }); - it('adds metadata - tx was too small and was immediately deleted', function (done) { + it("adds metadata - tx was too small and was immediately deleted", function (done) { const response = { _links: { transaction: { - href: 'https://horizon.stellar.org/transactions/db2c69a07be57eb5baefbfbb72b95c7c20d2c4d6f2a0e84e7c27dd0359055a2f' + href: "https://horizon.stellar.org/transactions/db2c69a07be57eb5baefbfbb72b95c7c20d2c4d6f2a0e84e7c27dd0359055a2f" } }, - hash: 'db2c69a07be57eb5baefbfbb72b95c7c20d2c4d6f2a0e84e7c27dd0359055a2f', + hash: "db2c69a07be57eb5baefbfbb72b95c7c20d2c4d6f2a0e84e7c27dd0359055a2f", ledger: 22895637, envelope_xdr: - 'AAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAAAZAEH/OgAAAAjAAAAAQAAAAAAAAAAAAAAAFyIDdQAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAFCQVQAAAAAAEZK09vHmzOmEMoVWYtbbZcKv3ZOoo06ckzbhyDIFKfhAAAAAAAAAAEAAAACAAAAAwAAAAAAAAAAAAAAAAAAAAFPQUH/AAAAQOJlnAnmSv1igsU/LjpXvuCqS/EcnM7oxgyk4ElnCwOz9YUEcvhXuc9GS2Sz1fMxsWvV9dHhmu3HvBrsphVl5A8=', - result_xdr: 'AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAAAAAACAAAAAA==', + "AAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAAAZAEH/OgAAAAjAAAAAQAAAAAAAAAAAAAAAFyIDdQAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAFCQVQAAAAAAEZK09vHmzOmEMoVWYtbbZcKv3ZOoo06ckzbhyDIFKfhAAAAAAAAAAEAAAACAAAAAwAAAAAAAAAAAAAAAAAAAAFPQUH/AAAAQOJlnAnmSv1igsU/LjpXvuCqS/EcnM7oxgyk4ElnCwOz9YUEcvhXuc9GS2Sz1fMxsWvV9dHhmu3HvBrsphVl5A8=", + result_xdr: "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAAAAAACAAAAAA==", result_meta_xdr: - 'AAAAAQAAAAIAAAADAV1cFQAAAAAAAAAAhQARbeNC3f59tPqcIBIDX/xFZ2n18nbCjGo8dk9BQf8AAAACU4RoUgEH/OgAAAAiAAAABQAAAAEAAAAAhD8BLsZFQEF33rKS6YopQUT3b6iLBG4nspe68/DBNBYAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBXVwVAAAAAAAAAACFABFt40Ld/n20+pwgEgNf/EVnafXydsKMajx2T0FB/wAAAAJThGhSAQf86AAAACMAAAAFAAAAAQAAAACEPwEuxkVAQXfespLpiilBRPdvqIsEbieyl7rz8ME0FgAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAA=' + "AAAAAQAAAAIAAAADAV1cFQAAAAAAAAAAhQARbeNC3f59tPqcIBIDX/xFZ2n18nbCjGo8dk9BQf8AAAACU4RoUgEH/OgAAAAiAAAABQAAAAEAAAAAhD8BLsZFQEF33rKS6YopQUT3b6iLBG4nspe68/DBNBYAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBXVwVAAAAAAAAAACFABFt40Ld/n20+pwgEgNf/EVnafXydsKMajx2T0FB/wAAAAJThGhSAQf86AAAACMAAAAFAAAAAQAAAACEPwEuxkVAQXfespLpiilBRPdvqIsEbieyl7rz8ME0FgAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAA=" }; this.axiosMock - .expects('post') + .expects("post") .withArgs( - 'https://horizon-live.stellar.org:1337/transactions', + "https://horizon-live.stellar.org:1337/transactions", `tx=${this.blob}` ) .returns(Promise.resolve({ data: response })); @@ -82,14 +82,14 @@ describe('server.js transaction tests', function () { .then(function (res) { expect(res.offerResults).to.be.an.instanceOf(Array); expect(res.offerResults[0].offersClaimed).to.be.an.instanceOf(Array); - expect(typeof res.offerResults[0].effect).to.equal('string'); + expect(typeof res.offerResults[0].effect).to.equal("string"); expect(res.offerResults[0].wasImmediatelyFilled).to.equal(false); expect(res.offerResults[0].wasImmediatelyDeleted).to.equal(true); expect(res.offerResults[0].wasPartiallyFilled).to.equal(false); expect(res.offerResults[0].operationIndex).to.equal(0); - expect(res.offerResults[0].amountBought).to.equal('0'); - expect(res.offerResults[0].amountSold).to.equal('0'); + expect(res.offerResults[0].amountBought).to.equal("0"); + expect(res.offerResults[0].amountSold).to.equal("0"); expect(res.offerResults[0].currentOffer).to.equal(undefined); done(); @@ -98,27 +98,27 @@ describe('server.js transaction tests', function () { done(err); }); }); - it('adds metadata, order immediately fills', function (done) { + it("adds metadata, order immediately fills", function (done) { const response = { _links: { transaction: { - href: 'https://horizon.stellar.org/transactions/d88ded94c558790f7e819b85fd35adb10a1e474312c34ebd611495c349a8eb69' + href: "https://horizon.stellar.org/transactions/d88ded94c558790f7e819b85fd35adb10a1e474312c34ebd611495c349a8eb69" } }, - hash: 'd88ded94c558790f7e819b85fd35adb10a1e474312c34ebd611495c349a8eb69', + hash: "d88ded94c558790f7e819b85fd35adb10a1e474312c34ebd611495c349a8eb69", ledger: 22895558, envelope_xdr: - 'AAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAAAZAEH/OgAAAAgAAAAAQAAAAAAAAAAAAAAAFyIDD0AAAAAAAAAAQAAAAAAAAADAAAAAAAAAAFCQVQAAAAAAEZK09vHmzOmEMoVWYtbbZcKv3ZOoo06ckzbhyDIFKfhAAAAAAExLQAAAAABAAAAAgAAAAAAAAAAAAAAAAAAAAFPQUH/AAAAQHk3Igj+JXqggsJBFl4mrzgACqxWpx87psxu5UHnSskbwRjHZz89NycCZmJL4gN5WN7twm+wK371K9XcRNDiBwQ=', + "AAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAAAZAEH/OgAAAAgAAAAAQAAAAAAAAAAAAAAAFyIDD0AAAAAAAAAAQAAAAAAAAADAAA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wrvXYkfwAAAAOqpQcdwD8MToAB1K5AAAACQAAAAEAAAAAPEGtxQtQD1UZU+mY3N5z5KtzKggiZYzimTMfGsnpHKQAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAALaNFPKAAAADouVkLYAAAAAAAAAAAAAAAMBXVmCAAAAAQAAAACFABFt40Ld/n20+pwgEgNf/EVnafXydsKMajx2T0FB/wAAAAFCQVQAAAAAAEZK09vHmzOmEMoVWYtbbZcKv3ZOoo06ckzbhyDIFKfhAAAAAAAAAAB//////////wAAAAEAAAAAAAAAAAAAAAEBXVvGAAAAAQAAAACFABFt40Ld/n20+pwgEgNf/EVnafXydsKMajx2T0FB/wAAAAFCQVQAAAAAAEZK09vHmzOmEMoVWYtbbZcKv3ZOoo06ckzbhyDIFKfhAAAAAACj1/l//////////wAAAAEAAAAAAAAAAAAAAAMBXVvGAAAAAAAAAACFABFt40Ld/n20+pwgEgNf/EVnafXydsKMajx2T0FB/wAAAAJUtZZ9AQf86AAAACAAAAAFAAAAAQAAAACEPwEuxkVAQXfespLpiilBRPdvqIsEbieyl7rz8ME0FgAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQFdW8YAAAAAAAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAAAAlOEaX4BB/zoAAAAIAAAAAUAAAABAAAAAIQ/AS7GRUBBd96ykumKKUFE92+oiwRuJ7KXuvPwwTQWAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" }; this.axiosMock - .expects('post') + .expects("post") .withArgs( - 'https://horizon-live.stellar.org:1337/transactions', + "https://horizon-live.stellar.org:1337/transactions", `tx=${this.blob}` ) .returns(Promise.resolve({ data: response })); @@ -128,13 +128,13 @@ describe('server.js transaction tests', function () { .then(function (res) { expect(res.offerResults).to.be.an.instanceOf(Array); expect(res.offerResults[0].offersClaimed).to.be.an.instanceOf(Array); - expect(typeof res.offerResults[0].effect).to.equal('string'); + expect(typeof res.offerResults[0].effect).to.equal("string"); expect(res.offerResults[0].wasImmediatelyFilled).to.equal(true); expect(res.offerResults[0].wasImmediatelyDeleted).to.equal(false); expect(res.offerResults[0].wasPartiallyFilled).to.equal(false); expect(res.offerResults[0].operationIndex).to.equal(0); - expect(res.offerResults[0].amountSold).to.equal('1.9999999'); + expect(res.offerResults[0].amountSold).to.equal("1.9999999"); done(); }) @@ -142,27 +142,27 @@ describe('server.js transaction tests', function () { done(err); }); }); - it('adds metadata, order is open', function (done) { + it("adds metadata, order is open", function (done) { const response = { _links: { transaction: { - href: 'https://horizon.stellar.org/transactions/e1c2b91141d8c4185dc8c18118f345a269d88c476bdadec695c1b3ecdc999831' + href: "https://horizon.stellar.org/transactions/e1c2b91141d8c4185dc8c18118f345a269d88c476bdadec695c1b3ecdc999831" } }, - hash: 'e1c2b91141d8c4185dc8c18118f345a269d88c476bdadec695c1b3ecdc999831', + hash: "e1c2b91141d8c4185dc8c18118f345a269d88c476bdadec695c1b3ecdc999831", ledger: 22896129, envelope_xdr: - 'AAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAAAZAEH/OgAAAAkAAAAAQAAAAAAAAAAAAAAAFyIF70AAAAAAAAAAQAAAAAAAAADAAAAAAAAAAFCQVQAAAAAAEZK09vHmzOmEMoVWYtbbZcKv3ZOoo06ckzbhyDIFKfhAAAAAACYloAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAFPQUH/AAAAQJYfX7d9Cp609ChIRR5ONhCkSM2a1YLmi21rNLjcw5XFZg5R6Y3ZQ6kwVyJBcgqMwpH9F+NgoybKpepIIaXJiQs=', + "AAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAAAZAEH/OgAAAAkAAAAAQAAAAAAAAAAAAAAAFyIF70AAAAAAAAAAQAAAAAAAAADAAAAAAAAAAFCQVQAAAAAAEZK09vHmzOmEMo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VnafXydsKMajx2T0FB/wAAAAAEZqfGAAAAAAAAAAFCQVQAAAAAAEZK09vHmzOmEMoVWYtbbZcKv3ZOoo06ckzbhyDIFKfhAAAAAACYloAAAAABAAAAAQAAAAAAAAAAAAAAAA==" }; this.axiosMock - .expects('post') + .expects("post") .withArgs( - 'https://horizon-live.stellar.org:1337/transactions', + "https://horizon-live.stellar.org:1337/transactions", `tx=${this.blob}` ) .returns(Promise.resolve({ data: response })); @@ -172,9 +172,9 @@ describe('server.js transaction tests', function () { .then(function (res) { expect(res.offerResults).to.be.an.instanceOf(Array); expect(res.offerResults[0].offersClaimed).to.be.an.instanceOf(Array); - expect(typeof res.offerResults[0].effect).to.equal('string'); + expect(typeof res.offerResults[0].effect).to.equal("string"); expect(res.offerResults[0].wasImmediatelyFilled).to.equal(false); - expect(res.offerResults[0].amountBought).to.equal('0'); + expect(res.offerResults[0].amountBought).to.equal("0"); expect(res.offerResults[0].wasImmediatelyDeleted).to.equal(false); expect(res.offerResults[0].wasPartiallyFilled).to.equal(false); expect(res.offerResults[0].isFullyOpen).to.equal(true); @@ -186,27 +186,27 @@ describe('server.js transaction tests', function () { done(err); }); }); - it('adds metadata, partial fill', function (done) { + it("adds metadata, partial fill", function (done) { const response = { _links: { transaction: { - href: 'https://horizon.stellar.org/transactions/28552ba6a70ab74f6de05319950e2ddad94491159ebc97b14cfcde2d3c7e70a1' + href: "https://horizon.stellar.org/transactions/28552ba6a70ab74f6de05319950e2ddad94491159ebc97b14cfcde2d3c7e70a1" } }, - hash: '28552ba6a70ab74f6de05319950e2ddad94491159ebc97b14cfcde2d3c7e70a1', + hash: "28552ba6a70ab74f6de05319950e2ddad94491159ebc97b14cfcde2d3c7e70a1", ledger: 22896525, envelope_xdr: - 'AAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAAAZAEH/OgAAAAlAAAAAQAAAAAAAAAAAAAAAFyIH7sAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAFCQVQA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23wBMS0AAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAB1m3A/FStIp4ybPiuwbAqUFZdVE0htPHeAmDCu9diR/AAAAAAEZsDDAAAAAwFdX4IAAAABAAAAAHWbcD8VK0injJs+K7BsCpQVl1UTSG08d4CYMK712JH8AAAAAUJBVAAAAAAARkrT28ebM6YQyhVZi1ttlwq/dk6ijTpyTNuHIMgUp+EAAAABgQWCFn//////////AAAAAQAAAAEAAAAIIq08AgAAAAGBBYIVAAAAAAAAAAAAAAABAV1fjQAAAAEAAAAAdZtwPxUrSKeMmz4rsGwKlBWXVRNIbTx3gJgwrvXYkfwAAAABQkFUAAAAAABGStPbx5szphDKFVmLW22XCr92TqKNOnJM24cgyBSn4QAAAAFg77c/f/////////8AAAABAAAAAQAAAAgirTwCAAAAAWDvtz4AAAAAAAAAAAAAAAABXV+NAAAAAgAAAACFABFt40Ld/n20+pwgEgNf/EVnafXydsKMajx2T0FB/wAAAAAEZsEvAAAAAAAAAAFCQVQAAAAAAEZK09vHmzOmEMoVWYtbbZcKv3ZOoo06ckzbhyDIFKfhAAAAADJ8VSAATEtAAIv23wAAAAAAAAAAAAAAAA==" }; this.axiosMock - .expects('post') + .expects("post") .withArgs( - 'https://horizon-live.stellar.org:1337/transactions', + "https://horizon-live.stellar.org:1337/transactions", `tx=${this.blob}` ) .returns(Promise.resolve({ data: response })); @@ -217,22 +217,22 @@ describe('server.js transaction tests', function () { expect(res.offerResults).to.be.an.instanceOf(Array); expect(res.offerResults[0].offersClaimed).to.be.an.instanceOf(Array); expect(res.offerResults[0].offersClaimed).to.have.lengthOf(1); - expect(res.offerResults[0].effect).to.equal('manageOfferCreated'); - expect(typeof res.offerResults[0].effect).to.equal('string'); + expect(res.offerResults[0].effect).to.equal("manageOfferCreated"); + expect(typeof res.offerResults[0].effect).to.equal("string"); expect(res.offerResults[0].wasImmediatelyFilled).to.equal(false); - expect(res.offerResults[0].amountBought).to.equal('53.8299095'); + expect(res.offerResults[0].amountBought).to.equal("53.8299095"); expect(res.offerResults[0].wasImmediatelyDeleted).to.equal(false); expect(res.offerResults[0].wasPartiallyFilled).to.equal(true); expect(res.offerResults[0].isFullyOpen).to.equal(false); expect(res.offerResults[0].operationIndex).to.equal(0); expect(res.offerResults[0].currentOffer.selling.type).to.equal( - 'native' + "native" ); expect(res.offerResults[0].currentOffer.buying.assetCode).to.equal( - 'BAT' + "BAT" ); expect(res.offerResults[0].currentOffer.buying.issuer).to.equal( - 'GBDEVU63Y6NTHJQQZIKVTC23NWLQVP3WJ2RI2OTSJTNYOIGICST6DUXR' + "GBDEVU63Y6NTHJQQZIKVTC23NWLQVP3WJ2RI2OTSJTNYOIGICST6DUXR" ); done(); @@ -245,22 +245,22 @@ describe('server.js transaction tests', function () { const response = { _links: { transaction: { - href: 'https://horizon.stellar.org/transactions/6c3191f252f2c586c74275c766ce761021513e520eab3bb63d3fd18d0d01492e' + href: "https://horizon.stellar.org/transactions/6c3191f252f2c586c74275c766ce761021513e520eab3bb63d3fd18d0d01492e" } }, - hash: '6c3191f252f2c586c74275c766ce761021513e520eab3bb63d3fd18d0d01492e', + hash: "6c3191f252f2c586c74275c766ce761021513e520eab3bb63d3fd18d0d01492e", ledger: 22893969, envelope_xdr: - 'AAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAAAZAEH/OgAAAAeAAAAAQAAAAAAAAAAAAAAAFyH7EoAAAAAAAAAAQAAAAAAAAAGAAAAAUJUQwAAAAAAKTpjGpnWX8jImMrLprg+1nHJhiAVINNe+zSvg3bvNiUAAAAAAAAAAAAAAAAAAAABT0FB/wAAAEBDRFjJITX4LIIY2tc8KxVU3Pe7dqZ+BkWft93SCVlEXxiCHnoNop5UEKRoRTvAUh34I6As4IN/QpGGqHmbKv8F', - result_xdr: 'AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAGAAAAAAAAAAA=', + "AAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAAAZAEH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J2woxqPHZPQUH/AAAAAlS1mHEBB/zoAAAAHgAAAAYAAAABAAAAAIQ/AS7GRUBBd96ykumKKUFE92+oiwRuJ7KXuvPwwTQWAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAV1VkQAAAAAAAAAAhQARbeNC3f59tPqcIBIDX/xFZ2n18nbCjGo8dk9BQf8AAAACVLWYcQEH/OgAAAAeAAAABQAAAAEAAAAAhD8BLsZFQEF33rKS6YopQUT3b6iLBG4nspe68/DBNBYAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==" }; this.axiosMock - .expects('post') + .expects("post") .withArgs( - 'https://horizon-live.stellar.org:1337/transactions', + "https://horizon-live.stellar.org:1337/transactions", `tx=${this.blob}` ) .returns(Promise.resolve({ data: response })); @@ -275,27 +275,27 @@ describe('server.js transaction tests', function () { done(err); }); }); - it('adds metadata about offers, even if some ops are not', function (done) { + it("adds metadata about offers, even if some ops are not", function (done) { const response = { _links: { transaction: { - href: 'https://horizon.stellar.org/transactions/6a22d6896140f6f330ef19086827df0780eb2ad3324f3271b38c70cb1cba1c3d' + href: "https://horizon.stellar.org/transactions/6a22d6896140f6f330ef19086827df0780eb2ad3324f3271b38c70cb1cba1c3d" } }, - hash: '6a22d6896140f6f330ef19086827df0780eb2ad3324f3271b38c70cb1cba1c3d', + hash: "6a22d6896140f6f330ef19086827df0780eb2ad3324f3271b38c70cb1cba1c3d", ledger: 22894978, envelope_xdr: - 'AAAAAIUAEW3jQt3+fbT6nCASA1/8RWdp9fJ2woxqPHZPQUH/AAABkAEH/OgAAAAfAAAAAQAAAAAAAAAAAAAAAFyIAGgAAAAAAAAABAAAAAAAAAAGAAAAAUJBVAAAAAAARkrT28ebM6YQyhVZi1ttlwq/dk6ijTpyTNuHIMgUp+F//////////wAAAAAAAAAFAAAAAQAAAACEPwEuxkVAQXfespLpiilBRPdvqIsEbieyl7rz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UFE92+oiwRuJ7KXuvPwwTQWAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAV1ZggAAAAAAAAAAhQARbeNC3f59tPqcIBIDX/xFZ2n18nbCjGo8dk9BQf8AAAACVLWW4QEH/OgAAAAfAAAABQAAAAEAAAAAhD8BLsZFQEF33rKS6YopQUT3b6iLBG4nspe68/DBNBYAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }; this.axiosMock - .expects('post') + .expects("post") .withArgs( - 'https://horizon-live.stellar.org:1337/transactions', + "https://horizon-live.stellar.org:1337/transactions", `tx=${this.blob}` ) .returns(Promise.resolve({ data: response })); @@ -306,10 +306,10 @@ describe('server.js transaction tests', function () { expect(res.offerResults).to.be.an.instanceOf(Array); expect(res.offerResults).to.have.lengthOf(2); expect(res.offerResults[0].offersClaimed).to.be.an.instanceOf(Array); - expect(typeof res.offerResults[0].effect).to.equal('string'); + expect(typeof res.offerResults[0].effect).to.equal("string"); expect(res.offerResults[0].operationIndex).to.equal(2); expect(res.offerResults[1].offersClaimed).to.be.an.instanceOf(Array); - expect(typeof res.offerResults[1].effect).to.equal('string'); + expect(typeof res.offerResults[1].effect).to.equal("string"); expect(res.offerResults[1].operationIndex).to.equal(3); done(); }) @@ -317,24 +317,24 @@ describe('server.js transaction tests', function () { done(err); }); }); - it('checks for memo required by default', function (done) { + it("checks for memo required by default", function (done) { this.axiosMock - .expects('post') + .expects("post") .withArgs( - 'https://horizon-live.stellar.org:1337/transactions', + "https://horizon-live.stellar.org:1337/transactions", `tx=${this.blob}` ) .returns(Promise.resolve({ data: {} })); this.axiosMock - .expects('get') + .expects("get") .withArgs( sinon.match( - 'https://horizon-live.stellar.org:1337/accounts/GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW' + "https://horizon-live.stellar.org:1337/accounts/GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW" ) ) .returns( Promise.reject({ - response: { status: 404, statusText: 'NotFound', data: {} } + response: { status: 404, statusText: "NotFound", data: {} } }) ) .once(); @@ -348,22 +348,22 @@ describe('server.js transaction tests', function () { done(err); }); }); - it('submits fee bump transactions', function (done) { + it("submits fee bump transactions", function (done) { const feeBumpTx = StellarSdk.TransactionBuilder.buildFeeBumpTransaction( keypair, - '200', + "200", this.transaction, StellarSdk.Networks.TESTNET ); this.blob = encodeURIComponent( - feeBumpTx.toEnvelope().toXDR().toString('base64') + feeBumpTx.toEnvelope().toXDR().toString("base64") ); this.axiosMock - .expects('post') + .expects("post") .withArgs( - 'https://horizon-live.stellar.org:1337/transactions', + "https://horizon-live.stellar.org:1337/transactions", `tx=${this.blob}` ) .returns(Promise.resolve({ data: {} })); diff --git a/test/unit/stellar_toml_resolver_test.js b/test/unit/stellar_toml_resolver_test.js index 024aae33c..198fa70c3 100644 --- a/test/unit/stellar_toml_resolver_test.js +++ b/test/unit/stellar_toml_resolver_test.js @@ -1,6 +1,6 @@ -const http = require('http'); +const http = require("http"); -describe('stellar_toml_resolver.js tests', function () { +describe("stellar_toml_resolver.js tests", function () { beforeEach(function () { this.axiosMock = sinon.mock(axios); StellarSdk.Config.setDefault(); @@ -11,15 +11,15 @@ describe('stellar_toml_resolver.js tests', function () { this.axiosMock.restore(); }); - describe('StellarTomlResolver.resolve', function () { + describe("StellarTomlResolver.resolve", function () { afterEach(function () { StellarSdk.Config.setDefault(); }); - it('returns stellar.toml object for valid request and stellar.toml file', function (done) { + it("returns stellar.toml object for valid request and stellar.toml file", function (done) { this.axiosMock - .expects('get') - .withArgs(sinon.match('https://acme.com/.well-known/stellar.toml')) + .expects("get") + .withArgs(sinon.match("https://acme.com/.well-known/stellar.toml")) .returns( Promise.resolve({ data: ` @@ -30,18 +30,18 @@ FEDERATION_SERVER="https://api.stellar.org/federation" }) ); - StellarSdk.StellarTomlResolver.resolve('acme.com').then((stellarToml) => { + StellarSdk.StellarTomlResolver.resolve("acme.com").then((stellarToml) => { expect(stellarToml.FEDERATION_SERVER).equals( - 'https://api.stellar.org/federation' + "https://api.stellar.org/federation" ); done(); }); }); - it('returns stellar.toml object for valid request and stellar.toml file when allowHttp is `true`', function (done) { + it("returns stellar.toml object for valid request and stellar.toml file when allowHttp is `true`", function (done) { this.axiosMock - .expects('get') - .withArgs(sinon.match('http://acme.com/.well-known/stellar.toml')) + .expects("get") + .withArgs(sinon.match("http://acme.com/.well-known/stellar.toml")) .returns( Promise.resolve({ data: ` @@ -52,22 +52,22 @@ FEDERATION_SERVER="http://api.stellar.org/federation" }) ); - StellarSdk.StellarTomlResolver.resolve('acme.com', { + StellarSdk.StellarTomlResolver.resolve("acme.com", { allowHttp: true }).then((stellarToml) => { expect(stellarToml.FEDERATION_SERVER).equals( - 'http://api.stellar.org/federation' + "http://api.stellar.org/federation" ); done(); }); }); - it('returns stellar.toml object for valid request and stellar.toml file when global Config.allowHttp flag is set', function (done) { + it("returns stellar.toml object for valid request and stellar.toml file when global Config.allowHttp flag is set", function (done) { StellarSdk.Config.setAllowHttp(true); this.axiosMock - .expects('get') - .withArgs(sinon.match('http://acme.com/.well-known/stellar.toml')) + .expects("get") + .withArgs(sinon.match("http://acme.com/.well-known/stellar.toml")) .returns( Promise.resolve({ data: ` @@ -78,18 +78,18 @@ FEDERATION_SERVER="http://api.stellar.org/federation" }) ); - StellarSdk.StellarTomlResolver.resolve('acme.com').then((stellarToml) => { + StellarSdk.StellarTomlResolver.resolve("acme.com").then((stellarToml) => { expect(stellarToml.FEDERATION_SERVER).equals( - 'http://api.stellar.org/federation' + "http://api.stellar.org/federation" ); done(); }); }); - it('rejects when stellar.toml file is invalid', function (done) { + it("rejects when stellar.toml file is invalid", function (done) { this.axiosMock - .expects('get') - .withArgs(sinon.match('https://acme.com/.well-known/stellar.toml')) + .expects("get") + .withArgs(sinon.match("https://acme.com/.well-known/stellar.toml")) .returns( Promise.resolve({ data: ` @@ -100,35 +100,35 @@ FEDERATION_SERVER="https://api.stellar.org/federation" }) ); - StellarSdk.StellarTomlResolver.resolve('acme.com') + StellarSdk.StellarTomlResolver.resolve("acme.com") .should.be.rejectedWith(/Parsing error on line/) .and.notify(done); }); - it('rejects when there was a connection error', function (done) { + it("rejects when there was a connection error", function (done) { this.axiosMock - .expects('get') - .withArgs(sinon.match('https://acme.com/.well-known/stellar.toml')) + .expects("get") + .withArgs(sinon.match("https://acme.com/.well-known/stellar.toml")) .returns(Promise.reject()); StellarSdk.StellarTomlResolver.resolve( - 'acme.com' + "acme.com" ).should.be.rejected.and.notify(done); }); - it('fails when response exceeds the limit', function (done) { + it("fails when response exceeds the limit", function (done) { // Unable to create temp server in a browser - if (typeof window != 'undefined') { + if (typeof window != "undefined") { return done(); } - var response = Array(StellarSdk.STELLAR_TOML_MAX_SIZE + 10).join('a'); + var response = Array(StellarSdk.STELLAR_TOML_MAX_SIZE + 10).join("a"); let tempServer = http .createServer((req, res) => { - res.setHeader('Content-Type', 'text/x-toml; charset=UTF-8'); + res.setHeader("Content-Type", "text/x-toml; charset=UTF-8"); res.end(response); }) .listen(4444, () => { - StellarSdk.StellarTomlResolver.resolve('localhost:4444', { + StellarSdk.StellarTomlResolver.resolve("localhost:4444", { allowHttp: true }) .should.be.rejectedWith( @@ -139,11 +139,11 @@ FEDERATION_SERVER="https://api.stellar.org/federation" }); }); - it('rejects after given timeout when global Config.timeout flag is set', function (done) { + it("rejects after given timeout when global Config.timeout flag is set", function (done) { StellarSdk.Config.setTimeout(1000); // Unable to create temp server in a browser - if (typeof window != 'undefined') { + if (typeof window != "undefined") { return done(); } @@ -152,7 +152,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation" setTimeout(() => {}, 10000); }) .listen(4444, () => { - StellarSdk.StellarTomlResolver.resolve('localhost:4444', { + StellarSdk.StellarTomlResolver.resolve("localhost:4444", { allowHttp: true }) .should.be.rejectedWith(/timeout of 1000ms exceeded/) @@ -164,9 +164,9 @@ FEDERATION_SERVER="https://api.stellar.org/federation" }); }); - it('rejects after given timeout when timeout specified in StellarTomlResolver opts param', function (done) { + it("rejects after given timeout when timeout specified in StellarTomlResolver opts param", function (done) { // Unable to create temp server in a browser - if (typeof window != 'undefined') { + if (typeof window != "undefined") { return done(); } @@ -175,7 +175,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation" setTimeout(() => {}, 10000); }) .listen(4444, () => { - StellarSdk.StellarTomlResolver.resolve('localhost:4444', { + StellarSdk.StellarTomlResolver.resolve("localhost:4444", { allowHttp: true, timeout: 1000 }) diff --git a/test/unit/transaction_test.js b/test/unit/transaction_test.js index a8e6c8067..925ccec63 100644 --- a/test/unit/transaction_test.js +++ b/test/unit/transaction_test.js @@ -1,10 +1,10 @@ const xdr = StellarSdk.xdr; // shorthand -describe('assembleTransaction', () => { - xit('works with keybump transactions'); +describe("assembleTransaction", () => { + xit("works with keybump transactions"); const scAddress = new StellarSdk.Address( - 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI' + "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI" ).toScAddress(); const fnAuth = new xdr.SorobanAuthorizationEntry({ @@ -23,7 +23,7 @@ describe('assembleTransaction', () => { xdr.SorobanAuthorizedFunction.sorobanAuthorizedFunctionTypeContractFn( new xdr.InvokeContractArgs({ contractAddress: scAddress, - functionName: 'fn', + functionName: "fn", args: [] }) ), @@ -36,40 +36,40 @@ describe('assembleTransaction', () => { .build(); const simulationResponse = { - transactionData: sorobanTransactionData.toXDR('base64'), + transactionData: sorobanTransactionData.toXDR("base64"), events: [], - minResourceFee: '115', + minResourceFee: "115", results: [ { auth: [fnAuth], - xdr: xdr.ScVal.scvU32(0).toXDR('base64') + xdr: xdr.ScVal.scvU32(0).toXDR("base64") } ], latestLedger: 3, cost: { - cpuInsns: '0', - memBytes: '0' + cpuInsns: "0", + memBytes: "0" } }; - describe('Transaction', () => { + describe("Transaction", () => { const networkPassphrase = StellarSdk.Networks.TESTNET; const source = new StellarSdk.Account( - 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI', - '1' + "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI", + "1" ); function singleContractFnTransaction(auth) { return new StellarSdk.TransactionBuilder(source, { fee: 100 }) - .setNetworkPassphrase('Test') + .setNetworkPassphrase("Test") .setTimeout(StellarSdk.TimeoutInfinite) .addOperation( StellarSdk.Operation.invokeHostFunction({ func: xdr.HostFunction.hostFunctionTypeInvokeContract( new xdr.InvokeContractArgs({ contractAddress: scAddress, - functionName: 'hello', - args: [xdr.ScVal.scvString('hello')] + functionName: "hello", + args: [xdr.ScVal.scvString("hello")] }) ), auth: auth ?? [] @@ -78,7 +78,7 @@ describe('assembleTransaction', () => { .build(); } - it('simulate updates the tx data from simulation response', () => { + it("simulate updates the tx data from simulation response", () => { const txn = singleContractFnTransaction(); const result = StellarSdk.assembleTransaction( txn, @@ -96,7 +96,7 @@ describe('assembleTransaction', () => { ); }); - it('simulate adds the auth to the host function in tx operation', () => { + it("simulate adds the auth to the host function in tx operation", () => { const txn = singleContractFnTransaction(); const result = StellarSdk.assembleTransaction( txn, @@ -118,7 +118,7 @@ describe('assembleTransaction', () => { .contractFn() .functionName() .toString() - ).to.equal('fn'); + ).to.equal("fn"); expect( StellarSdk.StrKey.encodeEd25519PublicKey( @@ -136,10 +136,10 @@ describe('assembleTransaction', () => { .accountId() .ed25519() ) - ).to.equal('GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI'); + ).to.equal("GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI"); }); - it('simulate ignores non auth from simulation', () => { + it("simulate ignores non auth from simulation", () => { const txn = singleContractFnTransaction(); let simulateResp = JSON.parse(JSON.stringify(simulationResponse)); simulateResp.results[0].auth = null; @@ -161,7 +161,7 @@ describe('assembleTransaction', () => { ).to.have.length(0); }); - it('throws for non-Soroban ops', () => { + it("throws for non-Soroban ops", () => { const txn = new StellarSdk.TransactionBuilder(source, { fee: 100, networkPassphrase, @@ -179,7 +179,7 @@ describe('assembleTransaction', () => { StellarSdk.assembleTransaction(txn, networkPassphrase, { transactionData: {}, events: [], - minResourceFee: '0', + minResourceFee: "0", results: [], latestLedger: 3 }).build(); @@ -187,7 +187,7 @@ describe('assembleTransaction', () => { }).to.throw(/unsupported transaction/i); }); - it('works for all Soroban ops', function () { + it("works for all Soroban ops", function () { [ StellarSdk.Operation.invokeHostFunction({ func: xdr.HostFunction.hostFunctionTypeInvokeContract() diff --git a/test/unit/utils_test.js b/test/unit/utils_test.js index 724b630e1..800eed371 100644 --- a/test/unit/utils_test.js +++ b/test/unit/utils_test.js @@ -1,10 +1,10 @@ -const randomBytes = require('randombytes'); +const randomBytes = require("randombytes"); function newClientSigner(key, weight) { return { key, weight }; } -describe('Utils', function () { +describe("Utils", function () { let clock, txBuilderOpts; beforeEach(function () { @@ -19,21 +19,21 @@ describe('Utils', function () { clock.restore(); }); - describe('Utils.buildChallengeTx', function () { - it('allows non-muxed accounts', function () { + describe("Utils.buildChallengeTx", function () { + it("allows non-muxed accounts", function () { let keypair = StellarSdk.Keypair.random(); let muxedAddress = - 'MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6'; + "MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6"; let challenge; expect( () => (challenge = StellarSdk.Utils.buildChallengeTx( keypair, - 'MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6', - 'testanchor.stellar.org', + "MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6", + "testanchor.stellar.org", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" )) ).not.to.throw(); const transaction = new StellarSdk.Transaction( @@ -44,7 +44,7 @@ describe('Utils', function () { expect(transaction.operations[0].source).to.equal(muxedAddress); }); - it('allows ID memos', function () { + it("allows ID memos", function () { let keypair = StellarSdk.Keypair.random(); let challenge; expect( @@ -52,11 +52,11 @@ describe('Utils', function () { (challenge = StellarSdk.Utils.buildChallengeTx( keypair, StellarSdk.Keypair.random().publicKey(), - 'testanchor.stellar.org', + "testanchor.stellar.org", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - '8884404377665521220' + "testanchor.stellar.org", + "8884404377665521220" )) ).not.to.throw(); const transaction = new StellarSdk.Transaction( @@ -64,56 +64,56 @@ describe('Utils', function () { StellarSdk.Networks.TESTNET, true ); - expect(transaction.memo.value).to.equal('8884404377665521220'); + expect(transaction.memo.value).to.equal("8884404377665521220"); }); - it('disallows non-ID memos', function () { + it("disallows non-ID memos", function () { let keypair = StellarSdk.Keypair.random(); expect( () => (challenge = StellarSdk.Utils.buildChallengeTx( keypair, StellarSdk.Keypair.random().publicKey(), - 'testanchor.stellar.org', + "testanchor.stellar.org", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - 'memo text' + "testanchor.stellar.org", + "memo text" )) ).to.throw(); }); - it('disallows memos with muxed accounts', function () { + it("disallows memos with muxed accounts", function () { let keypair = StellarSdk.Keypair.random(); const muxedAddress = - 'MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6'; + "MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6"; expect( () => (challenge = StellarSdk.Utils.buildChallengeTx( keypair, muxedAddress, - 'testanchor.stellar.org', + "testanchor.stellar.org", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - '8884404377665521220' + "testanchor.stellar.org", + "8884404377665521220" )) ).to.throw(/memo cannot be used if clientAccountID is a muxed account/); }); - it('returns challenge which follows SEP0010 spec', function () { + it("returns challenge which follows SEP0010 spec", function () { let keypair = StellarSdk.Keypair.random(); let clientSigningKeypair = StellarSdk.Keypair.random(); const challenge = StellarSdk.Utils.buildChallengeTx( keypair, - 'GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF', - 'testanchor.stellar.org', + "GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF", + "testanchor.stellar.org", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', + "testanchor.stellar.org", null, - 'testdomain', + "testdomain", clientSigningKeypair.publicKey() ); @@ -122,7 +122,7 @@ describe('Utils', function () { StellarSdk.Networks.TESTNET ); - expect(transaction.sequence).to.eql('0'); + expect(transaction.sequence).to.eql("0"); expect(transaction.source).to.eql(keypair.publicKey()); expect(transaction.operations.length).to.eql(3); @@ -132,37 +132,37 @@ describe('Utils', function () { const [operation1, operation2, operation3] = transaction.operations; - expect(operation1.name).to.eql('testanchor.stellar.org auth'); + expect(operation1.name).to.eql("testanchor.stellar.org auth"); expect(operation1.source).to.eql( - 'GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF' + "GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF" ); - expect(operation1.type).to.eql('manageData'); + expect(operation1.type).to.eql("manageData"); expect(operation1.value.length).to.eql(64); - expect(Buffer.from(operation1.value.toString(), 'base64').length).to.eql( + expect(Buffer.from(operation1.value.toString(), "base64").length).to.eql( 48 ); - expect(operation2.name).to.equal('web_auth_domain'); + expect(operation2.name).to.equal("web_auth_domain"); expect(operation2.source).to.eql(keypair.publicKey()); - expect(operation2.type).to.eql('manageData'); - expect(operation2.value.toString()).to.eql('testanchor.stellar.org'); + expect(operation2.type).to.eql("manageData"); + expect(operation2.value.toString()).to.eql("testanchor.stellar.org"); - expect(operation3.name).to.eql('client_domain'); + expect(operation3.name).to.eql("client_domain"); expect(operation3.source).to.eql(clientSigningKeypair.publicKey()); - expect(operation3.type).to.eql('manageData'); - expect(operation3.value.toString()).to.eql('testdomain'); + expect(operation3.type).to.eql("manageData"); + expect(operation3.value.toString()).to.eql("testdomain"); }); - it('uses the passed-in timeout', function () { + it("uses the passed-in timeout", function () { let keypair = StellarSdk.Keypair.random(); const challenge = StellarSdk.Utils.buildChallengeTx( keypair, - 'GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF', - 'testanchor.stellar.org', + "GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF", + "testanchor.stellar.org", 600, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); const transaction = new StellarSdk.Transaction( @@ -178,58 +178,58 @@ describe('Utils', function () { expect(maxTime - minTime).to.eql(600); }); - it('throws an error if a muxed account and memo is passed', function () { + it("throws an error if a muxed account and memo is passed", function () { let keypair = StellarSdk.Keypair.random(); const muxedAddress = - 'MCQQMHTBRF2NPCEJWO2JMDT2HBQ2FGDCYREY2YIBSHLTXDG54Y3KTWX3R7NBER62VBELC'; + "MCQQMHTBRF2NPCEJWO2JMDT2HBQ2FGDCYREY2YIBSHLTXDG54Y3KTWX3R7NBER62VBELC"; expect(() => StellarSdk.Utils.buildChallengeTx( keypair, muxedAddress, - 'testanchor.stellar.org', + "testanchor.stellar.org", 600, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - '10154623012567072189' + "testanchor.stellar.org", + "10154623012567072189" ) ).to.throw(/memo cannot be used if clientAccountID is a muxed account/); }); - it('throws an error if clientSigningKey is not passed', function () { + it("throws an error if clientSigningKey is not passed", function () { expect(() => StellarSdk.Utils.buildChallengeTx( StellarSdk.Keypair.random(), StellarSdk.Keypair.random().publicKey(), - 'testanchor.stellar.org', + "testanchor.stellar.org", 600, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', + "testanchor.stellar.org", null, - 'testdomain', + "testdomain", null ) ).to.throw(/clientSigningKey is required if clientDomain is provided/); }); }); - describe('Utils.readChallengeTx', function () { - it('requires a envelopeTypeTxV0 or envelopeTypeTx', function () { + describe("Utils.readChallengeTx", function () { + it("requires a envelopeTypeTxV0 or envelopeTypeTx", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); const challenge = StellarSdk.Utils.buildChallengeTx( serverKP, clientKP.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); const innerTx = new StellarSdk.TransactionBuilder( - new StellarSdk.Account(clientKP.publicKey(), '0'), + new StellarSdk.Account(clientKP.publicKey(), "0"), { - fee: '100', + fee: "100", networkPassphrase: StellarSdk.Networks.TESTNET, timebounds: { minTime: 0, @@ -241,14 +241,14 @@ describe('Utils', function () { StellarSdk.Operation.payment({ destination: clientKP.publicKey(), asset: StellarSdk.Asset.native(), - amount: '10.000' + amount: "10.000" }) ) .build(); let feeBump = StellarSdk.TransactionBuilder.buildFeeBumpTransaction( serverKP, - '300', + "300", innerTx, StellarSdk.Networks.TESTNET ).toXDR(); @@ -258,8 +258,8 @@ describe('Utils', function () { feeBump, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -271,17 +271,17 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.not.throw(StellarSdk.InvalidSep10ChallengeError); expect(() => StellarSdk.Utils.readChallengeTx( - feeBump.toXDR().toString('base64'), + feeBump.toXDR().toString("base64"), serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.not.throw(StellarSdk.InvalidSep10ChallengeError); }); @@ -292,10 +292,10 @@ describe('Utils', function () { const challenge = StellarSdk.Utils.buildChallengeTx( serverKP, clientKP.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -310,29 +310,29 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql({ tx: transaction, clientAccountID: clientKP.publicKey(), - matchedHomeDomain: 'SDF', + matchedHomeDomain: "SDF", memo: null }); }); - it('returns the clientAccountID and memo if the challenge includes a memo', function () { + it("returns the clientAccountID and memo if the challenge includes a memo", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - let clientMemo = '7659725268483412096'; + let clientMemo = "7659725268483412096"; const challenge = StellarSdk.Utils.buildChallengeTx( serverKP, clientKP.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', + "testanchor.stellar.org", clientMemo ); @@ -348,29 +348,29 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql({ tx: transaction, clientAccountID: clientKP.publicKey(), - matchedHomeDomain: 'SDF', + matchedHomeDomain: "SDF", memo: clientMemo }); }); - it('returns the muxed clientAccountID if included in the challenge', function () { + it("returns the muxed clientAccountID if included in the challenge", function () { let serverKP = StellarSdk.Keypair.random(); let muxedAddress = - 'MCQQMHTBRF2NPCEJWO2JMDT2HBQ2FGDCYREY2YIBSHLTXDG54Y3KTWX3R7NBER62VBELC'; + "MCQQMHTBRF2NPCEJWO2JMDT2HBQ2FGDCYREY2YIBSHLTXDG54Y3KTWX3R7NBER62VBELC"; const challenge = StellarSdk.Utils.buildChallengeTx( serverKP, muxedAddress, - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -386,23 +386,23 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql({ tx: transaction, clientAccountID: muxedAddress, - matchedHomeDomain: 'SDF', + matchedHomeDomain: "SDF", memo: null }); }); - it('throws an error if the transaction uses a muxed account and has a memo', function () { + it("throws an error if the transaction uses a muxed account and has a memo", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const clientMuxedAddress = - 'MCQQMHTBRF2NPCEJWO2JMDT2HBQ2FGDCYREY2YIBSHLTXDG54Y3KTWX3R7NBER62VBELC'; + "MCQQMHTBRF2NPCEJWO2JMDT2HBQ2FGDCYREY2YIBSHLTXDG54Y3KTWX3R7NBER62VBELC"; const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -410,17 +410,17 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientMuxedAddress, - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64'), + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64"), withMuxing: true }) ) - .addMemo(new StellarSdk.Memo.id('5842698851377328257')) + .addMemo(new StellarSdk.Memo.id("5842698851377328257")) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -432,8 +432,8 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - 'testanchor.stellar.org' + "testanchor.stellar.org", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -446,28 +446,28 @@ describe('Utils', function () { let clientKP = StellarSdk.Keypair.random(); const transaction = new StellarSdk.TransactionBuilder( - new StellarSdk.Account(serverKP.publicKey(), '-1'), + new StellarSdk.Account(serverKP.publicKey(), "-1"), { fee: 100, networkPassphrase: StellarSdk.Networks.TESTNET } ) .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'SDF-test auth', - value: randomBytes(48).toString('base64') + name: "SDF-test auth", + value: randomBytes(48).toString("base64") }) ) .setTimeout(30) .build(); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF-test', - 'testanchor.stellar.org' + "SDF-test", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -475,10 +475,10 @@ describe('Utils', function () { ); }); - it('throws an error if transaction sequenceNumber is different to zero', function () { + it("throws an error if transaction sequenceNumber is different to zero", function () { let keypair = StellarSdk.Keypair.random(); - const account = new StellarSdk.Account(keypair.publicKey(), '100'); + const account = new StellarSdk.Account(keypair.publicKey(), "100"); const transaction = new StellarSdk.TransactionBuilder( account, txBuilderOpts @@ -486,15 +486,15 @@ describe('Utils', function () { .setTimeout(30) .build(); - let challenge = transaction.toEnvelope().toXDR('base64').toString(); + let challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( challenge, keypair.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -502,16 +502,16 @@ describe('Utils', function () { ); }); - it('throws an error if transaction source account is different to server account id', function () { + it("throws an error if transaction source account is different to server account id", function () { let keypair = StellarSdk.Keypair.random(); const challenge = StellarSdk.Utils.buildChallengeTx( keypair, - 'GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF', - 'SDF', + "GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF", + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); let serverAccountId = StellarSdk.Keypair.random().publicKey(); @@ -521,8 +521,8 @@ describe('Utils', function () { challenge, serverAccountId, StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -532,7 +532,7 @@ describe('Utils', function () { it("throws an error if transaction doesn't contain any operation", function () { let keypair = StellarSdk.Keypair.random(); - const account = new StellarSdk.Account(keypair.publicKey(), '-1'); + const account = new StellarSdk.Account(keypair.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( account, txBuilderOpts @@ -541,15 +541,15 @@ describe('Utils', function () { .build(); transaction.sign(keypair); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( challenge, keypair.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -557,32 +557,32 @@ describe('Utils', function () { ); }); - it('throws an error if operation does not contain the source account', function () { + it("throws an error if operation does not contain the source account", function () { let keypair = StellarSdk.Keypair.random(); - const account = new StellarSdk.Account(keypair.publicKey(), '-1'); + const account = new StellarSdk.Account(keypair.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( account, txBuilderOpts ) .addOperation( StellarSdk.Operation.manageData({ - name: 'SDF auth', - value: randomBytes(48).toString('base64') + name: "SDF auth", + value: randomBytes(48).toString("base64") }) ) .setTimeout(30) .build(); transaction.sign(keypair); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( challenge, keypair.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -590,9 +590,9 @@ describe('Utils', function () { ); }); - it('throws an error if operation is not manage data', function () { + it("throws an error if operation is not manage data", function () { let keypair = StellarSdk.Keypair.random(); - const account = new StellarSdk.Account(keypair.publicKey(), '-1'); + const account = new StellarSdk.Account(keypair.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( account, txBuilderOpts @@ -607,15 +607,15 @@ describe('Utils', function () { .build(); transaction.sign(keypair); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( challenge, keypair.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -623,24 +623,24 @@ describe('Utils', function () { ); }); - it('throws an error if transaction.timeBounds.maxTime is infinite', function () { + it("throws an error if transaction.timeBounds.maxTime is infinite", function () { let serverKeypair = StellarSdk.Keypair.random(); let clientKeypair = StellarSdk.Keypair.random(); - const anchorName = 'SDF'; + const anchorName = "SDF"; const networkPassphrase = StellarSdk.Networks.TESTNET; - const account = new StellarSdk.Account(serverKeypair.publicKey(), '-1'); + const account = new StellarSdk.Account(serverKeypair.publicKey(), "-1"); const now = Math.floor(Date.now() / 1000); - const value = randomBytes(48).toString('base64'); + const value = randomBytes(48).toString("base64"); let transaction = new StellarSdk.TransactionBuilder(account, { fee: StellarSdk.BASE_FEE, networkPassphrase, timebounds: { minTime: now, - maxTime: '0' + maxTime: "0" } }) .addOperation( @@ -653,7 +653,7 @@ describe('Utils', function () { .build(); transaction.sign(serverKeypair); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); transaction = new StellarSdk.Transaction( challenge, @@ -663,7 +663,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -672,7 +672,7 @@ describe('Utils', function () { serverKeypair.publicKey(), StellarSdk.Networks.TESTNET, anchorName, - 'testanchor.stellar.org' + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -680,33 +680,33 @@ describe('Utils', function () { ); }); - it('throws an error if operation value is not a 64 bytes base64 string', function () { + it("throws an error if operation value is not a 64 bytes base64 string", function () { let keypair = StellarSdk.Keypair.random(); - const account = new StellarSdk.Account(keypair.publicKey(), '-1'); + const account = new StellarSdk.Account(keypair.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( account, txBuilderOpts ) .addOperation( StellarSdk.Operation.manageData({ - name: 'SDF auth', + name: "SDF auth", value: randomBytes(64), - source: 'GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF' + source: "GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF" }) ) .setTimeout(30) .build(); transaction.sign(keypair); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( challenge, keypair.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -714,25 +714,25 @@ describe('Utils', function () { ); }); - it('throws an error if operation value is null', function () { + it("throws an error if operation value is null", function () { let keypair = StellarSdk.Keypair.random(); - const account = new StellarSdk.Account(keypair.publicKey(), '-1'); + const account = new StellarSdk.Account(keypair.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( account, txBuilderOpts ) .addOperation( StellarSdk.Operation.manageData({ - name: 'SDF auth', + name: "SDF auth", value: null, - source: 'GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF' + source: "GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CFNF" }) ) .setTimeout(30) .build(); transaction.sign(keypair); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( @@ -746,17 +746,17 @@ describe('Utils', function () { ); }); - it('throws an error if transaction does not contain valid timeBounds', function () { + it("throws an error if transaction does not contain valid timeBounds", function () { let keypair = StellarSdk.Keypair.random(); let clientKeypair = StellarSdk.Keypair.random(); const challenge = StellarSdk.Utils.buildChallengeTx( keypair, clientKeypair.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); // Note that this is greater than the grace period of 5 minutes (600 seconds) @@ -770,7 +770,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -778,8 +778,8 @@ describe('Utils', function () { signedChallenge, keypair.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -787,21 +787,21 @@ describe('Utils', function () { ); }); - it('does NOT throw errors when the user is slightly out of minTime', function () { + it("does NOT throw errors when the user is slightly out of minTime", function () { clock.tick(1626888681 * 1000); // this challenge from Stablex's testnet env, collected 2021-07-21T17:31:21.530Z, // is erroring, and we want to know if it's a bug on our side or in the sdk const signedChallenge = - 'AAAAAgAAAADZJunw2QO9LzjqagEjh/mpWG8Us5nOb+gc6wOex8G+IwAAAGQAAAAAAAAAAAAAAAEAAAAAYPhZ6gAAAXrKHz2UAAAAAAAAAAEAAAABAAAAAJyknd/qYHdzX6iV3TkHlh/usJUr5/U8cRsfVNqaruBAAAAACgAAAB50ZXN0bmV0LXNlcC5zdGFibGV4LmNsb3VkIGF1dGgAAAAAAAEAAABAaEs3QUZieUFCZzBEekx0WnpTVXJkcEhWOXdkdExXUkwxUHFFOW5QRVIrZVlaZzQvdDJlc3drclpBc0ZnTnp5UQAAAAAAAAABx8G+IwAAAEA8I5qQ+/HHXoHrULlg1ODTiCEQ92GQrVBFaB40OKxJhTf1c597AuKLHhJ3c4TNdSp1rjLGbk7qUuhjauxUuH0N'; + "AAAAAgAAAADZJunw2QO9LzjqagEjh/mpWG8Us5nOb+gc6wOex8G+IwAAAGQAAAAAAAAAAAAAAAEAAAAAYPhZ6gAAAXrKHz2UAAAAAAAAAAEAAAABAAAAAJyknd/qYHdzX6iV3TkHlh/usJUr5/U8cRsfVNqaruBAAAAACgAAAB50ZXN0bmV0LXNlcC5zdGFibGV4LmNsb3VkIGF1dGgAAAAAAAEAAABAaEs3QUZieUFCZzBEekx0WnpTVXJkcEhWOXdkdExXUkwxUHFFOW5QRVIrZVlaZzQvdDJlc3drclpBc0ZnTnp5UQAAAAAAAAABx8G+IwAAAEA8I5qQ+/HHXoHrULlg1ODTiCEQ92GQrVBFaB40OKxJhTf1c597AuKLHhJ3c4TNdSp1rjLGbk7qUuhjauxUuH0N"; expect(() => StellarSdk.Utils.readChallengeTx( signedChallenge, - 'GDMSN2PQ3EB32LZY5JVACI4H7GUVQ3YUWOM4437IDTVQHHWHYG7CGA5Z', + "GDMSN2PQ3EB32LZY5JVACI4H7GUVQ3YUWOM4437IDTVQHHWHYG7CGA5Z", StellarSdk.Networks.TESTNET, - 'testnet-sep.stablex.cloud', - 'staging-transfer-server.zetl.network' + "testnet-sep.stablex.cloud", + "staging-transfer-server.zetl.network" ) ).not.to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -812,7 +812,7 @@ describe('Utils', function () { it("home domain string matches transaction's operation key name", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -820,15 +820,15 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -840,13 +840,13 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - 'testanchor.stellar.org' + "testanchor.stellar.org", + "testanchor.stellar.org" ) ).to.eql({ tx: transactionRoundTripped, clientAccountID: clientKP.publicKey(), - matchedHomeDomain: 'testanchor.stellar.org', + matchedHomeDomain: "testanchor.stellar.org", memo: null }); }); @@ -854,7 +854,7 @@ describe('Utils', function () { it("home domain in array matches transaction's operation key name", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -862,15 +862,15 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -882,21 +882,21 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - ['SDF', 'Test', 'testanchor.stellar.org', 'SDF-test'], - 'testanchor.stellar.org' + ["SDF", "Test", "testanchor.stellar.org", "SDF-test"], + "testanchor.stellar.org" ) ).to.eql({ tx: transactionRoundTripped, clientAccountID: clientKP.publicKey(), - matchedHomeDomain: 'testanchor.stellar.org', + matchedHomeDomain: "testanchor.stellar.org", memo: null }); }); - it('throws an error if home domain is not provided', function () { + it("throws an error if home domain is not provided", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -904,15 +904,15 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( @@ -927,10 +927,10 @@ describe('Utils', function () { ); }); - it('throws an error if home domain type is not string or array', function () { + it("throws an error if home domain type is not string or array", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -938,15 +938,15 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( @@ -965,7 +965,7 @@ describe('Utils', function () { it("throws an error if home domain string does not match transaction's operation key name", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -973,23 +973,23 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'does.not.match auth', - value: randomBytes(48).toString('base64') + name: "does.not.match auth", + value: randomBytes(48).toString("base64") }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - 'testanchor.stellar.org' + "testanchor.stellar.org", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1000,7 +1000,7 @@ describe('Utils', function () { it("throws an error if home domain array does not have a match to transaction's operation key name", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -1008,23 +1008,23 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'does.not.match auth', - value: randomBytes(48).toString('base64') + name: "does.not.match auth", + value: randomBytes(48).toString("base64") }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.readChallengeTx( challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - ['SDF', 'Test', 'testanchor.stellar.org', 'SDF-test'], - 'testanchor.stellar.org' + ["SDF", "Test", "testanchor.stellar.org", "SDF-test"], + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1032,10 +1032,10 @@ describe('Utils', function () { ); }); - it('allows transaction to contain subsequent manage data ops with server account as source account', function () { + it("allows transaction to contain subsequent manage data ops with server account as source account", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -1043,22 +1043,22 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'SDF auth', - value: randomBytes(48).toString('base64') + name: "SDF auth", + value: randomBytes(48).toString("base64") }) ) .addOperation( StellarSdk.Operation.manageData({ source: serverKP.publicKey(), - name: 'a key', - value: 'a value' + name: "a key", + value: "a value" }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -1070,21 +1070,21 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql({ tx: transactionRoundTripped, clientAccountID: clientKP.publicKey(), - matchedHomeDomain: 'SDF', + matchedHomeDomain: "SDF", memo: null }); }); - it('throws an error if the transaction contain subsequent manage data ops without the server account as the source account', function () { + it("throws an error if the transaction contain subsequent manage data ops without the server account as the source account", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -1092,22 +1092,22 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'SDF auth', - value: randomBytes(48).toString('base64') + name: "SDF auth", + value: randomBytes(48).toString("base64") }) ) .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'a key', - value: 'a value' + name: "a key", + value: "a value" }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -1119,8 +1119,8 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1128,10 +1128,10 @@ describe('Utils', function () { ); }); - it('throws an error if the transaction contain subsequent ops that are not manage data ops', function () { + it("throws an error if the transaction contain subsequent ops that are not manage data ops", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -1139,21 +1139,21 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'SDF auth', - value: randomBytes(48).toString('base64') + name: "SDF auth", + value: randomBytes(48).toString("base64") }) ) .addOperation( StellarSdk.Operation.bumpSequence({ source: clientKP.publicKey(), - bumpTo: '0' + bumpTo: "0" }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -1165,8 +1165,8 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1177,7 +1177,7 @@ describe('Utils', function () { it("throws an error if the provided webAuthDomain does not match the 'web_auth_domain' operation's value", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -1185,22 +1185,22 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .addOperation( StellarSdk.Operation.manageData({ source: serverKP.publicKey(), - name: 'web_auth_domain', - value: 'unexpected_web_auth_domain' + name: "web_auth_domain", + value: "unexpected_web_auth_domain" }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -1212,8 +1212,8 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - 'testanchor.stellar.org' + "testanchor.stellar.org", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1224,7 +1224,7 @@ describe('Utils', function () { it("throws an error if the 'web_auth_domain' operation's source account is not the server's public key", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -1232,22 +1232,22 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'web_auth_domain', - value: 'testanchor.stellar.org' + name: "web_auth_domain", + value: "testanchor.stellar.org" }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -1259,8 +1259,8 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - 'testanchor.stellar.org' + "testanchor.stellar.org", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1271,7 +1271,7 @@ describe('Utils', function () { it("allows transaction to omit the 'web_auth_domain' operation", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -1279,15 +1279,15 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -1299,13 +1299,13 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - 'testanchor.stellar.org' + "testanchor.stellar.org", + "testanchor.stellar.org" ) ).to.eql({ tx: transactionRoundTripped, clientAccountID: clientKP.publicKey(), - matchedHomeDomain: 'testanchor.stellar.org', + matchedHomeDomain: "testanchor.stellar.org", memo: null }); }); @@ -1313,7 +1313,7 @@ describe('Utils', function () { it("matches the 'web_auth_domain' operation value with webAuthDomain", function () { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -1321,22 +1321,22 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .addOperation( StellarSdk.Operation.manageData({ source: serverKP.publicKey(), - name: 'web_auth_domain', - value: 'auth.stellar.org' + name: "web_auth_domain", + value: "auth.stellar.org" }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -1348,21 +1348,21 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - 'auth.stellar.org' + "testanchor.stellar.org", + "auth.stellar.org" ) ).to.eql({ tx: transactionRoundTripped, clientAccountID: clientKP.publicKey(), - matchedHomeDomain: 'testanchor.stellar.org', + matchedHomeDomain: "testanchor.stellar.org", memo: null }); }); - it('allows subsequent manageData operations to have undefined values', () => { + it("allows subsequent manageData operations to have undefined values", () => { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, txBuilderOpts @@ -1370,14 +1370,14 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .addOperation( StellarSdk.Operation.manageData({ source: serverKP.publicKey(), - name: 'nonWebAuthDomainKey', + name: "nonWebAuthDomainKey", value: null }) ) @@ -1385,7 +1385,7 @@ describe('Utils', function () { .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const transactionRoundTripped = new StellarSdk.Transaction( challenge, @@ -1397,13 +1397,13 @@ describe('Utils', function () { challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - 'auth.stellar.org' + "testanchor.stellar.org", + "auth.stellar.org" ) ).to.eql({ tx: transactionRoundTripped, clientAccountID: clientKP.publicKey(), - matchedHomeDomain: 'testanchor.stellar.org', + matchedHomeDomain: "testanchor.stellar.org", memo: null }); }); @@ -1411,7 +1411,7 @@ describe('Utils', function () { it("validates a challenge containing a 'client_domain' manageData operation", () => { let serverKP = StellarSdk.Keypair.random(); let clientKP = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); let clientSigningKeypair = StellarSdk.Keypair.random(); const transaction = new StellarSdk.TransactionBuilder( @@ -1421,47 +1421,47 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .addOperation( StellarSdk.Operation.manageData({ source: clientSigningKeypair.publicKey(), - name: 'client_domain', - value: 'testdomain' + name: "client_domain", + value: "testdomain" }) ) .setTimeout(30) .build(); transaction.sign(serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); StellarSdk.Utils.readChallengeTx( challenge, serverKP.publicKey(), StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', - 'testanchor.stellar.org' + "testanchor.stellar.org", + "testanchor.stellar.org" ); }); }); - describe('Utils.verifyChallengeTxThreshold', function () { + describe("Utils.verifyChallengeTxThreshold", function () { beforeEach(function () { this.serverKP = StellarSdk.Keypair.random(); this.clientKP1 = StellarSdk.Keypair.random(); this.clientKP2 = StellarSdk.Keypair.random(); this.clientKP3 = StellarSdk.Keypair.random(); - this.txAccount = new StellarSdk.Account(this.serverKP.publicKey(), '-1'); - this.opAccount = new StellarSdk.Account(this.clientKP1.publicKey(), '0'); + this.txAccount = new StellarSdk.Account(this.serverKP.publicKey(), "-1"); + this.opAccount = new StellarSdk.Account(this.clientKP1.publicKey(), "0"); this.operation = StellarSdk.Operation.manageData({ source: this.clientKP1.publicKey(), - name: 'SDF-test auth', - value: randomBytes(48).toString('base64') + name: "SDF-test auth", + value: randomBytes(48).toString("base64") }); this.txBuilderOpts = { @@ -1493,7 +1493,7 @@ describe('Utils', function () { transaction.sign(this.clientKP1); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); expect(() => StellarSdk.Utils.verifyChallengeTxThreshold( @@ -1502,8 +1502,8 @@ describe('Utils', function () { StellarSdk.Networks.TESTNET, threshold, signerSummary, - 'SDF-test', - 'testanchor.stellar.org' + "SDF-test", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1511,14 +1511,14 @@ describe('Utils', function () { ); }); - it('successfully validates server and client key meeting threshold', function () { + it("successfully validates server and client key meeting threshold", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1530,7 +1530,7 @@ describe('Utils', function () { transaction.sign(this.clientKP1); const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); const threshold = 1; @@ -1543,20 +1543,20 @@ describe('Utils', function () { StellarSdk.Networks.TESTNET, threshold, signerSummary, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql([this.clientKP1.publicKey()]); }); - it('successfully validates server and multiple client keys, meeting threshold', function () { + it("successfully validates server and multiple client keys, meeting threshold", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1568,7 +1568,7 @@ describe('Utils', function () { transaction.sign(this.clientKP1, this.clientKP2); const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); const threshold = 3; @@ -1584,20 +1584,20 @@ describe('Utils', function () { StellarSdk.Networks.TESTNET, threshold, signerSummary, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql([this.clientKP1.publicKey(), this.clientKP2.publicKey()]); }); - it('successfully validates server and multiple client keys, meeting threshold with more keys than needed', function () { + it("successfully validates server and multiple client keys, meeting threshold with more keys than needed", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1609,7 +1609,7 @@ describe('Utils', function () { transaction.sign(this.clientKP1, this.clientKP2); const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); const threshold = 3; @@ -1626,26 +1626,26 @@ describe('Utils', function () { StellarSdk.Networks.TESTNET, threshold, signerSummary, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql([this.clientKP1.publicKey(), this.clientKP2.publicKey()]); }); - it('successfully validates server and multiple client keys, meeting threshold with more keys than needed but ignoring PreauthTxHash and XHash', function () { + it("successfully validates server and multiple client keys, meeting threshold with more keys than needed but ignoring PreauthTxHash and XHash", function () { const preauthTxHash = - 'TAQCSRX2RIDJNHFIFHWD63X7D7D6TRT5Y2S6E3TEMXTG5W3OECHZ2OG4'; - const xHash = 'XDRPF6NZRR7EEVO7ESIWUDXHAOMM2QSKIQQBJK6I2FB7YKDZES5UCLWD'; + "TAQCSRX2RIDJNHFIFHWD63X7D7D6TRT5Y2S6E3TEMXTG5W3OECHZ2OG4"; + const xHash = "XDRPF6NZRR7EEVO7ESIWUDXHAOMM2QSKIQQBJK6I2FB7YKDZES5UCLWD"; const unknownSignerType = - '?ARPF6NZRR7EEVO7ESIWUDXHAOMM2QSKIQQBJK6I2FB7YKDZES5UCLWD'; + "?ARPF6NZRR7EEVO7ESIWUDXHAOMM2QSKIQQBJK6I2FB7YKDZES5UCLWD"; const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1657,7 +1657,7 @@ describe('Utils', function () { transaction.sign(this.clientKP1, this.clientKP2); const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); const threshold = 3; @@ -1677,20 +1677,20 @@ describe('Utils', function () { StellarSdk.Networks.TESTNET, threshold, signerSummary, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql([this.clientKP1.publicKey(), this.clientKP2.publicKey()]); }); - it('throws an error if multiple client keys were not enough to meet the threshold', function () { + it("throws an error if multiple client keys were not enough to meet the threshold", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1702,7 +1702,7 @@ describe('Utils', function () { transaction.sign(this.clientKP1, this.clientKP2); const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); const threshold = 10; @@ -1719,8 +1719,8 @@ describe('Utils', function () { StellarSdk.Networks.TESTNET, threshold, signerSummary, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1728,14 +1728,14 @@ describe('Utils', function () { ); }); - it('throws an error if an unrecognized (not from the signerSummary) key has signed the transaction', function () { + it("throws an error if an unrecognized (not from the signerSummary) key has signed the transaction", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1747,7 +1747,7 @@ describe('Utils', function () { transaction.sign(this.clientKP1, this.clientKP2, this.clientKP3); const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); const threshold = 10; @@ -1763,8 +1763,8 @@ describe('Utils', function () { StellarSdk.Networks.TESTNET, threshold, signerSummary, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1772,14 +1772,14 @@ describe('Utils', function () { ); }); - it('throws an error if the signerSummary is empty', function () { + it("throws an error if the signerSummary is empty", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1791,7 +1791,7 @@ describe('Utils', function () { transaction.sign(this.clientKP1, this.clientKP2, this.clientKP3); const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); const threshold = 10; @@ -1803,8 +1803,8 @@ describe('Utils', function () { StellarSdk.Networks.TESTNET, threshold, [], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1813,19 +1813,19 @@ describe('Utils', function () { }); }); - describe('Utils.verifyChallengeTxSigners', function () { + describe("Utils.verifyChallengeTxSigners", function () { beforeEach(function () { this.serverKP = StellarSdk.Keypair.random(); this.clientKP1 = StellarSdk.Keypair.random(); this.clientKP2 = StellarSdk.Keypair.random(); - this.txAccount = new StellarSdk.Account(this.serverKP.publicKey(), '-1'); - this.opAccount = new StellarSdk.Account(this.clientKP1.publicKey(), '0'); + this.txAccount = new StellarSdk.Account(this.serverKP.publicKey(), "-1"); + this.opAccount = new StellarSdk.Account(this.clientKP1.publicKey(), "0"); this.operation = StellarSdk.Operation.manageData({ source: this.clientKP1.publicKey(), - name: 'SDF-test auth', - value: randomBytes(48).toString('base64') + name: "SDF-test auth", + value: randomBytes(48).toString("base64") }); this.txBuilderOpts = { @@ -1843,14 +1843,14 @@ describe('Utils', function () { (this.operation = null); }); - it('successfully validates server and client master key signatures in the transaction', function () { + it("successfully validates server and client master key signatures in the transaction", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1863,7 +1863,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect( @@ -1872,8 +1872,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP1.publicKey()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql([this.clientKP1.publicKey()]); }); @@ -1891,7 +1891,7 @@ describe('Utils', function () { const invalidsServerSignedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -1900,8 +1900,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP1.publicKey()], - 'SDF-test', - 'testanchor.stellar.org' + "SDF-test", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1909,14 +1909,14 @@ describe('Utils', function () { ); }); - it('throws an error if the list of signers is empty', function () { + it("throws an error if the list of signers is empty", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1927,8 +1927,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1936,14 +1936,14 @@ describe('Utils', function () { ); }); - it('throws an error if none of the given signers have signed the transaction', function () { + it("throws an error if none of the given signers have signed the transaction", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1958,7 +1958,7 @@ describe('Utils', function () { ); const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -1967,8 +1967,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP1.publicKey()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -1976,14 +1976,14 @@ describe('Utils', function () { ); }); - it('successfully validates server and multiple client signers in the transaction', function () { + it("successfully validates server and multiple client signers in the transaction", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -1998,7 +1998,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect( @@ -2007,20 +2007,20 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, clientSignersPubKey, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql(clientSignersPubKey); }); - it('successfully validates server and multiple client signers, in reverse order', function () { + it("successfully validates server and multiple client signers, in reverse order", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -2035,7 +2035,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect( @@ -2044,20 +2044,20 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, clientSignersPubKey, - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.have.same.members(clientSignersPubKey); }); - it('successfully validates server and non-masterkey client signer', function () { + it("successfully validates server and non-masterkey client signer", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -2070,7 +2070,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect( @@ -2079,20 +2079,20 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP2.publicKey()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql([this.clientKP2.publicKey()]); }); - it('successfully validates server and non-master key client signer, ignoring extra signer', function () { + it("successfully validates server and non-master key client signer, ignoring extra signer", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -2105,7 +2105,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect( @@ -2114,20 +2114,20 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP2.publicKey(), StellarSdk.Keypair.random().publicKey()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql([this.clientKP2.publicKey()]); }); - it('throws an error if no client but instead the server has signed the transaction', function () { + it("throws an error if no client but instead the server has signed the transaction", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -2140,7 +2140,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -2149,8 +2149,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP2.publicKey(), this.serverKP.publicKey()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -2158,14 +2158,14 @@ describe('Utils', function () { ); }); - it('successfully validates server and non-masterkey client signer, ignoring duplicated client signers', function () { + it("successfully validates server and non-masterkey client signer, ignoring duplicated client signers", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -2178,7 +2178,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect( @@ -2187,26 +2187,26 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP2.publicKey(), this.clientKP2.publicKey()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql([this.clientKP2.publicKey()]); }); - it('successfully validates server and non-masterkey client signer, ignoring preauthTxHash and xHash', function () { + it("successfully validates server and non-masterkey client signer, ignoring preauthTxHash and xHash", function () { const preauthTxHash = - 'TAQCSRX2RIDJNHFIFHWD63X7D7D6TRT5Y2S6E3TEMXTG5W3OECHZ2OG4'; - const xHash = 'XDRPF6NZRR7EEVO7ESIWUDXHAOMM2QSKIQQBJK6I2FB7YKDZES5UCLWD'; + "TAQCSRX2RIDJNHFIFHWD63X7D7D6TRT5Y2S6E3TEMXTG5W3OECHZ2OG4"; + const xHash = "XDRPF6NZRR7EEVO7ESIWUDXHAOMM2QSKIQQBJK6I2FB7YKDZES5UCLWD"; const unknownSignerType = - '?ARPF6NZRR7EEVO7ESIWUDXHAOMM2QSKIQQBJK6I2FB7YKDZES5UCLWD'; + "?ARPF6NZRR7EEVO7ESIWUDXHAOMM2QSKIQQBJK6I2FB7YKDZES5UCLWD"; const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -2219,7 +2219,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect( @@ -2228,8 +2228,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP2.publicKey(), preauthTxHash, xHash, unknownSignerType], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.eql([this.clientKP2.publicKey()]); }); @@ -2238,10 +2238,10 @@ describe('Utils', function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -2253,7 +2253,7 @@ describe('Utils', function () { transaction.sign(this.clientKP1); const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -2262,8 +2262,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP2.publicKey(), this.clientKP2.publicKey()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -2271,14 +2271,14 @@ describe('Utils', function () { ); }); - it('throws an error if the same KP has signed the transaction more than once', function () { + it("throws an error if the same KP has signed the transaction more than once", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -2291,7 +2291,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -2300,8 +2300,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP2.publicKey()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -2309,14 +2309,14 @@ describe('Utils', function () { ); }); - it('throws an error if the client attempts to verify the transaction with a Seed instead of the Public Key', function () { + it("throws an error if the client attempts to verify the transaction with a Seed instead of the Public Key", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -2329,7 +2329,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -2338,8 +2338,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [this.clientKP2.secret()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -2347,7 +2347,7 @@ describe('Utils', function () { ); }); - it('throws an error if no client has signed the transaction', function () { + it("throws an error if no client has signed the transaction", function () { const transaction = new StellarSdk.TransactionBuilder( this.txAccount, this.txBuilderOpts @@ -2357,7 +2357,7 @@ describe('Utils', function () { .build(); transaction.sign(this.serverKP); - const challenge = transaction.toEnvelope().toXDR('base64').toString(); + const challenge = transaction.toEnvelope().toXDR("base64").toString(); const clientSigners = [ this.clientKP1.publicKey(), @@ -2370,8 +2370,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, clientSigners, - 'SDF-test', - 'testanchor.stellar.org' + "SDF-test", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -2379,14 +2379,14 @@ describe('Utils', function () { ); }); - it('throws an error if no public keys were provided to verify signatires', function () { + it("throws an error if no public keys were provided to verify signatires", function () { const challenge = StellarSdk.Utils.buildChallengeTx( this.serverKP, this.clientKP1.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org' + "testanchor.stellar.org" ); clock.tick(200); @@ -2399,7 +2399,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -2408,8 +2408,8 @@ describe('Utils', function () { this.serverKP.publicKey(), StellarSdk.Networks.TESTNET, [], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -2417,19 +2417,19 @@ describe('Utils', function () { ); }); - it('validates challenges containing client domain signers', () => { + it("validates challenges containing client domain signers", () => { const serverKP = StellarSdk.Keypair.random(); const clientKP = StellarSdk.Keypair.random(); const clientSigningKey = StellarSdk.Keypair.random(); const challenge = StellarSdk.Utils.buildChallengeTx( serverKP, clientKP.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', + "testanchor.stellar.org", null, - 'testdomain', + "testdomain", clientSigningKey.publicKey() ); @@ -2445,7 +2445,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); const signersFound = StellarSdk.Utils.verifyChallengeTxSigners( @@ -2453,8 +2453,8 @@ describe('Utils', function () { serverKP.publicKey(), StellarSdk.Networks.TESTNET, [clientKP.publicKey()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ); expect(signersFound.indexOf(clientSigningKey.publicKey())).to.eql(-1); @@ -2467,12 +2467,12 @@ describe('Utils', function () { const challenge = StellarSdk.Utils.buildChallengeTx( serverKP, clientKP.publicKey(), - 'SDF', + "SDF", 300, StellarSdk.Networks.TESTNET, - 'testanchor.stellar.org', + "testanchor.stellar.org", null, - 'testdomain', + "testdomain", clientSigningKeypair.publicKey() ); @@ -2487,7 +2487,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -2496,8 +2496,8 @@ describe('Utils', function () { serverKP.publicKey(), StellarSdk.Networks.TESTNET, [clientKP.publicKey()], - 'SDF', - 'testanchor.stellar.org' + "SDF", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -2505,12 +2505,12 @@ describe('Utils', function () { ); }); - it('throws an error if a challenge has multiple client_domain operations', () => { + it("throws an error if a challenge has multiple client_domain operations", () => { const serverKP = StellarSdk.Keypair.random(); const clientKP = StellarSdk.Keypair.random(); const clientSigningKeypair = StellarSdk.Keypair.random(); - const serverAccount = new StellarSdk.Account(serverKP.publicKey(), '-1'); + const serverAccount = new StellarSdk.Account(serverKP.publicKey(), "-1"); const transaction = new StellarSdk.TransactionBuilder( serverAccount, @@ -2519,22 +2519,22 @@ describe('Utils', function () { .addOperation( StellarSdk.Operation.manageData({ source: clientKP.publicKey(), - name: 'testanchor.stellar.org auth', - value: randomBytes(48).toString('base64') + name: "testanchor.stellar.org auth", + value: randomBytes(48).toString("base64") }) ) .addOperation( StellarSdk.Operation.manageData({ source: clientSigningKeypair.publicKey(), - name: 'client_domain', - value: 'testdomain' + name: "client_domain", + value: "testdomain" }) ) .addOperation( StellarSdk.Operation.manageData({ source: clientSigningKeypair.publicKey(), - name: 'client_domain', - value: 'testdomain2' + name: "client_domain", + value: "testdomain2" }) ) .setTimeout(30) @@ -2548,7 +2548,7 @@ describe('Utils', function () { const signedChallenge = transaction .toEnvelope() - .toXDR('base64') + .toXDR("base64") .toString(); expect(() => @@ -2557,8 +2557,8 @@ describe('Utils', function () { serverKP.publicKey(), StellarSdk.Networks.TESTNET, [clientKP.publicKey()], - 'testanchor.stellar.org', - 'testanchor.stellar.org' + "testanchor.stellar.org", + "testanchor.stellar.org" ) ).to.throw( StellarSdk.InvalidSep10ChallengeError, @@ -2567,10 +2567,10 @@ describe('Utils', function () { }); }); - describe('Utils.verifyTxSignedBy', function () { + describe("Utils.verifyTxSignedBy", function () { beforeEach(function () { this.keypair = StellarSdk.Keypair.random(); - this.account = new StellarSdk.Account(this.keypair.publicKey(), '-1'); + this.account = new StellarSdk.Account(this.keypair.publicKey(), "-1"); this.transaction = new StellarSdk.TransactionBuilder( this.account, txBuilderOpts @@ -2583,7 +2583,7 @@ describe('Utils', function () { this.keypair, this.account, (this.transaction = null); }); - it('returns true if the transaction was signed by the given account', function () { + it("returns true if the transaction was signed by the given account", function () { this.transaction.sign(this.keypair); expect( @@ -2594,7 +2594,7 @@ describe('Utils', function () { ).to.eql(true); }); - it('returns false if the transaction was not signed by the given account', function () { + it("returns false if the transaction was not signed by the given account", function () { this.transaction.sign(this.keypair); let differentKeypair = StellarSdk.Keypair.random(); @@ -2607,7 +2607,7 @@ describe('Utils', function () { ).to.eql(false); }); - it('works with an unsigned transaction', function () { + it("works with an unsigned transaction", function () { expect( StellarSdk.Utils.verifyTxSignedBy( this.transaction, @@ -2617,11 +2617,11 @@ describe('Utils', function () { }); }); - describe('Utils.gatherTxSigners', function () { + describe("Utils.gatherTxSigners", function () { beforeEach(function () { this.keypair1 = StellarSdk.Keypair.random(); this.keypair2 = StellarSdk.Keypair.random(); - this.account = new StellarSdk.Account(this.keypair1.publicKey(), '-1'); + this.account = new StellarSdk.Account(this.keypair1.publicKey(), "-1"); this.transaction = new StellarSdk.TransactionBuilder( this.account, txBuilderOpts @@ -2634,7 +2634,7 @@ describe('Utils', function () { this.keypair1, this.keypair2, this.account, (this.transaction = null); }); - it('returns a list with the signatures used in the transaction', function () { + it("returns a list with the signatures used in the transaction", function () { this.transaction.sign(this.keypair1, this.keypair2); const expectedSignatures = [ @@ -2646,7 +2646,7 @@ describe('Utils', function () { ).to.eql(expectedSignatures); }); - it('returns a list with the signatures used in the transaction, removing duplicates', function () { + it("returns a list with the signatures used in the transaction, removing duplicates", function () { this.transaction.sign( this.keypair1, this.keypair1, @@ -2668,7 +2668,7 @@ describe('Utils', function () { ).to.eql(expectedSignatures); }); - it('returns an empty list if the transaction was not signed by the given accounts', function () { + it("returns an empty list if the transaction was not signed by the given accounts", function () { this.transaction.sign(this.keypair1, this.keypair2); let wrongSignatures = [ @@ -2682,7 +2682,7 @@ describe('Utils', function () { ).to.eql([]); }); - it('calling gatherTxSigners with an unsigned transaction will return an empty list', function () { + it("calling gatherTxSigners with an unsigned transaction will return an empty list", function () { expect( StellarSdk.Utils.gatherTxSigners(this.transaction, [ this.keypair1.publicKey(), @@ -2691,10 +2691,10 @@ describe('Utils', function () { ).to.eql([]); }); - it('Raises an error in case one of the given signers is not a valid G signer', function () { + it("Raises an error in case one of the given signers is not a valid G signer", function () { this.transaction.sign(this.keypair1, this.keypair2); const preauthTxHash = - 'TAQCSRX2RIDJNHFIFHWD63X7D7D6TRT5Y2S6E3TEMXTG5W3OECHZ2OG4'; + "TAQCSRX2RIDJNHFIFHWD63X7D7D6TRT5Y2S6E3TEMXTG5W3OECHZ2OG4"; expect(() => StellarSdk.Utils.gatherTxSigners(this.transaction, [ preauthTxHash, @@ -2706,10 +2706,10 @@ describe('Utils', function () { ); }); - it('Raises an error in case one of the given signers is an invalid G signer', function () { + it("Raises an error in case one of the given signers is an invalid G signer", function () { this.transaction.sign(this.keypair1, this.keypair2); const invalidGHash = - 'GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CAAA'; + "GBDIT5GUJ7R5BXO3GJHFXJ6AZ5UQK6MNOIDMPQUSMXLIHTUNR2Q5CAAA"; expect(() => StellarSdk.Utils.gatherTxSigners(this.transaction, [ invalidGHash,