@ar.io/sdk 3.23.0-alpha.6 → 3.23.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.
@@ -40,7 +40,7 @@ class AOProcess {
40
40
  messageData === '' ||
41
41
  messageData === null);
42
42
  }
43
- async read({ tags, retries = 3, fromAddress, select, }) {
43
+ async read({ tags, retries = 3, fromAddress, }) {
44
44
  this.logger.debug(`Evaluating read interaction on process`, {
45
45
  tags,
46
46
  processId: this.processId,
@@ -105,9 +105,7 @@ class AOProcess {
105
105
  throw new Error(result.message ||
106
106
  `Process ${this.processId} did not return a valid response. Response: ${JSON.stringify(result)}`);
107
107
  }
108
- const messageData = select
109
- ? result.Messages.find(select)?.Data
110
- : result.Messages?.[0]?.Data;
108
+ const messageData = result.Messages?.[0]?.Data;
111
109
  // return undefined if no data is returned
112
110
  if (this.isMessageDataEmpty(messageData)) {
113
111
  return undefined;
@@ -115,7 +113,7 @@ class AOProcess {
115
113
  const response = (0, json_js_1.safeDecode)(messageData);
116
114
  return response;
117
115
  }
118
- async send({ tags, data, signer, retries = 3, select, }) {
116
+ async send({ tags, data, signer, retries = 3, }) {
119
117
  let messageId;
120
118
  const anchor = (0, base64_js_1.getRandomText)(32); // anchor is a random text produce non-deterministic messages IDs when deterministic signers are provided (ETH)
121
119
  try {
@@ -212,7 +210,7 @@ class AOProcess {
212
210
  if (this.isMessageDataEmpty(result.Messages[0].Data)) {
213
211
  return { id: messageId };
214
212
  }
215
- const resultData = (0, json_js_1.safeDecode)(select ? result.Messages.find(select)?.Data : result.Messages[0].Data);
213
+ const resultData = (0, json_js_1.safeDecode)(result.Messages[0].Data);
216
214
  this.logger.debug('Message result data', {
217
215
  resultData,
218
216
  messageId,
@@ -35,7 +35,6 @@ class ArNSMarketplaceRead {
35
35
  async getInfo() {
36
36
  return this.process.read({
37
37
  tags: [{ name: 'Action', value: 'Info' }],
38
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Info-Notice'),
39
38
  });
40
39
  }
41
40
  async getPaginatedIntents({ cursor, limit, sortBy, sortOrder, filters, } = {}) {
@@ -50,8 +49,6 @@ class ArNSMarketplaceRead {
50
49
  const filteredTags = tags.filter((tag) => tag.value !== undefined);
51
50
  return this.process.read({
52
51
  tags: filteredTags,
53
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' &&
54
- tag.value === 'Get-Paginated-Intents-Notice'),
55
52
  });
56
53
  }
57
54
  async getIntent(intentId) {
@@ -60,7 +57,6 @@ class ArNSMarketplaceRead {
60
57
  { name: 'Action', value: 'Get-Intent-By-Id' },
61
58
  { name: 'Intent-Id', value: intentId },
62
59
  ],
63
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Get-Intent-By-Id-Notice'),
64
60
  });
65
61
  }
66
62
  async getIntentByANTId(antId) {
@@ -96,10 +92,7 @@ class ArNSMarketplaceRead {
96
92
  },
97
93
  ];
98
94
  const filteredTags = tags.filter((tag) => tag.value !== undefined);
99
- return this.process.read({
100
- tags: filteredTags,
101
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Get-Orders-Notice'),
102
- });
95
+ return this.process.read({ tags: filteredTags });
103
96
  }
104
97
  /**
105
98
  * Get a single order by ID
@@ -112,7 +105,6 @@ class ArNSMarketplaceRead {
112
105
  { name: 'Action', value: 'Get-Order' },
113
106
  { name: 'Order-Id', value: orderId },
114
107
  ],
115
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Get-Order-Notice'),
116
108
  });
117
109
  }
118
110
  async getOrderByANTId(antId) {
@@ -135,8 +127,6 @@ class ArNSMarketplaceRead {
135
127
  { name: 'Action', value: 'Get-Paginated-Balances' },
136
128
  ...(0, index_js_1.paginationParamsToTags)(params),
137
129
  ],
138
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' &&
139
- tag.value === 'Get-Paginated-Balances-Notice'),
140
130
  });
141
131
  }
142
132
  /**
@@ -148,7 +138,6 @@ class ArNSMarketplaceRead {
148
138
  { name: 'Action', value: 'Get-Balance' },
149
139
  { name: 'Address', value: address },
150
140
  ],
151
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Get-Balance-Notice'),
152
141
  });
153
142
  }
154
143
  async getUserAssets({ address, arioProcessId, }) {
@@ -249,7 +238,6 @@ class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
249
238
  { name: 'Quantity', value: params.amount },
250
239
  ],
251
240
  signer: this.signer,
252
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Withdraw-Ario-Notice'),
253
241
  });
254
242
  }
255
243
  async createIntent({ antId, orderType, quantity, price, expirationTime, minimumPrice, decreaseInterval, }) {
@@ -267,7 +255,6 @@ class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
267
255
  return this.process.send({
268
256
  tags: filteredTags,
269
257
  signer: this.signer,
270
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Create-Intent-Notice'),
271
258
  });
272
259
  }
273
260
  async pushANTIntentResolution(intentId) {
@@ -277,8 +264,6 @@ class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
277
264
  { name: 'X-Intent-Id', value: intentId },
278
265
  ],
279
266
  signer: this.signer,
280
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' &&
281
- tag.value === 'Push-ANT-Intent-Resolution-Notice'),
282
267
  });
283
268
  }
284
269
  async settleAuction(params) {
@@ -292,7 +277,6 @@ class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
292
277
  return this.process.send({
293
278
  tags: filteredTags,
294
279
  signer: this.signer,
295
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Settle-Auction-Notice'),
296
280
  });
297
281
  }
298
282
  async listNameForSale({ name, expirationTime, price, type, walletAddress, minimumPrice, decreaseInterval, onProgress = (event) => {
@@ -515,7 +499,6 @@ class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
515
499
  return this.process.send({
516
500
  tags,
517
501
  signer: this.signer,
518
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Cancel-Order-Notice'),
519
502
  });
520
503
  }
521
504
  async createOrder({ swapToken, quantity, orderType, price, expirationTime, minimumPrice, decreaseInterval, transferDenomination, }) {
@@ -535,7 +518,6 @@ class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
535
518
  return this.process.send({
536
519
  tags: filteredTags,
537
520
  signer: this.signer,
538
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Create-Order-Notice'),
539
521
  });
540
522
  }
541
523
  async buyFixedPriceANT(params) {
@@ -608,8 +590,6 @@ class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
608
590
  { name: 'Bid-Amount', value: params.bidAmount },
609
591
  ],
610
592
  signer: this.signer,
611
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' &&
612
- tag.value === 'Bid-On-English-Auction-Notice'),
613
593
  });
614
594
  }
615
595
  /**
@@ -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.23.0-alpha.6';
20
+ exports.version = '3.23.0';
@@ -37,7 +37,7 @@ export class AOProcess {
37
37
  messageData === '' ||
38
38
  messageData === null);
39
39
  }
40
- async read({ tags, retries = 3, fromAddress, select, }) {
40
+ async read({ tags, retries = 3, fromAddress, }) {
41
41
  this.logger.debug(`Evaluating read interaction on process`, {
42
42
  tags,
43
43
  processId: this.processId,
@@ -102,9 +102,7 @@ export class AOProcess {
102
102
  throw new Error(result.message ||
103
103
  `Process ${this.processId} did not return a valid response. Response: ${JSON.stringify(result)}`);
104
104
  }
105
- const messageData = select
106
- ? result.Messages.find(select)?.Data
107
- : result.Messages?.[0]?.Data;
105
+ const messageData = result.Messages?.[0]?.Data;
108
106
  // return undefined if no data is returned
109
107
  if (this.isMessageDataEmpty(messageData)) {
110
108
  return undefined;
@@ -112,7 +110,7 @@ export class AOProcess {
112
110
  const response = safeDecode(messageData);
113
111
  return response;
114
112
  }
115
- async send({ tags, data, signer, retries = 3, select, }) {
113
+ async send({ tags, data, signer, retries = 3, }) {
116
114
  let messageId;
117
115
  const anchor = getRandomText(32); // anchor is a random text produce non-deterministic messages IDs when deterministic signers are provided (ETH)
118
116
  try {
@@ -209,7 +207,7 @@ export class AOProcess {
209
207
  if (this.isMessageDataEmpty(result.Messages[0].Data)) {
210
208
  return { id: messageId };
211
209
  }
212
- const resultData = safeDecode(select ? result.Messages.find(select)?.Data : result.Messages[0].Data);
210
+ const resultData = safeDecode(result.Messages[0].Data);
213
211
  this.logger.debug('Message result data', {
214
212
  resultData,
215
213
  messageId,
@@ -30,7 +30,6 @@ export class ArNSMarketplaceRead {
30
30
  async getInfo() {
31
31
  return this.process.read({
32
32
  tags: [{ name: 'Action', value: 'Info' }],
33
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Info-Notice'),
34
33
  });
35
34
  }
36
35
  async getPaginatedIntents({ cursor, limit, sortBy, sortOrder, filters, } = {}) {
@@ -45,8 +44,6 @@ export class ArNSMarketplaceRead {
45
44
  const filteredTags = tags.filter((tag) => tag.value !== undefined);
46
45
  return this.process.read({
47
46
  tags: filteredTags,
48
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' &&
49
- tag.value === 'Get-Paginated-Intents-Notice'),
50
47
  });
51
48
  }
52
49
  async getIntent(intentId) {
@@ -55,7 +52,6 @@ export class ArNSMarketplaceRead {
55
52
  { name: 'Action', value: 'Get-Intent-By-Id' },
56
53
  { name: 'Intent-Id', value: intentId },
57
54
  ],
58
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Get-Intent-By-Id-Notice'),
59
55
  });
60
56
  }
61
57
  async getIntentByANTId(antId) {
@@ -91,10 +87,7 @@ export class ArNSMarketplaceRead {
91
87
  },
92
88
  ];
93
89
  const filteredTags = tags.filter((tag) => tag.value !== undefined);
94
- return this.process.read({
95
- tags: filteredTags,
96
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Get-Orders-Notice'),
97
- });
90
+ return this.process.read({ tags: filteredTags });
98
91
  }
99
92
  /**
100
93
  * Get a single order by ID
@@ -107,7 +100,6 @@ export class ArNSMarketplaceRead {
107
100
  { name: 'Action', value: 'Get-Order' },
108
101
  { name: 'Order-Id', value: orderId },
109
102
  ],
110
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Get-Order-Notice'),
111
103
  });
112
104
  }
113
105
  async getOrderByANTId(antId) {
@@ -130,8 +122,6 @@ export class ArNSMarketplaceRead {
130
122
  { name: 'Action', value: 'Get-Paginated-Balances' },
131
123
  ...paginationParamsToTags(params),
132
124
  ],
133
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' &&
134
- tag.value === 'Get-Paginated-Balances-Notice'),
135
125
  });
136
126
  }
137
127
  /**
@@ -143,7 +133,6 @@ export class ArNSMarketplaceRead {
143
133
  { name: 'Action', value: 'Get-Balance' },
144
134
  { name: 'Address', value: address },
145
135
  ],
146
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Get-Balance-Notice'),
147
136
  });
148
137
  }
149
138
  async getUserAssets({ address, arioProcessId, }) {
@@ -243,7 +232,6 @@ export class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
243
232
  { name: 'Quantity', value: params.amount },
244
233
  ],
245
234
  signer: this.signer,
246
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Withdraw-Ario-Notice'),
247
235
  });
248
236
  }
249
237
  async createIntent({ antId, orderType, quantity, price, expirationTime, minimumPrice, decreaseInterval, }) {
@@ -261,7 +249,6 @@ export class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
261
249
  return this.process.send({
262
250
  tags: filteredTags,
263
251
  signer: this.signer,
264
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Create-Intent-Notice'),
265
252
  });
266
253
  }
267
254
  async pushANTIntentResolution(intentId) {
@@ -271,8 +258,6 @@ export class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
271
258
  { name: 'X-Intent-Id', value: intentId },
272
259
  ],
273
260
  signer: this.signer,
274
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' &&
275
- tag.value === 'Push-ANT-Intent-Resolution-Notice'),
276
261
  });
277
262
  }
278
263
  async settleAuction(params) {
@@ -286,7 +271,6 @@ export class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
286
271
  return this.process.send({
287
272
  tags: filteredTags,
288
273
  signer: this.signer,
289
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Settle-Auction-Notice'),
290
274
  });
291
275
  }
292
276
  async listNameForSale({ name, expirationTime, price, type, walletAddress, minimumPrice, decreaseInterval, onProgress = (event) => {
@@ -509,7 +493,6 @@ export class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
509
493
  return this.process.send({
510
494
  tags,
511
495
  signer: this.signer,
512
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Cancel-Order-Notice'),
513
496
  });
514
497
  }
515
498
  async createOrder({ swapToken, quantity, orderType, price, expirationTime, minimumPrice, decreaseInterval, transferDenomination, }) {
@@ -529,7 +512,6 @@ export class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
529
512
  return this.process.send({
530
513
  tags: filteredTags,
531
514
  signer: this.signer,
532
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' && tag.value === 'Create-Order-Notice'),
533
515
  });
534
516
  }
535
517
  async buyFixedPriceANT(params) {
@@ -602,8 +584,6 @@ export class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
602
584
  { name: 'Bid-Amount', value: params.bidAmount },
603
585
  ],
604
586
  signer: this.signer,
605
- select: (message) => message.Tags.some((tag) => tag.name === 'Action' &&
606
- tag.value === 'Bid-On-English-Auction-Notice'),
607
587
  });
608
588
  }
609
589
  /**
@@ -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.23.0-alpha.6';
17
+ export const version = '3.23.0';
@@ -10,22 +10,15 @@ export declare class AOProcess implements AOContract {
10
10
  logger?: ILogger;
11
11
  });
12
12
  private isMessageDataEmpty;
13
- read<K>({ tags, retries, fromAddress, select, }: {
13
+ read<K>({ tags, retries, fromAddress, }: {
14
14
  tags?: Array<{
15
15
  name: string;
16
16
  value: string;
17
17
  }>;
18
18
  retries?: number;
19
19
  fromAddress?: string;
20
- select?: (message: {
21
- Data: string;
22
- Tags: Array<{
23
- name: string;
24
- value: string;
25
- }>;
26
- }) => boolean;
27
20
  }): Promise<K>;
28
- send<K>({ tags, data, signer, retries, select, }: {
21
+ send<K>({ tags, data, signer, retries, }: {
29
22
  tags: Array<{
30
23
  name: string;
31
24
  value: string;
@@ -33,13 +26,6 @@ export declare class AOProcess implements AOContract {
33
26
  data?: string | undefined;
34
27
  signer: AoSigner;
35
28
  retries?: number;
36
- select?: (message: {
37
- Data: string;
38
- Tags: Array<{
39
- name: string;
40
- value: string;
41
- }>;
42
- }) => boolean;
43
29
  }): Promise<{
44
30
  id: string;
45
31
  result?: K;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "3.23.0-alpha.6",
3
+ "version": "3.23.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"