@ar.io/sdk 2.4.0-alpha.5 → 2.4.0-alpha.6
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/bundles/web.bundle.min.js +52 -52
- package/lib/cjs/common/io.js +28 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/io.js +28 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +20 -0
- package/lib/types/types/io.d.ts +3 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/common/io.js
CHANGED
|
@@ -643,6 +643,34 @@ class IOWriteable extends IOReadable {
|
|
|
643
643
|
tags: prunedTags,
|
|
644
644
|
});
|
|
645
645
|
}
|
|
646
|
+
/**
|
|
647
|
+
* Upgrades an existing leased record to a permabuy.
|
|
648
|
+
*
|
|
649
|
+
* @param {Object} params - The parameters for upgrading a record
|
|
650
|
+
* @param {string} params.name - The name of the record to upgrade
|
|
651
|
+
* @param {Object} [options] - The options for the upgrade
|
|
652
|
+
* @returns {Promise<AoMessageResult>} The result of the upgrade
|
|
653
|
+
*/
|
|
654
|
+
async upgradeRecord(params, options) {
|
|
655
|
+
const { tags = [] } = options || {};
|
|
656
|
+
return this.process.send({
|
|
657
|
+
signer: this.signer,
|
|
658
|
+
tags: [
|
|
659
|
+
...tags,
|
|
660
|
+
{ name: 'Action', value: 'Upgrade-Name' }, // TODO: align on Update-Record vs. Upgrade-Name (contract currently uses Upgrade-Name)
|
|
661
|
+
{ name: 'Name', value: params.name },
|
|
662
|
+
],
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Extends the lease of an existing leased record.
|
|
667
|
+
*
|
|
668
|
+
* @param {Object} params - The parameters for extending a lease
|
|
669
|
+
* @param {string} params.name - The name of the record to extend
|
|
670
|
+
* @param {number} params.years - The number of years to extend the lease
|
|
671
|
+
* @param {Object} [options] - The options for the extension
|
|
672
|
+
* @returns {Promise<AoMessageResult>} The result of the extension
|
|
673
|
+
*/
|
|
646
674
|
async extendLease(params, options) {
|
|
647
675
|
const { tags = [] } = options || {};
|
|
648
676
|
return this.process.send({
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/common/io.js
CHANGED
|
@@ -638,6 +638,34 @@ export class IOWriteable extends IOReadable {
|
|
|
638
638
|
tags: prunedTags,
|
|
639
639
|
});
|
|
640
640
|
}
|
|
641
|
+
/**
|
|
642
|
+
* Upgrades an existing leased record to a permabuy.
|
|
643
|
+
*
|
|
644
|
+
* @param {Object} params - The parameters for upgrading a record
|
|
645
|
+
* @param {string} params.name - The name of the record to upgrade
|
|
646
|
+
* @param {Object} [options] - The options for the upgrade
|
|
647
|
+
* @returns {Promise<AoMessageResult>} The result of the upgrade
|
|
648
|
+
*/
|
|
649
|
+
async upgradeRecord(params, options) {
|
|
650
|
+
const { tags = [] } = options || {};
|
|
651
|
+
return this.process.send({
|
|
652
|
+
signer: this.signer,
|
|
653
|
+
tags: [
|
|
654
|
+
...tags,
|
|
655
|
+
{ name: 'Action', value: 'Upgrade-Name' }, // TODO: align on Update-Record vs. Upgrade-Name (contract currently uses Upgrade-Name)
|
|
656
|
+
{ name: 'Name', value: params.name },
|
|
657
|
+
],
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Extends the lease of an existing leased record.
|
|
662
|
+
*
|
|
663
|
+
* @param {Object} params - The parameters for extending a lease
|
|
664
|
+
* @param {string} params.name - The name of the record to extend
|
|
665
|
+
* @param {number} params.years - The number of years to extend the lease
|
|
666
|
+
* @param {Object} [options] - The options for the extension
|
|
667
|
+
* @returns {Promise<AoMessageResult>} The result of the extension
|
|
668
|
+
*/
|
|
641
669
|
async extendLease(params, options) {
|
|
642
670
|
const { tags = [] } = options || {};
|
|
643
671
|
return this.process.send({
|
package/lib/esm/version.js
CHANGED
package/lib/types/common/io.d.ts
CHANGED
|
@@ -158,6 +158,26 @@ export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
|
158
158
|
type: 'lease' | 'permabuy';
|
|
159
159
|
processId: string;
|
|
160
160
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
161
|
+
/**
|
|
162
|
+
* Upgrades an existing leased record to a permabuy.
|
|
163
|
+
*
|
|
164
|
+
* @param {Object} params - The parameters for upgrading a record
|
|
165
|
+
* @param {string} params.name - The name of the record to upgrade
|
|
166
|
+
* @param {Object} [options] - The options for the upgrade
|
|
167
|
+
* @returns {Promise<AoMessageResult>} The result of the upgrade
|
|
168
|
+
*/
|
|
169
|
+
upgradeRecord(params: {
|
|
170
|
+
name: string;
|
|
171
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
172
|
+
/**
|
|
173
|
+
* Extends the lease of an existing leased record.
|
|
174
|
+
*
|
|
175
|
+
* @param {Object} params - The parameters for extending a lease
|
|
176
|
+
* @param {string} params.name - The name of the record to extend
|
|
177
|
+
* @param {number} params.years - The number of years to extend the lease
|
|
178
|
+
* @param {Object} [options] - The options for the extension
|
|
179
|
+
* @returns {Promise<AoMessageResult>} The result of the extension
|
|
180
|
+
*/
|
|
161
181
|
extendLease(params: {
|
|
162
182
|
name: string;
|
|
163
183
|
years: number;
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -317,6 +317,9 @@ export interface AoIOWrite extends AoIORead {
|
|
|
317
317
|
type: 'lease' | 'permabuy';
|
|
318
318
|
processId: string;
|
|
319
319
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
320
|
+
upgradeRecord(params: {
|
|
321
|
+
name: string;
|
|
322
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
320
323
|
extendLease(params: {
|
|
321
324
|
name: string;
|
|
322
325
|
years: number;
|
package/lib/types/version.d.ts
CHANGED