diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-02 02:34:12 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-02 02:34:12 +0800 |
commit | 8cd4578d839c4311ff69ce9bb0245867e25dcf6d (patch) | |
tree | a2588e41113fa5eb41f7528ad237368bb62d967e /packages/order-utils/src/utils.ts | |
parent | 152082e1820f89bf65e99b5b3ecfe9d3946e3148 (diff) | |
download | dexon-sol-tools-8cd4578d839c4311ff69ce9bb0245867e25dcf6d.tar dexon-sol-tools-8cd4578d839c4311ff69ce9bb0245867e25dcf6d.tar.gz dexon-sol-tools-8cd4578d839c4311ff69ce9bb0245867e25dcf6d.tar.bz2 dexon-sol-tools-8cd4578d839c4311ff69ce9bb0245867e25dcf6d.tar.lz dexon-sol-tools-8cd4578d839c4311ff69ce9bb0245867e25dcf6d.tar.xz dexon-sol-tools-8cd4578d839c4311ff69ce9bb0245867e25dcf6d.tar.zst dexon-sol-tools-8cd4578d839c4311ff69ce9bb0245867e25dcf6d.zip |
Add signature specific validation methods, and other refactors
Diffstat (limited to 'packages/order-utils/src/utils.ts')
-rw-r--r-- | packages/order-utils/src/utils.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/order-utils/src/utils.ts b/packages/order-utils/src/utils.ts new file mode 100644 index 000000000..3b465cece --- /dev/null +++ b/packages/order-utils/src/utils.ts @@ -0,0 +1,9 @@ +export const utils = { + getSignatureTypeIndexIfExists(signature: string): number { + // tslint:disable-next-line:custom-no-magic-numbers + const signatureTypeHex = signature.slice(-2); + const base = 16; + const signatureTypeInt = parseInt(signatureTypeHex, base); + return signatureTypeInt; + }, +}; |