@triadxyz/triad-protocol 1.3.1-beta → 1.3.2-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,3 +5,4 @@ export declare const getVaultAddressSync: (programId: PublicKey, tickerAddress:
5
5
  export declare const getUserPositionPDA: (programId: PublicKey, wallet: PublicKey, ticker: PublicKey) => PublicKey;
6
6
  export declare const getTokenVaultAddressSync: (programId: PublicKey, vault: PublicKey) => PublicKey;
7
7
  export declare const getTokenATA: (address: PublicKey, Mint: PublicKey) => PublicKey;
8
+ export declare const getSpinPDA: (programId: PublicKey, name: string) => PublicKey;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTokenATA = exports.getTokenVaultAddressSync = exports.getUserPositionPDA = exports.getVaultAddressSync = exports.getTickerPDA = exports.getUserPDA = void 0;
3
+ exports.getSpinPDA = exports.getTokenATA = exports.getTokenVaultAddressSync = exports.getUserPositionPDA = exports.getVaultAddressSync = exports.getTickerPDA = exports.getUserPDA = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  const spl_token_1 = require("@solana/spl-token");
6
6
  const getUserPDA = (programId, wallet) => {
@@ -27,3 +27,7 @@ const getTokenATA = (address, Mint) => {
27
27
  return web3_js_1.PublicKey.findProgramAddressSync([address.toBytes(), spl_token_1.TOKEN_2022_PROGRAM_ID.toBytes(), Mint.toBytes()], new web3_js_1.PublicKey(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID))[0];
28
28
  };
29
29
  exports.getTokenATA = getTokenATA;
30
+ const getSpinPDA = (programId, name) => {
31
+ return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('spin'), Buffer.from(name)], programId)[0];
32
+ };
33
+ exports.getSpinPDA = getSpinPDA;
@@ -1,3 +1,5 @@
1
1
  import { RpcOptions } from '../types';
2
- declare const sendTransactionWithOptions: (method: any, options?: RpcOptions) => any;
2
+ import { MethodsBuilder } from '@coral-xyz/anchor/dist/cjs/program/namespace/methods';
3
+ import { TriadProtocol } from '../types/triad_protocol';
4
+ declare const sendTransactionWithOptions: (method: MethodsBuilder<TriadProtocol, any, any>, options?: RpcOptions) => Promise<string>;
3
5
  export default sendTransactionWithOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "1.3.1-beta",
3
+ "version": "1.3.2-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",