Skip to content

Commit c942bb6

Browse files
committed
v4.1.0-alpha.1: Add t22 and wns take bids.
1 parent 5cc382f commit c942bb6

File tree

8 files changed

+1722
-875
lines changed

8 files changed

+1722
-875
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tensor-oss/tcomp-sdk",
3-
"version": "3.0.0",
3+
"version": "4.1.0-alpha.1",
44
"description": "Anchor/JS SDK for interacting with TCOMP.",
55
"sideEffects": false,
66
"module": "./dist/esm/index.js",
@@ -32,7 +32,7 @@
3232
"@metaplex-foundation/mpl-token-metadata": "^2.13.0",
3333
"@msgpack/msgpack": "^3.0.0-beta2",
3434
"@solana/spl-account-compression": "^0.1.7",
35-
"@solana/spl-token": "^0.3.7",
35+
"@solana/spl-token": "^0.4.0",
3636
"@solana/web3.js": "^1.75.0",
3737
"@tensor-hq/tensor-common": "^4.1.0",
3838
"@tensor-hq/tensor-tests-common": "^0.3.0",

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from "./types";
22
export * from "./shared";
33
export * from "./tcomp";
4+
export * from "./token2022";

src/shared.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { getAssociatedTokenAddressSync } from "@solana/spl-token";
1+
import {
2+
getAssociatedTokenAddressSync,
3+
TOKEN_PROGRAM_ID,
4+
} from "@solana/spl-token";
25
import { PublicKey } from "@solana/web3.js";
36
import Mexp from "math-expression-evaluator";
47

@@ -27,5 +30,13 @@ export const evalMathExpr = (str: string) => {
2730

2831
//todo: move to common
2932
export const findAta = (mint: PublicKey, owner: PublicKey): PublicKey => {
30-
return getAssociatedTokenAddressSync(mint, owner, true);
33+
return findAtaWithProgramId(mint, owner, TOKEN_PROGRAM_ID);
34+
};
35+
36+
export const findAtaWithProgramId = (
37+
mint: PublicKey,
38+
owner: PublicKey,
39+
programId: PublicKey
40+
): PublicKey => {
41+
return getAssociatedTokenAddressSync(mint, owner, true, programId);
3142
};

0 commit comments

Comments
 (0)