Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
exports.TransactionBuilder = exports.Transaction = exports.opcodes = exports.Psbt = exports.Block = exports.script = exports.payments = exports.networks = exports.crypto = exports.bufferutils = exports.bip32 = exports.address = exports.ECPair = void 0;
exports.NetworkId = exports.TransactionBuilder = exports.Transaction = exports.opcodes = exports.Psbt = exports.Block = exports.script = exports.payments = exports.networks = exports.crypto = exports.bufferutils = exports.bip32 = exports.address = exports.ECPair = void 0;
const bip32_1 = require('bip32');
const ecc = require('tiny-secp256k1');
const address = require('./address');
Expand Down Expand Up @@ -54,3 +54,10 @@ Object.defineProperty(exports, 'TransactionBuilder', {
return transaction_builder_1.TransactionBuilder;
},
});
var networks_1 = require('./networks');
Object.defineProperty(exports, 'NetworkId', {
enumerable: true,
get: function() {
return networks_1.NetworkId;
},
});
7 changes: 6 additions & 1 deletion src/networks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
exports.dev = exports.prod = void 0;
exports.NetworkId = exports.dev = exports.prod = void 0;
exports.prod = {
messagePrefix: '\x18Tapyrus Signed Message:\n',
bech32: 'bc',
Expand All @@ -27,3 +27,8 @@ exports.dev = {
coloredScriptHash: 0xc5,
wif: 0xef,
};
var NetworkId;
(function(NetworkId) {
NetworkId[(NetworkId['TAPYRUS_API'] = 15215628)] = 'TAPYRUS_API';
NetworkId[(NetworkId['TESTNET'] = 1939510133)] = 'TESTNET';
})(NetworkId || (exports.NetworkId = NetworkId = {}));
2 changes: 1 addition & 1 deletion test/ecpair.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as fixtures from './fixtures/ecpair.json';
const hoodwink = require('hoodwink');
const tinysecp = require('tiny-secp256k1');

const NETWORKS_LIST = Object.values(NETWORKS);
const NETWORKS_LIST = [NETWORKS.prod, NETWORKS.dev];
const ZERO = Buffer.alloc(32, 0);
const ONE = Buffer.from(
'0000000000000000000000000000000000000000000000000000000000000001',
Expand Down
2 changes: 1 addition & 1 deletion ts_src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export { Transaction } from './transaction';
export { TransactionBuilder } from './transaction_builder';

export { ECPairInterface, Signer, SignerAsync } from './ecpair';
export { Network } from './networks';
export { Network, NetworkId } from './networks';
export {
Payment,
PaymentCreator,
Expand Down
5 changes: 5 additions & 0 deletions ts_src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ export const dev: Network = {
coloredScriptHash: 0xc5,
wif: 0xef,
};

export enum NetworkId {
TAPYRUS_API = 15215628,
TESTNET = 1939510133,
}
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export { OPS as opcodes } from './script';
export { Transaction } from './transaction';
export { TransactionBuilder } from './transaction_builder';
export { ECPairInterface, Signer, SignerAsync } from './ecpair';
export { Network } from './networks';
export { Network, NetworkId } from './networks';
export { Payment, PaymentCreator, PaymentOpts, Stack, StackElement, } from './payments';
export { OpCode } from './script';
export { Input as TxInput, Output as TxOutput } from './transaction';
4 changes: 4 additions & 0 deletions types/networks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ interface Bip32 {
}
export declare const prod: Network;
export declare const dev: Network;
export declare enum NetworkId {
TAPYRUS_API = 15215628,
TESTNET = 1939510133
}
export {};