Browse Source

ts: Export sighash coder

Armani Ferrante 4 years ago
parent
commit
734c751882
3 changed files with 6 additions and 1 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 1
      ts/package.json
  3. 4 0
      ts/src/coder.ts

+ 1 - 0
CHANGELOG.md

@@ -14,6 +14,7 @@ incremented for features.
 ## Features
 
 * ts: Allow preloading instructions for state rpc transactions ([cf9c84](https://github.com/project-serum/anchor/commit/cf9c847e4144989b5bc1936149d171e90204777b)).
+* ts: Export sighash coder function.
 * cli: Specify programs to embed into local validator genesis via Anchor.toml while testing.
 * cli: Allow skipping the creation of a local validator when testing against localnet.
 * cli: Adds support for tests with Typescript ([#94](https://github.com/project-serum/anchor/pull/94)).

+ 1 - 1
ts/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@project-serum/anchor",
-  "version": "0.2.2-beta.1",
+  "version": "0.2.2-beta.2",
   "description": "Anchor client",
   "main": "dist/cjs/index.js",
   "module": "dist/esm/index.js",

+ 4 - 0
ts/src/coder.ts

@@ -59,6 +59,10 @@ export default class Coder {
       this.state = new StateCoder(idl);
     }
   }
+
+  public sighash(nameSpace: string, ixName: string): Buffer {
+    return sighash(nameSpace, ixName);
+  }
 }
 
 /**