Browse Source

Add TransactionBuilder

fixTypes
junderw 6 years ago
parent
commit
fce08352f5
No known key found for this signature in database GPG Key ID: B256185D3A971908
  1. 15
      src/ecpair.ts
  2. 2
      src/index.ts
  3. 1182
      src/transaction_builder.ts
  4. 2
      test/transaction_builder.js

15
src/ecpair.ts

@ -11,13 +11,24 @@ const isOptions = typeforce.maybe(typeforce.compile({
network: types.maybe(types.Network)
}))
export interface ECPairOptions {
interface ECPairOptions {
compressed?: boolean
network?: Network
rng?(Buffer): Buffer
}
class ECPair {
export interface ECPairInterface {
compressed: boolean
network: Network
privateKey: Buffer
publicKey: Buffer
toWIF(): string
sign(hash: Buffer): Buffer
verify(hash: Buffer, signature: Buffer): Buffer
getPublicKey?(): Buffer
}
class ECPair implements ECPairInterface {
compressed: boolean
network: Network
private __d: Buffer

2
src/index.ts

@ -3,7 +3,7 @@ const opcodes = require('bitcoin-ops')
import { Block } from './block'
import * as ECPair from './ecpair'
import { Transaction } from './transaction'
import * as TransactionBuilder from './transaction_builder'
import { TransactionBuilder } from './transaction_builder'
import * as address from './address'
import * as bip32 from 'bip32'
import * as crypto from './crypto'

1182
src/transaction_builder.ts

File diff suppressed because it is too large

2
test/transaction_builder.js

@ -6,7 +6,7 @@ const payments = require('../dist/src/payments')
const ECPair = require('../dist/src/ecpair')
const Transaction = require('..').Transaction
const TransactionBuilder = require('../dist/src/transaction_builder')
const TransactionBuilder = require('..').TransactionBuilder
const NETWORKS = require('../dist/src/networks')
const fixtures = require('./fixtures/transaction_builder')

Loading…
Cancel
Save