@meterio/sumer-js 0.2.162 → 0.2.163
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/nodejs/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* @desc This file defines the constructor of the `Sumer` class.
|
|
4
4
|
* @hidden
|
|
5
5
|
*/
|
|
6
|
-
import { ethers } from 'ethers';
|
|
6
|
+
import { ethers, JsonRpcSigner } from 'ethers';
|
|
7
7
|
import * as eth from './eth';
|
|
8
8
|
import * as util from './util';
|
|
9
|
-
import {
|
|
9
|
+
import { SumerOptions, SumerInstance } from './types';
|
|
10
10
|
/**
|
|
11
11
|
* Creates an instance of the Sumer.js SDK.
|
|
12
12
|
*
|
|
@@ -38,7 +38,7 @@ import { Provider, SumerOptions, SumerInstance } from './types';
|
|
|
38
38
|
* @returns {object} Returns an instance of the Sumer.js SDK.
|
|
39
39
|
*/
|
|
40
40
|
declare const Sumer: {
|
|
41
|
-
(provider
|
|
41
|
+
(provider: JsonRpcSigner, options: SumerOptions): SumerInstance;
|
|
42
42
|
eth: typeof eth;
|
|
43
43
|
util: typeof util;
|
|
44
44
|
_ethers: typeof ethers;
|
package/dist/nodejs/index.js
CHANGED
|
@@ -69,18 +69,8 @@ const constants_1 = require("./constants");
|
|
|
69
69
|
*
|
|
70
70
|
* @returns {object} Returns an instance of the Sumer.js SDK.
|
|
71
71
|
*/
|
|
72
|
-
const Sumer = function (provider
|
|
73
|
-
const
|
|
74
|
-
options.provider = provider || options.provider;
|
|
75
|
-
provider = eth._createProvider(options);
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
77
|
-
const instance = Object.assign(Object.assign(Object.assign({ _originalProvider: originalProvider, _provider: provider }, comptroller), cToken), {
|
|
78
|
-
// ...gov,
|
|
79
|
-
// claimComp: comp.claimComp,
|
|
80
|
-
// delegate: comp.delegate,
|
|
81
|
-
// delegateBySig: comp.delegateBySig,
|
|
82
|
-
// createDelegateSignature: comp.createDelegateSignature,
|
|
83
|
-
_network: {
|
|
72
|
+
const Sumer = function (provider, options) {
|
|
73
|
+
const instance = Object.assign(Object.assign(Object.assign({ _provider: provider }, comptroller), cToken), { _network: {
|
|
84
74
|
id: options.networkId,
|
|
85
75
|
name: options.networkName,
|
|
86
76
|
}, getTokenPairBySymbol: (symbol) => {
|
|
@@ -90,12 +80,6 @@ const Sumer = function (provider = 'mainnet', options = {}) {
|
|
|
90
80
|
}, getTokenPairsByGroupId: (assetGroupId) => {
|
|
91
81
|
return (0, constants_1.getTokenPairsByGroupId)(options.networkName, assetGroupId);
|
|
92
82
|
} });
|
|
93
|
-
// Instance needs to know which network the provider connects to, so it can
|
|
94
|
-
// use the correct contract addresses.
|
|
95
|
-
// instance._networkPromise = eth.getProviderNetwork(provider).then((network) => {
|
|
96
|
-
// delete instance._networkPromise
|
|
97
|
-
// instance._network = network
|
|
98
|
-
// })
|
|
99
83
|
return instance;
|
|
100
84
|
};
|
|
101
85
|
Sumer.eth = eth;
|
package/dist/nodejs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mCAA8C;AAC9C,2CAA4B;AAC5B,6CAA8B;AAC9B,2DAA4C;AAC5C,iDAAkC;AAClC,2CAAuC;AACvC,iCAAiC;AACjC,+BAA+B;AAC/B,+BAA2B;AAC3B,2CAcoB;AAGpB,8BAA8B;AAC9B,oEAAoE;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,KAAK,GAAG,UAAU,QAAuB,EAAE,OAAqB;IAEpE,MAAM,QAAQ,+C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B,GAAG,4BAAgB,CAAA;AACzC,KAAK,CAAC,eAAe,GAAG,2BAAe,CAAA;AACvC,KAAK,CAAC,OAAO,GAAG,mBAAO,CAAA;AACvB,iBAAiB;AACjB,yCAAyC;AACzC,yCAAyC;AACzC,IAAI;AACJ,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,qBAAS,CAAC,CAAA;AAE/B,iBAAS,KAAK,CAAA"}
|
package/dist/nodejs/types.d.ts
CHANGED
|
@@ -5,11 +5,8 @@ export interface SumerInstance {
|
|
|
5
5
|
}
|
|
6
6
|
export { Provider } from 'ethers';
|
|
7
7
|
export interface SumerOptions {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
provider?: Provider | string;
|
|
11
|
-
networkId?: string | number;
|
|
12
|
-
networkName?: string;
|
|
8
|
+
networkId: string | number;
|
|
9
|
+
networkName: string;
|
|
13
10
|
}
|
|
14
11
|
export interface AbiType {
|
|
15
12
|
internalType?: string;
|