@cityofzion/blockchain-service 0.12.0 → 0.13.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.
@@ -226,3 +226,59 @@ export interface LedgerService {
226
226
  getAddress(transport: Transport): Promise<string>;
227
227
  getPublicKey(transport: Transport): Promise<string>;
228
228
  }
229
+ export type SwapRoute = {
230
+ assetToUseSymbol: string;
231
+ reservesToUse: string;
232
+ assetToReceiveSymbol: string;
233
+ reservesToReceive: string;
234
+ };
235
+ export type SwapControllerServiceEvents = {
236
+ accountToUse: (account: Account | null) => void | Promise<void>;
237
+ amountToUse: (amount: string | null) => void | Promise<void>;
238
+ tokenToUse: (token: Token | null) => void | Promise<void>;
239
+ reservesToUse: (reserves: string | null) => void | Promise<void>;
240
+ amountToReceive: (amount: string | null) => void | Promise<void>;
241
+ tokenToReceive: (token: Token | null) => void | Promise<void>;
242
+ reservesToReceive: (reserves: string | null) => void | Promise<void>;
243
+ minimumReceived: (minimumReceived: string | null) => void | Promise<void>;
244
+ maximumSelling: (maximumSelling: string | null) => void | Promise<void>;
245
+ deadline: (deadline: string) => void | Promise<void>;
246
+ slippage: (slippage: number) => void | Promise<void>;
247
+ liquidityProviderFee: (liquidityProviderFee: string | null) => void | Promise<void>;
248
+ priceImpact: (priceImpact: string | null) => void | Promise<void>;
249
+ priceInverse: (priceInverse: string | null) => void | Promise<void>;
250
+ routes: (routes: SwapRoute[] | null) => void | Promise<void>;
251
+ lastAmountChanged: (lastAmountChanged: 'amountToUse' | 'amountToReceive' | null) => void | Promise<void>;
252
+ };
253
+ export type SwapControllerServiceSwapArgs = {
254
+ amountToUse: string;
255
+ amountToReceive: string;
256
+ tokenToUse: Token;
257
+ tokenToReceive: Token;
258
+ address: string;
259
+ deadline: string;
260
+ network: Network;
261
+ };
262
+ export type SwapControllerServiceSwapToUseArgs = {
263
+ minimumReceived: string;
264
+ type: 'swapTokenToUse';
265
+ } & SwapControllerServiceSwapArgs;
266
+ export type SwapControllerServiceSwapToReceiveArgs = {
267
+ maximumSelling: string;
268
+ type: 'swapTokenToReceive';
269
+ } & SwapControllerServiceSwapArgs;
270
+ export interface SwapControllerService {
271
+ eventEmitter: TypedEmitter<SwapControllerServiceEvents>;
272
+ setAccountToUse(account: Account | null): void;
273
+ setAmountToUse(amount: string | null): void;
274
+ setTokenToUse(token: Token | null): void;
275
+ setAmountToReceive(amount: string | null): void;
276
+ setTokenToReceive(token: Token | null): void;
277
+ setDeadline(deadline: string): void;
278
+ setSlippage(slippage: number): void;
279
+ swap(isLedger?: boolean): void;
280
+ buildSwapArgs(): SwapControllerServiceSwapToUseArgs | SwapControllerServiceSwapToReceiveArgs;
281
+ setReserves(): void;
282
+ startListeningBlockGeneration(): void;
283
+ stopListeningBlockGeneration(): void;
284
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/blockchain-service",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",