@cityofzion/bs-ethereum 2.5.0 → 2.6.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.
|
@@ -3,10 +3,8 @@ import { RpcNDSEthereum } from './RpcNDSEthereum';
|
|
|
3
3
|
import { BSEthereumNetworkId } from '../../constants/BSEthereumConstants';
|
|
4
4
|
export declare class GhostMarketNDSEthereum extends RpcNDSEthereum {
|
|
5
5
|
#private;
|
|
6
|
-
static
|
|
7
|
-
|
|
8
|
-
chain: string;
|
|
9
|
-
}>>;
|
|
6
|
+
static readonly BASE_URL = "https://api.ghostmarket.io/api/v2";
|
|
7
|
+
static CONFIG_BY_NETWORK_ID: Partial<Record<BSEthereumNetworkId, string>>;
|
|
10
8
|
constructor(network: Network<BSEthereumNetworkId>);
|
|
11
9
|
getNftsByAddress({ address, size, cursor }: GetNftsByAddressParams): Promise<NftsResponse>;
|
|
12
10
|
getNft({ contractHash, tokenId }: GetNftParam): Promise<NftResponse>;
|
|
@@ -28,6 +28,7 @@ exports.GhostMarketNDSEthereum = void 0;
|
|
|
28
28
|
const query_string_1 = __importDefault(require("query-string"));
|
|
29
29
|
const axios_1 = __importDefault(require("axios"));
|
|
30
30
|
const RpcNDSEthereum_1 = require("./RpcNDSEthereum");
|
|
31
|
+
const BSEthereumConstants_1 = require("../../constants/BSEthereumConstants");
|
|
31
32
|
class GhostMarketNDSEthereum extends RpcNDSEthereum_1.RpcNDSEthereum {
|
|
32
33
|
constructor(network) {
|
|
33
34
|
super(network);
|
|
@@ -69,11 +70,11 @@ class GhostMarketNDSEthereum extends RpcNDSEthereum_1.RpcNDSEthereum {
|
|
|
69
70
|
return srcImage;
|
|
70
71
|
}
|
|
71
72
|
getUrlWithParams(params) {
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
73
|
+
const chain = GhostMarketNDSEthereum.CONFIG_BY_NETWORK_ID[__classPrivateFieldGet(this, _GhostMarketNDSEthereum_network, "f").id];
|
|
74
|
+
if (!chain)
|
|
74
75
|
throw new Error('Unsupported network');
|
|
75
|
-
const parameters = query_string_1.default.stringify(Object.assign({ chain
|
|
76
|
-
return `${
|
|
76
|
+
const parameters = query_string_1.default.stringify(Object.assign({ chain }, params), { arrayFormat: 'bracket' });
|
|
77
|
+
return `${GhostMarketNDSEthereum.BASE_URL}/assets?${parameters}`;
|
|
77
78
|
}
|
|
78
79
|
parse(data) {
|
|
79
80
|
var _a, _b;
|
|
@@ -96,9 +97,8 @@ class GhostMarketNDSEthereum extends RpcNDSEthereum_1.RpcNDSEthereum {
|
|
|
96
97
|
}
|
|
97
98
|
exports.GhostMarketNDSEthereum = GhostMarketNDSEthereum;
|
|
98
99
|
_GhostMarketNDSEthereum_network = new WeakMap();
|
|
100
|
+
GhostMarketNDSEthereum.BASE_URL = 'https://api.ghostmarket.io/api/v2';
|
|
99
101
|
GhostMarketNDSEthereum.CONFIG_BY_NETWORK_ID = {
|
|
100
|
-
'1':
|
|
101
|
-
|
|
102
|
-
chain: 'eth',
|
|
103
|
-
},
|
|
102
|
+
'1': 'eth',
|
|
103
|
+
[BSEthereumConstants_1.BSEthereumConstants.NEOX_MAINNET_NETWORK_ID]: 'neox',
|
|
104
104
|
};
|