@ar.io/sdk 2.4.0-alpha.2 → 2.4.0-alpha.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/README.md +27 -0
- package/bundles/web.bundle.min.js +2 -2
- package/lib/cjs/common/io.js +21 -8
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/io.js +21 -8
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +13 -2
- package/lib/types/types/io.d.ts +4 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/common/io.js
CHANGED
|
@@ -667,26 +667,39 @@ class IOWriteable extends IOReadable {
|
|
|
667
667
|
],
|
|
668
668
|
});
|
|
669
669
|
}
|
|
670
|
-
|
|
670
|
+
/**
|
|
671
|
+
* Cancel a withdrawal from a gateway.
|
|
672
|
+
*
|
|
673
|
+
* @param {Object} params - The parameters for cancelling a withdrawal
|
|
674
|
+
* @param {string} [params.address] - The address of the withdrawal (optional). If not provided, the signer's address will be used.
|
|
675
|
+
* @param {string} params.vaultId - The vault ID of the withdrawal.
|
|
676
|
+
* @param {Object} [options] - The options for the cancellation
|
|
677
|
+
* @returns {Promise<AoMessageResult>} The result of the cancellation
|
|
678
|
+
*/
|
|
679
|
+
async cancelWithdrawal(params, options) {
|
|
671
680
|
const { tags = [] } = options || {};
|
|
681
|
+
const allTags = [
|
|
682
|
+
...tags,
|
|
683
|
+
{ name: 'Action', value: 'Cancel-Withdrawal' },
|
|
684
|
+
{ name: 'Address', value: params.address },
|
|
685
|
+
{ name: 'Vault-Id', value: params.vaultId },
|
|
686
|
+
];
|
|
687
|
+
const prunedTags = allTags.filter((tag) => tag.value !== undefined);
|
|
672
688
|
return this.process.send({
|
|
673
689
|
signer: this.signer,
|
|
674
|
-
tags:
|
|
675
|
-
...tags,
|
|
676
|
-
{ name: 'Action', value: 'Cancel-Delegate-Withdrawal' },
|
|
677
|
-
{ name: 'Address', value: params.address },
|
|
678
|
-
{ name: 'Vault-Id', value: params.vaultId },
|
|
679
|
-
],
|
|
690
|
+
tags: prunedTags,
|
|
680
691
|
});
|
|
681
692
|
}
|
|
682
693
|
async submitAuctionBid(params, options) {
|
|
683
694
|
const { tags = [] } = options || {};
|
|
684
695
|
const allTags = [
|
|
685
696
|
...tags,
|
|
686
|
-
{ name: 'Action', value: '
|
|
697
|
+
{ name: 'Action', value: 'Auction-Bid' },
|
|
687
698
|
{ name: 'Name', value: params.name },
|
|
688
699
|
{ name: 'Process-Id', value: params.processId },
|
|
689
700
|
{ name: 'Quantity', value: params.quantity?.toString() ?? undefined },
|
|
701
|
+
{ name: 'Purchase-Type', value: params.type || 'lease' },
|
|
702
|
+
{ name: 'Years', value: params.years?.toString() ?? undefined },
|
|
690
703
|
];
|
|
691
704
|
const prunedTags = allTags.filter((tag) => tag.value !== undefined);
|
|
692
705
|
return this.process.send({
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/common/io.js
CHANGED
|
@@ -662,26 +662,39 @@ export class IOWriteable extends IOReadable {
|
|
|
662
662
|
],
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
|
-
|
|
665
|
+
/**
|
|
666
|
+
* Cancel a withdrawal from a gateway.
|
|
667
|
+
*
|
|
668
|
+
* @param {Object} params - The parameters for cancelling a withdrawal
|
|
669
|
+
* @param {string} [params.address] - The address of the withdrawal (optional). If not provided, the signer's address will be used.
|
|
670
|
+
* @param {string} params.vaultId - The vault ID of the withdrawal.
|
|
671
|
+
* @param {Object} [options] - The options for the cancellation
|
|
672
|
+
* @returns {Promise<AoMessageResult>} The result of the cancellation
|
|
673
|
+
*/
|
|
674
|
+
async cancelWithdrawal(params, options) {
|
|
666
675
|
const { tags = [] } = options || {};
|
|
676
|
+
const allTags = [
|
|
677
|
+
...tags,
|
|
678
|
+
{ name: 'Action', value: 'Cancel-Withdrawal' },
|
|
679
|
+
{ name: 'Address', value: params.address },
|
|
680
|
+
{ name: 'Vault-Id', value: params.vaultId },
|
|
681
|
+
];
|
|
682
|
+
const prunedTags = allTags.filter((tag) => tag.value !== undefined);
|
|
667
683
|
return this.process.send({
|
|
668
684
|
signer: this.signer,
|
|
669
|
-
tags:
|
|
670
|
-
...tags,
|
|
671
|
-
{ name: 'Action', value: 'Cancel-Delegate-Withdrawal' },
|
|
672
|
-
{ name: 'Address', value: params.address },
|
|
673
|
-
{ name: 'Vault-Id', value: params.vaultId },
|
|
674
|
-
],
|
|
685
|
+
tags: prunedTags,
|
|
675
686
|
});
|
|
676
687
|
}
|
|
677
688
|
async submitAuctionBid(params, options) {
|
|
678
689
|
const { tags = [] } = options || {};
|
|
679
690
|
const allTags = [
|
|
680
691
|
...tags,
|
|
681
|
-
{ name: 'Action', value: '
|
|
692
|
+
{ name: 'Action', value: 'Auction-Bid' },
|
|
682
693
|
{ name: 'Name', value: params.name },
|
|
683
694
|
{ name: 'Process-Id', value: params.processId },
|
|
684
695
|
{ name: 'Quantity', value: params.quantity?.toString() ?? undefined },
|
|
696
|
+
{ name: 'Purchase-Type', value: params.type || 'lease' },
|
|
697
|
+
{ name: 'Years', value: params.years?.toString() ?? undefined },
|
|
685
698
|
];
|
|
686
699
|
const prunedTags = allTags.filter((tag) => tag.value !== undefined);
|
|
687
700
|
return this.process.send({
|
package/lib/esm/version.js
CHANGED
package/lib/types/common/io.d.ts
CHANGED
|
@@ -166,13 +166,24 @@ export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
|
166
166
|
name: string;
|
|
167
167
|
increaseCount: number;
|
|
168
168
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
/**
|
|
170
|
+
* Cancel a withdrawal from a gateway.
|
|
171
|
+
*
|
|
172
|
+
* @param {Object} params - The parameters for cancelling a withdrawal
|
|
173
|
+
* @param {string} [params.address] - The address of the withdrawal (optional). If not provided, the signer's address will be used.
|
|
174
|
+
* @param {string} params.vaultId - The vault ID of the withdrawal.
|
|
175
|
+
* @param {Object} [options] - The options for the cancellation
|
|
176
|
+
* @returns {Promise<AoMessageResult>} The result of the cancellation
|
|
177
|
+
*/
|
|
178
|
+
cancelWithdrawal(params: {
|
|
179
|
+
address?: WalletAddress;
|
|
171
180
|
vaultId: string;
|
|
172
181
|
}, options?: WriteOptions | undefined): Promise<AoMessageResult>;
|
|
173
182
|
submitAuctionBid(params: {
|
|
174
183
|
name: string;
|
|
175
184
|
processId: string;
|
|
176
185
|
quantity?: number;
|
|
186
|
+
type?: 'lease' | 'permabuy';
|
|
187
|
+
years?: number;
|
|
177
188
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
178
189
|
}
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -325,14 +325,16 @@ export interface AoIOWrite extends AoIORead {
|
|
|
325
325
|
name: string;
|
|
326
326
|
increaseCount: number;
|
|
327
327
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
328
|
-
|
|
329
|
-
address
|
|
328
|
+
cancelWithdrawal(params: {
|
|
329
|
+
address?: WalletAddress;
|
|
330
330
|
vaultId: string;
|
|
331
331
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
332
332
|
submitAuctionBid(params: {
|
|
333
333
|
name: string;
|
|
334
334
|
processId: string;
|
|
335
335
|
quantity?: number;
|
|
336
|
+
type?: 'lease' | 'permabuy';
|
|
337
|
+
years?: number;
|
|
336
338
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
337
339
|
}
|
|
338
340
|
export declare function isProcessConfiguration(config: object): config is {
|
package/lib/types/version.d.ts
CHANGED