@cityofzion/blockchain-service 1.22.2 → 1.22.3
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.
package/dist/functions.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { TBSAccount, IBlockchainService, IBSWithClaim, IBSWithEncryption, IBSWithExplorer, IBSWithFee, IBSWithLedger, IBSWithNameService, IBSWithNeo3NeoXBridge, IBSWithNft, TUntilIndexRecord, IBSWithWalletConnect } from './interfaces';
|
|
2
|
-
export declare function hasNameService<
|
|
3
|
-
export declare function isClaimable<
|
|
4
|
-
export declare function isCalculableFee<
|
|
5
|
-
export declare function hasNft<
|
|
6
|
-
export declare function hasExplorerService<
|
|
7
|
-
export declare function hasLedger<
|
|
8
|
-
export declare function hasNeo3NeoXBridge<
|
|
9
|
-
export declare function hasEncryption<
|
|
10
|
-
export declare function hasWalletConnect<
|
|
2
|
+
export declare function hasNameService<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>): service is IBlockchainService<N, A> & IBSWithNameService;
|
|
3
|
+
export declare function isClaimable<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>): service is IBlockchainService<N, A> & IBSWithClaim<N>;
|
|
4
|
+
export declare function isCalculableFee<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>): service is IBlockchainService<N, A> & IBSWithFee<N>;
|
|
5
|
+
export declare function hasNft<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>): service is IBlockchainService<N, A> & IBSWithNft;
|
|
6
|
+
export declare function hasExplorerService<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>): service is IBlockchainService<N, A> & IBSWithExplorer;
|
|
7
|
+
export declare function hasLedger<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>): service is IBlockchainService<N, A> & IBSWithLedger<N>;
|
|
8
|
+
export declare function hasNeo3NeoXBridge<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>): service is IBlockchainService<N, A> & IBSWithNeo3NeoXBridge<N>;
|
|
9
|
+
export declare function hasEncryption<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>): service is IBlockchainService<N, A> & IBSWithEncryption<N>;
|
|
10
|
+
export declare function hasWalletConnect<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>): service is IBlockchainService<N, A> & IBSWithWalletConnect;
|
|
11
11
|
/**
|
|
12
12
|
* @deprecated use `waitForAccountTransaction` instead
|
|
13
13
|
*/
|
|
14
|
-
export declare function waitForTransaction<
|
|
15
|
-
export declare function waitForAccountTransaction<
|
|
16
|
-
service: IBlockchainService<
|
|
14
|
+
export declare function waitForTransaction<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>, txId: string): Promise<boolean>;
|
|
15
|
+
export declare function waitForAccountTransaction<N extends string = string, A extends string = string>(params: {
|
|
16
|
+
service: IBlockchainService<N, A>;
|
|
17
17
|
txId: string;
|
|
18
18
|
address: string;
|
|
19
19
|
maxAttempts?: number;
|
|
20
20
|
}): Promise<boolean>;
|
|
21
|
-
export declare function fetchAccounts<
|
|
22
|
-
export declare function generateAccount<
|
|
23
|
-
export declare function generateAccountForBlockchainService<
|
|
21
|
+
export declare function fetchAccounts<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>, initialIndex: number, getAccountCallback: (service: IBlockchainService<N, A>, index: number) => Promise<TBSAccount<N>>): Promise<TBSAccount<N>[]>;
|
|
22
|
+
export declare function generateAccount<N extends string = string, A extends string = string>(service: IBlockchainService<N, A>, initialIndex: number, untilIndex: number, getAccountCallback: (service: IBlockchainService<N, A>, index: number) => Promise<TBSAccount<N>>): Promise<TBSAccount<N>[]>;
|
|
23
|
+
export declare function generateAccountForBlockchainService<N extends string = string, A extends string = string>(services: IBlockchainService<N, A>[], getAccountCallback: (service: IBlockchainService<N, A>, index: number) => Promise<TBSAccount<N>>, untilIndexByBlockchainService?: TUntilIndexRecord<N>): Promise<Map<N, TBSAccount<N>[]>>;
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { TGetNftParam, TGetNftsByAddressParams, THasTokenParam, INftDataService, TNftResponse, TNftsResponse } from '../../interfaces';
|
|
2
|
-
export declare abstract class GhostMarketNDS implements INftDataService {
|
|
1
|
+
import { TGetNftParam, TGetNftsByAddressParams, THasTokenParam, INftDataService, TNftResponse, TNftsResponse, type IBlockchainService } from '../../interfaces';
|
|
2
|
+
export declare abstract class GhostMarketNDS<N extends string, A extends string, T extends IBlockchainService<N, A>> implements INftDataService {
|
|
3
3
|
#private;
|
|
4
4
|
static readonly BASE_URL: string;
|
|
5
|
+
_service: T;
|
|
6
|
+
constructor(service: T);
|
|
5
7
|
getNftsByAddress({ address, size, cursor }: TGetNftsByAddressParams): Promise<TNftsResponse>;
|
|
6
8
|
getNft({ collectionHash, tokenHash }: TGetNftParam): Promise<TNftResponse>;
|
|
7
9
|
abstract hasToken({ collectionHash, address }: THasTokenParam): Promise<boolean>;
|
|
@@ -21,9 +21,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
exports.GhostMarketNDS = void 0;
|
|
22
22
|
const axios_1 = __importDefault(require("axios"));
|
|
23
23
|
const query_string_1 = __importDefault(require("query-string"));
|
|
24
|
+
const functions_1 = require("../../functions");
|
|
24
25
|
class GhostMarketNDS {
|
|
25
|
-
constructor() {
|
|
26
|
+
constructor(service) {
|
|
26
27
|
_GhostMarketNDS_instances.add(this);
|
|
28
|
+
this._service = service;
|
|
27
29
|
}
|
|
28
30
|
getNftsByAddress(_b) {
|
|
29
31
|
return __awaiter(this, arguments, void 0, function* ({ address, size = 18, cursor }) {
|
|
@@ -68,6 +70,18 @@ _a = GhostMarketNDS, _GhostMarketNDS_instances = new WeakSet(), _GhostMarketNDS_
|
|
|
68
70
|
return `${_a.BASE_URL}/assets?${parameters}`;
|
|
69
71
|
}, _GhostMarketNDS_parse = function _GhostMarketNDS_parse(data) {
|
|
70
72
|
var _b, _c;
|
|
73
|
+
let explorerUri;
|
|
74
|
+
if ((0, functions_1.hasExplorerService)(this._service)) {
|
|
75
|
+
try {
|
|
76
|
+
explorerUri = this._service.explorerService.buildNftUrl({
|
|
77
|
+
tokenHash: data.tokenId,
|
|
78
|
+
collectionHash: data.contract.hash,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
catch (_d) {
|
|
82
|
+
/* empty */
|
|
83
|
+
}
|
|
84
|
+
}
|
|
71
85
|
const nftResponse = {
|
|
72
86
|
hash: data.tokenId,
|
|
73
87
|
collection: {
|
|
@@ -79,6 +93,7 @@ _a = GhostMarketNDS, _GhostMarketNDS_instances = new WeakSet(), _GhostMarketNDS_
|
|
|
79
93
|
image: __classPrivateFieldGet(this, _GhostMarketNDS_instances, "m", _GhostMarketNDS_treatGhostMarketImage).call(this, data.metadata.mediaUri),
|
|
80
94
|
isSVG: String(data.metadata.mediaType).includes('svg+xml'),
|
|
81
95
|
name: data.metadata.name,
|
|
96
|
+
explorerUri,
|
|
82
97
|
creator: {
|
|
83
98
|
address: data.creator.address,
|
|
84
99
|
name: data.creator.offchainName,
|