@xchainjs/xchain-solana 1.1.2 → 1.1.4
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/lib/index.esm.js +13 -1
- package/lib/index.js +13 -1
- package/package.json +3 -3
package/lib/index.esm.js
CHANGED
|
@@ -552,7 +552,19 @@ class Client extends BaseXChainClient {
|
|
|
552
552
|
return __awaiter(this, void 0, void 0, function* () {
|
|
553
553
|
try {
|
|
554
554
|
for (const provider of this.providers) {
|
|
555
|
-
const
|
|
555
|
+
const address = new PublicKey((params === null || params === void 0 ? void 0 : params.address) || (yield this.getAddressAsync()));
|
|
556
|
+
const limit = (params === null || params === void 0 ? void 0 : params.limit) || 10;
|
|
557
|
+
const offset = (params === null || params === void 0 ? void 0 : params.offset) || 0;
|
|
558
|
+
// To support offset, fetch enough signatures to skip past the offset
|
|
559
|
+
const fetchCount = offset + limit;
|
|
560
|
+
const allSignatures = yield provider.solanaProvider.getSignaturesForAddress(address, {
|
|
561
|
+
limit: fetchCount,
|
|
562
|
+
});
|
|
563
|
+
// Apply offset by slicing
|
|
564
|
+
const signatures = allSignatures.slice(offset);
|
|
565
|
+
if (signatures.length === 0) {
|
|
566
|
+
return { txs: [], total: 0 };
|
|
567
|
+
}
|
|
556
568
|
const transactions = yield provider.solanaProvider.getParsedTransactions(signatures.map(({ signature }) => signature));
|
|
557
569
|
const results = yield Promise.allSettled(transactions
|
|
558
570
|
.filter((transaction) => !!transaction)
|
package/lib/index.js
CHANGED
|
@@ -560,7 +560,19 @@ class Client extends xchainClient.BaseXChainClient {
|
|
|
560
560
|
return __awaiter(this, void 0, void 0, function* () {
|
|
561
561
|
try {
|
|
562
562
|
for (const provider of this.providers) {
|
|
563
|
-
const
|
|
563
|
+
const address = new web3_js.PublicKey((params === null || params === void 0 ? void 0 : params.address) || (yield this.getAddressAsync()));
|
|
564
|
+
const limit = (params === null || params === void 0 ? void 0 : params.limit) || 10;
|
|
565
|
+
const offset = (params === null || params === void 0 ? void 0 : params.offset) || 0;
|
|
566
|
+
// To support offset, fetch enough signatures to skip past the offset
|
|
567
|
+
const fetchCount = offset + limit;
|
|
568
|
+
const allSignatures = yield provider.solanaProvider.getSignaturesForAddress(address, {
|
|
569
|
+
limit: fetchCount,
|
|
570
|
+
});
|
|
571
|
+
// Apply offset by slicing
|
|
572
|
+
const signatures = allSignatures.slice(offset);
|
|
573
|
+
if (signatures.length === 0) {
|
|
574
|
+
return { txs: [], total: 0 };
|
|
575
|
+
}
|
|
564
576
|
const transactions = yield provider.solanaProvider.getParsedTransactions(signatures.map(({ signature }) => signature));
|
|
565
577
|
const results = yield Promise.allSettled(transactions
|
|
566
578
|
.filter((transaction) => !!transaction)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-solana",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Solana client for XChainJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Solana",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"@solana/addresses": "^2.1.1",
|
|
40
40
|
"@solana/spl-token": "^0.4.13",
|
|
41
41
|
"@solana/web3.js": "^1.98.2",
|
|
42
|
-
"@xchainjs/xchain-client": "2.0.
|
|
42
|
+
"@xchainjs/xchain-client": "2.0.12",
|
|
43
43
|
"@xchainjs/xchain-crypto": "1.0.6",
|
|
44
|
-
"@xchainjs/xchain-util": "2.0.
|
|
44
|
+
"@xchainjs/xchain-util": "2.0.7",
|
|
45
45
|
"bs58": "^6.0.0",
|
|
46
46
|
"micro-key-producer": "^0.7.6"
|
|
47
47
|
},
|