@cityofzion/blockchain-service 3.0.0 → 3.0.2

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.
@@ -32,7 +32,6 @@ export type TIntentTransferParam = {
32
32
  export type TTransferParam<N extends string> = {
33
33
  senderAccount: TBSAccount<N>;
34
34
  intents: TIntentTransferParam[];
35
- priorityFee?: string;
36
35
  };
37
36
  export type TPingNetworkResponse = {
38
37
  latency: number;
@@ -108,7 +107,7 @@ export type TTransactionNftEvent = {
108
107
  eventType: 'nft';
109
108
  amount?: string;
110
109
  methodName: string;
111
- collectionHash: string;
110
+ collectionHash?: string;
112
111
  collectionHashUrl?: string;
113
112
  to?: string;
114
113
  toUrl?: string;
@@ -134,7 +133,7 @@ export type TTransactionTokenEvent = {
134
133
  token?: TBSToken;
135
134
  tokenType: 'generic' | (string & NonNullable<unknown>);
136
135
  };
137
- type TTransactionDefault = {
136
+ export type TTransactionDefault = {
138
137
  type: 'default';
139
138
  };
140
139
  export type TTransactionBridgeNeo3NeoX<N extends string> = {
@@ -227,12 +226,12 @@ export interface IExchangeDataService {
227
226
  export type TNftResponse = {
228
227
  hash: string;
229
228
  explorerUri?: string;
230
- collection: {
229
+ collection?: {
231
230
  name?: string;
232
231
  image?: string;
233
232
  hash: string;
234
233
  };
235
- creator: {
234
+ creator?: {
236
235
  address: string;
237
236
  name?: string;
238
237
  };
@@ -243,8 +242,7 @@ export type TNftResponse = {
243
242
  };
244
243
  export type TNftsResponse = {
245
244
  items: TNftResponse[];
246
- nextCursor?: string;
247
- total?: number;
245
+ nextPageParams?: any;
248
246
  };
249
247
  export type TGetNftsByAddressParams = {
250
248
  address: string;
@@ -254,11 +252,11 @@ export type TGetNftsByAddressParams = {
254
252
  };
255
253
  export type TGetNftParam = {
256
254
  tokenHash: string;
257
- collectionHash: string;
255
+ collectionHash?: string;
258
256
  };
259
257
  export type THasTokenParam = {
260
258
  address: string;
261
- collectionHash: string;
259
+ collectionHash?: string;
262
260
  };
263
261
  export interface INftDataService {
264
262
  getNftsByAddress(params: TGetNftsByAddressParams): Promise<TNftsResponse>;
@@ -266,7 +264,7 @@ export interface INftDataService {
266
264
  hasToken(params: THasTokenParam): Promise<boolean>;
267
265
  }
268
266
  export type TBuildNftUrlParams = {
269
- collectionHash: string;
267
+ collectionHash?: string;
270
268
  tokenHash: string;
271
269
  };
272
270
  export interface IExplorerService {
@@ -456,4 +454,3 @@ export interface IWalletConnectService<N extends string> {
456
454
  calculateRequestFee(args: TWalletConnectServiceRequestMethodParams<N>): Promise<string>;
457
455
  [methodName: string]: any | TWalletConnectServiceRequestMethod<N>;
458
456
  }
459
- export {};
@@ -22,6 +22,7 @@ exports.GhostMarketNDS = void 0;
22
22
  const axios_1 = __importDefault(require("axios"));
23
23
  const query_string_1 = __importDefault(require("query-string"));
24
24
  const functions_1 = require("../../functions");
25
+ const error_1 = require("../../error");
25
26
  class GhostMarketNDS {
26
27
  constructor(service) {
27
28
  _GhostMarketNDS_instances.add(this);
@@ -43,11 +44,14 @@ class GhostMarketNDS {
43
44
  __classPrivateFieldGet(this, _GhostMarketNDS_nftsCacheMap, "f").set(__classPrivateFieldGet(this, _GhostMarketNDS_instances, "m", _GhostMarketNDS_buildNftsCacheKey).call(this, nft.contract.hash, nft.tokenId), item);
44
45
  return item;
45
46
  });
46
- return { nextCursor: data.next, items };
47
+ return { nextPageParams: data.next, items };
47
48
  });
48
49
  }
49
50
  getNft(_b) {
50
51
  return __awaiter(this, arguments, void 0, function* ({ collectionHash, tokenHash }) {
52
+ if (!collectionHash) {
53
+ throw new error_1.BSError('collectionHash is required to get NFT from GhostMarketNDSNeo3', 'REQUIRED_PARAMETER_MISSING');
54
+ }
51
55
  const cacheKey = __classPrivateFieldGet(this, _GhostMarketNDS_instances, "m", _GhostMarketNDS_buildNftsCacheKey).call(this, collectionHash, tokenHash);
52
56
  const nftFromCache = __classPrivateFieldGet(this, _GhostMarketNDS_nftsCacheMap, "f").get(cacheKey);
53
57
  if (nftFromCache) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/blockchain-service",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",