@keetanetwork/anchor 0.0.39 → 0.0.41
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/client/index.d.ts +6 -0
- package/client/index.d.ts.map +1 -1
- package/client/index.js +7 -0
- package/client/index.js.map +1 -1
- package/lib/block-listener.d.ts +93 -0
- package/lib/block-listener.d.ts.map +1 -0
- package/lib/block-listener.js +259 -0
- package/lib/block-listener.js.map +1 -0
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +3 -1
- package/lib/error.js.map +1 -1
- package/lib/http-server/index.d.ts +14 -1
- package/lib/http-server/index.d.ts.map +1 -1
- package/lib/http-server/index.js +86 -7
- package/lib/http-server/index.js.map +1 -1
- package/lib/queue/index.d.ts +20 -5
- package/lib/queue/index.d.ts.map +1 -1
- package/lib/queue/index.js +52 -17
- package/lib/queue/index.js.map +1 -1
- package/lib/resolver.d.ts +57 -0
- package/lib/resolver.d.ts.map +1 -1
- package/lib/resolver.js +864 -250
- package/lib/resolver.js.map +1 -1
- package/npm-shrinkwrap.json +4 -4
- package/package.json +1 -1
- package/services/asset-movement/client.d.ts +9 -2
- package/services/asset-movement/client.d.ts.map +1 -1
- package/services/asset-movement/client.js +35 -2
- package/services/asset-movement/client.js.map +1 -1
- package/services/asset-movement/common.d.ts +1 -0
- package/services/asset-movement/common.d.ts.map +1 -1
- package/services/asset-movement/common.js +75 -0
- package/services/asset-movement/common.js.map +1 -1
- package/services/asset-movement/server.d.ts +0 -10
- package/services/asset-movement/server.d.ts.map +1 -1
- package/services/asset-movement/server.js +0 -2
- package/services/asset-movement/server.js.map +1 -1
- package/services/fx/common.d.ts +1 -1
- package/services/fx/common.js.map +1 -1
- package/services/fx/server.d.ts +37 -6
- package/services/fx/server.d.ts.map +1 -1
- package/services/fx/server.js +207 -66
- package/services/fx/server.js.map +1 -1
- package/services/storage/client.d.ts +332 -0
- package/services/storage/client.d.ts.map +1 -0
- package/services/storage/client.js +1078 -0
- package/services/storage/client.js.map +1 -0
- package/services/storage/clients/contacts.d.ts +94 -0
- package/services/storage/clients/contacts.d.ts.map +1 -0
- package/services/storage/clients/contacts.generated.d.ts +3 -0
- package/services/storage/clients/contacts.generated.d.ts.map +1 -0
- package/services/storage/clients/contacts.generated.js +1197 -0
- package/services/storage/clients/contacts.generated.js.map +1 -0
- package/services/storage/clients/contacts.js +141 -0
- package/services/storage/clients/contacts.js.map +1 -0
- package/services/storage/common.d.ts +667 -0
- package/services/storage/common.d.ts.map +1 -0
- package/services/storage/common.generated.d.ts +17 -0
- package/services/storage/common.generated.d.ts.map +1 -0
- package/services/storage/common.generated.js +863 -0
- package/services/storage/common.generated.js.map +1 -0
- package/services/storage/common.js +587 -0
- package/services/storage/common.js.map +1 -0
- package/services/storage/lib/validators.d.ts +64 -0
- package/services/storage/lib/validators.d.ts.map +1 -0
- package/services/storage/lib/validators.js +82 -0
- package/services/storage/lib/validators.js.map +1 -0
- package/services/storage/server.d.ts +127 -0
- package/services/storage/server.d.ts.map +1 -0
- package/services/storage/server.js +626 -0
- package/services/storage/server.js.map +1 -0
- package/services/storage/test-utils.d.ts +70 -0
- package/services/storage/test-utils.d.ts.map +1 -0
- package/services/storage/test-utils.js +347 -0
- package/services/storage/test-utils.js.map +1 -0
- package/services/storage/utils.d.ts +3 -0
- package/services/storage/utils.d.ts.map +1 -0
- package/services/storage/utils.js +10 -0
- package/services/storage/utils.js.map +1 -0
- package/services/username/client.d.ts +145 -0
- package/services/username/client.d.ts.map +1 -0
- package/services/username/client.js +681 -0
- package/services/username/client.js.map +1 -0
- package/services/username/common.d.ts +136 -0
- package/services/username/common.d.ts.map +1 -0
- package/services/username/common.generated.d.ts +13 -0
- package/services/username/common.generated.d.ts.map +1 -0
- package/services/username/common.generated.js +256 -0
- package/services/username/common.generated.js.map +1 -0
- package/services/username/common.js +226 -0
- package/services/username/common.js.map +1 -0
- package/services/username/server.d.ts +49 -0
- package/services/username/server.d.ts.map +1 -0
- package/services/username/server.js +262 -0
- package/services/username/server.js.map +1 -0
package/services/fx/server.js
CHANGED
|
@@ -104,6 +104,64 @@ export function toValidateQuoteInput(input) {
|
|
|
104
104
|
}
|
|
105
105
|
return (ret);
|
|
106
106
|
}
|
|
107
|
+
function encodeKeetaFXAnchorQueueStage1Request(request) {
|
|
108
|
+
let expected;
|
|
109
|
+
if (request.expected === null) {
|
|
110
|
+
expected = null;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
expected = {
|
|
114
|
+
receive: {
|
|
115
|
+
token: request.expected.receive.token.publicKeyString.get(),
|
|
116
|
+
amount: request.expected.receive.amount.toString()
|
|
117
|
+
},
|
|
118
|
+
send: {
|
|
119
|
+
token: request.expected.send.token.publicKeyString.get(),
|
|
120
|
+
amount: request.expected.send.amount.toString()
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
;
|
|
125
|
+
const retval = {
|
|
126
|
+
version: 1,
|
|
127
|
+
account: request.account.publicKeyString.get(),
|
|
128
|
+
block: Buffer.from(request.block.toBytes()).toString('base64'),
|
|
129
|
+
request: request.request,
|
|
130
|
+
expected: expected
|
|
131
|
+
};
|
|
132
|
+
return (retval);
|
|
133
|
+
}
|
|
134
|
+
function decodeKeetaFXAnchorQueueStage1Request(request) {
|
|
135
|
+
/* See note at bottom of file */
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
137
|
+
const reqJSON = assertKeetaFXAnchorQueueStage1RequestJSON(request);
|
|
138
|
+
if (reqJSON.version !== 1) {
|
|
139
|
+
throw (new Error(`Unsupported KeetaFXAnchorQueueStage1Request version ${reqJSON.version}`));
|
|
140
|
+
}
|
|
141
|
+
let expected;
|
|
142
|
+
if (reqJSON.expected === null) {
|
|
143
|
+
expected = null;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
expected = {
|
|
147
|
+
receive: {
|
|
148
|
+
token: KeetaNet.lib.Account.fromPublicKeyString(reqJSON.expected.receive.token).assertKeyType(KeetaNet.lib.Account.AccountKeyAlgorithm.TOKEN),
|
|
149
|
+
amount: BigInt(reqJSON.expected.receive.amount)
|
|
150
|
+
},
|
|
151
|
+
send: {
|
|
152
|
+
token: KeetaNet.lib.Account.fromPublicKeyString(reqJSON.expected.send.token).assertKeyType(KeetaNet.lib.Account.AccountKeyAlgorithm.TOKEN),
|
|
153
|
+
amount: BigInt(reqJSON.expected.send.amount)
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
const retval = {
|
|
158
|
+
account: KeetaNet.lib.Account.fromPublicKeyString(reqJSON.account),
|
|
159
|
+
block: new KeetaNet.lib.Block(reqJSON.block),
|
|
160
|
+
request: reqJSON.request,
|
|
161
|
+
expected: expected
|
|
162
|
+
};
|
|
163
|
+
return (retval);
|
|
164
|
+
}
|
|
107
165
|
class KeetaFXAnchorQueuePipelineStage1 extends KeetaAnchorQueueRunner {
|
|
108
166
|
serverConfig;
|
|
109
167
|
sequential = true;
|
|
@@ -302,65 +360,13 @@ class KeetaFXAnchorQueuePipelineStage1 extends KeetaAnchorQueueRunner {
|
|
|
302
360
|
});
|
|
303
361
|
}
|
|
304
362
|
encodeRequest(request) {
|
|
305
|
-
|
|
306
|
-
if (request.expected === null) {
|
|
307
|
-
expected = null;
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
expected = {
|
|
311
|
-
receive: {
|
|
312
|
-
token: request.expected.receive.token.publicKeyString.get(),
|
|
313
|
-
amount: request.expected.receive.amount.toString()
|
|
314
|
-
},
|
|
315
|
-
send: {
|
|
316
|
-
token: request.expected.send.token.publicKeyString.get(),
|
|
317
|
-
amount: request.expected.send.amount.toString()
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
;
|
|
322
|
-
const retval = {
|
|
323
|
-
version: 1,
|
|
324
|
-
account: request.account.publicKeyString.get(),
|
|
325
|
-
block: Buffer.from(request.block.toBytes()).toString('base64'),
|
|
326
|
-
request: request.request,
|
|
327
|
-
expected: expected
|
|
328
|
-
};
|
|
329
|
-
return (retval);
|
|
363
|
+
return (encodeKeetaFXAnchorQueueStage1Request(request));
|
|
330
364
|
}
|
|
331
365
|
encodeResponse(response) {
|
|
332
366
|
return (response);
|
|
333
367
|
}
|
|
334
368
|
decodeRequest(request) {
|
|
335
|
-
|
|
336
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
337
|
-
const reqJSON = assertKeetaFXAnchorQueueStage1RequestJSON(request);
|
|
338
|
-
if (reqJSON.version !== 1) {
|
|
339
|
-
throw (new Error(`Unsupported KeetaFXAnchorQueueStage1Request version ${reqJSON.version}`));
|
|
340
|
-
}
|
|
341
|
-
let expected;
|
|
342
|
-
if (reqJSON.expected === null) {
|
|
343
|
-
expected = null;
|
|
344
|
-
}
|
|
345
|
-
else {
|
|
346
|
-
expected = {
|
|
347
|
-
receive: {
|
|
348
|
-
token: KeetaNet.lib.Account.fromPublicKeyString(reqJSON.expected.receive.token).assertKeyType(KeetaNet.lib.Account.AccountKeyAlgorithm.TOKEN),
|
|
349
|
-
amount: BigInt(reqJSON.expected.receive.amount)
|
|
350
|
-
},
|
|
351
|
-
send: {
|
|
352
|
-
token: KeetaNet.lib.Account.fromPublicKeyString(reqJSON.expected.send.token).assertKeyType(KeetaNet.lib.Account.AccountKeyAlgorithm.TOKEN),
|
|
353
|
-
amount: BigInt(reqJSON.expected.send.amount)
|
|
354
|
-
}
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
const retval = {
|
|
358
|
-
account: KeetaNet.lib.Account.fromPublicKeyString(reqJSON.account),
|
|
359
|
-
block: new KeetaNet.lib.Block(reqJSON.block),
|
|
360
|
-
request: reqJSON.request,
|
|
361
|
-
expected: expected
|
|
362
|
-
};
|
|
363
|
-
return (retval);
|
|
369
|
+
return (decodeKeetaFXAnchorQueueStage1Request(request));
|
|
364
370
|
}
|
|
365
371
|
decodeResponse(response) {
|
|
366
372
|
/* See note at bottom of file */
|
|
@@ -372,12 +378,88 @@ class KeetaFXAnchorQueuePipeline extends KeetaAnchorQueuePipelineAdvanced {
|
|
|
372
378
|
serverConfig;
|
|
373
379
|
accounts;
|
|
374
380
|
runners = {};
|
|
381
|
+
extensions;
|
|
382
|
+
successStageRunner = null;
|
|
383
|
+
failureStageRunner = null;
|
|
375
384
|
constructor(options) {
|
|
376
385
|
super(options);
|
|
377
386
|
this.serverConfig = options.serverConfig;
|
|
378
387
|
this.accounts = options.accounts;
|
|
388
|
+
this.extensions = options.extensions;
|
|
379
389
|
}
|
|
380
390
|
async createPipeline() {
|
|
391
|
+
const failureExtension = this.extensions?.failure;
|
|
392
|
+
const successExtension = this.extensions?.success;
|
|
393
|
+
if (failureExtension || successExtension) {
|
|
394
|
+
class BaseExtensionClass extends KeetaAnchorQueueRunner {
|
|
395
|
+
#configSet = false;
|
|
396
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
397
|
+
#processorMethod = (() => {
|
|
398
|
+
throw (new Error('config not set'));
|
|
399
|
+
});
|
|
400
|
+
_setConfigurationAndProcessor(config) {
|
|
401
|
+
if (this.#configSet) {
|
|
402
|
+
throw (new Error('Configuration can only be set once'));
|
|
403
|
+
}
|
|
404
|
+
this.#configSet = true;
|
|
405
|
+
if (typeof config === 'function') {
|
|
406
|
+
this.#processorMethod = config;
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
const { processor, ...parameters } = config;
|
|
410
|
+
this.#processorMethod = processor;
|
|
411
|
+
this.setConfiguration(parameters);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
async processor(entry) {
|
|
415
|
+
return (await this.#processorMethod(entry));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
if (failureExtension) {
|
|
419
|
+
const failureQueue = await this.baseQueue.partition('failed');
|
|
420
|
+
this.queues.push(failureQueue);
|
|
421
|
+
const runner = (new class extends BaseExtensionClass {
|
|
422
|
+
encodeRequest(request) { return (encodeKeetaFXAnchorQueueStage1Request(request)); }
|
|
423
|
+
decodeRequest(request) { return (decodeKeetaFXAnchorQueueStage1Request(request)); }
|
|
424
|
+
encodeResponse(response) { return (response); }
|
|
425
|
+
decodeResponse(response) { return (response); }
|
|
426
|
+
}({
|
|
427
|
+
id: 'keeta-fx-anchor-failure-runner',
|
|
428
|
+
queue: failureQueue,
|
|
429
|
+
logger: this.logger
|
|
430
|
+
}));
|
|
431
|
+
runner._setConfigurationAndProcessor(failureExtension);
|
|
432
|
+
this.failureStageRunner = runner;
|
|
433
|
+
}
|
|
434
|
+
if (successExtension) {
|
|
435
|
+
const successQueue = await this.baseQueue.partition('success');
|
|
436
|
+
this.queues.push(successQueue);
|
|
437
|
+
const runner = (new class extends BaseExtensionClass {
|
|
438
|
+
encodeRequest(request) { return (request); }
|
|
439
|
+
decodeRequest(request) {
|
|
440
|
+
/* See note at bottom of file */
|
|
441
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
442
|
+
const parsed = assertKeetaFXAnchorQueueStage1ResponseOrNull(request);
|
|
443
|
+
if (parsed === null) {
|
|
444
|
+
throw (new Error('Invalid request for success extension'));
|
|
445
|
+
}
|
|
446
|
+
return (parsed);
|
|
447
|
+
}
|
|
448
|
+
encodeResponse(response) { return (response); }
|
|
449
|
+
decodeResponse(response) {
|
|
450
|
+
/* See note at bottom of file */
|
|
451
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
452
|
+
return (assertKeetaFXAnchorQueueStage1ResponseOrNull(response));
|
|
453
|
+
}
|
|
454
|
+
}({
|
|
455
|
+
id: 'keeta-fx-anchor-success-runner',
|
|
456
|
+
queue: successQueue,
|
|
457
|
+
logger: this.logger
|
|
458
|
+
}));
|
|
459
|
+
runner._setConfigurationAndProcessor(successExtension);
|
|
460
|
+
this.successStageRunner = runner;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
381
463
|
for (const account of this.accounts) {
|
|
382
464
|
const queue = await this.baseQueue.partition(account.publicKeyAndTypeString);
|
|
383
465
|
this.queues.push(queue);
|
|
@@ -387,6 +469,12 @@ class KeetaFXAnchorQueuePipeline extends KeetaAnchorQueuePipelineAdvanced {
|
|
|
387
469
|
logger: this.logger,
|
|
388
470
|
serverConfig: this.serverConfig
|
|
389
471
|
});
|
|
472
|
+
if (this.successStageRunner) {
|
|
473
|
+
runner.pipe(this.successStageRunner, { exclusiveTarget: false });
|
|
474
|
+
}
|
|
475
|
+
if (this.failureStageRunner) {
|
|
476
|
+
runner.pipeFailed(this.failureStageRunner, { exclusiveTarget: false });
|
|
477
|
+
}
|
|
390
478
|
this.runners[account.publicKeyAndTypeString] = runner;
|
|
391
479
|
}
|
|
392
480
|
}
|
|
@@ -402,6 +490,14 @@ class KeetaFXAnchorQueuePipeline extends KeetaAnchorQueuePipelineAdvanced {
|
|
|
402
490
|
}
|
|
403
491
|
return (await runner.add(request));
|
|
404
492
|
}
|
|
493
|
+
/**
|
|
494
|
+
* Get the status of a request by ID.
|
|
495
|
+
* If the request is found in any of the runners, it is returned with its current status.
|
|
496
|
+
* Because typically the user will only care about the status of the first stage-
|
|
497
|
+
* The request will be marked as failed or completed if it is found in the success or failure stages, instead of the status from those stages.
|
|
498
|
+
* @param id The ID of the request to get the status of
|
|
499
|
+
* @returns The inferred status of the request, or null if the request is not found
|
|
500
|
+
*/
|
|
405
501
|
async get(id) {
|
|
406
502
|
await super.init();
|
|
407
503
|
for (const account of this.accounts) {
|
|
@@ -411,19 +507,65 @@ class KeetaFXAnchorQueuePipeline extends KeetaAnchorQueuePipelineAdvanced {
|
|
|
411
507
|
}
|
|
412
508
|
const entry = await runner.get(id);
|
|
413
509
|
if (entry !== null) {
|
|
510
|
+
if (entry.status === 'moved') {
|
|
511
|
+
let failedFound = null;
|
|
512
|
+
let successFound = null;
|
|
513
|
+
if (this.failureStageRunner || this.successStageRunner) {
|
|
514
|
+
await Promise.all([
|
|
515
|
+
(async () => {
|
|
516
|
+
if (!this.failureStageRunner) {
|
|
517
|
+
return (null);
|
|
518
|
+
}
|
|
519
|
+
failedFound = await this.failureStageRunner.get(id);
|
|
520
|
+
})(),
|
|
521
|
+
(async () => {
|
|
522
|
+
if (!this.successStageRunner) {
|
|
523
|
+
return (null);
|
|
524
|
+
}
|
|
525
|
+
successFound = await this.successStageRunner.get(id);
|
|
526
|
+
})()
|
|
527
|
+
]);
|
|
528
|
+
}
|
|
529
|
+
if (failedFound && successFound) {
|
|
530
|
+
this.logger?.warn(`Request with ID ${String(id)} was found in both the success and failure stages -- this should not happen`, { requestID: id });
|
|
531
|
+
}
|
|
532
|
+
else if (failedFound) {
|
|
533
|
+
entry.status = 'failed_permanently';
|
|
534
|
+
}
|
|
535
|
+
else if (successFound) {
|
|
536
|
+
entry.status = 'completed';
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
this.logger?.warn(`Request with ID ${String(id)} has moved from the main processing stage but was not found in either the success or failure stages -- leaving status as "moved"`, { requestID: id });
|
|
540
|
+
}
|
|
541
|
+
}
|
|
414
542
|
return (entry);
|
|
415
543
|
}
|
|
416
544
|
}
|
|
417
545
|
return (null);
|
|
418
546
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
let retval = false;
|
|
547
|
+
#getAllRunners() {
|
|
548
|
+
const runners = [];
|
|
422
549
|
for (const account of this.accounts) {
|
|
423
550
|
const runner = this.runners[account.publicKeyAndTypeString];
|
|
424
551
|
if (runner === undefined) {
|
|
425
552
|
continue;
|
|
426
553
|
}
|
|
554
|
+
runners.push(runner);
|
|
555
|
+
}
|
|
556
|
+
if (this.successStageRunner) {
|
|
557
|
+
runners.push(this.successStageRunner);
|
|
558
|
+
}
|
|
559
|
+
if (this.failureStageRunner) {
|
|
560
|
+
runners.push(this.failureStageRunner);
|
|
561
|
+
}
|
|
562
|
+
return (runners);
|
|
563
|
+
}
|
|
564
|
+
async run(options) {
|
|
565
|
+
await super.init();
|
|
566
|
+
const runners = this.#getAllRunners();
|
|
567
|
+
let retval = false;
|
|
568
|
+
for (const runner of runners) {
|
|
427
569
|
const more = await runner.run(options);
|
|
428
570
|
if (more) {
|
|
429
571
|
retval = true;
|
|
@@ -433,11 +575,8 @@ class KeetaFXAnchorQueuePipeline extends KeetaAnchorQueuePipelineAdvanced {
|
|
|
433
575
|
}
|
|
434
576
|
async maintain() {
|
|
435
577
|
await super.init();
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
if (runner === undefined) {
|
|
439
|
-
continue;
|
|
440
|
-
}
|
|
578
|
+
const runners = this.#getAllRunners();
|
|
579
|
+
for (const runner of runners) {
|
|
441
580
|
await runner.maintain();
|
|
442
581
|
}
|
|
443
582
|
}
|
|
@@ -448,7 +587,8 @@ class KeetaFXAnchorQueuePipeline extends KeetaAnchorQueuePipelineAdvanced {
|
|
|
448
587
|
}
|
|
449
588
|
this.destroyed = true;
|
|
450
589
|
await super.destroy();
|
|
451
|
-
|
|
590
|
+
const runners = this.#getAllRunners();
|
|
591
|
+
for (const runner of runners) {
|
|
452
592
|
try {
|
|
453
593
|
await runner.destroy();
|
|
454
594
|
}
|
|
@@ -527,7 +667,8 @@ export class KeetaNetFXAnchorHTTPServer extends KeetaAnchorHTTPServer.KeetaNetAn
|
|
|
527
667
|
}),
|
|
528
668
|
accounts: this.accounts,
|
|
529
669
|
logger: this.logger,
|
|
530
|
-
serverConfig: this
|
|
670
|
+
serverConfig: this,
|
|
671
|
+
extensions: config.queueRunnerExtensions
|
|
531
672
|
});
|
|
532
673
|
}
|
|
533
674
|
async initRoutes(config) {
|
|
@@ -591,10 +732,10 @@ export class KeetaNetFXAnchorHTTPServer extends KeetaAnchorHTTPServer.KeetaNetAn
|
|
|
591
732
|
instance.logger.warn('POST /api/getEstimate', 'FX configuration indicates quotes are not required, but "convertedAmountBound" was not provided in the rate and fee response');
|
|
592
733
|
}
|
|
593
734
|
else {
|
|
594
|
-
if (conversion.affinity === 'to' && (BigInt(
|
|
735
|
+
if (conversion.affinity === 'to' && (BigInt(rateAndFee.convertedAmount) > rateAndFee.convertedAmountBound)) {
|
|
595
736
|
throw (new KeetaAnchorError('Affinity is to, but bound is less than estimated sent amount'));
|
|
596
737
|
}
|
|
597
|
-
if (conversion.affinity === 'from' && (BigInt(
|
|
738
|
+
if (conversion.affinity === 'from' && (BigInt(rateAndFee.convertedAmount) < rateAndFee.convertedAmountBound)) {
|
|
598
739
|
throw (new KeetaAnchorError('Affinity is from, but bound is greater than estimated received amount'));
|
|
599
740
|
}
|
|
600
741
|
}
|