Browse Source

ts: add provider parameter to spl token client (#1597)

Armani Ferrante 3 years ago
parent
commit
b149fc522a
2 changed files with 4 additions and 3 deletions
  1. 1 0
      CHANGELOG.md
  2. 3 3
      ts/src/spl/index.ts

+ 1 - 0
CHANGELOG.md

@@ -15,6 +15,7 @@ incremented for features.
 
 * lang: Add new `AccountSysvarMismatch` error code and test cases for sysvars ([#1535](https://github.com/project-serum/anchor/pull/1535)).
 * spl: Add support for revoke instruction ([#1493](https://github.com/project-serum/anchor/pull/1493)).
+* ts: Add provider parameter to `Spl.token` factory method ([#1597](https://github.com/project-serum/anchor/pull/1597)).
 
 ### Fixes
 

+ 3 - 3
ts/src/spl/index.ts

@@ -1,10 +1,10 @@
-import { Program } from "../index.js";
+import { Program, Provider } from "../index.js";
 import { program as tokenProgram, SplToken } from "./token.js";
 
 export { SplToken } from "./token.js";
 
 export class Spl {
-  public static token(): Program<SplToken> {
-    return tokenProgram();
+  public static token(provider?: Provider): Program<SplToken> {
+    return tokenProgram(provider);
   }
 }