@atomiqlabs/chain-solana 12.0.6 → 12.0.8
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.
|
@@ -39,6 +39,7 @@ class SolanaEvents extends SolanaModule_1.SolanaModule {
|
|
|
39
39
|
* @param commitment
|
|
40
40
|
*/
|
|
41
41
|
async getTransactionsForAddress(account, options, commitment) {
|
|
42
|
+
const limit = 100;
|
|
42
43
|
//Try to use getPriorityFeeEstimate api of Helius
|
|
43
44
|
const response = await this.connection._rpcRequest("getTransactionsForAddress", [
|
|
44
45
|
account.toString(),
|
|
@@ -46,14 +47,14 @@ class SolanaEvents extends SolanaModule_1.SolanaModule {
|
|
|
46
47
|
...options,
|
|
47
48
|
transactionDetails: "full",
|
|
48
49
|
sortOrder: "desc",
|
|
49
|
-
limit
|
|
50
|
+
limit,
|
|
50
51
|
commitment: commitment ?? "confirmed",
|
|
51
52
|
encoding: "jsonParsed",
|
|
52
53
|
maxSupportedTransactionVersion: 0
|
|
53
54
|
}
|
|
54
55
|
]).catch(e => {
|
|
55
56
|
//Catching not supported errors
|
|
56
|
-
if (e.message != null && (e.message.includes("-32601") || e.message.includes("-32600"))) {
|
|
57
|
+
if (e.message != null && (e.message.includes("-32601") || e.message.includes("-32600") || e.message.includes("-32403"))) {
|
|
57
58
|
return {
|
|
58
59
|
error: {
|
|
59
60
|
code: -32601,
|
|
@@ -65,7 +66,7 @@ class SolanaEvents extends SolanaModule_1.SolanaModule {
|
|
|
65
66
|
});
|
|
66
67
|
if (response.error != null) {
|
|
67
68
|
//Catching not supported errors
|
|
68
|
-
if (response.error.code !== -32601 && response.error.code !== -32600)
|
|
69
|
+
if (response.error.code !== -32601 && response.error.code !== -32600 && response.error.code !== -32403)
|
|
69
70
|
throw new Error(response.error.message);
|
|
70
71
|
return null;
|
|
71
72
|
}
|
|
@@ -139,7 +140,7 @@ class SolanaEvents extends SolanaModule_1.SolanaModule {
|
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
142
|
}),
|
|
142
|
-
paginationToken: response.result.paginationToken
|
|
143
|
+
paginationToken: response.result.data.length < limit ? null : response.result.paginationToken
|
|
143
144
|
};
|
|
144
145
|
}
|
|
145
146
|
async _findInTxsTFA(topicKey, processor, abortSignal, startBlockheight) {
|
package/package.json
CHANGED
|
@@ -54,6 +54,8 @@ export class SolanaEvents extends SolanaModule {
|
|
|
54
54
|
data: ParsedTransactionWithMeta[],
|
|
55
55
|
paginationToken?: string
|
|
56
56
|
}> {
|
|
57
|
+
const limit = 100;
|
|
58
|
+
|
|
57
59
|
//Try to use getPriorityFeeEstimate api of Helius
|
|
58
60
|
const response = await (this.connection as any)._rpcRequest("getTransactionsForAddress", [
|
|
59
61
|
account.toString(),
|
|
@@ -61,14 +63,14 @@ export class SolanaEvents extends SolanaModule {
|
|
|
61
63
|
...options,
|
|
62
64
|
transactionDetails: "full",
|
|
63
65
|
sortOrder: "desc",
|
|
64
|
-
limit
|
|
66
|
+
limit,
|
|
65
67
|
commitment: commitment ?? "confirmed",
|
|
66
68
|
encoding: "jsonParsed",
|
|
67
69
|
maxSupportedTransactionVersion: 0
|
|
68
70
|
}
|
|
69
71
|
]).catch(e => {
|
|
70
72
|
//Catching not supported errors
|
|
71
|
-
if(e.message!=null && (e.message.includes("-32601") || e.message.includes("-32600"))) {
|
|
73
|
+
if(e.message!=null && (e.message.includes("-32601") || e.message.includes("-32600") || e.message.includes("-32403"))) {
|
|
72
74
|
return {
|
|
73
75
|
error: {
|
|
74
76
|
code: -32601,
|
|
@@ -81,7 +83,7 @@ export class SolanaEvents extends SolanaModule {
|
|
|
81
83
|
|
|
82
84
|
if(response.error!=null) {
|
|
83
85
|
//Catching not supported errors
|
|
84
|
-
if(response.error.code!==-32601 && response.error.code!==-32600) throw new Error(response.error.message);
|
|
86
|
+
if(response.error.code!==-32601 && response.error.code!==-32600 && response.error.code!==-32403) throw new Error(response.error.message);
|
|
85
87
|
return null;
|
|
86
88
|
}
|
|
87
89
|
|
|
@@ -153,7 +155,7 @@ export class SolanaEvents extends SolanaModule {
|
|
|
153
155
|
}
|
|
154
156
|
}
|
|
155
157
|
}),
|
|
156
|
-
paginationToken: response.result.paginationToken
|
|
158
|
+
paginationToken: response.result.data.length<limit ? null : response.result.paginationToken
|
|
157
159
|
};
|
|
158
160
|
}
|
|
159
161
|
|