@cityofzion/blockchain-service 1.1.0 → 1.3.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.
- package/dist/BSAggregator.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/interfaces.d.ts +24 -27
- package/package.json +1 -1
package/dist/BSAggregator.js
CHANGED
|
@@ -70,10 +70,10 @@ class BSAggregator {
|
|
|
70
70
|
}
|
|
71
71
|
if (index !== 0) {
|
|
72
72
|
try {
|
|
73
|
-
const {
|
|
73
|
+
const { transactions } = yield service.blockchainDataService.getTransactionsByAddress({
|
|
74
74
|
address: generatedAccount.address,
|
|
75
75
|
});
|
|
76
|
-
if (!
|
|
76
|
+
if (!transactions || transactions.length <= 0)
|
|
77
77
|
hasError = true;
|
|
78
78
|
}
|
|
79
79
|
catch (_a) {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./interfaces"), exports);
|
|
18
17
|
__exportStar(require("./BSAggregator"), exports);
|
|
19
|
-
__exportStar(require("./functions"), exports);
|
|
20
18
|
__exportStar(require("./CryptoCompareEDS"), exports);
|
|
19
|
+
__exportStar(require("./functions"), exports);
|
|
20
|
+
__exportStar(require("./interfaces"), exports);
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -109,15 +109,12 @@ export type ContractParameter = {
|
|
|
109
109
|
type: string;
|
|
110
110
|
};
|
|
111
111
|
export type TransactionsByAddressResponse = {
|
|
112
|
-
totalCount?: number;
|
|
113
|
-
limit?: number;
|
|
114
|
-
nextCursor?: string;
|
|
115
112
|
transactions: TransactionResponse[];
|
|
113
|
+
nextPageParams?: any;
|
|
116
114
|
};
|
|
117
115
|
export type TransactionsByAddressParams = {
|
|
118
116
|
address: string;
|
|
119
|
-
|
|
120
|
-
cursor?: string;
|
|
117
|
+
nextPageParams?: any;
|
|
121
118
|
};
|
|
122
119
|
export type ContractMethod = {
|
|
123
120
|
name: string;
|
|
@@ -230,12 +227,12 @@ export interface LedgerService {
|
|
|
230
227
|
getPublicKey(transport: Transport): Promise<string>;
|
|
231
228
|
}
|
|
232
229
|
export type SwapRoute = {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
230
|
+
tokenToUse: Token;
|
|
231
|
+
reserveTokenToUse: string;
|
|
232
|
+
tokenToReceive: Token;
|
|
233
|
+
reserveTokenToReceive: string;
|
|
237
234
|
};
|
|
238
|
-
export type
|
|
235
|
+
export type SwapServiceEvents = {
|
|
239
236
|
accountToUse: (account: Account | null) => void | Promise<void>;
|
|
240
237
|
amountToUse: (amount: string | null) => void | Promise<void>;
|
|
241
238
|
tokenToUse: (token: Token | null) => void | Promise<void>;
|
|
@@ -250,38 +247,38 @@ export type SwapControllerServiceEvents = {
|
|
|
250
247
|
liquidityProviderFee: (liquidityProviderFee: string | null) => void | Promise<void>;
|
|
251
248
|
priceImpact: (priceImpact: string | null) => void | Promise<void>;
|
|
252
249
|
priceInverse: (priceInverse: string | null) => void | Promise<void>;
|
|
253
|
-
|
|
250
|
+
route: (route: SwapRoute[] | null) => void | Promise<void>;
|
|
254
251
|
lastAmountChanged: (lastAmountChanged: 'amountToUse' | 'amountToReceive' | null) => void | Promise<void>;
|
|
255
252
|
};
|
|
256
|
-
export type
|
|
257
|
-
amountToUse: string;
|
|
258
|
-
amountToReceive: string;
|
|
259
|
-
tokenToUse: Token;
|
|
260
|
-
tokenToReceive: Token;
|
|
253
|
+
export type SwapServiceSwapArgs<T extends string> = {
|
|
261
254
|
address: string;
|
|
255
|
+
routePath: Token[];
|
|
262
256
|
deadline: string;
|
|
263
257
|
network: Network<T>;
|
|
264
258
|
};
|
|
265
|
-
export type
|
|
259
|
+
export type SwapServiceSwapToUseArgs<T extends string> = {
|
|
260
|
+
amountToUse: string;
|
|
266
261
|
minimumReceived: string;
|
|
267
262
|
type: 'swapTokenToUse';
|
|
268
|
-
} &
|
|
269
|
-
export type
|
|
263
|
+
} & SwapServiceSwapArgs<T>;
|
|
264
|
+
export type SwapServiceSwapToReceiveArgs<T extends string> = {
|
|
265
|
+
amountToReceive: string;
|
|
270
266
|
maximumSelling: string;
|
|
271
267
|
type: 'swapTokenToReceive';
|
|
272
|
-
} &
|
|
273
|
-
export
|
|
274
|
-
|
|
268
|
+
} & SwapServiceSwapArgs<T>;
|
|
269
|
+
export type PoolGraph = Record<string, string[]>;
|
|
270
|
+
export interface SwapService<AvailableNetworkIds extends string> {
|
|
271
|
+
eventEmitter: TypedEmitter<SwapServiceEvents>;
|
|
272
|
+
buildSwapInvocationArgs(): SwapServiceSwapToUseArgs<AvailableNetworkIds> | SwapServiceSwapToReceiveArgs<AvailableNetworkIds>;
|
|
275
273
|
setAccountToUse(account: Account | null): void;
|
|
276
274
|
setAmountToUse(amount: string | null): void;
|
|
277
|
-
setTokenToUse(token: Token | null): void;
|
|
278
275
|
setAmountToReceive(amount: string | null): void;
|
|
279
|
-
setTokenToReceive(token: Token | null): void;
|
|
280
276
|
setDeadline(deadline: string): void;
|
|
281
277
|
setSlippage(slippage: number): void;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
setReserves(): void;
|
|
278
|
+
setTokenToUse(token: Token | null): void;
|
|
279
|
+
setTokenToReceive(token: Token | null): void;
|
|
285
280
|
startListeningBlockGeneration(): void;
|
|
286
281
|
stopListeningBlockGeneration(): void;
|
|
282
|
+
listSwappableTokens(network: Network<AvailableNetworkIds>): PoolGraph;
|
|
283
|
+
swap(isLedger?: boolean): void;
|
|
287
284
|
}
|