stacks-archive / stacks-transactions-js

The JavaScript library for generating Stacks 2.0 transactions
19 stars 17 forks source link

Use hex number literals rather than hex strings for various enums #37

Closed zone117x closed 4 years ago

zone117x commented 4 years ago

Description

Several byte enums/constants were represented as hex strings. These are more typically used as numbers.

For example, constructing a spending condition given an address hash mode byte:

Previous code:

const hashMode = 0x01;
const hashModeStr = hashMode.toString(16).padStart(2, '0');
return new SingleSigSpendingCondition(hashModeStr, ...);

New code:

const hashMode = 0x01;
return new SingleSigSpendingCondition(hashMode, ...);

Type of Change

Checklist