@hawksightco/hawk-sdk 0.0.4 → 0.0.5
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 +2 -2
- package/test/index.spec.ts +105 -105
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hawksightco/hawk-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Hawksight v2 SDK",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "src/index.ts",
|
|
6
6
|
"repository": "https://github.com/ghabxph/hawk-api-client.git",
|
|
7
7
|
"homepage": "https://hawksight.co/",
|
|
8
8
|
"author": "Hawksight",
|
package/test/index.spec.ts
CHANGED
|
@@ -50,17 +50,17 @@ describe('General Endpoints', () => {
|
|
|
50
50
|
}
|
|
51
51
|
}, TIMEOUT);
|
|
52
52
|
|
|
53
|
-
it ('GET /pools', async () => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, TIMEOUT);
|
|
53
|
+
// it ('GET /pools', async () => {
|
|
54
|
+
// const result = await client.general.pools();
|
|
55
|
+
// expect(result.status).toBe(200);
|
|
56
|
+
// expect(result.data.length >= 0).toBe(true);
|
|
57
|
+
// }, TIMEOUT);
|
|
58
58
|
|
|
59
|
-
it ('POST /register', async () => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, TIMEOUT);
|
|
59
|
+
// it ('POST /register', async () => {
|
|
60
|
+
// const result = await client.general.register(connection, hawkWallet, { userWallet: hawkWallet });
|
|
61
|
+
// logIfNot200(result);
|
|
62
|
+
// expect(result.status).toBe(200);
|
|
63
|
+
// }, TIMEOUT);
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
describe('Meteora Endpoints', () => {
|
|
@@ -93,103 +93,103 @@ describe('Meteora Endpoints', () => {
|
|
|
93
93
|
logIfNot200(result);
|
|
94
94
|
expect(result.status).toBe(200);
|
|
95
95
|
}, TIMEOUT);
|
|
96
|
-
it ('POST /meteora/dlmm/tx/deposit', async () => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, TIMEOUT);
|
|
111
|
-
it ('POST /meteora/dlmm/tx/claim', async () => {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}, TIMEOUT);
|
|
123
|
-
it ('POST /meteora/dlmm/tx/withdraw', async () => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}, TIMEOUT);
|
|
137
|
-
it ('POST /meteora/dlmm/tx/closePosition', async () => { // will not work because position is not empty.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}, TIMEOUT);
|
|
96
|
+
// it ('POST /meteora/dlmm/tx/deposit', async () => {
|
|
97
|
+
// const result = await client.txGenerator.meteoraDeposit(
|
|
98
|
+
// connection,
|
|
99
|
+
// hawkWallet,
|
|
100
|
+
// {
|
|
101
|
+
// position: testPosition,
|
|
102
|
+
// userWallet: testWallet,
|
|
103
|
+
// totalXAmount: 10_000,
|
|
104
|
+
// totalYAmount: 10_000,
|
|
105
|
+
// distribution: 'CURVE',
|
|
106
|
+
// }
|
|
107
|
+
// );
|
|
108
|
+
// logIfNot200(result);
|
|
109
|
+
// expect(result.status).toBe(200);
|
|
110
|
+
// }, TIMEOUT);
|
|
111
|
+
// it ('POST /meteora/dlmm/tx/claim', async () => {
|
|
112
|
+
// const result = await client.txGenerator.meteoraClaim(
|
|
113
|
+
// connection,
|
|
114
|
+
// hawkWallet,
|
|
115
|
+
// {
|
|
116
|
+
// position: testPosition,
|
|
117
|
+
// userWallet: testWallet,
|
|
118
|
+
// }
|
|
119
|
+
// );
|
|
120
|
+
// logIfNot200(result);
|
|
121
|
+
// expect(result.status).toBe(200);
|
|
122
|
+
// }, TIMEOUT);
|
|
123
|
+
// it ('POST /meteora/dlmm/tx/withdraw', async () => {
|
|
124
|
+
// const result = await client.txGenerator.meteoraWithdraw(
|
|
125
|
+
// connection,
|
|
126
|
+
// hawkWallet,
|
|
127
|
+
// {
|
|
128
|
+
// position: testPosition,
|
|
129
|
+
// userWallet: testWallet,
|
|
130
|
+
// amountBps: 10_000,
|
|
131
|
+
// shouldClaimAndClose: true,
|
|
132
|
+
// }
|
|
133
|
+
// );
|
|
134
|
+
// logIfNot200(result);
|
|
135
|
+
// expect(result.status).toBe(200);
|
|
136
|
+
// }, TIMEOUT);
|
|
137
|
+
// it ('POST /meteora/dlmm/tx/closePosition', async () => { // will not work because position is not empty.
|
|
138
|
+
// const result = await client.txGenerator.meteoraClosePosition(
|
|
139
|
+
// connection,
|
|
140
|
+
// hawkWallet,
|
|
141
|
+
// {
|
|
142
|
+
// position: testPosition,
|
|
143
|
+
// userWallet: testWallet,
|
|
144
|
+
// }
|
|
145
|
+
// );
|
|
146
|
+
// logIfNot200(result);
|
|
147
|
+
// expect(result.status).toBe(200);
|
|
148
|
+
// }, TIMEOUT);
|
|
149
149
|
});
|
|
150
150
|
|
|
151
|
-
describe('Meteora Automation Endpoints', () => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
});
|
|
151
|
+
// describe('Meteora Automation Endpoints', () => {
|
|
152
|
+
// it ('POST /meteora/dlmm/automation/claimFeeAndRewardsAutomationIx', async () => {
|
|
153
|
+
// const result = await client.txGeneratorAutomation.meteoraClaimFeeAndRewards(
|
|
154
|
+
// connection,
|
|
155
|
+
// hawkWallet,
|
|
156
|
+
// {
|
|
157
|
+
// userWallet: testWallet,
|
|
158
|
+
// position: testPosition,
|
|
159
|
+
// }
|
|
160
|
+
// );
|
|
161
|
+
// logIfNot200(result);
|
|
162
|
+
// expect(result.status).toBe(200);
|
|
163
|
+
// }, TIMEOUT);
|
|
164
|
+
// it ('POST /meteora/dlmm/automation/fullWithdrawAndClosePositionAutomationIx', async () => {
|
|
165
|
+
// const result = await client.txGeneratorAutomation.meteoraFullWithdrawalAndClosePosition(
|
|
166
|
+
// connection,
|
|
167
|
+
// hawkWallet,
|
|
168
|
+
// {
|
|
169
|
+
// userWallet: testWallet,
|
|
170
|
+
// position: testPosition,
|
|
171
|
+
// }
|
|
172
|
+
// );
|
|
173
|
+
// logIfNot200(result);
|
|
174
|
+
// expect(result.status).toBe(200);
|
|
175
|
+
// }, TIMEOUT);
|
|
176
|
+
// it ('POST /meteora/dlmm/automation/createPositionAndDepositAutomationIx', async () => { // can't test...
|
|
177
|
+
// const result = await client.txGeneratorAutomation.meteoraCreatePositionAndDeposit(
|
|
178
|
+
// connection,
|
|
179
|
+
// hawkWallet,
|
|
180
|
+
// {
|
|
181
|
+
// position: web3.Keypair.generate().publicKey.toString(),
|
|
182
|
+
// pool: testPool,
|
|
183
|
+
// userWallet: testWallet,
|
|
184
|
+
// lowerBinRange: activeBin - 20,
|
|
185
|
+
// upperBinRange: activeBin + 20,
|
|
186
|
+
// distribution: 'CURVE',
|
|
187
|
+
// }
|
|
188
|
+
// );
|
|
189
|
+
// logIfNot200(result);
|
|
190
|
+
// expect(result.status).toBe(200);
|
|
191
|
+
// }, TIMEOUT);
|
|
192
|
+
// });
|
|
193
193
|
|
|
194
194
|
describe('Orca Endpoints', () => {});
|
|
195
195
|
|