@ar.io/sdk 3.0.0-alpha.1 → 3.0.0

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.
@@ -38,10 +38,10 @@ async function joinNetwork(options) {
38
38
  if (!options.skipConfirmation) {
39
39
  const settings = await ario.getGatewayRegistrySettings();
40
40
  if (settings.operators.minStake > mARIOQuantity.valueOf()) {
41
- throw new Error(`The minimum operator stake is ${(0, utils_js_1.formatARIOWithCommas)(new index_js_1.mARIOToken(settings.operators.minStake).toARIO())} IO. Please provide a higher stake.`);
41
+ throw new Error(`The minimum operator stake is ${(0, utils_js_1.formatARIOWithCommas)(new index_js_1.mARIOToken(settings.operators.minStake).toARIO())} ARIO. Please provide a higher stake.`);
42
42
  }
43
43
  await (0, utils_js_1.assertEnoughBalance)(ario, signerAddress, mARIOQuantity.toARIO());
44
- await (0, utils_js_1.assertConfirmationPrompt)(`Gateway Settings:\n\n${JSON.stringify(settings, null, 2)}\n\nYou are about to stake ${(0, utils_js_1.formatARIOWithCommas)(mARIOQuantity.toARIO())} IO to join the AR.IO network\nAre you sure?\n`, options);
44
+ await (0, utils_js_1.assertConfirmationPrompt)(`Gateway Settings:\n\n${JSON.stringify(settings, null, 2)}\n\nYou are about to stake ${(0, utils_js_1.formatARIOWithCommas)(mARIOQuantity.toARIO())} ARIO to join the AR.IO network\nAre you sure?\n`, options);
45
45
  }
46
46
  const result = await ario.joinNetwork(settings, (0, utils_js_1.writeActionTagsFromOptions)(options));
47
47
  const output = {
@@ -96,7 +96,7 @@ async function saveObservations(o) {
96
96
  exports.saveObservations = saveObservations;
97
97
  async function increaseOperatorStake(o) {
98
98
  const increaseQty = (0, utils_js_1.requiredMIOFromOptions)(o, 'operatorStake');
99
- await (0, utils_js_1.assertConfirmationPrompt)(`You are about to increase your operator stake by ${(0, utils_js_1.formatARIOWithCommas)(increaseQty.toARIO())} IO\nAre you sure?`, o);
99
+ await (0, utils_js_1.assertConfirmationPrompt)(`You are about to increase your operator stake by ${(0, utils_js_1.formatARIOWithCommas)(increaseQty.toARIO())} ARIO\nAre you sure?`, o);
100
100
  return ((0, utils_js_1.writeARIOFromOptions)(o).ario.increaseOperatorStake({
101
101
  increaseQty,
102
102
  }),
@@ -106,7 +106,7 @@ exports.increaseOperatorStake = increaseOperatorStake;
106
106
  async function decreaseOperatorStake(o) {
107
107
  const decreaseQty = (0, utils_js_1.requiredMIOFromOptions)(o, 'operatorStake');
108
108
  // TODO: Can assert stake is sufficient for action, and new target stake meets contract minimum
109
- await (0, utils_js_1.assertConfirmationPrompt)(`You are about to decrease your operator stake by ${(0, utils_js_1.formatARIOWithCommas)(decreaseQty.toARIO())} IO\nAre you sure?`, o);
109
+ await (0, utils_js_1.assertConfirmationPrompt)(`You are about to decrease your operator stake by ${(0, utils_js_1.formatARIOWithCommas)(decreaseQty.toARIO())} ARIO\nAre you sure?`, o);
110
110
  return (0, utils_js_1.writeARIOFromOptions)(o).ario.decreaseOperatorStake({
111
111
  decreaseQty,
112
112
  }, (0, utils_js_1.writeActionTagsFromOptions)(o));
@@ -65,7 +65,7 @@ exports.optionMap = {
65
65
  },
66
66
  quantity: {
67
67
  alias: '-q, --quantity <quantity>',
68
- description: 'The quantity of IO to interact with',
68
+ description: 'The quantity of ARIO to interact with',
69
69
  },
70
70
  autoStake: {
71
71
  alias: '--auto-stake',
@@ -296,15 +296,15 @@ function recordTypeFromOptions(options) {
296
296
  exports.recordTypeFromOptions = recordTypeFromOptions;
297
297
  function requiredMIOFromOptions(options, key) {
298
298
  if (options[key] === undefined) {
299
- throw new Error(`No ${key} provided. Use --${key} denominated in IO`);
299
+ throw new Error(`No ${key} provided. Use --${key} denominated in ARIO`);
300
300
  }
301
301
  return new index_js_1.ARIOToken(+options[key]).toMARIO();
302
302
  }
303
303
  exports.requiredMIOFromOptions = requiredMIOFromOptions;
304
- async function assertEnoughBalance(io, address, ioQuantity) {
305
- const balance = await io.getBalance({ address });
306
- if (balance < ioQuantity.toMARIO().valueOf()) {
307
- throw new Error(`Insufficient IO balance for action. Balance available: ${new index_js_1.mARIOToken(balance).toARIO()} IO`);
304
+ async function assertEnoughBalance(ario, address, arioQuantity) {
305
+ const balance = await ario.getBalance({ address });
306
+ if (balance < arioQuantity.toMARIO().valueOf()) {
307
+ throw new Error(`Insufficient ARIO balance for action. Balance available: ${new index_js_1.mARIOToken(balance).toARIO()} ARIO`);
308
308
  }
309
309
  }
310
310
  exports.assertEnoughBalance = assertEnoughBalance;
@@ -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 = '3.0.0-alpha.1';
20
+ exports.version = '3.0.0';
@@ -32,10 +32,10 @@ export async function joinNetwork(options) {
32
32
  if (!options.skipConfirmation) {
33
33
  const settings = await ario.getGatewayRegistrySettings();
34
34
  if (settings.operators.minStake > mARIOQuantity.valueOf()) {
35
- throw new Error(`The minimum operator stake is ${formatARIOWithCommas(new mARIOToken(settings.operators.minStake).toARIO())} IO. Please provide a higher stake.`);
35
+ throw new Error(`The minimum operator stake is ${formatARIOWithCommas(new mARIOToken(settings.operators.minStake).toARIO())} ARIO. Please provide a higher stake.`);
36
36
  }
37
37
  await assertEnoughBalance(ario, signerAddress, mARIOQuantity.toARIO());
38
- await assertConfirmationPrompt(`Gateway Settings:\n\n${JSON.stringify(settings, null, 2)}\n\nYou are about to stake ${formatARIOWithCommas(mARIOQuantity.toARIO())} IO to join the AR.IO network\nAre you sure?\n`, options);
38
+ await assertConfirmationPrompt(`Gateway Settings:\n\n${JSON.stringify(settings, null, 2)}\n\nYou are about to stake ${formatARIOWithCommas(mARIOQuantity.toARIO())} ARIO to join the AR.IO network\nAre you sure?\n`, options);
39
39
  }
40
40
  const result = await ario.joinNetwork(settings, writeActionTagsFromOptions(options));
41
41
  const output = {
@@ -86,7 +86,7 @@ export async function saveObservations(o) {
86
86
  }
87
87
  export async function increaseOperatorStake(o) {
88
88
  const increaseQty = requiredMARIOFromOptions(o, 'operatorStake');
89
- await assertConfirmationPrompt(`You are about to increase your operator stake by ${formatARIOWithCommas(increaseQty.toARIO())} IO\nAre you sure?`, o);
89
+ await assertConfirmationPrompt(`You are about to increase your operator stake by ${formatARIOWithCommas(increaseQty.toARIO())} ARIO\nAre you sure?`, o);
90
90
  return (writeARIOFromOptions(o).ario.increaseOperatorStake({
91
91
  increaseQty,
92
92
  }),
@@ -95,7 +95,7 @@ export async function increaseOperatorStake(o) {
95
95
  export async function decreaseOperatorStake(o) {
96
96
  const decreaseQty = requiredMARIOFromOptions(o, 'operatorStake');
97
97
  // TODO: Can assert stake is sufficient for action, and new target stake meets contract minimum
98
- await assertConfirmationPrompt(`You are about to decrease your operator stake by ${formatARIOWithCommas(decreaseQty.toARIO())} IO\nAre you sure?`, o);
98
+ await assertConfirmationPrompt(`You are about to decrease your operator stake by ${formatARIOWithCommas(decreaseQty.toARIO())} ARIO\nAre you sure?`, o);
99
99
  return writeARIOFromOptions(o).ario.decreaseOperatorStake({
100
100
  decreaseQty,
101
101
  }, writeActionTagsFromOptions(o));
@@ -62,7 +62,7 @@ export const optionMap = {
62
62
  },
63
63
  quantity: {
64
64
  alias: '-q, --quantity <quantity>',
65
- description: 'The quantity of IO to interact with',
65
+ description: 'The quantity of ARIO to interact with',
66
66
  },
67
67
  autoStake: {
68
68
  alias: '--auto-stake',
@@ -267,14 +267,14 @@ export function recordTypeFromOptions(options) {
267
267
  }
268
268
  export function requiredMIOFromOptions(options, key) {
269
269
  if (options[key] === undefined) {
270
- throw new Error(`No ${key} provided. Use --${key} denominated in IO`);
270
+ throw new Error(`No ${key} provided. Use --${key} denominated in ARIO`);
271
271
  }
272
272
  return new ARIOToken(+options[key]).toMARIO();
273
273
  }
274
- export async function assertEnoughBalance(io, address, ioQuantity) {
275
- const balance = await io.getBalance({ address });
276
- if (balance < ioQuantity.toMARIO().valueOf()) {
277
- throw new Error(`Insufficient IO balance for action. Balance available: ${new mARIOToken(balance).toARIO()} IO`);
274
+ export async function assertEnoughBalance(ario, address, arioQuantity) {
275
+ const balance = await ario.getBalance({ address });
276
+ if (balance < arioQuantity.toMARIO().valueOf()) {
277
+ throw new Error(`Insufficient ARIO balance for action. Balance available: ${new mARIOToken(balance).toARIO()} ARIO`);
278
278
  }
279
279
  }
280
280
  export async function confirmationPrompt(message) {
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '3.0.0-alpha.1';
17
+ export const version = '3.0.0';
@@ -52,7 +52,7 @@ export declare function recordTypeFromOptions<O extends {
52
52
  type?: string;
53
53
  }>(options: O): 'lease' | 'permabuy';
54
54
  export declare function requiredMIOFromOptions<O extends GlobalCLIOptions>(options: O, key: string): mARIOToken;
55
- export declare function assertEnoughBalance(io: AoARIORead, address: string, ioQuantity: ARIOToken): Promise<void>;
55
+ export declare function assertEnoughBalance(ario: AoARIORead, address: string, arioQuantity: ARIOToken): Promise<void>;
56
56
  export declare function confirmationPrompt(message: string): Promise<boolean>;
57
57
  export declare function assertConfirmationPrompt<O extends {
58
58
  skipConfirmation?: boolean;
@@ -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.7.0-alpha.7";
16
+ export declare const version = "3.0.0-alpha.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"