@ar.io/sdk 2.4.0 → 2.5.0-alpha.1
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/README.md +52 -0
- package/bundles/web.bundle.min.js +5 -5
- package/lib/cjs/common/io.js +13 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/io.js +13 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +4 -1
- package/lib/types/types/io.d.ts +13 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/common/io.js
CHANGED
|
@@ -406,6 +406,19 @@ class IOReadable {
|
|
|
406
406
|
tags: prunedPriceTags,
|
|
407
407
|
});
|
|
408
408
|
}
|
|
409
|
+
async getDelegations(params) {
|
|
410
|
+
const allTags = [
|
|
411
|
+
{ name: 'Action', value: 'Paginated-Delegations' },
|
|
412
|
+
{ name: 'Cursor', value: params.cursor?.toString() },
|
|
413
|
+
{ name: 'Limit', value: params.limit?.toString() },
|
|
414
|
+
{ name: 'Sort-By', value: params.sortBy },
|
|
415
|
+
{ name: 'Sort-Order', value: params.sortOrder },
|
|
416
|
+
{ name: 'Address', value: params.address },
|
|
417
|
+
];
|
|
418
|
+
return this.process.read({
|
|
419
|
+
tags: (0, arweave_js_1.pruneTags)(allTags),
|
|
420
|
+
});
|
|
421
|
+
}
|
|
409
422
|
}
|
|
410
423
|
exports.IOReadable = IOReadable;
|
|
411
424
|
class IOWriteable extends IOReadable {
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/common/io.js
CHANGED
|
@@ -402,6 +402,19 @@ export class IOReadable {
|
|
|
402
402
|
tags: prunedPriceTags,
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
|
+
async getDelegations(params) {
|
|
406
|
+
const allTags = [
|
|
407
|
+
{ name: 'Action', value: 'Paginated-Delegations' },
|
|
408
|
+
{ name: 'Cursor', value: params.cursor?.toString() },
|
|
409
|
+
{ name: 'Limit', value: params.limit?.toString() },
|
|
410
|
+
{ name: 'Sort-By', value: params.sortBy },
|
|
411
|
+
{ name: 'Sort-Order', value: params.sortOrder },
|
|
412
|
+
{ name: 'Address', value: params.address },
|
|
413
|
+
];
|
|
414
|
+
return this.process.read({
|
|
415
|
+
tags: pruneTags(allTags),
|
|
416
|
+
});
|
|
417
|
+
}
|
|
405
418
|
}
|
|
406
419
|
export class IOWriteable extends IOReadable {
|
|
407
420
|
signer;
|
package/lib/esm/version.js
CHANGED
package/lib/types/common/io.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import Arweave from 'arweave';
|
|
17
17
|
import { AoArNSNameDataWithName, AoArNSReservedNameData, AoAuction, AoBalanceWithAddress, AoEpochDistributionData, AoEpochObservationData, AoGatewayWithAddress, AoJoinNetworkParams, AoMessageResult, AoTokenSupplyData, AoUpdateGatewaySettingsParams, AoWeightedObserver, ContractSigner, PaginationParams, PaginationResult, ProcessConfiguration, TransactionId, WalletAddress, WithSigner, WriteOptions } from '../types/index.js';
|
|
18
|
-
import { AoArNSNameData, AoAuctionPriceData, AoEpochData, AoEpochSettings, AoGateway, AoGatewayDelegateWithAddress, AoIORead, AoIOWrite, AoRegistrationFees, AoVaultData, AoWalletVault, EpochInput } from '../types/io.js';
|
|
18
|
+
import { AoArNSNameData, AoAuctionPriceData, AoDelegation, AoEpochData, AoEpochSettings, AoGateway, AoGatewayDelegateWithAddress, AoIORead, AoIOWrite, AoRegistrationFees, AoVaultData, AoWalletVault, EpochInput } from '../types/io.js';
|
|
19
19
|
import { mIOToken } from '../types/token.js';
|
|
20
20
|
import { AOProcess } from './contracts/ao-process.js';
|
|
21
21
|
export declare class IO {
|
|
@@ -125,6 +125,9 @@ export declare class IOReadable implements AoIORead {
|
|
|
125
125
|
timestamp?: number;
|
|
126
126
|
intervalMs?: number;
|
|
127
127
|
}): Promise<AoAuctionPriceData>;
|
|
128
|
+
getDelegations(params: PaginationParams<AoDelegation> & {
|
|
129
|
+
address: WalletAddress;
|
|
130
|
+
}): Promise<PaginationResult<AoDelegation>>;
|
|
128
131
|
}
|
|
129
132
|
export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
130
133
|
protected process: AOProcess;
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -234,6 +234,19 @@ export type AoAuctionPriceData = {
|
|
|
234
234
|
prices: Record<string, number>;
|
|
235
235
|
currentPrice: number;
|
|
236
236
|
};
|
|
237
|
+
export type AoDelegationBase = {
|
|
238
|
+
type: 'stake' | 'vault';
|
|
239
|
+
gatewayAddress: WalletAddress;
|
|
240
|
+
delegationId: string;
|
|
241
|
+
};
|
|
242
|
+
export type AoVaultDelegation = AoDelegationBase & AoVaultData & {
|
|
243
|
+
type: 'vault';
|
|
244
|
+
vaultId: TransactionId;
|
|
245
|
+
};
|
|
246
|
+
export type AoStakeDelegation = Omit<AoVaultDelegation, 'endTimestamp' | 'vaultId'> & {
|
|
247
|
+
type: 'stake';
|
|
248
|
+
};
|
|
249
|
+
export type AoDelegation = AoStakeDelegation | AoVaultDelegation;
|
|
237
250
|
export type AoJoinNetworkParams = Pick<AoGateway, 'operatorStake' | 'observerAddress'> & Partial<AoGatewaySettings>;
|
|
238
251
|
export type AoUpdateGatewaySettingsParams = AtLeastOne<AoJoinNetworkParams>;
|
|
239
252
|
export interface AoIORead {
|
package/lib/types/version.d.ts
CHANGED