@ar.io/sdk 4.0.0-solana.10 → 4.0.0-solana.11

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.
@@ -22,7 +22,7 @@ import { version } from '../version.js';
22
22
  import { setAntBaseNameCLICommand, setAntRecordCLICommand, setAntUndernameCLICommand, transferRecordOwnershipCLICommand, upgradeAntCLICommand, } from './commands/antCommands.js';
23
23
  import { buyRecordCLICommand, extendLeaseCLICommand, increaseUndernameLimitCLICommand, requestPrimaryNameCLICommand, setPrimaryNameCLICommand, syncAttributesCLICommand, upgradeRecordCLICommand, } from './commands/arnsPurchaseCommands.js';
24
24
  import { escrowCancelCLICommand, escrowClaimArweaveCLICommand, escrowClaimEthereumCLICommand, escrowDepositCLICommand, escrowStatusCLICommand, escrowUpdateRecipientCLICommand, } from './commands/escrowCommands.js';
25
- import { cancelWithdrawal, decreaseDelegateStake, decreaseOperatorStake, delegateStake, increaseOperatorStake, instantWithdrawal, joinNetwork, leaveNetwork, redelegateStake, saveObservations, updateGatewaySettings, } from './commands/gatewayWriteCommands.js';
25
+ import { cancelWithdrawal, claimWithdrawal, decreaseDelegateStake, decreaseOperatorStake, delegateStake, increaseOperatorStake, instantWithdrawal, joinNetwork, leaveNetwork, redelegateStake, saveObservations, updateGatewaySettings, } from './commands/gatewayWriteCommands.js';
26
26
  import { closeDrainedWithdrawalCLICommand, closeEmptyDelegationCLICommand, closeExpiredRequestCLICommand, closeObservationCLICommand, finalizeGoneCLICommand, pruneExpiredNamesCLICommand, pruneExpiredReservationCLICommand, pruneGatewayCLICommand, pruneNameToReturnedCLICommand, pruneReturnedNamesCLICommand, releaseVaultCLICommand, } from './commands/pruneCommands.js';
27
27
  import { getAllGatewayVaults, getAllowedDelegates, getArNSRecord, getArNSReservedName, getArNSReturnedName, getCostDetails, getDelegations, getEpoch, getGateway, getGatewayDelegates, getGatewayVaults, getPrescribedNames, getPrescribedObservers, getPrimaryName, getTokenCost, getVault, listAllDelegatesCLICommand, listAntsForAddress, listArNSRecords, listArNSRecordsForAddress, listArNSReservedNames, listArNSReturnedNames, listGateways, resolveArNSName, } from './commands/readCommands.js';
28
28
  import { createVaultCLICommand, extendVaultCLICommand, increaseVaultCLICommand, revokeVaultCLICommand, transferCLICommand, vaultedTransferCLICommand, } from './commands/transfer.js';
@@ -389,6 +389,12 @@ makeCommand({
389
389
  options: addressAndVaultIdOptions,
390
390
  action: cancelWithdrawal,
391
391
  });
392
+ makeCommand({
393
+ name: 'claim-withdrawal',
394
+ description: 'Claim tokens from a matured withdrawal vault (after the lock period has elapsed)',
395
+ options: [...writeActionOptions, optionMap.vaultId],
396
+ action: claimWithdrawal,
397
+ });
392
398
  makeCommand({
393
399
  name: 'delegate-stake',
394
400
  description: 'Delegate stake to a gateway',
@@ -115,6 +115,18 @@ export async function decreaseOperatorStake(o) {
115
115
  decreaseQty,
116
116
  }, customTagsFromOptions(o));
117
117
  }
118
+ export async function claimWithdrawal(o) {
119
+ if (o.ao) {
120
+ throw new Error('claim-withdrawal is only supported on the Solana backend (drop --ao).');
121
+ }
122
+ const vaultId = requiredStringFromOptions(o, 'vaultId');
123
+ await assertConfirmationPrompt(`You are about to claim matured withdrawal vault ${vaultId}. Tokens will be transferred to your wallet.\nAre you sure?`, o);
124
+ // claimWithdrawal is Solana-only — no AO equivalent exists (see the comment
125
+ // block in src/types/io.ts above syncAttributes). The `--ao` guard above
126
+ // narrows us to the Solana path, so the cast is safe at runtime.
127
+ const { ario } = await writeARIOFromOptions(o);
128
+ return ario.claimWithdrawal({ withdrawalId: vaultId }, customTagsFromOptions(o));
129
+ }
118
130
  export async function instantWithdrawal(o) {
119
131
  const vaultId = requiredStringFromOptions(o, 'vaultId');
120
132
  const gatewayAddress = requiredAddressFromOptions(o);
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '4.0.0-solana.10';
17
+ export const version = '4.0.0-solana.11';
@@ -16,6 +16,7 @@ export declare function saveObservations(o: WriteActionCLIOptions & {
16
16
  }): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
17
17
  export declare function increaseOperatorStake(o: OperatorStakeCLIOptions): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
18
18
  export declare function decreaseOperatorStake(o: OperatorStakeCLIOptions): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
19
+ export declare function claimWithdrawal(o: AddressAndVaultIdCLIWriteOptions): Promise<import("../../types/common.js").AoMessageResult>;
19
20
  export declare function instantWithdrawal(o: AddressAndVaultIdCLIWriteOptions): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
20
21
  export declare function cancelWithdrawal(o: AddressAndVaultIdCLIWriteOptions): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
21
22
  export declare function delegateStake(options: TransferCLIOptions): Promise<{
@@ -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 = "4.0.0-solana.9";
16
+ export declare const version = "4.0.0-solana.10";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "4.0.0-solana.10",
3
+ "version": "4.0.0-solana.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"