@sonarwatch/portfolio-plugins 0.14.206 → 0.14.207
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.
- package/CHANGELOG.md +2495 -2486
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/pumpfun/constants.d.ts +5 -0
- package/src/plugins/pumpfun/constants.js +7 -0
- package/src/plugins/pumpfun/constants.js.map +1 -0
- package/src/plugins/pumpfun/creatorRewardsFetcher.d.ts +3 -0
- package/src/plugins/pumpfun/creatorRewardsFetcher.js +73 -0
- package/src/plugins/pumpfun/creatorRewardsFetcher.js.map +1 -0
- package/src/plugins/pumpfun/helpers.d.ts +7 -0
- package/src/plugins/pumpfun/helpers.js +54 -0
- package/src/plugins/pumpfun/helpers.js.map +1 -0
- package/src/plugins/pumpfun/index.d.ts +4 -0
- package/src/plugins/pumpfun/index.js +10 -0
- package/src/plugins/pumpfun/index.js.map +1 -0
- package/src/plugins/raydium/farmsFetcher.js +3 -3
- package/src/plugins/raydium/farmsFetcher.js.map +1 -1
- package/src/plugins/raydium/farmsJob.d.ts +0 -1
- package/src/plugins/raydium/farmsJob.js +1 -2
- package/src/plugins/raydium/farmsJob.js.map +1 -1
- package/src/plugins/raydium/farmsV6Fetcher.d.ts +3 -0
- package/src/plugins/raydium/farmsV6Fetcher.js +72 -0
- package/src/plugins/raydium/farmsV6Fetcher.js.map +1 -0
- package/src/plugins/raydium/farmsV6Job.d.ts +9 -0
- package/src/plugins/raydium/farmsV6Job.js +47 -0
- package/src/plugins/raydium/farmsV6Job.js.map +1 -0
- package/src/plugins/raydium/index.js +10 -2
- package/src/plugins/raydium/index.js.map +1 -1
- package/src/plugins/raydium/lpTokensJob.js +4 -0
- package/src/plugins/raydium/lpTokensJob.js.map +1 -1
- package/src/plugins/raydium/types.d.ts +14 -9
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/clients/getClientSolanaUmi.d.ts +7 -0
- package/src/utils/clients/getClientSolanaUmi.js +37 -0
- package/src/utils/clients/getClientSolanaUmi.js.map +1 -0
- package/src/utils/clients/index.d.ts +1 -0
- package/src/utils/clients/index.js +3 -1
- package/src/utils/clients/index.js.map +1 -1
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/solana/getAssociatedTokenAddressSync.d.ts +4 -0
- package/src/utils/solana/getAssociatedTokenAddressSync.js +11 -0
- package/src/utils/solana/getAssociatedTokenAddressSync.js.map +1 -0
@@ -3,11 +3,10 @@
|
|
3
3
|
import { GetProgramAccountsFilter, PublicKey } from '@solana/web3.js';
|
4
4
|
import { BeetStruct } from '@metaplex-foundation/beet';
|
5
5
|
import { TokenPrice, Yield } from '@sonarwatch/portfolio-core';
|
6
|
-
import BigNumber from 'bignumber.js';
|
7
6
|
import BN from 'bn.js';
|
8
7
|
import Decimal from 'decimal.js';
|
9
8
|
import { AmmInfoV4, AmmInfoV5 } from './structs/amms';
|
10
|
-
import { FarmAccount, FarmAccountV6, UserFarmAccountV3, UserFarmAccountV31, UserFarmAccountV4, UserFarmAccountV5 } from './structs/farms';
|
9
|
+
import { FarmAccount, FarmAccountV6, UserFarmAccountV3, UserFarmAccountV31, UserFarmAccountV4, UserFarmAccountV5, UserFarmAccountV61 } from './structs/farms';
|
11
10
|
import { ParsedAccount } from '../../utils/solana';
|
12
11
|
export declare enum LiquidityPoolStatus {
|
13
12
|
Uninitialized = 0,
|
@@ -35,6 +34,12 @@ export type UserFarmConfig = {
|
|
35
34
|
filters: (address: string) => GetProgramAccountsFilter[];
|
36
35
|
struct: BeetStruct<UserFarmAccountV3, Partial<UserFarmAccountV3>> | BeetStruct<UserFarmAccountV4, Partial<UserFarmAccountV4>> | BeetStruct<UserFarmAccountV5, Partial<UserFarmAccountV5>> | BeetStruct<UserFarmAccountV31, Partial<UserFarmAccountV31>>;
|
37
36
|
};
|
37
|
+
export type UserFarmConfigV6 = {
|
38
|
+
programId: PublicKey;
|
39
|
+
version: string;
|
40
|
+
filters: (address: string) => GetProgramAccountsFilter[];
|
41
|
+
struct: BeetStruct<UserFarmAccountV61, Partial<UserFarmAccountV61>>;
|
42
|
+
};
|
38
43
|
export type FarmConfig = {
|
39
44
|
programId: PublicKey;
|
40
45
|
version: string;
|
@@ -42,6 +47,13 @@ export type FarmConfig = {
|
|
42
47
|
filters: GetProgramAccountsFilter[];
|
43
48
|
struct: BeetStruct<FarmAccount, Partial<FarmAccount>>;
|
44
49
|
};
|
50
|
+
export type FarmConfigV6 = {
|
51
|
+
programId: PublicKey;
|
52
|
+
version: string;
|
53
|
+
d: number;
|
54
|
+
filters: GetProgramAccountsFilter[];
|
55
|
+
struct: BeetStruct<FarmAccountV6, Partial<FarmAccountV6>>;
|
56
|
+
};
|
45
57
|
export type FarmInfo = {
|
46
58
|
account: ParsedAccount<FarmAccount>;
|
47
59
|
lpToken: TokenPrice;
|
@@ -50,13 +62,6 @@ export type FarmInfo = {
|
|
50
62
|
rewardTokenB?: TokenPrice;
|
51
63
|
yields?: Yield[];
|
52
64
|
};
|
53
|
-
export type FarmInfoV6 = {
|
54
|
-
account: FarmAccountV6;
|
55
|
-
lpToken: TokenPrice;
|
56
|
-
multiplier: BigNumber;
|
57
|
-
rewardTokens: (TokenPrice | undefined)[];
|
58
|
-
yields?: Yield[];
|
59
|
-
};
|
60
65
|
export interface ClmmPoolRewardInfo {
|
61
66
|
rewardState: number;
|
62
67
|
openTime: BN;
|
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -40,28 +40,28 @@ function getPairKey(version) {
|
|
40
40
|
exports.getPairKey = getPairKey;
|
41
41
|
function getPairsV2FromTheGraph(url, length = 300) {
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
{
|
45
|
-
pairs(
|
46
|
-
orderBy: reserveUSD
|
47
|
-
first: ${length}
|
48
|
-
orderDirection: desc
|
49
|
-
where: { trackedReserveETH_not: "0" }
|
50
|
-
) {
|
51
|
-
id
|
52
|
-
reserve0
|
53
|
-
reserve1
|
54
|
-
totalSupply
|
55
|
-
token0 {
|
56
|
-
id
|
57
|
-
decimals
|
58
|
-
}
|
59
|
-
token1 {
|
60
|
-
id
|
61
|
-
decimals
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
{
|
45
|
+
pairs(
|
46
|
+
orderBy: reserveUSD
|
47
|
+
first: ${length}
|
48
|
+
orderDirection: desc
|
49
|
+
where: { trackedReserveETH_not: "0" }
|
50
|
+
) {
|
51
|
+
id
|
52
|
+
reserve0
|
53
|
+
reserve1
|
54
|
+
totalSupply
|
55
|
+
token0 {
|
56
|
+
id
|
57
|
+
decimals
|
58
|
+
}
|
59
|
+
token1 {
|
60
|
+
id
|
61
|
+
decimals
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
65
|
`;
|
66
66
|
const res = yield (0, graphql_request_1.default)(url, query);
|
67
67
|
const pairs = res.pairs;
|
@@ -40,20 +40,20 @@ const clients_1 = require("../../utils/clients");
|
|
40
40
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
41
41
|
const helpers_1 = require("./helpers");
|
42
42
|
const AirdropFetcher_1 = require("../../AirdropFetcher");
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
query GetAirdropFinalFrontend($authority: String!) {
|
45
|
-
getAirdropFinalFrontend(authority: $authority) {
|
46
|
-
authority
|
47
|
-
community_allocation
|
48
|
-
eligibility
|
49
|
-
main_allocation
|
50
|
-
og_allocation
|
51
|
-
s1_allocation
|
52
|
-
s2_allocation
|
53
|
-
total_allocation
|
54
|
-
__typename
|
55
|
-
}
|
56
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
query GetAirdropFinalFrontend($authority: String!) {
|
45
|
+
getAirdropFinalFrontend(authority: $authority) {
|
46
|
+
authority
|
47
|
+
community_allocation
|
48
|
+
eligibility
|
49
|
+
main_allocation
|
50
|
+
og_allocation
|
51
|
+
s1_allocation
|
52
|
+
s2_allocation
|
53
|
+
total_allocation
|
54
|
+
__typename
|
55
|
+
}
|
56
|
+
}
|
57
57
|
`;
|
58
58
|
const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
59
59
|
const res = yield (0, graphql_request_1.default)(constants_1.graphqlApi, query, {
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
2
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
|
+
import { Commitment } from '@solana/web3.js';
|
4
|
+
export type SolanaClientParams = {
|
5
|
+
commitment?: Commitment;
|
6
|
+
};
|
7
|
+
export default function getClientSolanaUmi(params?: SolanaClientParams): import("@metaplex-foundation/umi").Umi;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
4
|
+
const umi_bundle_defaults_1 = require("@metaplex-foundation/umi-bundle-defaults");
|
5
|
+
const getBasicAuthHeaders_1 = require("../misc/getBasicAuthHeaders");
|
6
|
+
const constants_1 = require("./constants");
|
7
|
+
function getClientSolanaUmi(params) {
|
8
|
+
const rpcEndpoint = (0, constants_1.getRpcEndpoint)(portfolio_core_1.NetworkId.solana);
|
9
|
+
const httpHeaders = rpcEndpoint.basicAuth
|
10
|
+
? (0, getBasicAuthHeaders_1.getBasicAuthHeaders)(rpcEndpoint.basicAuth.username, rpcEndpoint.basicAuth.password)
|
11
|
+
: undefined;
|
12
|
+
let fetchMiddleware;
|
13
|
+
if (process.env['PORTFOLIO_RPC_LOGS'] === 'true') {
|
14
|
+
const reqs = {
|
15
|
+
total: 0,
|
16
|
+
};
|
17
|
+
fetchMiddleware = (info, init, fetch) => {
|
18
|
+
var _a;
|
19
|
+
const { method } = JSON.parse(((_a = init === null || init === void 0 ? void 0 : init.body) === null || _a === void 0 ? void 0 : _a.toString()) || '{}');
|
20
|
+
if (typeof method !== 'string')
|
21
|
+
return;
|
22
|
+
if (!reqs[method])
|
23
|
+
reqs[method] = 0;
|
24
|
+
reqs[method] += 1;
|
25
|
+
reqs['total'] += 1;
|
26
|
+
if (reqs['total'] % 5 === 1) {
|
27
|
+
// eslint-disable-next-line no-console
|
28
|
+
console.log(`RPC Requests: ${JSON.stringify(reqs, undefined, 2)}`);
|
29
|
+
}
|
30
|
+
fetch(info, init);
|
31
|
+
};
|
32
|
+
}
|
33
|
+
return (0, umi_bundle_defaults_1.createUmi)(rpcEndpoint.url, Object.assign(Object.assign({}, params), { httpHeaders,
|
34
|
+
fetchMiddleware }));
|
35
|
+
}
|
36
|
+
exports.default = getClientSolanaUmi;
|
37
|
+
//# sourceMappingURL=getClientSolanaUmi.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getClientSolanaUmi.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clients/getClientSolanaUmi.ts"],"names":[],"mappings":";;AAAA,+DAAuD;AAEvD,kFAAqE;AACrE,qEAAkE;AAClE,2CAA6C;AAM7C,SAAwB,kBAAkB,CAAC,MAA2B;IACpE,MAAM,WAAW,GAAG,IAAA,0BAAc,EAAC,0BAAS,CAAC,MAAM,CAAC,CAAC;IACrD,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS;QACvC,CAAC,CAAC,IAAA,yCAAmB,EACjB,WAAW,CAAC,SAAS,CAAC,QAAQ,EAC9B,WAAW,CAAC,SAAS,CAAC,QAAQ,CAC/B;QACH,CAAC,CAAC,SAAS,CAAC;IAEd,IAAI,eAA4C,CAAC;IACjD,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,KAAK,MAAM,EAAE,CAAC;QACjD,MAAM,IAAI,GAA2B;YACnC,KAAK,EAAE,CAAC;SACT,CAAC;QACF,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;;YACtC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,0CAAE,QAAQ,EAAE,KAAI,IAAI,CAAC,CAAC;YAC9D,IAAI,OAAO,MAAM,KAAK,QAAQ;gBAAE,OAAO;YACvC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;gBAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAClB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACnB,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,sCAAsC;gBACtC,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YACrE,CAAC;YACD,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,IAAA,+BAAS,EAAC,WAAW,CAAC,GAAG,kCAC3B,MAAM,KACT,WAAW;QACX,eAAe,IACf,CAAC;AACL,CAAC;AAjCD,qCAiCC"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
export { default as getClientAptos } from './getClientAptos';
|
2
2
|
export { default as getClientSolana } from './getClientSolana';
|
3
|
+
export { default as getClientSolanaUmi } from './getClientSolanaUmi';
|
3
4
|
export { default as getClientSui } from './getClientSui';
|
4
5
|
export { default as getClientSei } from './getClientSei';
|
5
6
|
export { default as getClientCosmos } from './getClientCosmos';
|
@@ -3,11 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.getMempoolEndpoint = exports.urlToRpcEndpoint = exports.getEvmClients = exports.getEvmWeb3V1Client = exports.getEvmEthersClient = exports.getEvmClient = exports.getClientCosmWasm = exports.getClientIbc = exports.getClientCosmos = exports.getClientSei = exports.getClientSui = exports.getClientSolana = exports.getClientAptos = void 0;
|
6
|
+
exports.getMempoolEndpoint = exports.urlToRpcEndpoint = exports.getEvmClients = exports.getEvmWeb3V1Client = exports.getEvmEthersClient = exports.getEvmClient = exports.getClientCosmWasm = exports.getClientIbc = exports.getClientCosmos = exports.getClientSei = exports.getClientSui = exports.getClientSolanaUmi = exports.getClientSolana = exports.getClientAptos = void 0;
|
7
7
|
var getClientAptos_1 = require("./getClientAptos");
|
8
8
|
Object.defineProperty(exports, "getClientAptos", { enumerable: true, get: function () { return __importDefault(getClientAptos_1).default; } });
|
9
9
|
var getClientSolana_1 = require("./getClientSolana");
|
10
10
|
Object.defineProperty(exports, "getClientSolana", { enumerable: true, get: function () { return __importDefault(getClientSolana_1).default; } });
|
11
|
+
var getClientSolanaUmi_1 = require("./getClientSolanaUmi");
|
12
|
+
Object.defineProperty(exports, "getClientSolanaUmi", { enumerable: true, get: function () { return __importDefault(getClientSolanaUmi_1).default; } });
|
11
13
|
var getClientSui_1 = require("./getClientSui");
|
12
14
|
Object.defineProperty(exports, "getClientSui", { enumerable: true, get: function () { return __importDefault(getClientSui_1).default; } });
|
13
15
|
var getClientSei_1 = require("./getClientSei");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clients/index.ts"],"names":[],"mappings":";;;;;;AAAA,mDAA6D;AAApD,iIAAA,OAAO,OAAkB;AAClC,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,yDAAmE;AAA1D,uIAAA,OAAO,OAAqB;AACrC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB;AACtC,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB;AACtC,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,uDAAiE;AAAxD,qIAAA,OAAO,OAAoB;AACpC,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clients/index.ts"],"names":[],"mappings":";;;;;;AAAA,mDAA6D;AAApD,iIAAA,OAAO,OAAkB;AAClC,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB;AACtC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,yDAAmE;AAA1D,uIAAA,OAAO,OAAqB;AACrC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB;AACtC,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB;AACtC,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,uDAAiE;AAAxD,qIAAA,OAAO,OAAoB;AACpC,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB"}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
|
4
|
-
exports.infoQueryMsg = JSON.parse(`{
|
5
|
-
"info": {}
|
4
|
+
exports.infoQueryMsg = JSON.parse(`{
|
5
|
+
"info": {}
|
6
6
|
}`);
|
7
|
-
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
-
"token_info": {}
|
7
|
+
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
+
"token_info": {}
|
9
9
|
}`);
|
10
|
-
exports.minterQueryMsg = JSON.parse(`{
|
11
|
-
"minter": {}
|
10
|
+
exports.minterQueryMsg = JSON.parse(`{
|
11
|
+
"minter": {}
|
12
12
|
}`);
|
13
|
-
exports.poolQueryMsg = JSON.parse(`{
|
14
|
-
"pool": {}
|
13
|
+
exports.poolQueryMsg = JSON.parse(`{
|
14
|
+
"pool": {}
|
15
15
|
}`);
|
16
16
|
//# sourceMappingURL=constants.js.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
function getQueryBalanceByOwner(owner) {
|
4
|
-
return JSON.parse(`{
|
5
|
-
"balance": {
|
6
|
-
"address": "${owner}"
|
7
|
-
}
|
4
|
+
return JSON.parse(`{
|
5
|
+
"balance": {
|
6
|
+
"address": "${owner}"
|
7
|
+
}
|
8
8
|
}`);
|
9
9
|
}
|
10
10
|
exports.default = getQueryBalanceByOwner;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
2
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
export default function getAssociatedTokenAddress(mint: PublicKey, owner: PublicKey): PublicKey | undefined;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const web3_js_1 = require("@solana/web3.js");
|
4
|
+
const constants_1 = require("./constants");
|
5
|
+
function getAssociatedTokenAddress(mint, owner) {
|
6
|
+
if (!web3_js_1.PublicKey.isOnCurve(owner.toBuffer()))
|
7
|
+
return undefined;
|
8
|
+
return web3_js_1.PublicKey.findProgramAddressSync([owner.toBuffer(), constants_1.solanaTokenPidPk.toBuffer(), mint.toBuffer()], constants_1.associatedTokenProgramId)[0];
|
9
|
+
}
|
10
|
+
exports.default = getAssociatedTokenAddress;
|
11
|
+
//# sourceMappingURL=getAssociatedTokenAddressSync.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getAssociatedTokenAddressSync.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/getAssociatedTokenAddressSync.ts"],"names":[],"mappings":";;AAAA,6CAA4C;AAC5C,2CAAyE;AAEzE,SAAwB,yBAAyB,CAC/C,IAAe,EACf,KAAgB;IAEhB,IAAI,CAAC,mBAAS,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QAAE,OAAO,SAAS,CAAC;IAE7D,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,4BAAgB,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,EAChE,oCAAwB,CACzB,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AAVD,4CAUC"}
|