UNPKG

stellar-plus

Version:

beta version of stellar-plus, an all-in-one sdk for the Stellar blockchain

59 lines (58 loc) 2.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _1 = require("."); describe('Network', () => { describe('Default Network Configurations', () => { it('should return the TestNet configuration', () => { const testNet = (0, _1.TestNet)(); expect(testNet).toEqual({ name: _1.NetworksList.testnet, networkPassphrase: 'Test SDF Network ; September 2015', rpcUrl: 'https://soroban-testnet.stellar.org:443', friendbotUrl: 'https://friendbot.stellar.org', horizonUrl: 'https://horizon-testnet.stellar.org', allowHttp: false, }); }); it('should return the FutureNet configuration', () => { const futureNet = (0, _1.FutureNet)(); expect(futureNet).toEqual({ name: _1.NetworksList.futurenet, networkPassphrase: 'Test SDF Future Network ; October 2022', rpcUrl: 'https://rpc-futurenet.stellar.org:443', friendbotUrl: 'https://friendbot-futurenet.stellar.org', horizonUrl: 'https://horizon-futurenet.stellar.org', allowHttp: false, }); }); it('should return the MainNet configuration', () => { const mainNet = (0, _1.MainNet)(); expect(mainNet).toEqual({ name: _1.NetworksList.mainnet, networkPassphrase: 'Public Global Stellar Network ; September 2015', rpcUrl: '', horizonUrl: 'https://horizon.stellar.org', allowHttp: false, }); }); }); describe('Custom Network Configuration', () => { it('should return a custom network configuration', () => { const customNet = (0, _1.CustomNet)({ networkPassphrase: 'Custom Network', rpcUrl: 'https://rpc.custom.com', friendbotUrl: 'https://friendbot.custom.com', horizonUrl: 'https://horizon.custom.com', allowHttp: true, }); expect(customNet).toEqual({ name: _1.NetworksList.custom, networkPassphrase: 'Custom Network', rpcUrl: 'https://rpc.custom.com', friendbotUrl: 'https://friendbot.custom.com', horizonUrl: 'https://horizon.custom.com', allowHttp: true, }); }); }); });