@cityofzion/bs-ethereum 1.0.3 → 1.0.4

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.
@@ -1,3 +1,3 @@
1
1
  {
2
- "nonCachedDurationMs": 2456.2693220000074
2
+ "nonCachedDurationMs": 2408.369583000007
3
3
  }
@@ -2,18 +2,18 @@
2
2
  "files": {
3
3
  "packages/bs-ethereum/.eslintignore": "3ee402c88b68258919e4f4b4eef4f25e5d078d90",
4
4
  "packages/bs-ethereum/.eslintrc.cjs": "5ec0bf6332ec01b3e02beb532bb47025c4c1bf7b",
5
- "packages/bs-ethereum/CHANGELOG.json": "52f7565b9455ae693f0b870741ce9ac69ac8ece3",
6
- "packages/bs-ethereum/CHANGELOG.md": "1a2e1ab64b099b95532c397fd44a19ec709a5931",
5
+ "packages/bs-ethereum/CHANGELOG.json": "0094ceba141816910afd5af220cb454d2c78761a",
6
+ "packages/bs-ethereum/CHANGELOG.md": "6402c0560ff4ad6a6cafcfb1b53a6dbd2d87d97e",
7
7
  "packages/bs-ethereum/jest.config.ts": "d944475db93cbe41a9339187fd94b9962e411c43",
8
8
  "packages/bs-ethereum/jest.setup.ts": "9a1976a32050616d4d2ee95b1aa21041bc4daca3",
9
- "packages/bs-ethereum/package.json": "1adbf3bd6afb0f62ab98f33bf7e38089707f92e7",
10
- "packages/bs-ethereum/src/BSEthereum.ts": "21e03098208f6764ca8848cc344a6268ff16262c",
9
+ "packages/bs-ethereum/package.json": "6898373785607fd411c9c33df47c7484a27a7f9b",
10
+ "packages/bs-ethereum/src/BSEthereum.ts": "f1214f4571cd94d2072e76f356e36d8d5b6d2094",
11
11
  "packages/bs-ethereum/src/BitqueryBDSEthereum.ts": "47f24d0f3a94aa0eb761e1c2e96f6aeb9c51f82b",
12
12
  "packages/bs-ethereum/src/BitqueryEDSEthereum.ts": "a1232bf1d1683d7fe0e752577f3eb489cfce734f",
13
13
  "packages/bs-ethereum/src/GhostMarketNDSEthereum.ts": "c97f7fd9323b4089a8f2ed4178dbc14a0d17c61c",
14
14
  "packages/bs-ethereum/src/RpcBDSEthereum.ts": "6cbca256420b09cef7182cbc485eb4799ff9b614",
15
15
  "packages/bs-ethereum/src/__tests__/BDSEthereum.spec.ts": "b5d64fe975c82fb604f15717ede1707d016d1f9d",
16
- "packages/bs-ethereum/src/__tests__/BSEthereum.spec.ts": "4d123a45f1431ad00db142522423359122b692b7",
16
+ "packages/bs-ethereum/src/__tests__/BSEthereum.spec.ts": "13a4b1a9c94b95536d4e067cd7f738b9779344e2",
17
17
  "packages/bs-ethereum/src/__tests__/BitqueryEDSEthereum.spec.ts": "a0994e0ad66408b281ec96a5f72b30b5e14a68ce",
18
18
  "packages/bs-ethereum/src/__tests__/GhostMarketNDSEthereum.spec.ts": "4b10ef2b59437c9ea06695ab4844d5b131f65738",
19
19
  "packages/bs-ethereum/src/assets/tokens/common.json": "96597dd06475ee6068b484510f27ffad27b52ebd",
package/CHANGELOG.json CHANGED
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-ethereum",
3
3
  "entries": [
4
+ {
5
+ "version": "1.0.4",
6
+ "tag": "@cityofzion/bs-ethereum_v1.0.4",
7
+ "date": "Mon, 04 Mar 2024 21:53:09 GMT",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "fix wrong calculated fee"
12
+ }
13
+ ]
14
+ }
15
+ },
4
16
  {
5
17
  "version": "1.0.3",
6
18
  "tag": "@cityofzion/bs-ethereum_v1.0.3",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log - @cityofzion/bs-ethereum
2
2
 
3
- This log was last generated on Wed, 28 Feb 2024 17:43:01 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 04 Mar 2024 21:53:09 GMT and should not be manually modified.
4
+
5
+ ## 1.0.4
6
+ Mon, 04 Mar 2024 21:53:09 GMT
7
+
8
+ ### Patches
9
+
10
+ - fix wrong calculated fee
4
11
 
5
12
  ## 1.0.3
6
13
  Wed, 28 Feb 2024 17:43:01 GMT
@@ -152,6 +152,7 @@ class BSEthereum {
152
152
  return __awaiter(this, void 0, void 0, function* () {
153
153
  const provider = new ethers_1.ethers.providers.JsonRpcProvider(this.network.url);
154
154
  const wallet = new ethers_1.ethers.Wallet(senderAccount.key, provider);
155
+ const gasPrice = yield provider.getGasPrice();
155
156
  let estimated;
156
157
  const isNative = constants_1.NATIVE_ASSETS.some(asset => asset.hash === intent.tokenHash);
157
158
  const decimals = (_a = intent.tokenDecimals) !== null && _a !== void 0 ? _a : 18;
@@ -166,7 +167,7 @@ class BSEthereum {
166
167
  value: amount,
167
168
  });
168
169
  }
169
- return ethers_1.ethers.utils.formatEther(estimated);
170
+ return ethers_1.ethers.utils.formatEther(gasPrice.mul(estimated));
170
171
  });
171
172
  }
172
173
  resolveNameServiceDomain(domainName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-ethereum",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",
package/src/BSEthereum.ts CHANGED
@@ -155,6 +155,8 @@ export class BSEthereum<BSCustomName extends string = string>
155
155
  const provider = new ethers.providers.JsonRpcProvider(this.network.url)
156
156
  const wallet = new ethers.Wallet(senderAccount.key, provider)
157
157
 
158
+ const gasPrice = await provider.getGasPrice()
159
+
158
160
  let estimated: ethers.BigNumber
159
161
 
160
162
  const isNative = NATIVE_ASSETS.some(asset => asset.hash === intent.tokenHash)
@@ -176,7 +178,7 @@ export class BSEthereum<BSCustomName extends string = string>
176
178
  })
177
179
  }
178
180
 
179
- return ethers.utils.formatEther(estimated)
181
+ return ethers.utils.formatEther(gasPrice.mul(estimated))
180
182
  }
181
183
 
182
184
  async resolveNameServiceDomain(domainName: string): Promise<string> {
@@ -89,7 +89,7 @@ describe('BSEthereum', () => {
89
89
  },
90
90
  })
91
91
 
92
- expect(fee).toEqual(expect.any(Number))
92
+ expect(fee).toEqual(expect.any(String))
93
93
  })
94
94
 
95
95
  it.skip('Should be able to transfer a native token', async () => {