@hawksightco/hawk-sdk 1.3.148 → 1.3.150
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/dist/src/addresses.d.ts +1 -0
- package/dist/src/addresses.d.ts.map +1 -1
- package/dist/src/addresses.js +2 -1
- package/dist/src/classes/Transactions.d.ts +9 -2
- package/dist/src/classes/Transactions.d.ts.map +1 -1
- package/dist/src/classes/Transactions.js +19 -2
- package/dist/src/classes/TxGenerator.d.ts +11 -2
- package/dist/src/classes/TxGenerator.d.ts.map +1 -1
- package/dist/src/classes/TxGenerator.js +35 -0
- package/dist/src/functions.js +1 -1
- package/dist/src/idl/iyf-main-idl.d.ts +1 -0
- package/dist/src/idl/iyf-main-idl.d.ts.map +1 -1
- package/dist/src/idl/iyf-main-idl.js +2 -1
- package/dist/src/idl/jupiter-idl.d.ts +1051 -1026
- package/dist/src/idl/jupiter-idl.d.ts.map +1 -1
- package/dist/src/idl/jupiter-idl.js +881 -773
- package/dist/src/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/src/addresses.d.ts
CHANGED
|
@@ -23,4 +23,5 @@ export declare const RAYDIUM_PROGRAM: web3.PublicKey;
|
|
|
23
23
|
export declare const TOKEN_2022: web3.PublicKey;
|
|
24
24
|
export declare const MEMO_PROGRAM: web3.PublicKey;
|
|
25
25
|
export declare const PUMP_FUN_AMM_PROGRAM: web3.PublicKey;
|
|
26
|
+
export declare const USDC_MINT: web3.PublicKey;
|
|
26
27
|
//# sourceMappingURL=addresses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,eAAO,MAAM,UAAU,UAYtB,CAAC;AAEF,eAAO,MAAM,QAAQ,gBAAqE,CAAC;AAC3F,eAAO,MAAM,aAAa,gBAAqE,CAAC;AAChG,eAAO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AAC;AACvG,eAAO,MAAM,wBAAwB,gBAAqE,CAAC;AAC3G,eAAO,MAAM,cAAc,gBAAqE,CAAC;AACjG,eAAO,MAAM,SAAS,gBAAqE,CAAC;AAC5F,eAAO,MAAM,QAAQ,gBAAqE,CAAC;AAC3F,eAAO,MAAM,sBAAsB,gBAAqE,CAAC;AACzG,eAAO,MAAM,oBAAoB,gBAAoE,CAAC;AACtG,eAAO,MAAM,uBAAuB,gBAAqE,CAAC;AAC1G,eAAO,MAAM,cAAc,gBAAoE,CAAC;AAChG,eAAO,MAAM,YAAY,gBAAoE,CAAC;AAC9F,eAAO,MAAM,sBAAsB,gBAAoE,CAAC;AACxG,eAAO,MAAM,yBAAyB,gBAAqE,CAAC;AAC5G,eAAO,MAAM,SAAS,gBAAoE,CAAC;AAC3F,eAAO,MAAM,eAAe,gBAAoE,CAAC;AACjG,eAAO,MAAM,eAAe,gBAAqE,CAAC;AAClG,eAAO,MAAM,UAAU,gBAAoE,CAAC;AAC5F,eAAO,MAAM,YAAY,gBAAoE,CAAC;AAC9F,eAAO,MAAM,oBAAoB,gBAAoE,CAAC;AACtG,eAAO,MAAM,SAAS,gBAAqE,CAAC"}
|
package/dist/src/addresses.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.PUMP_FUN_AMM_PROGRAM = exports.MEMO_PROGRAM = exports.TOKEN_2022 = exports.RAYDIUM_PROGRAM = exports.JUPITER_PROGRAM = exports.WSOL_MINT = exports.ORCA_METADATA_UPDATE_AUTH = exports.ORCA_WHIRLPOOL_PROGRAM = exports.HS_AUTHORITY = exports.COMPUTE_BUDGET = exports.METEORA_EVENT_AUTHORITY = exports.METEORA_DLMM_PROGRAM = exports.SOME_METEORA_DLMM_POOL = exports.SOL_FARM = exports.USDC_FARM = exports.SITE_FEE_OWNER = exports.ASSOCIATED_TOKEN_PROGRAM = exports.TOKEN_2022_PROGRAM_ID = exports.TOKEN_PROGRAM_ID = exports.STABLEMINT_2 = exports.STABLEMINT_1 = exports.IYF_EXTENSION = exports.IYF_MAIN = exports.GLOBAL_ALT = void 0;
|
|
36
|
+
exports.USDC_MINT = exports.PUMP_FUN_AMM_PROGRAM = exports.MEMO_PROGRAM = exports.TOKEN_2022 = exports.RAYDIUM_PROGRAM = exports.JUPITER_PROGRAM = exports.WSOL_MINT = exports.ORCA_METADATA_UPDATE_AUTH = exports.ORCA_WHIRLPOOL_PROGRAM = exports.HS_AUTHORITY = exports.COMPUTE_BUDGET = exports.METEORA_EVENT_AUTHORITY = exports.METEORA_DLMM_PROGRAM = exports.SOME_METEORA_DLMM_POOL = exports.SOL_FARM = exports.USDC_FARM = exports.SITE_FEE_OWNER = exports.ASSOCIATED_TOKEN_PROGRAM = exports.TOKEN_2022_PROGRAM_ID = exports.TOKEN_PROGRAM_ID = exports.STABLEMINT_2 = exports.STABLEMINT_1 = exports.IYF_EXTENSION = exports.IYF_MAIN = exports.GLOBAL_ALT = void 0;
|
|
37
37
|
const web3 = __importStar(require("@solana/web3.js"));
|
|
38
38
|
exports.GLOBAL_ALT = [
|
|
39
39
|
"AC3t5k5PUTJirxGEHgGGQStafu1vXkvddPyqVNDrRQDt",
|
|
@@ -71,3 +71,4 @@ exports.RAYDIUM_PROGRAM = new web3.PublicKey("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW
|
|
|
71
71
|
exports.TOKEN_2022 = new web3.PublicKey("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
72
72
|
exports.MEMO_PROGRAM = new web3.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr");
|
|
73
73
|
exports.PUMP_FUN_AMM_PROGRAM = new web3.PublicKey("pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA");
|
|
74
|
+
exports.USDC_MINT = new web3.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as web3 from '@solana/web3.js';
|
|
2
|
-
import { MeteoraClaim, MeteoraClaimAll, MeteoraClose, MeteoraCompound, MeteoraCreatePositionAndDeposit, MeteoraCreatePositionAndDepositPda, MeteoraDeposit, MeteoraInitializeBinArrays, MeteoraRebalance, MeteoraWithdraw, Register, TxgenParams, InitializeStorageTokenAccount, MeteoraLimitCloseAutomation, MeteoraLimitCloseAutomation2, OrcaOpenPosition, OrcaClosePosition, OrcaDeposit, OrcaWithdraw, OrcaSweepDust, OrcaClaimRewards, TransactionMetadataResponse, MeteoraRebalance2,
|
|
2
|
+
import { MeteoraClaim, MeteoraClaimAll, MeteoraClose, MeteoraCompound, MeteoraCreatePositionAndDeposit, MeteoraCreatePositionAndDepositPda, MeteoraDeposit, MeteoraInitializeBinArrays, MeteoraRebalance, MeteoraWithdraw, Register, TxgenParams, InitializeStorageTokenAccount, MeteoraLimitCloseAutomation, MeteoraLimitCloseAutomation2, OrcaOpenPosition, OrcaClosePosition, OrcaDeposit, OrcaWithdraw, OrcaSweepDust, OrcaClaimRewards, TransactionMetadataResponse, MeteoraRebalance2, ClaimTokensFromSTA, RaydiumClosePosition, OpenAutomationIx, RaydiumWithdrawAndClosePosition, MeteoraCreatePoolAndPosition, ClaimTokenFromPda } from '../types';
|
|
3
3
|
import { RaydiumIncreaseLiquidity, RaydiumOpenPosition, RaydiumDecreaseLiquidity } from '../types';
|
|
4
4
|
import { GeneralUtility } from './GeneralUtility';
|
|
5
5
|
import { MultiTransaction } from './MultiTransaction';
|
|
@@ -150,7 +150,14 @@ export declare class Transactions {
|
|
|
150
150
|
*
|
|
151
151
|
* @returns
|
|
152
152
|
*/
|
|
153
|
-
claimTokenFromSta({ connection, params, }: TxgenParams<
|
|
153
|
+
claimTokenFromSta({ connection, params, }: TxgenParams<ClaimTokenFromPda>): Promise<TransactionMetadataResponse>;
|
|
154
|
+
/**
|
|
155
|
+
* Claim token from ATA.
|
|
156
|
+
*
|
|
157
|
+
*
|
|
158
|
+
* @returns
|
|
159
|
+
*/
|
|
160
|
+
claimTokenFromAta({ connection, params, }: TxgenParams<ClaimTokenFromPda>): Promise<TransactionMetadataResponse>;
|
|
154
161
|
/**
|
|
155
162
|
* Claim tokens from STA.
|
|
156
163
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAqBxC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,+BAA+B,EAC/B,kCAAkC,EAClC,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAqBxC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,+BAA+B,EAC/B,kCAAkC,EAClC,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EAEpB,gBAAgB,EAChB,+BAA+B,EA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AAoB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAwB3E;;;;;;OAMG;IACG,wBAAwB,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA2G/E;;;;;;OAMG;IACG,wBAAwB,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAmGhF;AAED,eAAO,MAAM,KAAK,cAA6B,CAAC"}
|
|
@@ -664,8 +664,6 @@ class Transactions {
|
|
|
664
664
|
*/
|
|
665
665
|
claimTokenFromSta(_a) {
|
|
666
666
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
667
|
-
const farm = addresses_1.USDC_FARM;
|
|
668
|
-
const userPda = (0, functions_1.generateUserPda)(params.userWallet, farm);
|
|
669
667
|
const mainInstructions = [];
|
|
670
668
|
mainInstructions.push(yield this.ix.iyfMain.withdrawMultipleTokenWithToken2022({
|
|
671
669
|
connection,
|
|
@@ -675,10 +673,29 @@ class Transactions {
|
|
|
675
673
|
pdaTokenType: types_1.TokenType.STA,
|
|
676
674
|
hasAmount: false,
|
|
677
675
|
}));
|
|
676
|
+
mainInstructions.push(...(0, functions_1.unwrapSolIfMintIsWsol)(params.userWallet, [params.mint]));
|
|
677
|
+
return (0, functions_1.createTransactionMeta)({
|
|
678
|
+
payer: params.userWallet,
|
|
679
|
+
description: 'Withdraw token from PDA',
|
|
680
|
+
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
681
|
+
mainInstructions: mainInstructions,
|
|
682
|
+
});
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Claim token from ATA.
|
|
687
|
+
*
|
|
688
|
+
*
|
|
689
|
+
* @returns
|
|
690
|
+
*/
|
|
691
|
+
claimTokenFromAta(_a) {
|
|
692
|
+
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
693
|
+
const mainInstructions = [];
|
|
678
694
|
mainInstructions.push(yield this.ix.iyfMain.withdrawMultipleTokenWithToken2022({
|
|
679
695
|
connection,
|
|
680
696
|
payer: params.userWallet,
|
|
681
697
|
withdraw: [{ mint: params.mint, amount: new bn_js_1.default(0) }],
|
|
698
|
+
useSta: false,
|
|
682
699
|
pdaTokenType: types_1.TokenType.ATA,
|
|
683
700
|
hasAmount: false,
|
|
684
701
|
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as web3 from "@solana/web3.js";
|
|
2
2
|
import * as _client from "@hawksightco/swagger-client";
|
|
3
|
-
import { InitializeStorageTokenAccount, ClaimTokensFromSTA,
|
|
3
|
+
import { InitializeStorageTokenAccount, ClaimTokensFromSTA, MeteoraTxWithdraw, ResponseWithStatus, TransactionMetadata, OrcaWithdraw, OrcaDeposit, OrcaClosePosition, OrcaOpenPosition, OrcaClaimRewards, MeteoraClaimAll, MeteoraCreatePositionAndDepositPda, RaydiumOpenPosition, RaydiumClosePosition, RaydiumIncreaseLiquidity, RaydiumDecreaseLiquidity, OrcaSweepDust, CreateLimitTokenParams, CloseLimitTokenParams, TokenType, RaydiumWithdrawAndClosePosition, MeteoraCreatePoolAndPosition, MeteoraInitializeBinArrays, ClaimTokenFromPda } from "../types";
|
|
4
4
|
import { Client } from "./Client";
|
|
5
5
|
import { GeneralUtility } from "./GeneralUtility";
|
|
6
6
|
import BN from "bn.js";
|
|
@@ -53,7 +53,16 @@ export declare class TxGenerator {
|
|
|
53
53
|
*
|
|
54
54
|
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
55
55
|
*/
|
|
56
|
-
claimTokenFromSta(connection: web3.Connection, payer: string, params:
|
|
56
|
+
claimTokenFromSta(connection: web3.Connection, payer: string, params: ClaimTokenFromPda): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
57
|
+
/**
|
|
58
|
+
* Claim token from ATA.
|
|
59
|
+
* @param connection A Solana web3 connection for interacting with the blockchain.
|
|
60
|
+
* @param payer The public key of the payer for transaction fees.
|
|
61
|
+
* @param params Parameters required.
|
|
62
|
+
*
|
|
63
|
+
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
64
|
+
*/
|
|
65
|
+
claimTokenFromAta(connection: web3.Connection, payer: string, params: ClaimTokenFromPda): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
57
66
|
/**
|
|
58
67
|
* Claim tokens from STA.
|
|
59
68
|
* @param connection A Solana web3 connection for interacting with the blockchain.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxGenerator.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"TxGenerator.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EAInB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,kCAAkC,EAClC,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,+BAA+B,EAE/B,4BAA4B,EAC5B,0BAA0B,EAC1B,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQlC,OA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,GAC/B,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CA6BpD"}
|
|
@@ -108,6 +108,41 @@ class TxGenerator {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Claim token from ATA.
|
|
113
|
+
* @param connection A Solana web3 connection for interacting with the blockchain.
|
|
114
|
+
* @param payer The public key of the payer for transaction fees.
|
|
115
|
+
* @param params Parameters required.
|
|
116
|
+
*
|
|
117
|
+
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
118
|
+
*/
|
|
119
|
+
claimTokenFromAta(connection, payer, params) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
// Initialize anchor
|
|
122
|
+
anchor_1.Anchor.initialize(connection);
|
|
123
|
+
try {
|
|
124
|
+
const result = yield Transactions_1.txgen.claimTokenFromAta({
|
|
125
|
+
connection,
|
|
126
|
+
params,
|
|
127
|
+
fetch: undefined,
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
status: 200,
|
|
131
|
+
data: yield (0, functions_1.createTxMetadata)(this.generalUtility, connection, payer, result),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
return {
|
|
136
|
+
status: 400,
|
|
137
|
+
data: {
|
|
138
|
+
code: "custom",
|
|
139
|
+
message: e,
|
|
140
|
+
path: [],
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
111
146
|
/**
|
|
112
147
|
* Claim tokens from STA.
|
|
113
148
|
* @param connection A Solana web3 connection for interacting with the blockchain.
|
package/dist/src/functions.js
CHANGED
|
@@ -1183,7 +1183,7 @@ function getTokenProgramForMints(connection, mints) {
|
|
|
1183
1183
|
}
|
|
1184
1184
|
else {
|
|
1185
1185
|
// Make sure that all tokens are owned by the same program.
|
|
1186
|
-
if (_tokenProgram !== tokenProgram) {
|
|
1186
|
+
if (_tokenProgram.toString() !== tokenProgram.toString()) {
|
|
1187
1187
|
throw new Error(`Token program mismatch for mint: ${pubkey}. It should be owned by program: ${tokenProgram}`);
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|