@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.
@@ -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 {
@@ -17,4 +17,4 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.version = void 0;
19
19
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
20
- exports.version = '2.4.0';
20
+ exports.version = '2.5.0-alpha.1';
@@ -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;
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '2.4.0';
17
+ export const version = '2.5.0-alpha.1';
@@ -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;
@@ -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 {
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const version = "2.4.0-alpha.16";
16
+ export declare const version = "2.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "2.4.0",
3
+ "version": "2.5.0-alpha.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"