@cityofzion/bs-ethereum 1.0.2 → 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": 2506.814418000169
2
+ "nonCachedDurationMs": 2408.369583000007
3
3
  }
@@ -2,20 +2,20 @@
2
2
  "files": {
3
3
  "packages/bs-ethereum/.eslintignore": "3ee402c88b68258919e4f4b4eef4f25e5d078d90",
4
4
  "packages/bs-ethereum/.eslintrc.cjs": "5ec0bf6332ec01b3e02beb532bb47025c4c1bf7b",
5
- "packages/bs-ethereum/CHANGELOG.json": "e9deaab142df67f914c0937a354e52d95788e123",
6
- "packages/bs-ethereum/CHANGELOG.md": "df6978b6ed3433dd4fea769889161b1b95ef68e7",
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": "c601b40f37debd8788b2aab66e4a2387bbb821e8",
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
- "packages/bs-ethereum/src/GhostMarketNDSEthereum.ts": "7768175d74e42759582273f7f0ae4dff5054c2ca",
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
- "packages/bs-ethereum/src/__tests__/GhostMarketNDSEthereum.spec.ts": "f5c9ba8f6c866b97bcf647d105bfa2d5f140180d",
18
+ "packages/bs-ethereum/src/__tests__/GhostMarketNDSEthereum.spec.ts": "4b10ef2b59437c9ea06695ab4844d5b131f65738",
19
19
  "packages/bs-ethereum/src/assets/tokens/common.json": "96597dd06475ee6068b484510f27ffad27b52ebd",
20
20
  "packages/bs-ethereum/src/constants.ts": "03fa0c2e94d53e42f1b81e66f736807364b60f16",
21
21
  "packages/bs-ethereum/src/graphql.ts": "2e759e198a9a37205ed115c41165eda18df66539",
package/CHANGELOG.json CHANGED
@@ -1,6 +1,35 @@
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
+ },
16
+ {
17
+ "version": "1.0.3",
18
+ "tag": "@cityofzion/bs-ethereum_v1.0.3",
19
+ "date": "Wed, 28 Feb 2024 17:43:01 GMT",
20
+ "comments": {
21
+ "patch": [
22
+ {
23
+ "comment": "Add creator infomations in nft methods return"
24
+ }
25
+ ],
26
+ "dependency": [
27
+ {
28
+ "comment": "Updating dependency \"@cityofzion/blockchain-service\" to `0.9.1`"
29
+ }
30
+ ]
31
+ }
32
+ },
4
33
  {
5
34
  "version": "1.0.2",
6
35
  "tag": "@cityofzion/bs-ethereum_v1.0.2",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Change Log - @cityofzion/bs-ethereum
2
2
 
3
- This log was last generated on Tue, 27 Feb 2024 20:29:09 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
11
+
12
+ ## 1.0.3
13
+ Wed, 28 Feb 2024 17:43:01 GMT
14
+
15
+ ### Patches
16
+
17
+ - Add creator infomations in nft methods return
4
18
 
5
19
  ## 1.0.2
6
20
  Tue, 27 Feb 2024 20:29:09 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) {
@@ -70,6 +70,10 @@ class GhostMarketNDSEthereum {
70
70
  image: this.treatGhostMarketImage(data.metadata.mediaUri),
71
71
  isSVG: String(data.metadata.mediaType).includes('svg+xml'),
72
72
  name: data.metadata.name,
73
+ creator: {
74
+ address: data.creator.address,
75
+ name: data.creator.offchainName,
76
+ },
73
77
  };
74
78
  return nftResponse;
75
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-ethereum",
3
- "version": "1.0.2",
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",
@@ -16,7 +16,7 @@
16
16
  "@ethersproject/json-wallets": "5.7.0",
17
17
  "@ethersproject/bytes": "5.7.0",
18
18
  "@ethersproject/bignumber": "5.7.0",
19
- "@cityofzion/blockchain-service": "0.9.0"
19
+ "@cityofzion/blockchain-service": "0.9.1"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/jest": "29.5.3",
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> {
@@ -19,7 +19,7 @@ type GhostMarketNFT = {
19
19
  symbol: string
20
20
  }
21
21
  creator: {
22
- address?: string
22
+ address: string
23
23
  offchainName?: string
24
24
  }
25
25
  apiUrl?: string
@@ -114,6 +114,10 @@ export class GhostMarketNDSEthereum implements NftDataService {
114
114
  image: this.treatGhostMarketImage(data.metadata.mediaUri),
115
115
  isSVG: String(data.metadata.mediaType).includes('svg+xml'),
116
116
  name: data.metadata.name,
117
+ creator: {
118
+ address: data.creator.address,
119
+ name: data.creator.offchainName,
120
+ },
117
121
  }
118
122
 
119
123
  return nftResponse
@@ -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 () => {
@@ -23,6 +23,10 @@ describe('GhostMarketNDSEthereum', () => {
23
23
  image: expect.any(String),
24
24
  isSVG: expect.any(Boolean),
25
25
  name: 'MOAR #379',
26
+ creator: {
27
+ address: '0xd71ef31e9d4e8674d9177c28cc2d0d633580615b',
28
+ name: undefined,
29
+ },
26
30
  })
27
31
  )
28
32
  })