@@ -6,7 +6,7 @@ import { Buffer } from 'buffer'
6
6
import stableStringify from 'json-stable-stringify'
7
7
import clone from 'clone'
8
8
import base58 from 'bs58'
9
- import cc from 'crypto-conditions'
9
+ import { Ed25519Sha256 , PreimageSha256 , ThresholdSha256 } from 'crypto-conditions'
10
10
import ccJsonify from './utils/ccJsonify'
11
11
import sha256Hash from './sha256Hash'
12
12
@@ -96,7 +96,7 @@ export default class Transaction {
96
96
static makeEd25519Condition ( publicKey , json = true ) {
97
97
const publicKeyBuffer = base58 . decode ( publicKey )
98
98
99
- const ed25519Fulfillment = new cc . Ed25519Sha256 ( )
99
+ const ed25519Fulfillment = new Ed25519Sha256 ( )
100
100
ed25519Fulfillment . setPublicKey ( publicKeyBuffer )
101
101
102
102
if ( json ) {
@@ -143,7 +143,7 @@ export default class Transaction {
143
143
* @returns {Object } Preimage-Sha256 Condition (that will need to wrapped in an Output)
144
144
*/
145
145
static makeSha256Condition ( preimage , json = true ) {
146
- const sha256Fulfillment = new cc . PreimageSha256 ( )
146
+ const sha256Fulfillment = new PreimageSha256 ( )
147
147
sha256Fulfillment . setPreimage ( Buffer . from ( preimage ) )
148
148
149
149
if ( json ) {
@@ -160,7 +160,7 @@ export default class Transaction {
160
160
* @returns {Object } Sha256 Threshold Condition (that will need to wrapped in an Output)
161
161
*/
162
162
static makeThresholdCondition ( threshold , subconditions = [ ] , json = true ) {
163
- const thresholdCondition = new cc . ThresholdSha256 ( )
163
+ const thresholdCondition = new ThresholdSha256 ( )
164
164
thresholdCondition . setThreshold ( threshold )
165
165
166
166
subconditions . forEach ( ( subcondition ) => {
@@ -244,7 +244,7 @@ export default class Transaction {
244
244
. concat ( input . fulfills . transaction_id )
245
245
. concat ( input . fulfills . output_index ) : serializedTransaction
246
246
const transactionHash = sha256Hash ( transactionUniqueFulfillment )
247
- const ed25519Fulfillment = new cc . Ed25519Sha256 ( )
247
+ const ed25519Fulfillment = new Ed25519Sha256 ( )
248
248
ed25519Fulfillment . sign ( Buffer . from ( transactionHash , 'hex' ) , privateKeyBuffer )
249
249
const fulfillmentUri = ed25519Fulfillment . serializeUri ( )
250
250
0 commit comments