@ar.io/sdk 2.0.3-alpha.1 → 2.1.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.
@@ -30,5 +30,5 @@ exports.ioDevnetProcessId = exports.IO_DEVNET_PROCESS_ID;
30
30
  exports.IO_TESTNET_PROCESS_ID = 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA';
31
31
  exports.MIO_PER_IO = 1_000_000;
32
32
  exports.AOS_MODULE_ID = 'cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk';
33
- exports.ANT_LUA_ID = '3OlGzE5mrsN2GsxCYM0Tae1KzWepGOr5a94deOWmApM';
33
+ exports.ANT_LUA_ID = 'Flwio4Lr08g6s6uim6lEJNnVGD9ylvz0_aafvpiL8FI';
34
34
  exports.DEFAULT_SCHEDULER_ID = '_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.spawnANT = void 0;
3
+ exports.evolveANT = exports.spawnANT = void 0;
4
4
  /**
5
5
  * Copyright (C) 2022-2024 Permanent Data Solutions, Inc. All Rights Reserved.
6
6
  *
@@ -60,3 +60,25 @@ async function spawnANT({ signer, module = constants_js_1.AOS_MODULE_ID, luaCode
60
60
  return processId;
61
61
  }
62
62
  exports.spawnANT = spawnANT;
63
+ async function evolveANT({ signer, processId, luaCodeTxId = constants_js_1.ANT_LUA_ID, ao = (0, aoconnect_1.connect)(), }) {
64
+ const aosClient = new index_js_1.AOProcess({
65
+ processId,
66
+ ao,
67
+ });
68
+ //TODO: cache locally and only fetch if not cached
69
+ const luaString = (await arweave_js_1.defaultArweave.transactions.getData(luaCodeTxId, {
70
+ decode: true,
71
+ string: true,
72
+ }));
73
+ const { id } = await aosClient.send({
74
+ tags: [
75
+ { name: 'Action', value: 'Eval' },
76
+ { name: 'App-Name', value: 'ArNS-ANT' },
77
+ { name: 'Source-Code-TX-ID', value: luaCodeTxId },
78
+ ],
79
+ data: luaString,
80
+ signer,
81
+ });
82
+ return id;
83
+ }
84
+ exports.evolveANT = evolveANT;
@@ -18,4 +18,4 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.version = void 0;
20
20
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
21
- exports.version = '2.0.3-alpha.1';
21
+ exports.version = '2.1.0-alpha.1';
@@ -27,5 +27,5 @@ export const ioDevnetProcessId = IO_DEVNET_PROCESS_ID;
27
27
  export const IO_TESTNET_PROCESS_ID = 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA';
28
28
  export const MIO_PER_IO = 1_000_000;
29
29
  export const AOS_MODULE_ID = 'cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk';
30
- export const ANT_LUA_ID = '3OlGzE5mrsN2GsxCYM0Tae1KzWepGOr5a94deOWmApM';
30
+ export const ANT_LUA_ID = 'Flwio4Lr08g6s6uim6lEJNnVGD9ylvz0_aafvpiL8FI';
31
31
  export const DEFAULT_SCHEDULER_ID = '_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA';
@@ -56,3 +56,24 @@ export async function spawnANT({ signer, module = AOS_MODULE_ID, luaCodeTxId = A
56
56
  }
57
57
  return processId;
58
58
  }
59
+ export async function evolveANT({ signer, processId, luaCodeTxId = ANT_LUA_ID, ao = connect(), }) {
60
+ const aosClient = new AOProcess({
61
+ processId,
62
+ ao,
63
+ });
64
+ //TODO: cache locally and only fetch if not cached
65
+ const luaString = (await defaultArweave.transactions.getData(luaCodeTxId, {
66
+ decode: true,
67
+ string: true,
68
+ }));
69
+ const { id } = await aosClient.send({
70
+ tags: [
71
+ { name: 'Action', value: 'Eval' },
72
+ { name: 'App-Name', value: 'ArNS-ANT' },
73
+ { name: 'Source-Code-TX-ID', value: luaCodeTxId },
74
+ ],
75
+ data: luaString,
76
+ signer,
77
+ });
78
+ return id;
79
+ }
@@ -15,4 +15,4 @@
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
17
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
18
- export const version = '2.0.3-alpha.1';
18
+ export const version = '2.1.0-alpha.1';
@@ -31,6 +31,7 @@ export declare class AoANTReadable implements AoANTRead {
31
31
  Ticker: string;
32
32
  Denomination: number;
33
33
  Owner: string;
34
+ ['Source-Code-TX-ID']?: string;
34
35
  }>;
35
36
  /**
36
37
  * @param undername @type {string} The domain name.
@@ -25,5 +25,5 @@ export declare const ioDevnetProcessId = "GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6Gc
25
25
  export declare const IO_TESTNET_PROCESS_ID = "agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA";
26
26
  export declare const MIO_PER_IO = 1000000;
27
27
  export declare const AOS_MODULE_ID = "cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk";
28
- export declare const ANT_LUA_ID = "3OlGzE5mrsN2GsxCYM0Tae1KzWepGOr5a94deOWmApM";
28
+ export declare const ANT_LUA_ID = "Flwio4Lr08g6s6uim6lEJNnVGD9ylvz0_aafvpiL8FI";
29
29
  export declare const DEFAULT_SCHEDULER_ID = "_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";
package/lib/types/io.d.ts CHANGED
@@ -158,6 +158,7 @@ export interface AoANTRead {
158
158
  Ticker: string;
159
159
  Denomination: number;
160
160
  Owner: string;
161
+ ['Source-Code-TX-ID']?: string;
161
162
  }>;
162
163
  getRecord({ undername }: {
163
164
  undername: any;
@@ -9,3 +9,9 @@ export declare function spawnANT({ signer, module, luaCodeTxId, ao, scheduler, s
9
9
  state?: ANTState;
10
10
  stateContractTxId?: string;
11
11
  }): Promise<string>;
12
+ export declare function evolveANT({ signer, processId, luaCodeTxId, ao, }: {
13
+ signer: ContractSigner;
14
+ processId: string;
15
+ luaCodeTxId?: string;
16
+ ao?: AoClient;
17
+ }): Promise<string>;
@@ -14,4 +14,4 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- export declare const version = "2.0.2";
17
+ export declare const version = "2.0.3-alpha.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "2.0.3-alpha.1",
3
+ "version": "2.1.0-alpha.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"