@keetanetwork/anchor 0.0.36 → 0.0.38
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/lib/queue/common.d.ts.map +1 -1
- package/lib/queue/common.js +1 -0
- package/lib/queue/common.js.map +1 -1
- package/lib/queue/index.d.ts +1 -0
- package/lib/queue/index.d.ts.map +1 -1
- package/lib/queue/index.js +25 -3
- package/lib/queue/index.js.map +1 -1
- package/lib/utils/types.d.ts +14 -2
- package/lib/utils/types.d.ts.map +1 -1
- package/lib/utils/types.js.map +1 -1
- package/npm-shrinkwrap.json +5 -5
- package/package.json +2 -2
- package/services/asset-movement/common.d.ts +145 -2
- package/services/asset-movement/common.d.ts.map +1 -1
- package/services/asset-movement/common.js +10 -10
- package/services/asset-movement/common.js.map +1 -1
- package/services/fx/client.d.ts +23 -8
- package/services/fx/client.d.ts.map +1 -1
- package/services/fx/client.js +169 -42
- package/services/fx/client.js.map +1 -1
- package/services/fx/common.d.ts +55 -6
- package/services/fx/common.d.ts.map +1 -1
- package/services/fx/common.js +142 -16
- package/services/fx/common.js.map +1 -1
- package/services/fx/server.d.ts +31 -6
- package/services/fx/server.d.ts.map +1 -1
- package/services/fx/server.js +229 -61
- package/services/fx/server.js.map +1 -1
- package/services/fx/util.d.ts +13 -0
- package/services/fx/util.d.ts.map +1 -0
- package/services/fx/util.js +44 -0
- package/services/fx/util.js.map +1 -0
package/services/fx/common.d.ts
CHANGED
|
@@ -34,9 +34,21 @@ export type ConversionInputCanonical = {
|
|
|
34
34
|
};
|
|
35
35
|
export type ConversionInputCanonicalJSON = ToJSONSerializable<ConversionInputCanonical>;
|
|
36
36
|
export type KeetaFXAnchorClientCreateExchangeRequest = {
|
|
37
|
-
quote: KeetaFXAnchorQuote;
|
|
38
37
|
block: InstanceType<typeof KeetaNetLib.Block>;
|
|
39
|
-
}
|
|
38
|
+
} & ({
|
|
39
|
+
quote: KeetaFXAnchorQuote;
|
|
40
|
+
} | {
|
|
41
|
+
request: ConversionInputCanonical;
|
|
42
|
+
});
|
|
43
|
+
export type KeetaFXAnchorClientCreateExchangeRequestJSON = {
|
|
44
|
+
block: string;
|
|
45
|
+
} & ({
|
|
46
|
+
quote: KeetaFXAnchorQuoteJSON;
|
|
47
|
+
request?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
quote?: undefined;
|
|
50
|
+
request: ConversionInputCanonicalJSON;
|
|
51
|
+
});
|
|
40
52
|
export type KeetaFXAnchorEstimate = {
|
|
41
53
|
/**
|
|
42
54
|
* Conversion request that was provided
|
|
@@ -46,6 +58,11 @@ export type KeetaFXAnchorEstimate = {
|
|
|
46
58
|
* Amount after the conversion as specified by either `from` or `to`, as specified by the `affinity` property in the request.
|
|
47
59
|
*/
|
|
48
60
|
convertedAmount: bigint;
|
|
61
|
+
/**
|
|
62
|
+
* Outer bound of the converted amount.
|
|
63
|
+
* if affinity is 'from', this is the maximum amount the user would need to send, if its to, this is the minimum amount the user would receive.
|
|
64
|
+
*/
|
|
65
|
+
convertedAmountBound?: bigint;
|
|
49
66
|
/**
|
|
50
67
|
* The expected cost of the fx request, in the form of a
|
|
51
68
|
* token and a range of minimum and maximum expected costs
|
|
@@ -55,7 +72,21 @@ export type KeetaFXAnchorEstimate = {
|
|
|
55
72
|
max: bigint;
|
|
56
73
|
token: KeetaNetToken;
|
|
57
74
|
};
|
|
58
|
-
}
|
|
75
|
+
} & ({
|
|
76
|
+
/**
|
|
77
|
+
* Indicates that a quote is required before proceeding with the exchange
|
|
78
|
+
*/
|
|
79
|
+
requiresQuote: false;
|
|
80
|
+
/**
|
|
81
|
+
* Liquidity provider account if the user is not going to request a quote before the exchange
|
|
82
|
+
*/
|
|
83
|
+
account: KeetaNetAccount | KeetaNetStorageAccount;
|
|
84
|
+
} | {
|
|
85
|
+
/**
|
|
86
|
+
* Indicates that a quote is required before proceeding with the exchange, defaults to true
|
|
87
|
+
*/
|
|
88
|
+
requiresQuote?: true;
|
|
89
|
+
});
|
|
59
90
|
export type KeetaFXAnchorEstimateResponse = ({
|
|
60
91
|
ok: true;
|
|
61
92
|
estimate: ToJSONSerializable<KeetaFXAnchorEstimate>;
|
|
@@ -121,9 +152,9 @@ export type KeetaFXAnchorExchange = {
|
|
|
121
152
|
*/
|
|
122
153
|
blockhash: string;
|
|
123
154
|
});
|
|
124
|
-
export type KeetaFXAnchorExchangeResponse = KeetaFXAnchorExchange &
|
|
155
|
+
export type KeetaFXAnchorExchangeResponse = (KeetaFXAnchorExchange & {
|
|
125
156
|
ok: true;
|
|
126
|
-
} | {
|
|
157
|
+
}) | (Partial<KeetaFXAnchorExchange> & {
|
|
127
158
|
ok: false;
|
|
128
159
|
error: string;
|
|
129
160
|
});
|
|
@@ -132,7 +163,7 @@ export declare const isKeetaFXAnchorQuoteResponse: (input: unknown) => input is
|
|
|
132
163
|
export declare const isKeetaFXAnchorExchangeResponse: (input: unknown) => input is KeetaFXAnchorExchangeResponse;
|
|
133
164
|
export declare const assertKeetaNetTokenPublicKeyString: (input: unknown) => KeetaNetTokenPublicKeyString;
|
|
134
165
|
export declare const assertConversionInputCanonicalJSON: (input: unknown) => ConversionInputCanonicalJSON;
|
|
135
|
-
export declare const
|
|
166
|
+
export declare const assertKeetaFXAnchorClientCreateExchangeRequestJSON: (input: unknown) => KeetaFXAnchorClientCreateExchangeRequestJSON;
|
|
136
167
|
declare class KeetaFXAnchorQuoteValidationFailedError extends KeetaAnchorUserError {
|
|
137
168
|
static readonly name: string;
|
|
138
169
|
private readonly KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID;
|
|
@@ -141,8 +172,26 @@ declare class KeetaFXAnchorQuoteValidationFailedError extends KeetaAnchorUserErr
|
|
|
141
172
|
static isInstance(input: unknown): input is KeetaFXAnchorQuoteValidationFailedError;
|
|
142
173
|
static fromJSON(input: unknown): Promise<InstanceType<typeof this>>;
|
|
143
174
|
}
|
|
175
|
+
declare class KeetaFXAnchorQuoteRequiredError extends KeetaAnchorUserError {
|
|
176
|
+
static readonly name: string;
|
|
177
|
+
private readonly KeetaFXAnchorQuoteRequiredErrorObjectTypeID;
|
|
178
|
+
private static readonly KeetaFXAnchorQuoteRequiredErrorObjectTypeID;
|
|
179
|
+
constructor(message?: string);
|
|
180
|
+
static isInstance(input: unknown): input is KeetaFXAnchorQuoteRequiredError;
|
|
181
|
+
static fromJSON(input: unknown): Promise<InstanceType<typeof this>>;
|
|
182
|
+
}
|
|
183
|
+
declare class KeetaFXAnchorQuoteIssuanceDisabledError extends KeetaAnchorUserError {
|
|
184
|
+
static readonly name: string;
|
|
185
|
+
private readonly KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID;
|
|
186
|
+
private static readonly KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID;
|
|
187
|
+
constructor(message?: string);
|
|
188
|
+
static isInstance(input: unknown): input is KeetaFXAnchorQuoteIssuanceDisabledError;
|
|
189
|
+
static fromJSON(input: unknown): Promise<InstanceType<typeof this>>;
|
|
190
|
+
}
|
|
144
191
|
export declare const Errors: {
|
|
145
192
|
QuoteValidationFailed: typeof KeetaFXAnchorQuoteValidationFailedError;
|
|
193
|
+
QuoteRequired: typeof KeetaFXAnchorQuoteRequiredError;
|
|
194
|
+
QuoteIssuanceDisabled: typeof KeetaFXAnchorQuoteIssuanceDisabledError;
|
|
146
195
|
};
|
|
147
196
|
export {};
|
|
148
197
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/services/fx/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,IAAI,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/services/fx/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC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zE,gBAAyB,IAAI,EAAE,MAAM,CAA6C;IAClF,OAAO,CAAC,QAAQ,CAAC,mDAAmD,CAAU;IAC9E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mDAAmD,CAA0C;gBAEzG,OAAO,CAAC,EAAE,MAAM;IAU5B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,uCAAuC;WAItE,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;CAMzE;AAED,eAAO,MAAM,MAAM,EAAE;IACpB,qBAAqB,EAAE,OAAO,uCAAuC,CAAC;IACtE,aAAa,EAAE,OAAO,+BAA+B,CAAC;IACtD,qBAAqB,EAAE,OAAO,uCAAuC,CAAC;CAgBtE,CAAC"}
|
package/services/fx/common.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard.js";
|
|
2
2
|
import { createAssert, createIs } from 'typia';
|
|
3
3
|
import { KeetaAnchorUserError } from '../../lib/error.js';
|
|
4
|
-
export const isKeetaFXAnchorEstimateResponse = (() => { const _io0 = input => true === input.ok && ("object" === typeof input.estimate && null !== input.estimate &&
|
|
4
|
+
export const isKeetaFXAnchorEstimateResponse = (() => { const _io0 = input => true === input.ok && ("object" === typeof input.estimate && null !== input.estimate && _iu0(input.estimate)); const _io1 = input => "object" === typeof input.request && null !== input.request && _io2(input.request) && "string" === typeof input.convertedAmount && (undefined === input.convertedAmountBound || "string" === typeof input.convertedAmountBound) && ("object" === typeof input.expectedCost && null !== input.expectedCost && _io3(input.expectedCost)) && false === input.requiresQuote && ("string" === typeof input.account && (RegExp(/^keeta_am(.*)/).test(input.account) || RegExp(/^keeta_an(.*)/).test(input.account) || RegExp(/^keeta_ao(.*)/).test(input.account) || RegExp(/^keeta_ap(.*)/).test(input.account) || RegExp(/^tyblocks_am(.*)/).test(input.account) || RegExp(/^tyblocks_an(.*)/).test(input.account) || RegExp(/^tyblocks_ao(.*)/).test(input.account) || RegExp(/^tyblocks_ap(.*)/).test(input.account) || RegExp(/^keeta_aa(.*)/).test(input.account) || RegExp(/^keeta_ab(.*)/).test(input.account) || RegExp(/^keeta_ac(.*)/).test(input.account) || RegExp(/^keeta_ad(.*)/).test(input.account) || RegExp(/^tyblocks_aa(.*)/).test(input.account) || RegExp(/^tyblocks_ab(.*)/).test(input.account) || RegExp(/^tyblocks_ac(.*)/).test(input.account) || RegExp(/^tyblocks_ad(.*)/).test(input.account) || RegExp(/^keeta_ae(.*)/).test(input.account) || RegExp(/^keeta_af(.*)/).test(input.account) || RegExp(/^keeta_ag(.*)/).test(input.account) || RegExp(/^keeta_ah(.*)/).test(input.account) || RegExp(/^tyblocks_ae(.*)/).test(input.account) || RegExp(/^tyblocks_af(.*)/).test(input.account) || RegExp(/^tyblocks_ag(.*)/).test(input.account) || RegExp(/^tyblocks_ah(.*)/).test(input.account) || RegExp(/^keeta_ai(.*)/).test(input.account) || RegExp(/^keeta_aj(.*)/).test(input.account) || RegExp(/^keeta_ak(.*)/).test(input.account) || RegExp(/^keeta_al(.*)/).test(input.account) || RegExp(/^tyblocks_ai(.*)/).test(input.account) || RegExp(/^tyblocks_aj(.*)/).test(input.account) || RegExp(/^tyblocks_ak(.*)/).test(input.account) || RegExp(/^tyblocks_al(.*)/).test(input.account) || RegExp(/^keeta_at(.*)/).test(input.account) || RegExp(/^keeta_aq(.*)/).test(input.account) || RegExp(/^keeta_ar(.*)/).test(input.account) || RegExp(/^keeta_as(.*)/).test(input.account) || RegExp(/^tyblocks_at(.*)/).test(input.account) || RegExp(/^tyblocks_aq(.*)/).test(input.account) || RegExp(/^tyblocks_ar(.*)/).test(input.account) || RegExp(/^tyblocks_as(.*)/).test(input.account) || RegExp(/^keeta_ay(.*)/).test(input.account) || RegExp(/^keeta_az(.*)/).test(input.account) || RegExp(/^keeta_a2(.*)/).test(input.account) || RegExp(/^keeta_a3(.*)/).test(input.account) || RegExp(/^tyblocks_ay(.*)/).test(input.account) || RegExp(/^tyblocks_az(.*)/).test(input.account) || RegExp(/^tyblocks_a2(.*)/).test(input.account) || RegExp(/^tyblocks_a3(.*)/).test(input.account) || RegExp(/^keeta_a4(.*)/).test(input.account) || RegExp(/^keeta_a5(.*)/).test(input.account) || RegExp(/^keeta_a6(.*)/).test(input.account) || RegExp(/^keeta_a7(.*)/).test(input.account) || RegExp(/^tyblocks_a4(.*)/).test(input.account) || RegExp(/^tyblocks_a5(.*)/).test(input.account) || RegExp(/^tyblocks_a6(.*)/).test(input.account) || RegExp(/^tyblocks_a7(.*)/).test(input.account))); const _io2 = input => "string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to))) && "string" === typeof input.amount && ("from" === input.affinity || "to" === input.affinity); const _io3 = input => "string" === typeof input.min && "string" === typeof input.max && ("string" === typeof input.token && (RegExp(/^keeta_am(.*)/).test(input.token) || RegExp(/^keeta_an(.*)/).test(input.token) || RegExp(/^keeta_ao(.*)/).test(input.token) || RegExp(/^keeta_ap(.*)/).test(input.token) || RegExp(/^tyblocks_am(.*)/).test(input.token) || RegExp(/^tyblocks_an(.*)/).test(input.token) || RegExp(/^tyblocks_ao(.*)/).test(input.token) || RegExp(/^tyblocks_ap(.*)/).test(input.token))); const _io4 = input => "object" === typeof input.request && null !== input.request && _io2(input.request) && "string" === typeof input.convertedAmount && (undefined === input.convertedAmountBound || "string" === typeof input.convertedAmountBound) && ("object" === typeof input.expectedCost && null !== input.expectedCost && _io3(input.expectedCost)) && (undefined === input.requiresQuote || true === input.requiresQuote); const _io5 = input => false === input.ok && "string" === typeof input.error; const _iu0 = input => (() => {
|
|
5
|
+
if (false === input.requiresQuote)
|
|
6
|
+
return _io1(input);
|
|
7
|
+
else
|
|
8
|
+
return _io4(input);
|
|
9
|
+
})(); const _iu1 = input => (() => {
|
|
5
10
|
if (true === input.ok)
|
|
6
11
|
return _io0(input);
|
|
7
12
|
else if (false === input.ok)
|
|
8
|
-
return
|
|
13
|
+
return _io5(input);
|
|
9
14
|
else
|
|
10
15
|
return false;
|
|
11
|
-
})(); return input => "object" === typeof input && null !== input &&
|
|
16
|
+
})(); return input => "object" === typeof input && null !== input && _iu1(input); })();
|
|
12
17
|
export const isKeetaFXAnchorQuoteResponse = (() => { const _io0 = input => true === input.ok && ("object" === typeof input.quote && null !== input.quote && _io1(input.quote)); const _io1 = input => "object" === typeof input.request && null !== input.request && _io2(input.request) && ("string" === typeof input.account && (RegExp(/^keeta_am(.*)/).test(input.account) || RegExp(/^keeta_an(.*)/).test(input.account) || RegExp(/^keeta_ao(.*)/).test(input.account) || RegExp(/^keeta_ap(.*)/).test(input.account) || RegExp(/^tyblocks_am(.*)/).test(input.account) || RegExp(/^tyblocks_an(.*)/).test(input.account) || RegExp(/^tyblocks_ao(.*)/).test(input.account) || RegExp(/^tyblocks_ap(.*)/).test(input.account) || RegExp(/^keeta_aa(.*)/).test(input.account) || RegExp(/^keeta_ab(.*)/).test(input.account) || RegExp(/^keeta_ac(.*)/).test(input.account) || RegExp(/^keeta_ad(.*)/).test(input.account) || RegExp(/^tyblocks_aa(.*)/).test(input.account) || RegExp(/^tyblocks_ab(.*)/).test(input.account) || RegExp(/^tyblocks_ac(.*)/).test(input.account) || RegExp(/^tyblocks_ad(.*)/).test(input.account) || RegExp(/^keeta_ae(.*)/).test(input.account) || RegExp(/^keeta_af(.*)/).test(input.account) || RegExp(/^keeta_ag(.*)/).test(input.account) || RegExp(/^keeta_ah(.*)/).test(input.account) || RegExp(/^tyblocks_ae(.*)/).test(input.account) || RegExp(/^tyblocks_af(.*)/).test(input.account) || RegExp(/^tyblocks_ag(.*)/).test(input.account) || RegExp(/^tyblocks_ah(.*)/).test(input.account) || RegExp(/^keeta_ai(.*)/).test(input.account) || RegExp(/^keeta_aj(.*)/).test(input.account) || RegExp(/^keeta_ak(.*)/).test(input.account) || RegExp(/^keeta_al(.*)/).test(input.account) || RegExp(/^tyblocks_ai(.*)/).test(input.account) || RegExp(/^tyblocks_aj(.*)/).test(input.account) || RegExp(/^tyblocks_ak(.*)/).test(input.account) || RegExp(/^tyblocks_al(.*)/).test(input.account) || RegExp(/^keeta_at(.*)/).test(input.account) || RegExp(/^keeta_aq(.*)/).test(input.account) || RegExp(/^keeta_ar(.*)/).test(input.account) || RegExp(/^keeta_as(.*)/).test(input.account) || RegExp(/^tyblocks_at(.*)/).test(input.account) || RegExp(/^tyblocks_aq(.*)/).test(input.account) || RegExp(/^tyblocks_ar(.*)/).test(input.account) || RegExp(/^tyblocks_as(.*)/).test(input.account) || RegExp(/^keeta_ay(.*)/).test(input.account) || RegExp(/^keeta_az(.*)/).test(input.account) || RegExp(/^keeta_a2(.*)/).test(input.account) || RegExp(/^keeta_a3(.*)/).test(input.account) || RegExp(/^tyblocks_ay(.*)/).test(input.account) || RegExp(/^tyblocks_az(.*)/).test(input.account) || RegExp(/^tyblocks_a2(.*)/).test(input.account) || RegExp(/^tyblocks_a3(.*)/).test(input.account) || RegExp(/^keeta_a4(.*)/).test(input.account) || RegExp(/^keeta_a5(.*)/).test(input.account) || RegExp(/^keeta_a6(.*)/).test(input.account) || RegExp(/^keeta_a7(.*)/).test(input.account) || RegExp(/^tyblocks_a4(.*)/).test(input.account) || RegExp(/^tyblocks_a5(.*)/).test(input.account) || RegExp(/^tyblocks_a6(.*)/).test(input.account) || RegExp(/^tyblocks_a7(.*)/).test(input.account))) && "string" === typeof input.convertedAmount && ("object" === typeof input.cost && null !== input.cost && _io3(input.cost)) && ("object" === typeof input.signed && null !== input.signed && _io4(input.signed)); const _io2 = input => "string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to))) && "string" === typeof input.amount && ("from" === input.affinity || "to" === input.affinity); const _io3 = input => "string" === typeof input.amount && ("string" === typeof input.token && (RegExp(/^keeta_am(.*)/).test(input.token) || RegExp(/^keeta_an(.*)/).test(input.token) || RegExp(/^keeta_ao(.*)/).test(input.token) || RegExp(/^keeta_ap(.*)/).test(input.token) || RegExp(/^tyblocks_am(.*)/).test(input.token) || RegExp(/^tyblocks_an(.*)/).test(input.token) || RegExp(/^tyblocks_ao(.*)/).test(input.token) || RegExp(/^tyblocks_ap(.*)/).test(input.token))); const _io4 = input => "string" === typeof input.nonce && "string" === typeof input.timestamp && "string" === typeof input.signature; const _io5 = input => false === input.ok && "string" === typeof input.error; const _iu0 = input => (() => {
|
|
13
18
|
if (true === input.ok)
|
|
14
19
|
return _io0(input);
|
|
@@ -17,7 +22,7 @@ export const isKeetaFXAnchorQuoteResponse = (() => { const _io0 = input => true
|
|
|
17
22
|
else
|
|
18
23
|
return false;
|
|
19
24
|
})(); return input => "object" === typeof input && null !== input && _iu0(input); })();
|
|
20
|
-
export const isKeetaFXAnchorExchangeResponse = (() => { const _io0 = input => "string" === typeof input.exchangeID && ("pending" === input.status || "failed" === input.status) && true === input.ok; const _io1 = input => "string" === typeof input.exchangeID &&
|
|
25
|
+
export const isKeetaFXAnchorExchangeResponse = (() => { const _io0 = input => "string" === typeof input.exchangeID && ("pending" === input.status || "failed" === input.status) && true === input.ok; const _io1 = input => "string" === typeof input.exchangeID && "completed" === input.status && "string" === typeof input.blockhash && true === input.ok; const _io2 = input => (undefined === input.exchangeID || "string" === typeof input.exchangeID) && (undefined === input.status || "pending" === input.status || "failed" === input.status) && false === input.ok && "string" === typeof input.error; const _io3 = input => (undefined === input.exchangeID || "string" === typeof input.exchangeID) && (undefined === input.status || "completed" === input.status) && (undefined === input.blockhash || "string" === typeof input.blockhash) && false === input.ok && "string" === typeof input.error; const _iu0 = input => (() => {
|
|
21
26
|
if (_io0(input))
|
|
22
27
|
return _io0(input);
|
|
23
28
|
if (_io1(input))
|
|
@@ -77,12 +82,44 @@ export const assertConversionInputCanonicalJSON = (() => { const _io0 = input =>
|
|
|
77
82
|
}
|
|
78
83
|
return input;
|
|
79
84
|
}; })();
|
|
80
|
-
export const
|
|
85
|
+
export const assertKeetaFXAnchorClientCreateExchangeRequestJSON = (() => { const _io0 = input => "string" === typeof input.block && ("object" === typeof input.quote && null !== input.quote && _io1(input.quote)) && (null !== input.request && undefined === input.request); const _io1 = input => "object" === typeof input.request && null !== input.request && _io2(input.request) && ("string" === typeof input.account && (RegExp(/^keeta_am(.*)/).test(input.account) || RegExp(/^keeta_an(.*)/).test(input.account) || RegExp(/^keeta_ao(.*)/).test(input.account) || RegExp(/^keeta_ap(.*)/).test(input.account) || RegExp(/^tyblocks_am(.*)/).test(input.account) || RegExp(/^tyblocks_an(.*)/).test(input.account) || RegExp(/^tyblocks_ao(.*)/).test(input.account) || RegExp(/^tyblocks_ap(.*)/).test(input.account) || RegExp(/^keeta_aa(.*)/).test(input.account) || RegExp(/^keeta_ab(.*)/).test(input.account) || RegExp(/^keeta_ac(.*)/).test(input.account) || RegExp(/^keeta_ad(.*)/).test(input.account) || RegExp(/^tyblocks_aa(.*)/).test(input.account) || RegExp(/^tyblocks_ab(.*)/).test(input.account) || RegExp(/^tyblocks_ac(.*)/).test(input.account) || RegExp(/^tyblocks_ad(.*)/).test(input.account) || RegExp(/^keeta_ae(.*)/).test(input.account) || RegExp(/^keeta_af(.*)/).test(input.account) || RegExp(/^keeta_ag(.*)/).test(input.account) || RegExp(/^keeta_ah(.*)/).test(input.account) || RegExp(/^tyblocks_ae(.*)/).test(input.account) || RegExp(/^tyblocks_af(.*)/).test(input.account) || RegExp(/^tyblocks_ag(.*)/).test(input.account) || RegExp(/^tyblocks_ah(.*)/).test(input.account) || RegExp(/^keeta_ai(.*)/).test(input.account) || RegExp(/^keeta_aj(.*)/).test(input.account) || RegExp(/^keeta_ak(.*)/).test(input.account) || RegExp(/^keeta_al(.*)/).test(input.account) || RegExp(/^tyblocks_ai(.*)/).test(input.account) || RegExp(/^tyblocks_aj(.*)/).test(input.account) || RegExp(/^tyblocks_ak(.*)/).test(input.account) || RegExp(/^tyblocks_al(.*)/).test(input.account) || RegExp(/^keeta_at(.*)/).test(input.account) || RegExp(/^keeta_aq(.*)/).test(input.account) || RegExp(/^keeta_ar(.*)/).test(input.account) || RegExp(/^keeta_as(.*)/).test(input.account) || RegExp(/^tyblocks_at(.*)/).test(input.account) || RegExp(/^tyblocks_aq(.*)/).test(input.account) || RegExp(/^tyblocks_ar(.*)/).test(input.account) || RegExp(/^tyblocks_as(.*)/).test(input.account) || RegExp(/^keeta_ay(.*)/).test(input.account) || RegExp(/^keeta_az(.*)/).test(input.account) || RegExp(/^keeta_a2(.*)/).test(input.account) || RegExp(/^keeta_a3(.*)/).test(input.account) || RegExp(/^tyblocks_ay(.*)/).test(input.account) || RegExp(/^tyblocks_az(.*)/).test(input.account) || RegExp(/^tyblocks_a2(.*)/).test(input.account) || RegExp(/^tyblocks_a3(.*)/).test(input.account) || RegExp(/^keeta_a4(.*)/).test(input.account) || RegExp(/^keeta_a5(.*)/).test(input.account) || RegExp(/^keeta_a6(.*)/).test(input.account) || RegExp(/^keeta_a7(.*)/).test(input.account) || RegExp(/^tyblocks_a4(.*)/).test(input.account) || RegExp(/^tyblocks_a5(.*)/).test(input.account) || RegExp(/^tyblocks_a6(.*)/).test(input.account) || RegExp(/^tyblocks_a7(.*)/).test(input.account))) && "string" === typeof input.convertedAmount && ("object" === typeof input.cost && null !== input.cost && _io3(input.cost)) && ("object" === typeof input.signed && null !== input.signed && _io4(input.signed)); const _io2 = input => "string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to))) && "string" === typeof input.amount && ("from" === input.affinity || "to" === input.affinity); const _io3 = input => "string" === typeof input.amount && ("string" === typeof input.token && (RegExp(/^keeta_am(.*)/).test(input.token) || RegExp(/^keeta_an(.*)/).test(input.token) || RegExp(/^keeta_ao(.*)/).test(input.token) || RegExp(/^keeta_ap(.*)/).test(input.token) || RegExp(/^tyblocks_am(.*)/).test(input.token) || RegExp(/^tyblocks_an(.*)/).test(input.token) || RegExp(/^tyblocks_ao(.*)/).test(input.token) || RegExp(/^tyblocks_ap(.*)/).test(input.token))); const _io4 = input => "string" === typeof input.nonce && "string" === typeof input.timestamp && "string" === typeof input.signature; const _io5 = input => "string" === typeof input.block && (null !== input.quote && undefined === input.quote) && ("object" === typeof input.request && null !== input.request && _io2(input.request)); const _iu0 = input => (() => {
|
|
86
|
+
if ("object" === typeof input.request && null !== input.request && _io2(input.request))
|
|
87
|
+
return _io5(input);
|
|
88
|
+
else if ("object" === typeof input.quote && null !== input.quote && _io1(input.quote))
|
|
89
|
+
return _io0(input);
|
|
90
|
+
else
|
|
91
|
+
return false;
|
|
92
|
+
})(); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.block || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
93
|
+
method: "createAssert",
|
|
94
|
+
path: _path + ".block",
|
|
95
|
+
expected: "string",
|
|
96
|
+
value: input.block
|
|
97
|
+
}, _errorFactory)) && (("object" === typeof input.quote && null !== input.quote || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
98
|
+
method: "createAssert",
|
|
99
|
+
path: _path + ".quote",
|
|
100
|
+
expected: "__type",
|
|
101
|
+
value: input.quote
|
|
102
|
+
}, _errorFactory)) && _ao1(input.quote, _path + ".quote", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
103
|
+
method: "createAssert",
|
|
104
|
+
path: _path + ".quote",
|
|
105
|
+
expected: "__type",
|
|
106
|
+
value: input.quote
|
|
107
|
+
}, _errorFactory)) && ((null !== input.request || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
108
|
+
method: "createAssert",
|
|
109
|
+
path: _path + ".request",
|
|
110
|
+
expected: "undefined",
|
|
111
|
+
value: input.request
|
|
112
|
+
}, _errorFactory)) && (undefined === input.request || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
113
|
+
method: "createAssert",
|
|
114
|
+
path: _path + ".request",
|
|
115
|
+
expected: "undefined",
|
|
116
|
+
value: input.request
|
|
117
|
+
}, _errorFactory))); const _ao1 = (input, _path, _exceptionable = true) => (("object" === typeof input.request && null !== input.request || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
81
118
|
method: "createAssert",
|
|
82
119
|
path: _path + ".request",
|
|
83
120
|
expected: "__type.o1",
|
|
84
121
|
value: input.request
|
|
85
|
-
}, _errorFactory)) &&
|
|
122
|
+
}, _errorFactory)) && _ao2(input.request, _path + ".request", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
86
123
|
method: "createAssert",
|
|
87
124
|
path: _path + ".request",
|
|
88
125
|
expected: "__type.o1",
|
|
@@ -102,7 +139,7 @@ export const assertConversionQuoteJSON = (() => { const _io0 = input => "object"
|
|
|
102
139
|
path: _path + ".cost",
|
|
103
140
|
expected: "__type.o2",
|
|
104
141
|
value: input.cost
|
|
105
|
-
}, _errorFactory)) &&
|
|
142
|
+
}, _errorFactory)) && _ao3(input.cost, _path + ".cost", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
106
143
|
method: "createAssert",
|
|
107
144
|
path: _path + ".cost",
|
|
108
145
|
expected: "__type.o2",
|
|
@@ -112,12 +149,12 @@ export const assertConversionQuoteJSON = (() => { const _io0 = input => "object"
|
|
|
112
149
|
path: _path + ".signed",
|
|
113
150
|
expected: "__type.o3",
|
|
114
151
|
value: input.signed
|
|
115
|
-
}, _errorFactory)) &&
|
|
152
|
+
}, _errorFactory)) && _ao4(input.signed, _path + ".signed", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
116
153
|
method: "createAssert",
|
|
117
154
|
path: _path + ".signed",
|
|
118
155
|
expected: "__type.o3",
|
|
119
156
|
value: input.signed
|
|
120
|
-
}, _errorFactory)); const
|
|
157
|
+
}, _errorFactory)); const _ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
121
158
|
method: "createAssert",
|
|
122
159
|
path: _path + ".from",
|
|
123
160
|
expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}`)",
|
|
@@ -137,7 +174,7 @@ export const assertConversionQuoteJSON = (() => { const _io0 = input => "object"
|
|
|
137
174
|
path: _path + ".affinity",
|
|
138
175
|
expected: "(\"from\" | \"to\")",
|
|
139
176
|
value: input.affinity
|
|
140
|
-
}, _errorFactory)); const
|
|
177
|
+
}, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => ("string" === typeof input.amount || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
141
178
|
method: "createAssert",
|
|
142
179
|
path: _path + ".amount",
|
|
143
180
|
expected: "string",
|
|
@@ -147,7 +184,7 @@ export const assertConversionQuoteJSON = (() => { const _io0 = input => "object"
|
|
|
147
184
|
path: _path + ".token",
|
|
148
185
|
expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}`)",
|
|
149
186
|
value: input.token
|
|
150
|
-
}, _errorFactory)); const
|
|
187
|
+
}, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => ("string" === typeof input.nonce || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
151
188
|
method: "createAssert",
|
|
152
189
|
path: _path + ".nonce",
|
|
153
190
|
expected: "string",
|
|
@@ -162,18 +199,55 @@ export const assertConversionQuoteJSON = (() => { const _io0 = input => "object"
|
|
|
162
199
|
path: _path + ".signature",
|
|
163
200
|
expected: "string",
|
|
164
201
|
value: input.signature
|
|
165
|
-
}, _errorFactory)); const
|
|
202
|
+
}, _errorFactory)); const _ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.block || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
203
|
+
method: "createAssert",
|
|
204
|
+
path: _path + ".block",
|
|
205
|
+
expected: "string",
|
|
206
|
+
value: input.block
|
|
207
|
+
}, _errorFactory)) && ((null !== input.quote || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
208
|
+
method: "createAssert",
|
|
209
|
+
path: _path + ".quote",
|
|
210
|
+
expected: "undefined",
|
|
211
|
+
value: input.quote
|
|
212
|
+
}, _errorFactory)) && (undefined === input.quote || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
213
|
+
method: "createAssert",
|
|
214
|
+
path: _path + ".quote",
|
|
215
|
+
expected: "undefined",
|
|
216
|
+
value: input.quote
|
|
217
|
+
}, _errorFactory))) && (("object" === typeof input.request && null !== input.request || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
218
|
+
method: "createAssert",
|
|
219
|
+
path: _path + ".request",
|
|
220
|
+
expected: "__type.o1",
|
|
221
|
+
value: input.request
|
|
222
|
+
}, _errorFactory)) && _ao2(input.request, _path + ".request", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
223
|
+
method: "createAssert",
|
|
224
|
+
path: _path + ".request",
|
|
225
|
+
expected: "__type.o1",
|
|
226
|
+
value: input.request
|
|
227
|
+
}, _errorFactory)); const _au0 = (input, _path, _exceptionable = true) => (() => {
|
|
228
|
+
if ("object" === typeof input.request && null !== input.request && _ao2(input.request, _path + ".request", false && _exceptionable))
|
|
229
|
+
return _ao5(input, _path, true && _exceptionable);
|
|
230
|
+
else if ("object" === typeof input.quote && null !== input.quote && _ao1(input.quote, _path + ".quote", false && _exceptionable))
|
|
231
|
+
return _ao0(input, _path, true && _exceptionable);
|
|
232
|
+
else
|
|
233
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
234
|
+
method: "createAssert",
|
|
235
|
+
path: _path,
|
|
236
|
+
expected: "({ block: string; } & { quote?: undefined; request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; }; } | { block: string; } & { quote: { request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; }; account: TokenPublicKeyString | ... 5 more ... | MultisigPublicKeyString; convertedAmount: string; cost: { ...; }; signed: { ...; }; }; request?: undefined; })",
|
|
237
|
+
value: input
|
|
238
|
+
}, _errorFactory);
|
|
239
|
+
})(); const __is = input => "object" === typeof input && null !== input && _iu0(input); let _errorFactory; return (input, errorFactory) => {
|
|
166
240
|
if (false === __is(input)) {
|
|
167
241
|
_errorFactory = errorFactory;
|
|
168
242
|
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
|
|
169
243
|
method: "createAssert",
|
|
170
244
|
path: _path + "",
|
|
171
|
-
expected: "
|
|
245
|
+
expected: "({ block: string; } & { quote: { request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; }; account: TokenPublicKeyString | ... 5 more ... | MultisigPublicKeyString; convertedAmount: string; cost: { ...; }; signed: { ...; }; }; request?: undefined; } | { block: string; } & { quote?: undefined; request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; }; })",
|
|
172
246
|
value: input
|
|
173
|
-
}, _errorFactory)) &&
|
|
247
|
+
}, _errorFactory)) && _au0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
174
248
|
method: "createAssert",
|
|
175
249
|
path: _path + "",
|
|
176
|
-
expected: "
|
|
250
|
+
expected: "({ block: string; } & { quote: { request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; }; account: TokenPublicKeyString | ... 5 more ... | MultisigPublicKeyString; convertedAmount: string; cost: { ...; }; signed: { ...; }; }; request?: undefined; } | { block: string; } & { quote?: undefined; request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; }; })",
|
|
177
251
|
value: input
|
|
178
252
|
}, _errorFactory))(input, "$input", true);
|
|
179
253
|
}
|
|
@@ -201,10 +275,62 @@ class KeetaFXAnchorQuoteValidationFailedError extends KeetaAnchorUserError {
|
|
|
201
275
|
return (error);
|
|
202
276
|
}
|
|
203
277
|
}
|
|
278
|
+
class KeetaFXAnchorQuoteRequiredError extends KeetaAnchorUserError {
|
|
279
|
+
static name = 'KeetaFXAnchorQuoteRequiredError';
|
|
280
|
+
KeetaFXAnchorQuoteRequiredErrorObjectTypeID;
|
|
281
|
+
static KeetaFXAnchorQuoteRequiredErrorObjectTypeID = '9f22067f-52b3-40f2-84c1-ad9285260980';
|
|
282
|
+
constructor(message) {
|
|
283
|
+
super(message ?? 'Quote required to perform exchange');
|
|
284
|
+
this.statusCode = 400;
|
|
285
|
+
Object.defineProperty(this, 'KeetaFXAnchorQuoteRequiredErrorObjectTypeID', {
|
|
286
|
+
value: KeetaFXAnchorQuoteRequiredError.KeetaFXAnchorQuoteRequiredErrorObjectTypeID,
|
|
287
|
+
enumerable: false
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
static isInstance(input) {
|
|
291
|
+
return (this.hasPropWithValue(input, 'KeetaFXAnchorQuoteRequiredErrorObjectTypeID', KeetaFXAnchorQuoteRequiredError.KeetaFXAnchorQuoteRequiredErrorObjectTypeID));
|
|
292
|
+
}
|
|
293
|
+
static async fromJSON(input) {
|
|
294
|
+
const { message, other } = this.extractErrorProperties(input, this);
|
|
295
|
+
const error = new this(message);
|
|
296
|
+
error.restoreFromJSON(other);
|
|
297
|
+
return (error);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
class KeetaFXAnchorQuoteIssuanceDisabledError extends KeetaAnchorUserError {
|
|
301
|
+
static name = 'KeetaFXAnchorQuoteIssuanceDisabledError';
|
|
302
|
+
KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID;
|
|
303
|
+
static KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID = 'a0f70c0b-6e17-41f0-825a-d086983209e1';
|
|
304
|
+
constructor(message) {
|
|
305
|
+
super(message ?? 'Anchor cannot issue quotes');
|
|
306
|
+
this.statusCode = 501;
|
|
307
|
+
Object.defineProperty(this, 'KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID', {
|
|
308
|
+
value: KeetaFXAnchorQuoteIssuanceDisabledError.KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID,
|
|
309
|
+
enumerable: false
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
static isInstance(input) {
|
|
313
|
+
return (this.hasPropWithValue(input, 'KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID', KeetaFXAnchorQuoteIssuanceDisabledError.KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID));
|
|
314
|
+
}
|
|
315
|
+
static async fromJSON(input) {
|
|
316
|
+
const { message, other } = this.extractErrorProperties(input, this);
|
|
317
|
+
const error = new this(message);
|
|
318
|
+
error.restoreFromJSON(other);
|
|
319
|
+
return (error);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
204
322
|
export const Errors = {
|
|
205
323
|
/**
|
|
206
324
|
* The quote validation failed
|
|
207
325
|
*/
|
|
208
|
-
QuoteValidationFailed: KeetaFXAnchorQuoteValidationFailedError
|
|
326
|
+
QuoteValidationFailed: KeetaFXAnchorQuoteValidationFailedError,
|
|
327
|
+
/**
|
|
328
|
+
* Quote is required to perform the exchange
|
|
329
|
+
*/
|
|
330
|
+
QuoteRequired: KeetaFXAnchorQuoteRequiredError,
|
|
331
|
+
/**
|
|
332
|
+
* The anchor cannot issue quotes
|
|
333
|
+
*/
|
|
334
|
+
QuoteIssuanceDisabled: KeetaFXAnchorQuoteIssuanceDisabledError
|
|
209
335
|
};
|
|
210
336
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/services/fx/common.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACN,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAkJ5B,MAAM,CAAC,MAAM,+BAA+B;;;;;;;sFAAwG,CAAC;AACrJ,MAAM,CAAC,MAAM,4BAA4B;;;;;;;sFAAkG,CAAC;AAC5I,MAAM,CAAC,MAAM,+BAA+B;;;;;;;;;;sFAAwG,CAAC;AACrJ,MAAM,CAAC,MAAM,kCAAkC;;;;;;;;;;;OAAkG,CAAC;AAClJ,MAAM,CAAC,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAiG,CAAC;AACjJ,MAAM,CAAC,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAoF,CAAC;AAE3H,MAAM,uCAAwC,SAAQ,oBAAoB;IACzE,MAAM,CAAmB,IAAI,GAAW,yCAAyC,CAAC;IACjE,mDAAmD,CAAU;IACtE,MAAM,CAAU,mDAAmD,GAAG,sCAAsC,CAAC;IAErH,YAAY,OAAgB;QAC3B,KAAK,CAAC,OAAO,IAAI,yBAAyB,CAAC,CAAC;QAC5C,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QAEtB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qDAAqD,EAAE;YAClF,KAAK,EAAE,uCAAuC,CAAC,mDAAmD;YAClG,UAAU,EAAE,KAAK;SACjB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,KAAc;QAC/B,OAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,qDAAqD,EAAE,uCAAuC,CAAC,mDAAmD,CAAC,CAAC,CAAC;IAC1L,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpE,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAM,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;;AAGF,MAAM,CAAC,MAAM,MAAM,GAEf;IACH;;OAEG;IACH,qBAAqB,EAAE,uCAAuC;CAC9D,CAAC","sourcesContent":["import type { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';\n\nimport type { ServiceSearchCriteria } from '../../lib/resolver.js';\nimport type { ToJSONSerializable } from '../../lib/utils/json.js';\nimport { createAssert, createIs } from 'typia';\nimport {\n\tKeetaAnchorUserError\n} from '../../lib/error.js';\nimport type { HTTPSignedField } from '../../lib/http-server/common.js';\n\nexport type KeetaNetAccount = InstanceType<typeof KeetaNetLib.Account>;\nexport type KeetaNetStorageAccount = InstanceType<typeof KeetaNetLib.Account<typeof KeetaNetLib.Account.AccountKeyAlgorithm.STORAGE>>;\nexport type KeetaNetToken = InstanceType<typeof KeetaNetLib.Account<typeof KeetaNetLib.Account.AccountKeyAlgorithm.TOKEN>>;\nexport type KeetaNetTokenPublicKeyString = ReturnType<InstanceType<typeof KeetaNetLib.Account<typeof KeetaNetLib.Account.AccountKeyAlgorithm.TOKEN>>['publicKeyString']['get']>;\n\nexport type ConversionInput = {\n\t/**\n\t * The currency code to convert from (i.e., what the user has).\n\t */\n\tfrom: ServiceSearchCriteria<'fx'>['inputCurrencyCode'] | KeetaNetToken;\n\t/**\n\t * The currency code to convert to (i.e., what the user wants).\n\t */\n\tto: ServiceSearchCriteria<'fx'>['outputCurrencyCode'] | KeetaNetToken;\n\t/**\n\t * The amount to convert. This is a bigint representing the\n\t * amount in the currency specified by either `from` or `to`, as\n\t * specified by the `affinity` property.\n\t */\n\tamount: bigint;\n\t/**\n\t * Indicates whether the amount specified is in terms of the `from`\n\t * currency (i.e., the user has this much) or the `to` currency\n\t * (i.e., the user wants this much).\n\t */\n\taffinity: 'from' | 'to';\n};\n\nexport type ConversionInputCanonical = {\n\t[k in keyof ConversionInput]: k extends 'amount' ? bigint : k extends 'from' ? KeetaNetToken : k extends 'to' ? KeetaNetToken : ConversionInput[k];\n};\n\nexport type ConversionInputCanonicalJSON = ToJSONSerializable<ConversionInputCanonical>;\n\nexport type KeetaFXAnchorClientCreateExchangeRequest = {\n\tquote: KeetaFXAnchorQuote;\n\tblock: InstanceType<typeof KeetaNetLib.Block>;\n};\n\nexport type KeetaFXAnchorEstimate = {\n\t/**\n\t * Conversion request that was provided\n\t */\n\trequest: ConversionInputCanonical;\n\n\t/**\n\t * Amount after the conversion as specified by either `from` or `to`, as specified by the `affinity` property in the request.\n\t */\n\tconvertedAmount: bigint;\n\n\t/**\n\t * The expected cost of the fx request, in the form of a\n\t * token and a range of minimum and maximum expected costs\n\t */\n\texpectedCost: {\n\t\tmin: bigint;\n\t\tmax: bigint;\n\t\ttoken: KeetaNetToken;\n\t};\n};\n\nexport type KeetaFXAnchorEstimateResponse = ({\n\tok: true;\n\testimate: ToJSONSerializable<KeetaFXAnchorEstimate>;\n} | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaFXAnchorQuote = {\n\t/**\n\t * Conversion request that was provided\n\t */\n\trequest: ConversionInputCanonical;\n\n\t/**\n\t * The public key of the liquidity provider account\n\t */\n\taccount: KeetaNetAccount | KeetaNetStorageAccount;\n\n\t/**\n\t * Amount after the conversion as specified by either `from` or `to`, as specified by the `affinity` property in the request.\n\t */\n\n\tconvertedAmount: bigint;\n\n\t/**\n\t * The cost of the fx request, in the form of a\n\t * token and amount that should be included with the swap\n\t */\n\tcost: {\n\t\tamount: bigint;\n\t\ttoken: KeetaNetToken;\n\t};\n\n\t/**\n\t * Signature information to verify the quote\n\t */\n\tsigned: HTTPSignedField;\n};\n\nexport type KeetaFXAnchorQuoteJSON = ToJSONSerializable<KeetaFXAnchorQuote>;\n\nexport type KeetaFXAnchorQuoteResponse = ({\n\tok: true;\n\tquote: ToJSONSerializable<KeetaFXAnchorQuote>\n} | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaFXAnchorExchange = {\n\t/**\n\t * ID used to identify the conversion request\n\t */\n\texchangeID: string\n} & ({\n\t/**\n\t * Status of the exchange request\n\t */\n\tstatus: 'pending' | 'failed';\n} | {\n\t/**\n\t * Status of the exchange request\n\t */\n\tstatus: 'completed';\n\t/**\n\t * Blockhash where the exchange was completed -- the user-supplied\n\t * blockhash for their portion of the exchange transaction can be\n\t * used to look up the transaction on-chain as well, but we return\n\t * a value here so that it can be looked up without needing to store\n\t * that initial block.\n\t */\n\tblockhash: string;\n});\n\nexport type KeetaFXAnchorExchangeResponse = KeetaFXAnchorExchange & ({\n\tok: true;\n} | {\n\tok: false;\n\terror: string;\n});\n\nexport const isKeetaFXAnchorEstimateResponse: (input: unknown) => input is KeetaFXAnchorEstimateResponse = createIs<KeetaFXAnchorEstimateResponse>();\nexport const isKeetaFXAnchorQuoteResponse: (input: unknown) => input is KeetaFXAnchorQuoteResponse = createIs<KeetaFXAnchorQuoteResponse>();\nexport const isKeetaFXAnchorExchangeResponse: (input: unknown) => input is KeetaFXAnchorExchangeResponse = createIs<KeetaFXAnchorExchangeResponse>();\nexport const assertKeetaNetTokenPublicKeyString: (input: unknown) => KeetaNetTokenPublicKeyString = createAssert<KeetaNetTokenPublicKeyString>();\nexport const assertConversionInputCanonicalJSON: (input: unknown) => ConversionInputCanonicalJSON = createAssert<ConversionInputCanonicalJSON>();\nexport const assertConversionQuoteJSON: (input: unknown) => KeetaFXAnchorQuoteJSON= createAssert<KeetaFXAnchorQuoteJSON>();\n\nclass KeetaFXAnchorQuoteValidationFailedError extends KeetaAnchorUserError {\n\tstatic override readonly name: string = 'KeetaFXAnchorQuoteValidationFailedError';\n\tprivate readonly KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID!: string;\n\tprivate static readonly KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID = 'a8f3c2d1-9b4e-4f2a-8c1d-5e6f7a8b9c0d';\n\n\tconstructor(message?: string) {\n\t\tsuper(message ?? 'Quote validation failed');\n\t\tthis.statusCode = 400;\n\n\t\tObject.defineProperty(this, 'KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID', {\n\t\t\tvalue: KeetaFXAnchorQuoteValidationFailedError.KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaFXAnchorQuoteValidationFailedError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID', KeetaFXAnchorQuoteValidationFailedError.KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID));\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<InstanceType<typeof this>> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\t\tconst error = new this(message);\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\nexport const Errors: {\n\tQuoteValidationFailed: typeof KeetaFXAnchorQuoteValidationFailedError;\n} = {\n\t/**\n\t * The quote validation failed\n\t */\n\tQuoteValidationFailed: KeetaFXAnchorQuoteValidationFailedError\n};\n"]}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/services/fx/common.ts"],"names":[],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ACf,CAAC;;AAGF,MAAM,uCAAwC,SAAQ,oBAAoB;IACzE,MAAM,CAAmB,IAAI,GAAW,yCAAyC,CAAC;IACjE,mDAAmD,CAAU;IACtE,MAAM,CAAU,mDAAmD,GAAG,sCAAsC,CAAC;IAErH,YAAY,OAAgB;QAC3B,KAAK,CAAC,OAAO,IAAI,4BAA4B,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QAEtB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qDAAqD,EAAE;YAClF,KAAK,EAAE,uCAAuC,CAAC,mDAAmD;YAClG,UAAU,EAAE,KAAK;SACjB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,KAAc;QAC/B,OAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,qDAAqD,EAAE,uCAAuC,CAAC,mDAAmD,CAAC,CAAC,CAAC;IAC1L,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpE,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAM,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;;AAGF,MAAM,CAAC,MAAM,MAAM,GAIf;IACH;;OAEG;IACH,qBAAqB,EAAE,uCAAuC;IAE9D;;OAEG;IACH,aAAa,EAAE,+BAA+B;IAE9C;;OAEG;IACH,qBAAqB,EAAE,uCAAuC;CAC9D,CAAC","sourcesContent":["import type { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';\n\nimport type { ServiceSearchCriteria } from '../../lib/resolver.js';\nimport type { ToJSONSerializable } from '../../lib/utils/json.js';\nimport { createAssert, createIs } from 'typia';\nimport {\n\tKeetaAnchorUserError\n} from '../../lib/error.js';\nimport type { HTTPSignedField } from '../../lib/http-server/common.js';\n\nexport type KeetaNetAccount = InstanceType<typeof KeetaNetLib.Account>;\nexport type KeetaNetStorageAccount = InstanceType<typeof KeetaNetLib.Account<typeof KeetaNetLib.Account.AccountKeyAlgorithm.STORAGE>>;\nexport type KeetaNetToken = InstanceType<typeof KeetaNetLib.Account<typeof KeetaNetLib.Account.AccountKeyAlgorithm.TOKEN>>;\nexport type KeetaNetTokenPublicKeyString = ReturnType<InstanceType<typeof KeetaNetLib.Account<typeof KeetaNetLib.Account.AccountKeyAlgorithm.TOKEN>>['publicKeyString']['get']>;\n\nexport type ConversionInput = {\n\t/**\n\t * The currency code to convert from (i.e., what the user has).\n\t */\n\tfrom: ServiceSearchCriteria<'fx'>['inputCurrencyCode'] | KeetaNetToken;\n\t/**\n\t * The currency code to convert to (i.e., what the user wants).\n\t */\n\tto: ServiceSearchCriteria<'fx'>['outputCurrencyCode'] | KeetaNetToken;\n\t/**\n\t * The amount to convert. This is a bigint representing the\n\t * amount in the currency specified by either `from` or `to`, as\n\t * specified by the `affinity` property.\n\t */\n\tamount: bigint;\n\t/**\n\t * Indicates whether the amount specified is in terms of the `from`\n\t * currency (i.e., the user has this much) or the `to` currency\n\t * (i.e., the user wants this much).\n\t */\n\taffinity: 'from' | 'to';\n};\n\nexport type ConversionInputCanonical = {\n\t[k in keyof ConversionInput]: k extends 'amount' ? bigint : k extends 'from' ? KeetaNetToken : k extends 'to' ? KeetaNetToken : ConversionInput[k];\n};\n\nexport type ConversionInputCanonicalJSON = ToJSONSerializable<ConversionInputCanonical>;\n\nexport type KeetaFXAnchorClientCreateExchangeRequest = {\n\tblock: InstanceType<typeof KeetaNetLib.Block>;\n} & ({\n\tquote: KeetaFXAnchorQuote;\n} | {\n\trequest: ConversionInputCanonical;\n});\n\nexport type KeetaFXAnchorClientCreateExchangeRequestJSON = {\n\tblock: string;\n} & ({\n\tquote: KeetaFXAnchorQuoteJSON;\n\trequest?: undefined;\n} | {\n\tquote?: undefined;\n\trequest: ConversionInputCanonicalJSON;\n})\n\nexport type KeetaFXAnchorEstimate = {\n\t/**\n\t * Conversion request that was provided\n\t */\n\trequest: ConversionInputCanonical;\n\n\t/**\n\t * Amount after the conversion as specified by either `from` or `to`, as specified by the `affinity` property in the request.\n\t */\n\tconvertedAmount: bigint;\n\n\t/**\n\t * Outer bound of the converted amount.\n\t * if affinity is 'from', this is the maximum amount the user would need to send, if its to, this is the minimum amount the user would receive.\n\t */\n\tconvertedAmountBound?: bigint;\n\n\t/**\n\t * The expected cost of the fx request, in the form of a\n\t * token and a range of minimum and maximum expected costs\n\t */\n\texpectedCost: {\n\t\tmin: bigint;\n\t\tmax: bigint;\n\t\ttoken: KeetaNetToken;\n\t};\n} & ({\n\t/**\n\t * Indicates that a quote is required before proceeding with the exchange\n\t */\n\trequiresQuote: false;\n\n\t/**\n\t * Liquidity provider account if the user is not going to request a quote before the exchange\n\t */\n\taccount: KeetaNetAccount | KeetaNetStorageAccount;\n} | {\n\t/**\n\t * Indicates that a quote is required before proceeding with the exchange, defaults to true\n\t */\n\trequiresQuote?: true;\n});\n\nexport type KeetaFXAnchorEstimateResponse = ({\n\tok: true;\n\testimate: ToJSONSerializable<KeetaFXAnchorEstimate>;\n} | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaFXAnchorQuote = {\n\t/**\n\t * Conversion request that was provided\n\t */\n\trequest: ConversionInputCanonical;\n\n\t/**\n\t * The public key of the liquidity provider account\n\t */\n\taccount: KeetaNetAccount | KeetaNetStorageAccount;\n\n\t/**\n\t * Amount after the conversion as specified by either `from` or `to`, as specified by the `affinity` property in the request.\n\t */\n\tconvertedAmount: bigint;\n\n\t/**\n\t * The cost of the fx request, in the form of a\n\t * token and amount that should be included with the swap\n\t */\n\tcost: {\n\t\tamount: bigint;\n\t\ttoken: KeetaNetToken;\n\t};\n\n\t/**\n\t * Signature information to verify the quote\n\t */\n\tsigned: HTTPSignedField;\n};\n\nexport type KeetaFXAnchorQuoteJSON = ToJSONSerializable<KeetaFXAnchorQuote>;\n\nexport type KeetaFXAnchorQuoteResponse = ({\n\tok: true;\n\tquote: ToJSONSerializable<KeetaFXAnchorQuote>\n} | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaFXAnchorExchange = {\n\t/**\n\t * ID used to identify the conversion request\n\t */\n\texchangeID: string\n} & ({\n\t/**\n\t * Status of the exchange request\n\t */\n\tstatus: 'pending' | 'failed';\n} | {\n\t/**\n\t * Status of the exchange request\n\t */\n\tstatus: 'completed';\n\t/**\n\t * Blockhash where the exchange was completed -- the user-supplied\n\t * blockhash for their portion of the exchange transaction can be\n\t * used to look up the transaction on-chain as well, but we return\n\t * a value here so that it can be looked up without needing to store\n\t * that initial block.\n\t */\n\tblockhash: string;\n});\n\nexport type KeetaFXAnchorExchangeResponse = (KeetaFXAnchorExchange & {\n\tok: true;\n}) | (Partial<KeetaFXAnchorExchange> & {\n\tok: false;\n\terror: string;\n});\n\nexport const isKeetaFXAnchorEstimateResponse: (input: unknown) => input is KeetaFXAnchorEstimateResponse = createIs<KeetaFXAnchorEstimateResponse>();\nexport const isKeetaFXAnchorQuoteResponse: (input: unknown) => input is KeetaFXAnchorQuoteResponse = createIs<KeetaFXAnchorQuoteResponse>();\nexport const isKeetaFXAnchorExchangeResponse: (input: unknown) => input is KeetaFXAnchorExchangeResponse = createIs<KeetaFXAnchorExchangeResponse>();\nexport const assertKeetaNetTokenPublicKeyString: (input: unknown) => KeetaNetTokenPublicKeyString = createAssert<KeetaNetTokenPublicKeyString>();\nexport const assertConversionInputCanonicalJSON: (input: unknown) => ConversionInputCanonicalJSON = createAssert<ConversionInputCanonicalJSON>();\nexport const assertKeetaFXAnchorClientCreateExchangeRequestJSON: (input: unknown) => KeetaFXAnchorClientCreateExchangeRequestJSON = createAssert<KeetaFXAnchorClientCreateExchangeRequestJSON>();\n\nclass KeetaFXAnchorQuoteValidationFailedError extends KeetaAnchorUserError {\n\tstatic override readonly name: string = 'KeetaFXAnchorQuoteValidationFailedError';\n\tprivate readonly KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID!: string;\n\tprivate static readonly KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID = 'a8f3c2d1-9b4e-4f2a-8c1d-5e6f7a8b9c0d';\n\n\tconstructor(message?: string) {\n\t\tsuper(message ?? 'Quote validation failed');\n\t\tthis.statusCode = 400;\n\n\t\tObject.defineProperty(this, 'KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID', {\n\t\t\tvalue: KeetaFXAnchorQuoteValidationFailedError.KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaFXAnchorQuoteValidationFailedError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID', KeetaFXAnchorQuoteValidationFailedError.KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID));\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<InstanceType<typeof this>> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\t\tconst error = new this(message);\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\nclass KeetaFXAnchorQuoteRequiredError extends KeetaAnchorUserError {\n\tstatic override readonly name: string = 'KeetaFXAnchorQuoteRequiredError';\n\tprivate readonly KeetaFXAnchorQuoteRequiredErrorObjectTypeID!: string;\n\tprivate static readonly KeetaFXAnchorQuoteRequiredErrorObjectTypeID = '9f22067f-52b3-40f2-84c1-ad9285260980';\n\n\tconstructor(message?: string) {\n\t\tsuper(message ?? 'Quote required to perform exchange');\n\t\tthis.statusCode = 400;\n\n\t\tObject.defineProperty(this, 'KeetaFXAnchorQuoteRequiredErrorObjectTypeID', {\n\t\t\tvalue: KeetaFXAnchorQuoteRequiredError.KeetaFXAnchorQuoteRequiredErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaFXAnchorQuoteRequiredError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaFXAnchorQuoteRequiredErrorObjectTypeID', KeetaFXAnchorQuoteRequiredError.KeetaFXAnchorQuoteRequiredErrorObjectTypeID));\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<InstanceType<typeof this>> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\t\tconst error = new this(message);\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\nclass KeetaFXAnchorQuoteIssuanceDisabledError extends KeetaAnchorUserError {\n\tstatic override readonly name: string = 'KeetaFXAnchorQuoteIssuanceDisabledError';\n\tprivate readonly KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID!: string;\n\tprivate static readonly KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID = 'a0f70c0b-6e17-41f0-825a-d086983209e1';\n\n\tconstructor(message?: string) {\n\t\tsuper(message ?? 'Anchor cannot issue quotes');\n\t\tthis.statusCode = 501;\n\n\t\tObject.defineProperty(this, 'KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID', {\n\t\t\tvalue: KeetaFXAnchorQuoteIssuanceDisabledError.KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaFXAnchorQuoteIssuanceDisabledError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID', KeetaFXAnchorQuoteIssuanceDisabledError.KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID));\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<InstanceType<typeof this>> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\t\tconst error = new this(message);\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\nexport const Errors: {\n\tQuoteValidationFailed: typeof KeetaFXAnchorQuoteValidationFailedError;\n\tQuoteRequired: typeof KeetaFXAnchorQuoteRequiredError;\n\tQuoteIssuanceDisabled: typeof KeetaFXAnchorQuoteIssuanceDisabledError;\n} = {\n\t/**\n\t * The quote validation failed\n\t */\n\tQuoteValidationFailed: KeetaFXAnchorQuoteValidationFailedError,\n\n\t/**\n\t * Quote is required to perform the exchange\n\t */\n\tQuoteRequired: KeetaFXAnchorQuoteRequiredError,\n\n\t/**\n\t * The anchor cannot issue quotes\n\t */\n\tQuoteIssuanceDisabled: KeetaFXAnchorQuoteIssuanceDisabledError\n};\n"]}
|
package/services/fx/server.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as KeetaAnchorHTTPServer from '../../lib/http-server/index.js';
|
|
2
2
|
import { KeetaNet } from '../../client/index.js';
|
|
3
|
-
import type { ConversionInputCanonicalJSON, KeetaFXAnchorQuote, KeetaFXAnchorQuoteJSON, KeetaNetAccount } from './common.ts';
|
|
3
|
+
import type { ConversionInputCanonicalJSON, KeetaFXAnchorEstimate, KeetaFXAnchorQuote, KeetaFXAnchorQuoteJSON, KeetaNetAccount } from './common.ts';
|
|
4
4
|
import * as Signing from '../../lib/utils/signing.js';
|
|
5
5
|
import type { ServiceMetadata } from '../../lib/resolver.ts';
|
|
6
6
|
import { KeetaAnchorQueueRunner } from '../../lib/queue/index.js';
|
|
7
7
|
import type { KeetaAnchorQueueStorageDriver, KeetaAnchorQueueRequestID } from '../../lib/queue/index.ts';
|
|
8
8
|
import { KeetaAnchorQueuePipelineAdvanced } from '../../lib/queue/pipeline.js';
|
|
9
9
|
import type { JSONSerializable } from '../../lib/utils/json.ts';
|
|
10
|
+
import type { DeepRequired } from '../../lib/utils/types.ts';
|
|
10
11
|
export interface KeetaAnchorFXServerConfig extends KeetaAnchorHTTPServer.KeetaAnchorHTTPServerConfig {
|
|
11
12
|
/**
|
|
12
13
|
* The data to use for the index page (optional)
|
|
@@ -36,9 +37,27 @@ export interface KeetaAnchorFXServerConfig extends KeetaAnchorHTTPServer.KeetaAn
|
|
|
36
37
|
*/
|
|
37
38
|
signer?: InstanceType<typeof KeetaNet.lib.Account> | ((request: ConversionInputCanonicalJSON) => Promise<InstanceType<typeof KeetaNet.lib.Account>> | InstanceType<typeof KeetaNet.lib.Account>);
|
|
38
39
|
/**
|
|
39
|
-
* Account which performs the signing and validation of quotes
|
|
40
|
+
* Account which performs the signing and validation of quotes,
|
|
41
|
+
* This can be null but only if `quoteConfiguration.issueQuotes` is false.
|
|
40
42
|
*/
|
|
41
|
-
quoteSigner: Signing.SignableAccount;
|
|
43
|
+
quoteSigner: Signing.SignableAccount | null;
|
|
44
|
+
/**
|
|
45
|
+
* Indicates whether the liquidity provider requires a quote before performing an exchange
|
|
46
|
+
* defaults to requiresQuote: true
|
|
47
|
+
*/
|
|
48
|
+
quoteConfiguration?: {
|
|
49
|
+
requiresQuote: true;
|
|
50
|
+
} | {
|
|
51
|
+
requiresQuote: false;
|
|
52
|
+
/**
|
|
53
|
+
* Indicates whether to call validateQuote before performing the exchange, defaults to true if validateQuote is provided
|
|
54
|
+
*/
|
|
55
|
+
validateQuoteBeforeExchange: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Indicates if the server should issue quotes when requested, if not it will throw a
|
|
58
|
+
*/
|
|
59
|
+
issueQuotes: boolean;
|
|
60
|
+
};
|
|
42
61
|
/**
|
|
43
62
|
* Configuration for FX handling
|
|
44
63
|
*/
|
|
@@ -52,7 +71,7 @@ export interface KeetaAnchorFXServerConfig extends KeetaAnchorHTTPServer.KeetaAn
|
|
|
52
71
|
*
|
|
53
72
|
* This is used to handle quotes and estimates
|
|
54
73
|
*/
|
|
55
|
-
getConversionRateAndFee: (request: ConversionInputCanonicalJSON) => Promise<
|
|
74
|
+
getConversionRateAndFee: (request: ConversionInputCanonicalJSON) => Promise<KeetaFXInternalPriceQuote>;
|
|
56
75
|
/**
|
|
57
76
|
* Optional callback to validate a quote before completing an exchange
|
|
58
77
|
*
|
|
@@ -62,7 +81,7 @@ export interface KeetaAnchorFXServerConfig extends KeetaAnchorHTTPServer.KeetaAn
|
|
|
62
81
|
* @param quote The quote to validate
|
|
63
82
|
* @returns true to accept the quote and proceed with the exchange, false to reject it
|
|
64
83
|
*/
|
|
65
|
-
validateQuote?: (quote:
|
|
84
|
+
validateQuote?: (quote: ValidateQuoteArguments) => Promise<boolean> | boolean;
|
|
66
85
|
};
|
|
67
86
|
/**
|
|
68
87
|
* Storage driver to use for stateful operation and managing queues
|
|
@@ -90,11 +109,16 @@ export interface KeetaAnchorFXServerConfig extends KeetaAnchorHTTPServer.KeetaAn
|
|
|
90
109
|
networkAlias: typeof KeetaNet.Client.Config.networksArray[number];
|
|
91
110
|
} | KeetaNet.UserClient;
|
|
92
111
|
}
|
|
112
|
+
export type KeetaFXInternalPriceQuote = Omit<KeetaFXAnchorQuote, 'signed' | 'request'> & Pick<KeetaFXAnchorEstimate, 'convertedAmountBound'>;
|
|
113
|
+
export type ValidateQuoteArguments = KeetaFXInternalPriceQuote & Partial<Omit<KeetaFXAnchorQuote, keyof KeetaFXInternalPriceQuote>>;
|
|
114
|
+
export declare function toValidateQuoteInput(input: KeetaFXAnchorQuoteJSON | KeetaFXInternalPriceQuote | KeetaFXAnchorQuote): ValidateQuoteArguments;
|
|
93
115
|
type KeetaFXAnchorQueueStage1Request = {
|
|
94
116
|
account: KeetaNetAccount;
|
|
95
117
|
block: Parameters<typeof KeetaNet.UserClient['acceptSwapRequest']>[0]['block'];
|
|
96
118
|
request: ConversionInputCanonicalJSON;
|
|
97
|
-
expected:
|
|
119
|
+
expected: Extract<DeepRequired<NonNullable<Parameters<typeof KeetaNet.UserClient['acceptSwapRequest']>[0]['expected']>>, {
|
|
120
|
+
receive: unknown;
|
|
121
|
+
}>;
|
|
98
122
|
};
|
|
99
123
|
type KeetaFXAnchorQueueStage1Response = {
|
|
100
124
|
/**
|
|
@@ -161,6 +185,7 @@ export declare class KeetaNetFXAnchorHTTPServer extends KeetaAnchorHTTPServer.Ke
|
|
|
161
185
|
readonly quoteSigner: KeetaAnchorFXServerConfig['quoteSigner'];
|
|
162
186
|
readonly fx: KeetaAnchorFXServerConfig['fx'];
|
|
163
187
|
readonly pipeline: KeetaFXAnchorQueuePipeline;
|
|
188
|
+
readonly quoteConfiguration: Exclude<KeetaAnchorFXServerConfig['quoteConfiguration'], undefined>;
|
|
164
189
|
protected pipelineAutoRunInterval: ReturnType<typeof setInterval> | null;
|
|
165
190
|
constructor(config: KeetaAnchorFXServerConfig);
|
|
166
191
|
protected initRoutes(config: KeetaAnchorFXServerConfig): Promise<KeetaAnchorHTTPServer.Routes>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/services/fx/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,qBAAqB,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/services/fx/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,qBAAqB,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAUjD,OAAO,KAAK,EACX,4BAA4B,EAC5B,qBAAqB,EAGrB,kBAAkB,EAClB,sBAAsB,EAEtB,eAAe,EAEf,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAuC,MAAM,0BAA0B,CAAC;AACvG,OAAO,KAAK,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACzG,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,yBAAyB,CAAC;AAEpF,OAAO,KAAK,E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