@hawksightco/hawk-sdk 1.3.263 → 1.3.265
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/package.json +1 -1
- package/dist/src/addresses.d.ts +0 -37
- package/dist/src/addresses.d.ts.map +0 -1
- package/dist/src/addresses.js +0 -84
- package/dist/src/anchor.d.ts +0 -22
- package/dist/src/anchor.d.ts.map +0 -1
- package/dist/src/anchor.js +0 -121
- package/dist/src/classes/AltStorage.d.ts +0 -29
- package/dist/src/classes/AltStorage.d.ts.map +0 -1
- package/dist/src/classes/AltStorage.js +0 -58
- package/dist/src/classes/Atomicity.d.ts +0 -34
- package/dist/src/classes/Atomicity.d.ts.map +0 -1
- package/dist/src/classes/Atomicity.js +0 -110
- package/dist/src/classes/Client.d.ts +0 -35
- package/dist/src/classes/Client.d.ts.map +0 -1
- package/dist/src/classes/Client.js +0 -66
- package/dist/src/classes/CombineTransactions.d.ts +0 -11
- package/dist/src/classes/CombineTransactions.d.ts.map +0 -1
- package/dist/src/classes/CombineTransactions.js +0 -58
- package/dist/src/classes/CreateTxMetadata.d.ts +0 -100
- package/dist/src/classes/CreateTxMetadata.d.ts.map +0 -1
- package/dist/src/classes/CreateTxMetadata.js +0 -415
- package/dist/src/classes/General.d.ts +0 -87
- package/dist/src/classes/General.d.ts.map +0 -1
- package/dist/src/classes/General.js +0 -176
- package/dist/src/classes/GeneralUtility.d.ts +0 -79
- package/dist/src/classes/GeneralUtility.d.ts.map +0 -1
- package/dist/src/classes/GeneralUtility.js +0 -121
- package/dist/src/classes/HawkAPI.d.ts +0 -122
- package/dist/src/classes/HawkAPI.d.ts.map +0 -1
- package/dist/src/classes/HawkAPI.js +0 -169
- package/dist/src/classes/Health.d.ts +0 -29
- package/dist/src/classes/Health.d.ts.map +0 -1
- package/dist/src/classes/Health.js +0 -48
- package/dist/src/classes/JupiterAlts.d.ts +0 -37
- package/dist/src/classes/JupiterAlts.d.ts.map +0 -1
- package/dist/src/classes/JupiterAlts.js +0 -114
- package/dist/src/classes/JupiterSwap.d.ts +0 -21
- package/dist/src/classes/JupiterSwap.d.ts.map +0 -1
- package/dist/src/classes/JupiterSwap.js +0 -40
- package/dist/src/classes/Logging.d.ts +0 -13
- package/dist/src/classes/Logging.d.ts.map +0 -1
- package/dist/src/classes/Logging.js +0 -50
- package/dist/src/classes/MultiTransaction.d.ts +0 -75
- package/dist/src/classes/MultiTransaction.d.ts.map +0 -1
- package/dist/src/classes/MultiTransaction.js +0 -296
- package/dist/src/classes/RaydiumSDK.d.ts +0 -67
- package/dist/src/classes/RaydiumSDK.d.ts.map +0 -1
- package/dist/src/classes/RaydiumSDK.js +0 -206
- package/dist/src/classes/Search.d.ts +0 -100
- package/dist/src/classes/Search.d.ts.map +0 -1
- package/dist/src/classes/Search.js +0 -216
- package/dist/src/classes/SimpleIxGenerator.d.ts +0 -57
- package/dist/src/classes/SimpleIxGenerator.d.ts.map +0 -1
- package/dist/src/classes/SimpleIxGenerator.js +0 -62
- package/dist/src/classes/SimplePdaGenerator.d.ts +0 -28
- package/dist/src/classes/SimplePdaGenerator.d.ts.map +0 -1
- package/dist/src/classes/SimplePdaGenerator.js +0 -33
- package/dist/src/classes/Transaction.d.ts +0 -229
- package/dist/src/classes/Transaction.d.ts.map +0 -1
- package/dist/src/classes/Transaction.js +0 -643
- package/dist/src/classes/Transaction2.d.ts +0 -107
- package/dist/src/classes/Transaction2.d.ts.map +0 -1
- package/dist/src/classes/Transaction2.js +0 -249
- package/dist/src/classes/Transaction3.d.ts +0 -165
- package/dist/src/classes/Transaction3.d.ts.map +0 -1
- package/dist/src/classes/Transaction3.js +0 -416
- package/dist/src/classes/TransactionBatchExecute.d.ts +0 -163
- package/dist/src/classes/TransactionBatchExecute.d.ts.map +0 -1
- package/dist/src/classes/TransactionBatchExecute.js +0 -466
- package/dist/src/classes/TransactionBatchExecute2.d.ts +0 -99
- package/dist/src/classes/TransactionBatchExecute2.d.ts.map +0 -1
- package/dist/src/classes/TransactionBatchExecute2.js +0 -357
- package/dist/src/classes/Transactions.d.ts +0 -586
- package/dist/src/classes/Transactions.d.ts.map +0 -1
- package/dist/src/classes/Transactions.js +0 -7656
- package/dist/src/classes/TxGenerator.d.ts +0 -350
- package/dist/src/classes/TxGenerator.d.ts.map +0 -1
- package/dist/src/classes/TxGenerator.js +0 -1957
- package/dist/src/classes/TxGeneratorAutomations.d.ts +0 -186
- package/dist/src/classes/TxGeneratorAutomations.d.ts.map +0 -1
- package/dist/src/classes/TxGeneratorAutomations.js +0 -897
- package/dist/src/classes/Util.d.ts +0 -87
- package/dist/src/classes/Util.d.ts.map +0 -1
- package/dist/src/classes/Util.js +0 -148
- package/dist/src/classes/account-cache/AccountCache.d.ts +0 -54
- package/dist/src/classes/account-cache/AccountCache.d.ts.map +0 -1
- package/dist/src/classes/account-cache/AccountCache.js +0 -143
- package/dist/src/classes/account-cache/MintCache.d.ts +0 -33
- package/dist/src/classes/account-cache/MintCache.d.ts.map +0 -1
- package/dist/src/classes/account-cache/MintCache.js +0 -47
- package/dist/src/classes/account-cache/TokenCache.d.ts +0 -33
- package/dist/src/classes/account-cache/TokenCache.d.ts.map +0 -1
- package/dist/src/classes/account-cache/TokenCache.js +0 -47
- package/dist/src/errors.d.ts +0 -13
- package/dist/src/errors.d.ts.map +0 -1
- package/dist/src/errors.js +0 -96
- package/dist/src/functions.d.ts +0 -514
- package/dist/src/functions.d.ts.map +0 -1
- package/dist/src/functions.js +0 -1636
- package/dist/src/hawksight.d.ts +0 -53
- package/dist/src/hawksight.d.ts.map +0 -1
- package/dist/src/hawksight.js +0 -328
- package/dist/src/hsToMeteora.d.ts +0 -31
- package/dist/src/hsToMeteora.d.ts.map +0 -1
- package/dist/src/hsToMeteora.js +0 -3175
- package/dist/src/idl/iyf-extension-idl.d.ts +0 -14583
- package/dist/src/idl/iyf-extension-idl.d.ts.map +0 -1
- package/dist/src/idl/iyf-extension-idl.js +0 -14578
- package/dist/src/idl/iyf-extension-wrapper.d.ts +0 -112
- package/dist/src/idl/iyf-extension-wrapper.d.ts.map +0 -1
- package/dist/src/idl/iyf-extension-wrapper.js +0 -2
- package/dist/src/idl/iyf-main-idl.d.ts +0 -11329
- package/dist/src/idl/iyf-main-idl.d.ts.map +0 -1
- package/dist/src/idl/iyf-main-idl.js +0 -11324
- package/dist/src/idl/iyf-main-wrapper.d.ts +0 -112
- package/dist/src/idl/iyf-main-wrapper.d.ts.map +0 -1
- package/dist/src/idl/iyf-main-wrapper.js +0 -2
- package/dist/src/idl/jupiter-idl.d.ts +0 -3063
- package/dist/src/idl/jupiter-idl.d.ts.map +0 -1
- package/dist/src/idl/jupiter-idl.js +0 -3061
- package/dist/src/idl/meteora-idl.d.ts +0 -7371
- package/dist/src/idl/meteora-idl.d.ts.map +0 -1
- package/dist/src/idl/meteora-idl.js +0 -7372
- package/dist/src/idl/orca-idl.d.ts +0 -3833
- package/dist/src/idl/orca-idl.d.ts.map +0 -1
- package/dist/src/idl/orca-idl.js +0 -3834
- package/dist/src/idl/raydium-idl.d.ts +0 -3054
- package/dist/src/idl/raydium-idl.d.ts.map +0 -1
- package/dist/src/idl/raydium-idl.js +0 -3055
- package/dist/src/index.d.ts +0 -9
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -31
- package/dist/src/ixGenerator/IyfExtensionIxGenerator.d.ts +0 -126
- package/dist/src/ixGenerator/IyfExtensionIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/IyfExtensionIxGenerator.js +0 -467
- package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts +0 -330
- package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/IyfMainIxGenerator.js +0 -1239
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts +0 -685
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.js +0 -3005
- package/dist/src/ixGenerator/OrcaIxGenerator.d.ts +0 -119
- package/dist/src/ixGenerator/OrcaIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/OrcaIxGenerator.js +0 -438
- package/dist/src/ixGenerator/RaydiumIxGenerator.d.ts +0 -99
- package/dist/src/ixGenerator/RaydiumIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/RaydiumIxGenerator.js +0 -558
- package/dist/src/ixGenerator/UtilIxGenerator.d.ts +0 -20
- package/dist/src/ixGenerator/UtilIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/UtilIxGenerator.js +0 -25
- package/dist/src/meteora/index.d.ts +0 -2
- package/dist/src/meteora/index.d.ts.map +0 -1
- package/dist/src/meteora/index.js +0 -17
- package/dist/src/meteora/liquidityStrategy.d.ts +0 -408
- package/dist/src/meteora/liquidityStrategy.d.ts.map +0 -1
- package/dist/src/meteora/liquidityStrategy.js +0 -1325
- package/dist/src/meteora.d.ts +0 -669
- package/dist/src/meteora.d.ts.map +0 -1
- package/dist/src/meteora.js +0 -1932
- package/dist/src/orca.d.ts +0 -57
- package/dist/src/orca.d.ts.map +0 -1
- package/dist/src/orca.js +0 -123
- package/dist/src/pdaGenerator/HawksightPdaGenerator.d.ts +0 -29
- package/dist/src/pdaGenerator/HawksightPdaGenerator.d.ts.map +0 -1
- package/dist/src/pdaGenerator/HawksightPdaGenerator.js +0 -75
- package/dist/src/pdaGenerator/MeteoraPdaGenerator.d.ts +0 -76
- package/dist/src/pdaGenerator/MeteoraPdaGenerator.d.ts.map +0 -1
- package/dist/src/pdaGenerator/MeteoraPdaGenerator.js +0 -166
- package/dist/src/pdaGenerator/OrcaPdaGenerator.d.ts +0 -23
- package/dist/src/pdaGenerator/OrcaPdaGenerator.d.ts.map +0 -1
- package/dist/src/pdaGenerator/OrcaPdaGenerator.js +0 -68
- package/dist/src/pdaGenerator/RaydiumPdaGenerator.d.ts +0 -49
- package/dist/src/pdaGenerator/RaydiumPdaGenerator.d.ts.map +0 -1
- package/dist/src/pdaGenerator/RaydiumPdaGenerator.js +0 -114
- package/dist/src/pdaGenerator/UtilPdaGenerator.d.ts +0 -8
- package/dist/src/pdaGenerator/UtilPdaGenerator.d.ts.map +0 -1
- package/dist/src/pdaGenerator/UtilPdaGenerator.js +0 -51
- package/dist/src/types.d.ts +0 -1100
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -95
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.Search = void 0;
|
|
16
|
-
const axios_1 = __importDefault(require("axios"));
|
|
17
|
-
class Search {
|
|
18
|
-
/**
|
|
19
|
-
* Set load persistence callback
|
|
20
|
-
*
|
|
21
|
-
* @param loadFromPersistenceFn
|
|
22
|
-
*/
|
|
23
|
-
setLoadFromPersistenceFn(loadFromPersistenceFn) {
|
|
24
|
-
this.loadFromPersistenceFn = loadFromPersistenceFn;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Set store to persistence callback
|
|
28
|
-
*
|
|
29
|
-
* @param storeToPersistenceFn
|
|
30
|
-
*/
|
|
31
|
-
setStoreToPersistenceFn(storeToPersistenceFn) {
|
|
32
|
-
this.storeToPersistenceFn = storeToPersistenceFn;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Checks if the token indices and tokens have been loaded.
|
|
36
|
-
*
|
|
37
|
-
* @returns {boolean} True if the token indices and tokens have been loaded, false otherwise.
|
|
38
|
-
*/
|
|
39
|
-
get loaded() { return this._loaded; }
|
|
40
|
-
/**
|
|
41
|
-
* Constructs a new instance of the Search class.
|
|
42
|
-
*
|
|
43
|
-
* @param {string} url - The base URL for the API.
|
|
44
|
-
*/
|
|
45
|
-
constructor(url) {
|
|
46
|
-
this.url = url;
|
|
47
|
-
this._loaded = false;
|
|
48
|
-
this._loadedFromPersistence = false;
|
|
49
|
-
this.previousHash = '';
|
|
50
|
-
this.latestHash = '';
|
|
51
|
-
this.disableFetch = false;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Retrieves tokens that match the given keyword.
|
|
55
|
-
*
|
|
56
|
-
* This method searches for tokens that match the provided keyword.
|
|
57
|
-
* If the token indices or tokens are not yet loaded, it logs a warning and returns an empty array.
|
|
58
|
-
*
|
|
59
|
-
* @param {string} keyword - The keyword to search for.
|
|
60
|
-
* @param {number} limit - Number of results to show.
|
|
61
|
-
* @param {boolean} noLimit - disable limit
|
|
62
|
-
* @returns {Token[]} An array of tokens that match the given keyword.
|
|
63
|
-
*/
|
|
64
|
-
token(keyword, limit = 100, noLimit = false) {
|
|
65
|
-
const result = [];
|
|
66
|
-
keyword = keyword.trim();
|
|
67
|
-
if (this.tokenIndices === undefined || this.tokens === undefined) {
|
|
68
|
-
console.warn("Token list still loading...");
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
const indices = this.tokenIndices.indices[keyword.toLowerCase()];
|
|
72
|
-
let count = 0;
|
|
73
|
-
for (const index in indices) {
|
|
74
|
-
count++;
|
|
75
|
-
result.push(this.tokens[index]);
|
|
76
|
-
if (!noLimit && count >= limit)
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
return result;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Loads the token indices and tokens.
|
|
83
|
-
*
|
|
84
|
-
* This method loads the token indices and tokens if they are not already loaded.
|
|
85
|
-
* It also sets up a periodic update to refresh the token indices and tokens every minute.
|
|
86
|
-
*
|
|
87
|
-
* @returns {Promise<void>} A promise that resolves when the initial load is complete.
|
|
88
|
-
*/
|
|
89
|
-
load() {
|
|
90
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
if (!this.loaded) {
|
|
92
|
-
this._loaded = true;
|
|
93
|
-
let firstRun = true;
|
|
94
|
-
const update = () => __awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
if (this.disableFetch === false) {
|
|
96
|
-
yield this.getTokenIndices();
|
|
97
|
-
setTimeout(update, 60 * 1000);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
const updateFromPersistence = () => __awaiter(this, void 0, void 0, function* () {
|
|
101
|
-
if (this.disableFetch === false) {
|
|
102
|
-
yield this.loadFromPersistence();
|
|
103
|
-
if (firstRun && this.loadFromPersistenceFn !== undefined) {
|
|
104
|
-
yield update();
|
|
105
|
-
firstRun = false;
|
|
106
|
-
}
|
|
107
|
-
if (!!this.tokens && !!this.tokenIndices) {
|
|
108
|
-
if (!!this.storeToPersistenceFn && this.tokens.length > 0 && this.previousHash !== this.latestHash) {
|
|
109
|
-
yield this.storeToPersistenceFn(this.tokenIndices, this.tokens);
|
|
110
|
-
}
|
|
111
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () { return yield updateFromPersistence(); }), 60 * 1000);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () { return yield updateFromPersistence(); }), 1 * 1000);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
yield this.loadFromPersistence();
|
|
118
|
-
if (typeof this.tokens === 'undefined' || this.tokens.length === 0) {
|
|
119
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () { return yield updateFromPersistence(); }), 1 * 10000);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () { return yield updateFromPersistence(); }), 10 * 10000);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
yield updateFromPersistence();
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Load tokens and indices from persistence
|
|
131
|
-
*
|
|
132
|
-
* @param tokenIndices
|
|
133
|
-
* @param tokens
|
|
134
|
-
* @returns
|
|
135
|
-
*/
|
|
136
|
-
loadFromPersistence() {
|
|
137
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
-
if (this._loadedFromPersistence)
|
|
139
|
-
return;
|
|
140
|
-
if (this.loadFromPersistenceFn === undefined)
|
|
141
|
-
return;
|
|
142
|
-
const [tokenIndices, tokens] = yield this.loadFromPersistenceFn();
|
|
143
|
-
if (tokenIndices === undefined || tokens === undefined)
|
|
144
|
-
return;
|
|
145
|
-
this.tokenIndices = tokenIndices;
|
|
146
|
-
this.tokens = tokens;
|
|
147
|
-
this.latestHash = tokenIndices.hash;
|
|
148
|
-
this._loadedFromPersistence = true;
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Retrieves and updates the token indices and tokens if necessary.
|
|
153
|
-
*
|
|
154
|
-
* This method checks if the current token indices and tokens are undefined.
|
|
155
|
-
* If they are, it fetches the token indices and tokens from the API.
|
|
156
|
-
* It then compares the hash of the current token indices with the hash from the server.
|
|
157
|
-
* If the hashes do not match, it updates the token indices and tokens.
|
|
158
|
-
*
|
|
159
|
-
* @private
|
|
160
|
-
* @returns {Promise<void>} A promise that resolves when the token indices and tokens are updated.
|
|
161
|
-
*/
|
|
162
|
-
getTokenIndices() {
|
|
163
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
-
if (this.tokenIndices === undefined || this.latestHash === '') {
|
|
165
|
-
this.tokenIndices = yield this.getSearchIndices('tokens');
|
|
166
|
-
this.tokens = yield this.getAllTokens();
|
|
167
|
-
this.previousHash = '';
|
|
168
|
-
this.latestHash = this.tokenIndices.hash;
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
const tokenIndices = yield this.getSearchIndices('tokens', this.tokenIndices.hash);
|
|
172
|
-
this.previousHash = this.tokenIndices.hash;
|
|
173
|
-
this.latestHash = tokenIndices.hash;
|
|
174
|
-
// If hash doesn't match, it means there's a new token.
|
|
175
|
-
if (tokenIndices.hash !== this.tokenIndices.hash) {
|
|
176
|
-
this.tokenIndices = tokenIndices;
|
|
177
|
-
this.tokens = yield this.getAllTokens();
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Retrieves all tokens from the API.
|
|
183
|
-
*
|
|
184
|
-
* This method makes a GET request to the API to fetch all tokens.
|
|
185
|
-
*
|
|
186
|
-
* @private
|
|
187
|
-
* @returns {Promise<Token[]>} A promise that resolves to an array of tokens.
|
|
188
|
-
*/
|
|
189
|
-
getAllTokens() {
|
|
190
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
-
return (yield axios_1.default.get(`${this.url}/tokens?all=true`)).data;
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Retrieves the search indices from the API based on the provided key and optional hash.
|
|
196
|
-
*
|
|
197
|
-
* This method makes a GET request to the API to fetch the search indices for the specified key.
|
|
198
|
-
* If a hash is provided, it includes the hash in the request to check for updated indices.
|
|
199
|
-
*
|
|
200
|
-
* @private
|
|
201
|
-
* @param {string} key - The key to identify the search indices.
|
|
202
|
-
* @param {string} [hash] - Optional hash to validate against the current hash of the indices.
|
|
203
|
-
* @returns {Promise<SearchIndices>} A promise that resolves to the search indices for the specified key.
|
|
204
|
-
*/
|
|
205
|
-
getSearchIndices(key, hash) {
|
|
206
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
-
if (hash !== undefined) {
|
|
208
|
-
return (yield axios_1.default.get(`${this.url}/searchIndices?key=${key}&hash=${hash}`)).data;
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
return (yield axios_1.default.get(`${this.url}/searchIndices?key=${key}`)).data;
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
exports.Search = Search;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { IyfExtensionIxGenerator } from "../ixGenerator/IyfExtensionIxGenerator";
|
|
2
|
-
import { IyfMainIxGenerator } from "../ixGenerator/IyfMainIxGenerator";
|
|
3
|
-
import { MeteoraDlmmIxGenerator } from "../ixGenerator/MeteoraDlmmIxGenerator";
|
|
4
|
-
import { UtilIxGenerator } from "../ixGenerator/UtilIxGenerator";
|
|
5
|
-
import { OrcaIxGenerator } from "../ixGenerator/OrcaIxGenerator";
|
|
6
|
-
import { RaydiumIxGenerator } from "../ixGenerator/RaydiumIxGenerator";
|
|
7
|
-
import { SimplePdaGenerator } from "./SimplePdaGenerator";
|
|
8
|
-
/**
|
|
9
|
-
* The SimpleIxGenerator class is a general-purpose utility for generating single
|
|
10
|
-
* transaction instructions for simple tasks on the Solana blockchain. It offers
|
|
11
|
-
* methods to set and verify transaction slots within an atomicity context, specifically
|
|
12
|
-
* interacting with the user's PDA (Program Derived Address) account.
|
|
13
|
-
*/
|
|
14
|
-
export declare class SimpleIxGenerator {
|
|
15
|
-
/**
|
|
16
|
-
* PDA generator instance
|
|
17
|
-
*/
|
|
18
|
-
pda: SimplePdaGenerator;
|
|
19
|
-
/**
|
|
20
|
-
* Utility instruction generator for miscellaneous operations and transactions
|
|
21
|
-
* that don't fit into specific protocol categories.
|
|
22
|
-
*/
|
|
23
|
-
util: UtilIxGenerator;
|
|
24
|
-
/**
|
|
25
|
-
* Instruction generator for the IYF (IndexYieldFarming) main protocol operations.
|
|
26
|
-
* Handles core protocol interactions and transactions.
|
|
27
|
-
*/
|
|
28
|
-
iyfMain: IyfMainIxGenerator;
|
|
29
|
-
/**
|
|
30
|
-
* Instruction generator for IYF extension operations.
|
|
31
|
-
* Extends the functionality of the main IYF protocol with additional features.
|
|
32
|
-
* @param iyfMain - Reference to the main IYF instruction generator for dependency injection
|
|
33
|
-
*/
|
|
34
|
-
iyfExtension: IyfExtensionIxGenerator;
|
|
35
|
-
/**
|
|
36
|
-
* Instruction generator for Meteora DLMM (Dynamic Liquidity Market Maker) operations.
|
|
37
|
-
* Handles concentrated liquidity pool interactions and transactions.
|
|
38
|
-
* @param iyfMain - Reference to the main IYF instruction generator for dependency injection
|
|
39
|
-
*/
|
|
40
|
-
meteoraDlmm: MeteoraDlmmIxGenerator;
|
|
41
|
-
/**
|
|
42
|
-
* Instruction generator for Orca DEX operations.
|
|
43
|
-
* Handles Orca-specific pool interactions and transactions.
|
|
44
|
-
* @param iyfMain - Reference to the main IYF instruction generator for dependency injection
|
|
45
|
-
*/
|
|
46
|
-
orca: OrcaIxGenerator;
|
|
47
|
-
/**
|
|
48
|
-
* Instruction generator for Raydium DEX operations.
|
|
49
|
-
* Handles Raydium-specific pool interactions, concentrated liquidity positions,
|
|
50
|
-
* and other Raydium protocol transactions.
|
|
51
|
-
* @param iyfMain - Reference to the main IYF instruction generator for dependency injection
|
|
52
|
-
* @param iyfExtension - Reference to the IYF extension instruction generator for additional functionality
|
|
53
|
-
* @param pda - Reference to the PDA generator for managing program derived addresses
|
|
54
|
-
*/
|
|
55
|
-
raydium: RaydiumIxGenerator;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=SimpleIxGenerator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleIxGenerator.d.ts","sourceRoot":"","sources":["../../../src/classes/SimpleIxGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;GAKG;AACH,qBAAa,iBAAiB;IAE5B;;OAEG;IACI,GAAG,EAAE,kBAAkB,CAA2B;IAEzD;;;OAGG;IACI,IAAI,EAAE,eAAe,CAAyB;IAErD;;;OAGG;IACI,OAAO,EAAE,kBAAkB,CAA4B;IAE9D;;;;OAIG;IACI,YAAY,EAAE,uBAAuB,CAAuD;IAEnG;;;;OAIG;IACI,WAAW,EAAE,sBAAsB,CAA8C;IAExF;;;;OAIG;IACI,IAAI,EAAE,eAAe,CAA+C;IAE3E;;;;;;;OAOG;IACI,OAAO,EAAE,kBAAkB,CAAqE;CACxG"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SimpleIxGenerator = void 0;
|
|
4
|
-
const IyfExtensionIxGenerator_1 = require("../ixGenerator/IyfExtensionIxGenerator");
|
|
5
|
-
const IyfMainIxGenerator_1 = require("../ixGenerator/IyfMainIxGenerator");
|
|
6
|
-
const MeteoraDlmmIxGenerator_1 = require("../ixGenerator/MeteoraDlmmIxGenerator");
|
|
7
|
-
const UtilIxGenerator_1 = require("../ixGenerator/UtilIxGenerator");
|
|
8
|
-
const OrcaIxGenerator_1 = require("../ixGenerator/OrcaIxGenerator");
|
|
9
|
-
const RaydiumIxGenerator_1 = require("../ixGenerator/RaydiumIxGenerator");
|
|
10
|
-
const SimplePdaGenerator_1 = require("./SimplePdaGenerator");
|
|
11
|
-
/**
|
|
12
|
-
* The SimpleIxGenerator class is a general-purpose utility for generating single
|
|
13
|
-
* transaction instructions for simple tasks on the Solana blockchain. It offers
|
|
14
|
-
* methods to set and verify transaction slots within an atomicity context, specifically
|
|
15
|
-
* interacting with the user's PDA (Program Derived Address) account.
|
|
16
|
-
*/
|
|
17
|
-
class SimpleIxGenerator {
|
|
18
|
-
constructor() {
|
|
19
|
-
/**
|
|
20
|
-
* PDA generator instance
|
|
21
|
-
*/
|
|
22
|
-
this.pda = new SimplePdaGenerator_1.SimplePdaGenerator();
|
|
23
|
-
/**
|
|
24
|
-
* Utility instruction generator for miscellaneous operations and transactions
|
|
25
|
-
* that don't fit into specific protocol categories.
|
|
26
|
-
*/
|
|
27
|
-
this.util = new UtilIxGenerator_1.UtilIxGenerator();
|
|
28
|
-
/**
|
|
29
|
-
* Instruction generator for the IYF (IndexYieldFarming) main protocol operations.
|
|
30
|
-
* Handles core protocol interactions and transactions.
|
|
31
|
-
*/
|
|
32
|
-
this.iyfMain = new IyfMainIxGenerator_1.IyfMainIxGenerator();
|
|
33
|
-
/**
|
|
34
|
-
* Instruction generator for IYF extension operations.
|
|
35
|
-
* Extends the functionality of the main IYF protocol with additional features.
|
|
36
|
-
* @param iyfMain - Reference to the main IYF instruction generator for dependency injection
|
|
37
|
-
*/
|
|
38
|
-
this.iyfExtension = new IyfExtensionIxGenerator_1.IyfExtensionIxGenerator(this.pda, this.iyfMain);
|
|
39
|
-
/**
|
|
40
|
-
* Instruction generator for Meteora DLMM (Dynamic Liquidity Market Maker) operations.
|
|
41
|
-
* Handles concentrated liquidity pool interactions and transactions.
|
|
42
|
-
* @param iyfMain - Reference to the main IYF instruction generator for dependency injection
|
|
43
|
-
*/
|
|
44
|
-
this.meteoraDlmm = new MeteoraDlmmIxGenerator_1.MeteoraDlmmIxGenerator(this, this.pda);
|
|
45
|
-
/**
|
|
46
|
-
* Instruction generator for Orca DEX operations.
|
|
47
|
-
* Handles Orca-specific pool interactions and transactions.
|
|
48
|
-
* @param iyfMain - Reference to the main IYF instruction generator for dependency injection
|
|
49
|
-
*/
|
|
50
|
-
this.orca = new OrcaIxGenerator_1.OrcaIxGenerator(this.iyfMain, this.pda);
|
|
51
|
-
/**
|
|
52
|
-
* Instruction generator for Raydium DEX operations.
|
|
53
|
-
* Handles Raydium-specific pool interactions, concentrated liquidity positions,
|
|
54
|
-
* and other Raydium protocol transactions.
|
|
55
|
-
* @param iyfMain - Reference to the main IYF instruction generator for dependency injection
|
|
56
|
-
* @param iyfExtension - Reference to the IYF extension instruction generator for additional functionality
|
|
57
|
-
* @param pda - Reference to the PDA generator for managing program derived addresses
|
|
58
|
-
*/
|
|
59
|
-
this.raydium = new RaydiumIxGenerator_1.RaydiumIxGenerator(this.iyfMain, this.iyfExtension, this.pda);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.SimpleIxGenerator = SimpleIxGenerator;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { HawksightPdaGenerator } from "../pdaGenerator/HawksightPdaGenerator";
|
|
2
|
-
import { MeteoraPdaGenerator } from "../pdaGenerator/MeteoraPdaGenerator";
|
|
3
|
-
import { OrcaPdaGenerator } from "../pdaGenerator/OrcaPdaGenerator";
|
|
4
|
-
import { RaydiumPdaGenerator } from "../pdaGenerator/RaydiumPdaGenerator";
|
|
5
|
-
import { UtilPdaGenerator } from "../pdaGenerator/UtilPdaGenerator";
|
|
6
|
-
export declare class SimplePdaGenerator {
|
|
7
|
-
/**
|
|
8
|
-
* Util PDA Generator (Other PDA generators / uncategorized)
|
|
9
|
-
*/
|
|
10
|
-
util: UtilPdaGenerator;
|
|
11
|
-
/**
|
|
12
|
-
* Hawksight PDA Generator
|
|
13
|
-
*/
|
|
14
|
-
hawksight: HawksightPdaGenerator;
|
|
15
|
-
/**
|
|
16
|
-
* Meteora PDA Generator
|
|
17
|
-
*/
|
|
18
|
-
meteora: MeteoraPdaGenerator;
|
|
19
|
-
/**
|
|
20
|
-
* Meteora PDA Generator
|
|
21
|
-
*/
|
|
22
|
-
orca: OrcaPdaGenerator;
|
|
23
|
-
/**
|
|
24
|
-
* Meteora PDA Generator
|
|
25
|
-
*/
|
|
26
|
-
raydium: RaydiumPdaGenerator;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=SimplePdaGenerator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimplePdaGenerator.d.ts","sourceRoot":"","sources":["../../../src/classes/SimplePdaGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,qBAAa,kBAAkB;IAE7B;;OAEG;IACI,IAAI,EAAE,gBAAgB,CAA0B;IAEvD;;OAEG;IACI,SAAS,EAAE,qBAAqB,CAA+B;IAEtE;;OAEG;IACI,OAAO,EAAE,mBAAmB,CAA6B;IAEhE;;OAEG;IACI,IAAI,EAAE,gBAAgB,CAA0B;IAEvD;;OAEG;IACI,OAAO,EAAE,mBAAmB,CAA6B;CACjE"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SimplePdaGenerator = void 0;
|
|
4
|
-
const HawksightPdaGenerator_1 = require("../pdaGenerator/HawksightPdaGenerator");
|
|
5
|
-
const MeteoraPdaGenerator_1 = require("../pdaGenerator/MeteoraPdaGenerator");
|
|
6
|
-
const OrcaPdaGenerator_1 = require("../pdaGenerator/OrcaPdaGenerator");
|
|
7
|
-
const RaydiumPdaGenerator_1 = require("../pdaGenerator/RaydiumPdaGenerator");
|
|
8
|
-
const UtilPdaGenerator_1 = require("../pdaGenerator/UtilPdaGenerator");
|
|
9
|
-
class SimplePdaGenerator {
|
|
10
|
-
constructor() {
|
|
11
|
-
/**
|
|
12
|
-
* Util PDA Generator (Other PDA generators / uncategorized)
|
|
13
|
-
*/
|
|
14
|
-
this.util = new UtilPdaGenerator_1.UtilPdaGenerator();
|
|
15
|
-
/**
|
|
16
|
-
* Hawksight PDA Generator
|
|
17
|
-
*/
|
|
18
|
-
this.hawksight = new HawksightPdaGenerator_1.HawksightPdaGenerator();
|
|
19
|
-
/**
|
|
20
|
-
* Meteora PDA Generator
|
|
21
|
-
*/
|
|
22
|
-
this.meteora = new MeteoraPdaGenerator_1.MeteoraPdaGenerator();
|
|
23
|
-
/**
|
|
24
|
-
* Meteora PDA Generator
|
|
25
|
-
*/
|
|
26
|
-
this.orca = new OrcaPdaGenerator_1.OrcaPdaGenerator();
|
|
27
|
-
/**
|
|
28
|
-
* Meteora PDA Generator
|
|
29
|
-
*/
|
|
30
|
-
this.raydium = new RaydiumPdaGenerator_1.RaydiumPdaGenerator();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.SimplePdaGenerator = SimplePdaGenerator;
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import * as client from "@hawksightco/swagger-client";
|
|
2
|
-
import * as web3 from "@solana/web3.js";
|
|
3
|
-
import { GeneralUtility } from "./GeneralUtility";
|
|
4
|
-
import { TransactionMetadata } from "../types";
|
|
5
|
-
export type SimulatedTransactionResponse = {
|
|
6
|
-
err: web3.TransactionError | string | null;
|
|
7
|
-
logs: Array<string> | null;
|
|
8
|
-
accounts?: (web3.SimulatedTransactionAccountInfo | null)[] | null;
|
|
9
|
-
unitsConsumed: number;
|
|
10
|
-
returnData?: web3.TransactionReturnData | null;
|
|
11
|
-
};
|
|
12
|
-
export type TransactionMetadataResponse = {
|
|
13
|
-
description: string;
|
|
14
|
-
estimatedFeeInSOL: string;
|
|
15
|
-
addressLookupTableAddresses: string[];
|
|
16
|
-
computeBudgetInstructions: Instruction[];
|
|
17
|
-
mainInstructions: Instruction[];
|
|
18
|
-
payer: string;
|
|
19
|
-
signature: string;
|
|
20
|
-
};
|
|
21
|
-
export type Instruction = {
|
|
22
|
-
accounts: {
|
|
23
|
-
isSigner: boolean;
|
|
24
|
-
isWritable: boolean;
|
|
25
|
-
pubkey: string;
|
|
26
|
-
}[];
|
|
27
|
-
data: string;
|
|
28
|
-
programId: string;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Represents a transaction object in Solana using the web3.js library.
|
|
32
|
-
* This class encapsulates the logic for creating, signing, and verifying signatures of transactions.
|
|
33
|
-
*/
|
|
34
|
-
export declare class Transaction {
|
|
35
|
-
readonly txMetadataResponse: TransactionMetadataResponse;
|
|
36
|
-
readonly payerKey: web3.PublicKey;
|
|
37
|
-
protected latestBlockhash: {
|
|
38
|
-
blockhash: string;
|
|
39
|
-
lastValidBlockHeight: number;
|
|
40
|
-
};
|
|
41
|
-
readonly alts: web3.AddressLookupTableAccount[];
|
|
42
|
-
protected generalUtility: GeneralUtility;
|
|
43
|
-
protected readonly MAX_TX_SIZE = 1200;
|
|
44
|
-
/** Compiled TransactionMessage which includes payer, instructions, and recent blockhash */
|
|
45
|
-
protected _txMessage: web3.TransactionMessage;
|
|
46
|
-
get txMessage(): web3.TransactionMessage;
|
|
47
|
-
/** Versioned transaction built from the transaction message */
|
|
48
|
-
protected _versionedTransaction: web3.VersionedTransaction;
|
|
49
|
-
get versionedTransaction(): web3.VersionedTransaction;
|
|
50
|
-
/** A map indicating whether each required signer has signed the transaction */
|
|
51
|
-
readonly requiredSigners: Record<string, boolean>;
|
|
52
|
-
/** Estimated fee in SOL for priority fee when addPriorityFee() method is called. */
|
|
53
|
-
protected _priorityFeeEstimate: string;
|
|
54
|
-
get priorityFeeEstimate(): string;
|
|
55
|
-
/** The blockhash of a recent ledger entry */
|
|
56
|
-
get recentBlockhash(): string;
|
|
57
|
-
/** Array of TransactionInstruction to be executed in this transaction */
|
|
58
|
-
protected _instructions: web3.TransactionInstruction[];
|
|
59
|
-
get instructions(): web3.TransactionInstruction[];
|
|
60
|
-
/** last valid block height */
|
|
61
|
-
get lastValidBlockHeight(): number;
|
|
62
|
-
/**
|
|
63
|
-
* Constructs a new Transaction object.
|
|
64
|
-
*
|
|
65
|
-
* @param payerKey PublicKey of the transaction payer
|
|
66
|
-
* @param instructions Array of TransactionInstruction to be executed in this transaction
|
|
67
|
-
* @param recentBlockhash The blockhash of a recent ledger entry
|
|
68
|
-
* @param alts Address lookup tables that optimize account address storage
|
|
69
|
-
*/
|
|
70
|
-
constructor(txMetadataResponse: TransactionMetadataResponse, payerKey: web3.PublicKey, latestBlockhash: {
|
|
71
|
-
blockhash: string;
|
|
72
|
-
lastValidBlockHeight: number;
|
|
73
|
-
}, alts: web3.AddressLookupTableAccount[], generalUtility: GeneralUtility, _mainIxs?: web3.TransactionInstruction[]);
|
|
74
|
-
/**
|
|
75
|
-
* Signs the transaction with provided signers.
|
|
76
|
-
*
|
|
77
|
-
* @param signers Array of Signer objects whose private keys will be used to sign the transaction.
|
|
78
|
-
* @param idempotent Boolean indicating whether signing should be idempotent (default is false).
|
|
79
|
-
* @throws Error if a signer is not required or has already signed the transaction when not idempotent.
|
|
80
|
-
*/
|
|
81
|
-
sign(signers: web3.Signer[], idempotent?: boolean): void;
|
|
82
|
-
/**
|
|
83
|
-
* Add a signature on the transaction with provided signature.
|
|
84
|
-
*
|
|
85
|
-
* @param publicKey The public key of the signer
|
|
86
|
-
* @param signature A signature of the signed transaction
|
|
87
|
-
* @throws Error if a signer is not required or has already signed the transaction.
|
|
88
|
-
*/
|
|
89
|
-
addSignature(publicKey: web3.PublicKey, signature: Uint8Array): void;
|
|
90
|
-
/**
|
|
91
|
-
* Checks if all required signers have signed the transaction.
|
|
92
|
-
*
|
|
93
|
-
* @returns Boolean indicating whether all required signers have signed.
|
|
94
|
-
*/
|
|
95
|
-
isSignedByRequiredSigners(): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Add priority fee instructions (compute budget) with a fixed priority fee.
|
|
98
|
-
*
|
|
99
|
-
* This method adds priority fee instructions to the transaction based on a fixed priority fee.
|
|
100
|
-
*
|
|
101
|
-
* @param connection - The connection to the Solana cluster.
|
|
102
|
-
* @param computeUnitLimit - The limit on the number of compute units.
|
|
103
|
-
* @param fixedPriority - Set to true to indicate a fixed priority fee.
|
|
104
|
-
* @param fixedPriorityFee - The fixed priority fee in lamports.
|
|
105
|
-
* @returns An array of transaction instructions.
|
|
106
|
-
*/
|
|
107
|
-
addPriorityFeeIx(connection: web3.Connection, computeUnitLimit: number, fixedPriority: true, fixedPriorityFee: number): Promise<web3.TransactionInstruction[]>;
|
|
108
|
-
/**
|
|
109
|
-
* Add priority fee instructions (compute budget) with a variable priority defined by Helius.
|
|
110
|
-
*
|
|
111
|
-
* This method adds priority fee instructions to the transaction based on the specified
|
|
112
|
-
* priority level and compute unit limit. It ensures that the total fee does not exceed
|
|
113
|
-
* the specified maximum priority fee (in SOL) if provided.
|
|
114
|
-
*
|
|
115
|
-
* @param connection - The connection to the Solana cluster.
|
|
116
|
-
* @param computeUnitLimit - The limit on the number of compute units.
|
|
117
|
-
* @param fixedPriority - Set to false to indicate a variable priority fee.
|
|
118
|
-
* @param priorityLevel - The priority level for the fee estimation.
|
|
119
|
-
* @param maxPriorityFee - The maximum priority fee in SOL (optional).
|
|
120
|
-
* @returns An array of transaction instructions.
|
|
121
|
-
*/
|
|
122
|
-
addPriorityFeeIx(connection: web3.Connection, computeUnitLimit: number, fixedPriority: false, priorityLevel: client.PriorityLevel, maxPriorityFee?: number): Promise<web3.TransactionInstruction[]>;
|
|
123
|
-
/**
|
|
124
|
-
* Gets the compute unit limit from a transaction simulation.
|
|
125
|
-
*
|
|
126
|
-
* This function simulates a transaction and calculates the compute unit limit
|
|
127
|
-
* based on the simulation results. If an additional compute limit is provided,
|
|
128
|
-
* it is added to the units consumed in the simulation. Otherwise, the units
|
|
129
|
-
* consumed are increased by 10%.
|
|
130
|
-
*
|
|
131
|
-
* @param {web3.Connection} connection - The connection object to the Solana cluster.
|
|
132
|
-
* @param {number} [additionalComputeLimit] - Optional additional compute limit to add to the units consumed.
|
|
133
|
-
* @returns {Promise<number>} - A promise that resolves to the total compute unit limit.
|
|
134
|
-
* @throws {Error} - Throws an error if the transaction simulation fails.
|
|
135
|
-
*/
|
|
136
|
-
getComputeUnitLimit(connection: web3.Connection, additionalComputeLimit?: number): Promise<number>;
|
|
137
|
-
/**
|
|
138
|
-
* Simulate transaction
|
|
139
|
-
*
|
|
140
|
-
* @param connection
|
|
141
|
-
* @returns
|
|
142
|
-
*/
|
|
143
|
-
simulateTransaction(connection: web3.Connection, signers?: web3.Keypair[]): Promise<SimulatedTransactionResponse>;
|
|
144
|
-
/**
|
|
145
|
-
* Builds transaction object
|
|
146
|
-
*/
|
|
147
|
-
buildTransaction(latestBlockhash: web3.BlockhashWithExpiryBlockHeight): [web3.TransactionMessage, web3.VersionedTransaction];
|
|
148
|
-
/**
|
|
149
|
-
* Gathers the public keys of all parties required to sign the transaction.
|
|
150
|
-
*
|
|
151
|
-
* @returns A record of signer public keys mapped to a boolean indicating whether they have signed.
|
|
152
|
-
*/
|
|
153
|
-
protected getRequiredSigners(): Record<string, boolean>;
|
|
154
|
-
/**
|
|
155
|
-
* Find setComputeUnitLimit index within the instructions
|
|
156
|
-
*/
|
|
157
|
-
protected findSetComputeUnitLimitIndex(instructions?: web3.TransactionInstruction[]): number;
|
|
158
|
-
/**
|
|
159
|
-
* Find setComputeUnitPrice index within the instructions
|
|
160
|
-
*/
|
|
161
|
-
protected findSetComputeUnitPriceIndex(instructions?: web3.TransactionInstruction[]): number;
|
|
162
|
-
/**
|
|
163
|
-
* Remove priority fee instructions
|
|
164
|
-
*/
|
|
165
|
-
protected removePriorityFeeIxs(): void;
|
|
166
|
-
/**
|
|
167
|
-
* Injects a candidate user alt into the transaction metadata.
|
|
168
|
-
*
|
|
169
|
-
* @param connection - The connection to the Solana cluster.
|
|
170
|
-
* @returns A new transaction metadata with the candidate user alt injected.
|
|
171
|
-
*/
|
|
172
|
-
injectCandidateUserAlt(connection: web3.Connection): Promise<{
|
|
173
|
-
metadata: TransactionMetadata;
|
|
174
|
-
withUserAlt: boolean;
|
|
175
|
-
}>;
|
|
176
|
-
/**
|
|
177
|
-
* Generate a new transaction metadata with a user alt injected.
|
|
178
|
-
*
|
|
179
|
-
* @param connection - The connection to the Solana cluster.
|
|
180
|
-
* @param lookupTable - The lookup table to inject into the transaction metadata.
|
|
181
|
-
* @returns A new transaction metadata with the user alt injected.
|
|
182
|
-
*/
|
|
183
|
-
injectUserAlt(connection: web3.Connection, lookupTable: web3.PublicKey): Promise<TransactionMetadata>;
|
|
184
|
-
/**
|
|
185
|
-
* Close all address lookup tables.
|
|
186
|
-
* Dev Note: This is a temporary function to close all address lookup tables.
|
|
187
|
-
* This is not meant to be used in production. It is only meant to be used for testing.
|
|
188
|
-
*
|
|
189
|
-
* @param connection - The connection to the Solana cluster.
|
|
190
|
-
*/
|
|
191
|
-
deactivateAllAddressLookupTable(connection: web3.Connection): Promise<TransactionMetadata>;
|
|
192
|
-
/**
|
|
193
|
-
* Close all address lookup tables.
|
|
194
|
-
* Dev Note: This is a temporary function to close all address lookup tables.
|
|
195
|
-
* This is not meant to be used in production. It is only meant to be used for testing.
|
|
196
|
-
*
|
|
197
|
-
* @param connection - The connection to the Solana cluster.
|
|
198
|
-
*/
|
|
199
|
-
closeAllAddressLookupTable(connection: web3.Connection): Promise<TransactionMetadata>;
|
|
200
|
-
/**
|
|
201
|
-
* Create a new address lookup table.
|
|
202
|
-
*
|
|
203
|
-
* @param connection - The connection to the Solana cluster.
|
|
204
|
-
* @param payer - The payer of the transaction.
|
|
205
|
-
* @returns A new address lookup table.
|
|
206
|
-
*/
|
|
207
|
-
createAddressLookupTable(connection: web3.Connection, payer: web3.PublicKey): Promise<[TransactionMetadata, web3.PublicKey]>;
|
|
208
|
-
private pubkeysNotInAlt;
|
|
209
|
-
/**
|
|
210
|
-
* List all unique pubkeys in the instructions
|
|
211
|
-
* @param instructions - Transaction instructions
|
|
212
|
-
* @returns Unique pubkeys
|
|
213
|
-
*/
|
|
214
|
-
private listPubkeys;
|
|
215
|
-
/**
|
|
216
|
-
* Check if a pubkey is in an alt
|
|
217
|
-
* @param pubkey - Pubkey to check
|
|
218
|
-
* @returns True if the pubkey is in an alt, false otherwise
|
|
219
|
-
*/
|
|
220
|
-
private pubkeyInAlt;
|
|
221
|
-
private _pubkeysNotInAlt;
|
|
222
|
-
/**
|
|
223
|
-
* Check if a pubkey is in an alt
|
|
224
|
-
* @param pubkey - Pubkey to check
|
|
225
|
-
* @returns True if the pubkey is in an alt, false otherwise
|
|
226
|
-
*/
|
|
227
|
-
private _pubkeyInAlt;
|
|
228
|
-
}
|
|
229
|
-
//# sourceMappingURL=Transaction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../../src/classes/Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAGxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,MAAM,4BAA4B,GAAG;IACzC,GAAG,EAAE,IAAI,CAAC,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3C,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,+BAA+B,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,2BAA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