@cityofzion/bs-neox 3.1.9 → 3.1.10
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,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GhostMarketNDS, type THasTokenParams } from '@cityofzion/blockchain-service';
|
|
2
2
|
import type { IBSNeoX, TBSNeoXName, TBSNeoXNetworkId } from '../../types';
|
|
3
|
-
export declare class GhostMarketNDSNeoX extends
|
|
3
|
+
export declare class GhostMarketNDSNeoX extends GhostMarketNDS<TBSNeoXName, TBSNeoXNetworkId, IBSNeoX> {
|
|
4
4
|
static readonly CHAIN_BY_NETWORK_ID: Partial<Record<TBSNeoXNetworkId, string>>;
|
|
5
5
|
constructor(service: IBSNeoX);
|
|
6
|
+
hasToken({ address, collectionHash }: THasTokenParams): Promise<boolean>;
|
|
6
7
|
getChain(): string;
|
|
7
8
|
}
|
|
@@ -2,10 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GhostMarketNDSNeoX = void 0;
|
|
4
4
|
const bs_ethereum_1 = require("@cityofzion/bs-ethereum");
|
|
5
|
-
|
|
5
|
+
const blockchain_service_1 = require("@cityofzion/blockchain-service");
|
|
6
|
+
const ethers_1 = require("ethers");
|
|
7
|
+
class GhostMarketNDSNeoX extends blockchain_service_1.GhostMarketNDS {
|
|
6
8
|
constructor(service) {
|
|
7
9
|
super(service);
|
|
8
10
|
}
|
|
11
|
+
async hasToken({ address, collectionHash }) {
|
|
12
|
+
try {
|
|
13
|
+
if (!collectionHash)
|
|
14
|
+
return false;
|
|
15
|
+
const provider = new ethers_1.ethers.providers.JsonRpcProvider(this._service.network.url);
|
|
16
|
+
const contract = new ethers_1.ethers.Contract(collectionHash, bs_ethereum_1.ERC20_ABI, provider);
|
|
17
|
+
const response = await contract.balanceOf(address);
|
|
18
|
+
if (!response)
|
|
19
|
+
return false;
|
|
20
|
+
const parsedResponse = response;
|
|
21
|
+
return parsedResponse.gt(0);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
9
27
|
getChain() {
|
|
10
28
|
const chain = GhostMarketNDSNeoX.CHAIN_BY_NETWORK_ID[this._service.network.id];
|
|
11
29
|
if (!chain)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neox",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.10",
|
|
4
4
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"author": "Coz",
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@cityofzion/dora-ts": "0.6.2",
|
|
14
|
-
"axios": "~1.
|
|
14
|
+
"axios": "~1.15.0",
|
|
15
15
|
"ethers": "~5.7.2",
|
|
16
16
|
"neox-tpke": "~1.0.5",
|
|
17
17
|
"viem": "~2.38.5",
|
|
18
|
-
"@cityofzion/bs-ethereum": "3.1.
|
|
19
|
-
"@cityofzion/bs-neo3": "3.1.
|
|
20
|
-
"@cityofzion/blockchain-service": "3.1.
|
|
18
|
+
"@cityofzion/bs-ethereum": "3.1.10",
|
|
19
|
+
"@cityofzion/bs-neo3": "3.1.10",
|
|
20
|
+
"@cityofzion/blockchain-service": "3.1.10"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@ledgerhq/hw-transport": "~6.32.0",
|