@sudobility/mail_box_types 1.0.1
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/index.cjs +27 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/types/common/index.cjs +15 -0
- package/dist/types/common/index.d.ts +37 -0
- package/dist/types/common/index.d.ts.map +1 -0
- package/dist/types/common/index.js +15 -0
- package/dist/types/common/index.js.map +1 -0
- package/dist/types/index.cjs +25 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +25 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/indexer/index.cjs +31 -0
- package/dist/types/indexer/index.d.ts +3 -0
- package/dist/types/indexer/index.d.ts.map +1 -0
- package/dist/types/indexer/index.js +31 -0
- package/dist/types/indexer/index.js.map +1 -0
- package/dist/types/indexer/indexer-guards.cjs +303 -0
- package/dist/types/indexer/indexer-guards.d.ts +37 -0
- package/dist/types/indexer/indexer-guards.d.ts.map +1 -0
- package/dist/types/indexer/indexer-guards.js +303 -0
- package/dist/types/indexer/indexer-guards.js.map +1 -0
- package/dist/types/indexer/indexer-responses.cjs +7 -0
- package/dist/types/indexer/indexer-responses.d.ts +213 -0
- package/dist/types/indexer/indexer-responses.d.ts.map +1 -0
- package/dist/types/indexer/indexer-responses.js +7 -0
- package/dist/types/indexer/indexer-responses.js.map +1 -0
- package/dist/types/kyc/index.cjs +19 -0
- package/dist/types/kyc/index.d.ts +2 -0
- package/dist/types/kyc/index.d.ts.map +1 -0
- package/dist/types/kyc/index.js +19 -0
- package/dist/types/kyc/index.js.map +1 -0
- package/dist/types/kyc/kyc-types.cjs +85 -0
- package/dist/types/kyc/kyc-types.d.ts +307 -0
- package/dist/types/kyc/kyc-types.d.ts.map +1 -0
- package/dist/types/kyc/kyc-types.js +85 -0
- package/dist/types/kyc/kyc-types.js.map +1 -0
- package/dist/types/wildduck/index.cjs +20 -0
- package/dist/types/wildduck/index.d.ts +3 -0
- package/dist/types/wildduck/index.d.ts.map +1 -0
- package/dist/types/wildduck/index.js +20 -0
- package/dist/types/wildduck/index.js.map +1 -0
- package/dist/types/wildduck/wildduck-types.cjs +92 -0
- package/dist/types/wildduck/wildduck-types.d.ts +1242 -0
- package/dist/types/wildduck/wildduck-types.d.ts.map +1 -0
- package/dist/types/wildduck/wildduck-types.js +92 -0
- package/dist/types/wildduck/wildduck-types.js.map +1 -0
- package/dist/types/wildduck/wildduck-websocket-types.cjs +135 -0
- package/dist/types/wildduck/wildduck-websocket-types.d.ts +381 -0
- package/dist/types/wildduck/wildduck-websocket-types.d.ts.map +1 -0
- package/dist/types/wildduck/wildduck-websocket-types.js +135 -0
- package/dist/types/wildduck/wildduck-websocket-types.js.map +1 -0
- package/package.json +66 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @anthropic/mail-box-types - TypeScript types for Mail Box services
|
|
4
|
+
*
|
|
5
|
+
* This package contains type definitions for:
|
|
6
|
+
* - Mail Box Indexer API responses and type guards
|
|
7
|
+
* - WildDuck Mail Server API types
|
|
8
|
+
* - KYC (Know Your Customer) verification types
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
// Re-export all types
|
|
26
|
+
__exportStar(require("./types"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @anthropic/mail-box-types - TypeScript types for Mail Box services
|
|
3
|
+
*
|
|
4
|
+
* This package contains type definitions for:
|
|
5
|
+
* - Mail Box Indexer API responses and type guards
|
|
6
|
+
* - WildDuck Mail Server API types
|
|
7
|
+
* - KYC (Know Your Customer) verification types
|
|
8
|
+
*/
|
|
9
|
+
export * from './types';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @anthropic/mail-box-types - TypeScript types for Mail Box services
|
|
4
|
+
*
|
|
5
|
+
* This package contains type definitions for:
|
|
6
|
+
* - Mail Box Indexer API responses and type guards
|
|
7
|
+
* - WildDuck Mail Server API types
|
|
8
|
+
* - KYC (Know Your Customer) verification types
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
// Re-export all types
|
|
26
|
+
__exportStar(require("./types"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;AAEH,sBAAsB;AACtB,0CAAwB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Common utility types used throughout the mail box types library
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ChainType = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Chain type classification
|
|
9
|
+
*/
|
|
10
|
+
var ChainType;
|
|
11
|
+
(function (ChainType) {
|
|
12
|
+
ChainType["EVM"] = "evm";
|
|
13
|
+
ChainType["SOLANA"] = "solana";
|
|
14
|
+
})(ChainType || (exports.ChainType = ChainType = {}));
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common utility types used throughout the mail box types library
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Utility type for values that can be T, undefined, or null
|
|
6
|
+
*/
|
|
7
|
+
export type Optional<T> = T | undefined | null;
|
|
8
|
+
/**
|
|
9
|
+
* Chain type classification
|
|
10
|
+
*/
|
|
11
|
+
export declare enum ChainType {
|
|
12
|
+
EVM = "evm",
|
|
13
|
+
SOLANA = "solana"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Base wallet data structure containing address and chain type
|
|
17
|
+
*/
|
|
18
|
+
export interface WalletData {
|
|
19
|
+
/** Wallet address (EVM 0x format or Solana Base58) */
|
|
20
|
+
walletAddress: string;
|
|
21
|
+
/** Chain type classification (EVM or Solana) */
|
|
22
|
+
chainType: ChainType;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Base response structure for all API operations
|
|
26
|
+
*/
|
|
27
|
+
export interface ApiResponse<T = unknown> {
|
|
28
|
+
/** Operation success status */
|
|
29
|
+
success: boolean;
|
|
30
|
+
/** Response data */
|
|
31
|
+
data?: Optional<T>;
|
|
32
|
+
/** Error message if operation failed */
|
|
33
|
+
error?: Optional<string>;
|
|
34
|
+
/** Response timestamp */
|
|
35
|
+
timestamp?: string;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/common/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;AAE/C;;GAEG;AACH,oBAAY,SAAS;IACnB,GAAG,QAAQ;IACX,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,SAAS,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,+BAA+B;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Common utility types used throughout the mail box types library
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ChainType = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Chain type classification
|
|
9
|
+
*/
|
|
10
|
+
var ChainType;
|
|
11
|
+
(function (ChainType) {
|
|
12
|
+
ChainType["EVM"] = "evm";
|
|
13
|
+
ChainType["SOLANA"] = "solana";
|
|
14
|
+
})(ChainType || (exports.ChainType = ChainType = {}));
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/common/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAOH;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;AACnB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Common types
|
|
18
|
+
__exportStar(require("./common"), exports);
|
|
19
|
+
// Indexer types
|
|
20
|
+
__exportStar(require("./indexer"), exports);
|
|
21
|
+
// WildDuck types
|
|
22
|
+
__exportStar(require("./wildduck"), exports);
|
|
23
|
+
// KYC types
|
|
24
|
+
__exportStar(require("./kyc"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC;AAG1B,cAAc,YAAY,CAAC;AAG3B,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Common types
|
|
18
|
+
__exportStar(require("./common"), exports);
|
|
19
|
+
// Indexer types
|
|
20
|
+
__exportStar(require("./indexer"), exports);
|
|
21
|
+
// WildDuck types
|
|
22
|
+
__exportStar(require("./wildduck"), exports);
|
|
23
|
+
// KYC types
|
|
24
|
+
__exportStar(require("./kyc"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,eAAe;AACf,2CAAyB;AAEzB,gBAAgB;AAChB,4CAA0B;AAE1B,iBAAiB;AACjB,6CAA2B;AAE3B,YAAY;AACZ,wCAAsB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isIndexerSuccessResponse = exports.isIndexerErrorResponse = exports.isWebhookDeleteResponse = exports.isWebhookListResponse = exports.isWebhookResponse = exports.isTemplateDeleteResponse = exports.isTemplateListResponse = exports.isTemplateResponse = exports.isNameResolutionResponse = exports.isNameServiceResponse = exports.isBlockStatusResponse = exports.isAuthenticationStatusResponse = exports.isReferralStatsResponse = exports.isReferralCodeResponse = exports.isSiteStatsResponse = exports.isLeaderboardResponse = exports.isPointsResponse = exports.isSignInMessageResponse = exports.isEntitlementResponse = exports.isNonceResponse = exports.isDelegatedFromResponse = exports.isDelegatedToResponse = exports.isRewardsResponse = exports.isEmailAccountsResponse = exports.isAddressValidationResponse = void 0;
|
|
4
|
+
// Export type guards
|
|
5
|
+
var indexer_guards_1 = require("./indexer-guards");
|
|
6
|
+
Object.defineProperty(exports, "isAddressValidationResponse", { enumerable: true, get: function () { return indexer_guards_1.isAddressValidationResponse; } });
|
|
7
|
+
Object.defineProperty(exports, "isEmailAccountsResponse", { enumerable: true, get: function () { return indexer_guards_1.isEmailAccountsResponse; } });
|
|
8
|
+
Object.defineProperty(exports, "isRewardsResponse", { enumerable: true, get: function () { return indexer_guards_1.isRewardsResponse; } });
|
|
9
|
+
Object.defineProperty(exports, "isDelegatedToResponse", { enumerable: true, get: function () { return indexer_guards_1.isDelegatedToResponse; } });
|
|
10
|
+
Object.defineProperty(exports, "isDelegatedFromResponse", { enumerable: true, get: function () { return indexer_guards_1.isDelegatedFromResponse; } });
|
|
11
|
+
Object.defineProperty(exports, "isNonceResponse", { enumerable: true, get: function () { return indexer_guards_1.isNonceResponse; } });
|
|
12
|
+
Object.defineProperty(exports, "isEntitlementResponse", { enumerable: true, get: function () { return indexer_guards_1.isEntitlementResponse; } });
|
|
13
|
+
Object.defineProperty(exports, "isSignInMessageResponse", { enumerable: true, get: function () { return indexer_guards_1.isSignInMessageResponse; } });
|
|
14
|
+
Object.defineProperty(exports, "isPointsResponse", { enumerable: true, get: function () { return indexer_guards_1.isPointsResponse; } });
|
|
15
|
+
Object.defineProperty(exports, "isLeaderboardResponse", { enumerable: true, get: function () { return indexer_guards_1.isLeaderboardResponse; } });
|
|
16
|
+
Object.defineProperty(exports, "isSiteStatsResponse", { enumerable: true, get: function () { return indexer_guards_1.isSiteStatsResponse; } });
|
|
17
|
+
Object.defineProperty(exports, "isReferralCodeResponse", { enumerable: true, get: function () { return indexer_guards_1.isReferralCodeResponse; } });
|
|
18
|
+
Object.defineProperty(exports, "isReferralStatsResponse", { enumerable: true, get: function () { return indexer_guards_1.isReferralStatsResponse; } });
|
|
19
|
+
Object.defineProperty(exports, "isAuthenticationStatusResponse", { enumerable: true, get: function () { return indexer_guards_1.isAuthenticationStatusResponse; } });
|
|
20
|
+
Object.defineProperty(exports, "isBlockStatusResponse", { enumerable: true, get: function () { return indexer_guards_1.isBlockStatusResponse; } });
|
|
21
|
+
Object.defineProperty(exports, "isNameServiceResponse", { enumerable: true, get: function () { return indexer_guards_1.isNameServiceResponse; } });
|
|
22
|
+
Object.defineProperty(exports, "isNameResolutionResponse", { enumerable: true, get: function () { return indexer_guards_1.isNameResolutionResponse; } });
|
|
23
|
+
Object.defineProperty(exports, "isTemplateResponse", { enumerable: true, get: function () { return indexer_guards_1.isTemplateResponse; } });
|
|
24
|
+
Object.defineProperty(exports, "isTemplateListResponse", { enumerable: true, get: function () { return indexer_guards_1.isTemplateListResponse; } });
|
|
25
|
+
Object.defineProperty(exports, "isTemplateDeleteResponse", { enumerable: true, get: function () { return indexer_guards_1.isTemplateDeleteResponse; } });
|
|
26
|
+
Object.defineProperty(exports, "isWebhookResponse", { enumerable: true, get: function () { return indexer_guards_1.isWebhookResponse; } });
|
|
27
|
+
Object.defineProperty(exports, "isWebhookListResponse", { enumerable: true, get: function () { return indexer_guards_1.isWebhookListResponse; } });
|
|
28
|
+
Object.defineProperty(exports, "isWebhookDeleteResponse", { enumerable: true, get: function () { return indexer_guards_1.isWebhookDeleteResponse; } });
|
|
29
|
+
Object.defineProperty(exports, "isIndexerErrorResponse", { enumerable: true, get: function () { return indexer_guards_1.isIndexerErrorResponse; } });
|
|
30
|
+
Object.defineProperty(exports, "isIndexerSuccessResponse", { enumerable: true, get: function () { return indexer_guards_1.isIndexerSuccessResponse; } });
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { IndexerNameServiceAccount, IndexerWalletAccount, IndexerEmailAccountsResult, IndexerEmailAccountsResponse, IndexerRewardData, IndexerRewardHistoryData, IndexerRewardsResponse, IndexerAddressValidationData, IndexerAddressValidationResponse, IndexerDelegateData, IndexerDelegatedToResponse, IndexerDelegatedFromData, IndexerDelegatedFromResponse, IndexerNonceData, IndexerNonceResponse, IndexerEntitlementInfo, IndexerEntitlementData, IndexerEntitlementResponse, IndexerSignInMessageData, IndexerSignInMessageResponse, IndexerPointsData, IndexerPointsResponse, IndexerLeaderboardData, IndexerLeaderboardResponse, IndexerSiteStatsData, IndexerSiteStatsResponse, IndexerReferralCodeData, IndexerReferralCodeResponse, IndexerReferralConsumptionData, IndexerReferralStatsData, IndexerReferralStatsResponse, IndexerAuthenticationStatusData, IndexerAuthenticationStatusResponse, IndexerChainBlockInfo, IndexerBlockStatusData, IndexerBlockStatusResponse, IndexerNameServiceData, IndexerNameServiceResponse, IndexerNameResolutionData, IndexerNameResolutionResponse, IndexerTemplateData, IndexerTemplateResult, IndexerTemplateResponse, IndexerTemplateListResult, IndexerTemplateListResponse, IndexerTemplateDeleteResult, IndexerTemplateDeleteResponse, IndexerTemplateCreateRequest, IndexerTemplateUpdateRequest, IndexerWebhookData, IndexerWebhookResult, IndexerWebhookResponse, IndexerWebhookListResult, IndexerWebhookListResponse, IndexerWebhookDeleteResult, IndexerWebhookDeleteResponse, IndexerWebhookCreateRequest, IndexerErrorResponse, IndexerApiResponse, } from './indexer-responses';
|
|
2
|
+
export { isAddressValidationResponse, isEmailAccountsResponse, isRewardsResponse, isDelegatedToResponse, isDelegatedFromResponse, isNonceResponse, isEntitlementResponse, isSignInMessageResponse, isPointsResponse, isLeaderboardResponse, isSiteStatsResponse, isReferralCodeResponse, isReferralStatsResponse, isAuthenticationStatusResponse, isBlockStatusResponse, isNameServiceResponse, isNameResolutionResponse, isTemplateResponse, isTemplateListResponse, isTemplateDeleteResponse, isWebhookResponse, isWebhookListResponse, isWebhookDeleteResponse, isIndexerErrorResponse, isIndexerSuccessResponse, } from './indexer-guards';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/indexer/index.ts"],"names":[],"mappings":"AACA,YAAY,EAEV,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC1B,4BAA4B,EAG5B,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EAGtB,4BAA4B,EAC5B,gCAAgC,EAGhC,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAG5B,gBAAgB,EAChB,oBAAoB,EAGpB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAG1B,wBAAwB,EACxB,4BAA4B,EAG5B,iBAAiB,EACjB,qBAAqB,EAGrB,sBAAsB,EACtB,0BAA0B,EAG1B,oBAAoB,EACpB,wBAAwB,EAGxB,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAG5B,+BAA+B,EAC/B,mCAAmC,EAGnC,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAG1B,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,6BAA6B,EAG7B,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,EAC5B,4BAA4B,EAG5B,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAG3B,oBAAoB,EAGpB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,8BAA8B,EAC9B,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isIndexerSuccessResponse = exports.isIndexerErrorResponse = exports.isWebhookDeleteResponse = exports.isWebhookListResponse = exports.isWebhookResponse = exports.isTemplateDeleteResponse = exports.isTemplateListResponse = exports.isTemplateResponse = exports.isNameResolutionResponse = exports.isNameServiceResponse = exports.isBlockStatusResponse = exports.isAuthenticationStatusResponse = exports.isReferralStatsResponse = exports.isReferralCodeResponse = exports.isSiteStatsResponse = exports.isLeaderboardResponse = exports.isPointsResponse = exports.isSignInMessageResponse = exports.isEntitlementResponse = exports.isNonceResponse = exports.isDelegatedFromResponse = exports.isDelegatedToResponse = exports.isRewardsResponse = exports.isEmailAccountsResponse = exports.isAddressValidationResponse = void 0;
|
|
4
|
+
// Export type guards
|
|
5
|
+
var indexer_guards_1 = require("./indexer-guards");
|
|
6
|
+
Object.defineProperty(exports, "isAddressValidationResponse", { enumerable: true, get: function () { return indexer_guards_1.isAddressValidationResponse; } });
|
|
7
|
+
Object.defineProperty(exports, "isEmailAccountsResponse", { enumerable: true, get: function () { return indexer_guards_1.isEmailAccountsResponse; } });
|
|
8
|
+
Object.defineProperty(exports, "isRewardsResponse", { enumerable: true, get: function () { return indexer_guards_1.isRewardsResponse; } });
|
|
9
|
+
Object.defineProperty(exports, "isDelegatedToResponse", { enumerable: true, get: function () { return indexer_guards_1.isDelegatedToResponse; } });
|
|
10
|
+
Object.defineProperty(exports, "isDelegatedFromResponse", { enumerable: true, get: function () { return indexer_guards_1.isDelegatedFromResponse; } });
|
|
11
|
+
Object.defineProperty(exports, "isNonceResponse", { enumerable: true, get: function () { return indexer_guards_1.isNonceResponse; } });
|
|
12
|
+
Object.defineProperty(exports, "isEntitlementResponse", { enumerable: true, get: function () { return indexer_guards_1.isEntitlementResponse; } });
|
|
13
|
+
Object.defineProperty(exports, "isSignInMessageResponse", { enumerable: true, get: function () { return indexer_guards_1.isSignInMessageResponse; } });
|
|
14
|
+
Object.defineProperty(exports, "isPointsResponse", { enumerable: true, get: function () { return indexer_guards_1.isPointsResponse; } });
|
|
15
|
+
Object.defineProperty(exports, "isLeaderboardResponse", { enumerable: true, get: function () { return indexer_guards_1.isLeaderboardResponse; } });
|
|
16
|
+
Object.defineProperty(exports, "isSiteStatsResponse", { enumerable: true, get: function () { return indexer_guards_1.isSiteStatsResponse; } });
|
|
17
|
+
Object.defineProperty(exports, "isReferralCodeResponse", { enumerable: true, get: function () { return indexer_guards_1.isReferralCodeResponse; } });
|
|
18
|
+
Object.defineProperty(exports, "isReferralStatsResponse", { enumerable: true, get: function () { return indexer_guards_1.isReferralStatsResponse; } });
|
|
19
|
+
Object.defineProperty(exports, "isAuthenticationStatusResponse", { enumerable: true, get: function () { return indexer_guards_1.isAuthenticationStatusResponse; } });
|
|
20
|
+
Object.defineProperty(exports, "isBlockStatusResponse", { enumerable: true, get: function () { return indexer_guards_1.isBlockStatusResponse; } });
|
|
21
|
+
Object.defineProperty(exports, "isNameServiceResponse", { enumerable: true, get: function () { return indexer_guards_1.isNameServiceResponse; } });
|
|
22
|
+
Object.defineProperty(exports, "isNameResolutionResponse", { enumerable: true, get: function () { return indexer_guards_1.isNameResolutionResponse; } });
|
|
23
|
+
Object.defineProperty(exports, "isTemplateResponse", { enumerable: true, get: function () { return indexer_guards_1.isTemplateResponse; } });
|
|
24
|
+
Object.defineProperty(exports, "isTemplateListResponse", { enumerable: true, get: function () { return indexer_guards_1.isTemplateListResponse; } });
|
|
25
|
+
Object.defineProperty(exports, "isTemplateDeleteResponse", { enumerable: true, get: function () { return indexer_guards_1.isTemplateDeleteResponse; } });
|
|
26
|
+
Object.defineProperty(exports, "isWebhookResponse", { enumerable: true, get: function () { return indexer_guards_1.isWebhookResponse; } });
|
|
27
|
+
Object.defineProperty(exports, "isWebhookListResponse", { enumerable: true, get: function () { return indexer_guards_1.isWebhookListResponse; } });
|
|
28
|
+
Object.defineProperty(exports, "isWebhookDeleteResponse", { enumerable: true, get: function () { return indexer_guards_1.isWebhookDeleteResponse; } });
|
|
29
|
+
Object.defineProperty(exports, "isIndexerErrorResponse", { enumerable: true, get: function () { return indexer_guards_1.isIndexerErrorResponse; } });
|
|
30
|
+
Object.defineProperty(exports, "isIndexerSuccessResponse", { enumerable: true, get: function () { return indexer_guards_1.isIndexerSuccessResponse; } });
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/indexer/index.ts"],"names":[],"mappings":";;;AAkGA,qBAAqB;AACrB,mDA0B0B;AAzBxB,6HAAA,2BAA2B,OAAA;AAC3B,yHAAA,uBAAuB,OAAA;AACvB,mHAAA,iBAAiB,OAAA;AACjB,uHAAA,qBAAqB,OAAA;AACrB,yHAAA,uBAAuB,OAAA;AACvB,iHAAA,eAAe,OAAA;AACf,uHAAA,qBAAqB,OAAA;AACrB,yHAAA,uBAAuB,OAAA;AACvB,kHAAA,gBAAgB,OAAA;AAChB,uHAAA,qBAAqB,OAAA;AACrB,qHAAA,mBAAmB,OAAA;AACnB,wHAAA,sBAAsB,OAAA;AACtB,yHAAA,uBAAuB,OAAA;AACvB,gIAAA,8BAA8B,OAAA;AAC9B,uHAAA,qBAAqB,OAAA;AACrB,uHAAA,qBAAqB,OAAA;AACrB,0HAAA,wBAAwB,OAAA;AACxB,oHAAA,kBAAkB,OAAA;AAClB,wHAAA,sBAAsB,OAAA;AACtB,0HAAA,wBAAwB,OAAA;AACxB,mHAAA,iBAAiB,OAAA;AACjB,uHAAA,qBAAqB,OAAA;AACrB,yHAAA,uBAAuB,OAAA;AACvB,wHAAA,sBAAsB,OAAA;AACtB,0HAAA,wBAAwB,OAAA"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Type Guards for Mail Box Indexer API Responses
|
|
4
|
+
* @description Runtime type checking functions for all indexer API response types
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.isIndexerErrorResponse = isIndexerErrorResponse;
|
|
8
|
+
exports.isIndexerSuccessResponse = isIndexerSuccessResponse;
|
|
9
|
+
exports.isAddressValidationResponse = isAddressValidationResponse;
|
|
10
|
+
exports.isEmailAccountsResponse = isEmailAccountsResponse;
|
|
11
|
+
exports.isRewardsResponse = isRewardsResponse;
|
|
12
|
+
exports.isDelegatedToResponse = isDelegatedToResponse;
|
|
13
|
+
exports.isDelegatedFromResponse = isDelegatedFromResponse;
|
|
14
|
+
exports.isNonceResponse = isNonceResponse;
|
|
15
|
+
exports.isEntitlementResponse = isEntitlementResponse;
|
|
16
|
+
exports.isSignInMessageResponse = isSignInMessageResponse;
|
|
17
|
+
exports.isPointsResponse = isPointsResponse;
|
|
18
|
+
exports.isLeaderboardResponse = isLeaderboardResponse;
|
|
19
|
+
exports.isSiteStatsResponse = isSiteStatsResponse;
|
|
20
|
+
exports.isTemplateResponse = isTemplateResponse;
|
|
21
|
+
exports.isTemplateListResponse = isTemplateListResponse;
|
|
22
|
+
exports.isTemplateDeleteResponse = isTemplateDeleteResponse;
|
|
23
|
+
exports.isWebhookResponse = isWebhookResponse;
|
|
24
|
+
exports.isWebhookListResponse = isWebhookListResponse;
|
|
25
|
+
exports.isWebhookDeleteResponse = isWebhookDeleteResponse;
|
|
26
|
+
exports.isReferralCodeResponse = isReferralCodeResponse;
|
|
27
|
+
exports.isReferralStatsResponse = isReferralStatsResponse;
|
|
28
|
+
exports.isAuthenticationStatusResponse = isAuthenticationStatusResponse;
|
|
29
|
+
exports.isBlockStatusResponse = isBlockStatusResponse;
|
|
30
|
+
exports.isNameServiceResponse = isNameServiceResponse;
|
|
31
|
+
exports.isNameResolutionResponse = isNameResolutionResponse;
|
|
32
|
+
// Basic type guards for indexer responses
|
|
33
|
+
function isIndexerErrorResponse(response) {
|
|
34
|
+
return !!(response &&
|
|
35
|
+
typeof response === 'object' &&
|
|
36
|
+
'error' in response &&
|
|
37
|
+
'success' in response &&
|
|
38
|
+
!response.success);
|
|
39
|
+
}
|
|
40
|
+
function isIndexerSuccessResponse(response) {
|
|
41
|
+
return !!(response &&
|
|
42
|
+
typeof response === 'object' &&
|
|
43
|
+
'success' in response &&
|
|
44
|
+
response.success === true &&
|
|
45
|
+
'data' in response);
|
|
46
|
+
}
|
|
47
|
+
// Specific response type guards
|
|
48
|
+
function isAddressValidationResponse(response) {
|
|
49
|
+
return !!(response &&
|
|
50
|
+
typeof response === 'object' &&
|
|
51
|
+
'success' in response &&
|
|
52
|
+
'data' in response &&
|
|
53
|
+
response.data &&
|
|
54
|
+
typeof response.data === 'object' &&
|
|
55
|
+
('name' in response.data || 'wallet' in response.data));
|
|
56
|
+
}
|
|
57
|
+
function isEmailAccountsResponse(response) {
|
|
58
|
+
return !!(response &&
|
|
59
|
+
typeof response === 'object' &&
|
|
60
|
+
'success' in response &&
|
|
61
|
+
'data' in response &&
|
|
62
|
+
response.data &&
|
|
63
|
+
typeof response.data === 'object' &&
|
|
64
|
+
'accounts' in response.data &&
|
|
65
|
+
Array.isArray(response.data.accounts));
|
|
66
|
+
}
|
|
67
|
+
function isRewardsResponse(response) {
|
|
68
|
+
return !!(response &&
|
|
69
|
+
typeof response === 'object' &&
|
|
70
|
+
'success' in response &&
|
|
71
|
+
'data' in response &&
|
|
72
|
+
response.data &&
|
|
73
|
+
typeof response.data === 'object' &&
|
|
74
|
+
'rewards' in response.data &&
|
|
75
|
+
'records' in response.data &&
|
|
76
|
+
'points' in response.data);
|
|
77
|
+
}
|
|
78
|
+
function isDelegatedToResponse(response) {
|
|
79
|
+
return !!(response &&
|
|
80
|
+
typeof response === 'object' &&
|
|
81
|
+
'success' in response &&
|
|
82
|
+
'data' in response &&
|
|
83
|
+
response.data &&
|
|
84
|
+
typeof response.data === 'object' &&
|
|
85
|
+
'walletAddress' in response.data &&
|
|
86
|
+
'chainType' in response.data);
|
|
87
|
+
}
|
|
88
|
+
function isDelegatedFromResponse(response) {
|
|
89
|
+
return !!(response &&
|
|
90
|
+
typeof response === 'object' &&
|
|
91
|
+
'success' in response &&
|
|
92
|
+
'data' in response &&
|
|
93
|
+
response.data &&
|
|
94
|
+
typeof response.data === 'object' &&
|
|
95
|
+
'from' in response.data &&
|
|
96
|
+
Array.isArray(response.data.from));
|
|
97
|
+
}
|
|
98
|
+
function isNonceResponse(response) {
|
|
99
|
+
return !!(response &&
|
|
100
|
+
typeof response === 'object' &&
|
|
101
|
+
'success' in response &&
|
|
102
|
+
'data' in response &&
|
|
103
|
+
response.data &&
|
|
104
|
+
typeof response.data === 'object' &&
|
|
105
|
+
'nonce' in response.data);
|
|
106
|
+
}
|
|
107
|
+
function isEntitlementResponse(response) {
|
|
108
|
+
return !!(response &&
|
|
109
|
+
typeof response === 'object' &&
|
|
110
|
+
'success' in response &&
|
|
111
|
+
'data' in response &&
|
|
112
|
+
response.data &&
|
|
113
|
+
typeof response.data === 'object' &&
|
|
114
|
+
'entitlement' in response.data &&
|
|
115
|
+
'verified' in response.data);
|
|
116
|
+
}
|
|
117
|
+
function isSignInMessageResponse(response) {
|
|
118
|
+
return !!(response &&
|
|
119
|
+
typeof response === 'object' &&
|
|
120
|
+
'success' in response &&
|
|
121
|
+
'data' in response &&
|
|
122
|
+
response.data &&
|
|
123
|
+
typeof response.data === 'object' &&
|
|
124
|
+
'message' in response.data &&
|
|
125
|
+
'walletAddress' in response.data);
|
|
126
|
+
}
|
|
127
|
+
function isPointsResponse(response) {
|
|
128
|
+
return !!(response &&
|
|
129
|
+
typeof response === 'object' &&
|
|
130
|
+
'success' in response &&
|
|
131
|
+
'data' in response &&
|
|
132
|
+
response.data &&
|
|
133
|
+
typeof response.data === 'object' &&
|
|
134
|
+
'pointsEarned' in response.data &&
|
|
135
|
+
'walletAddress' in response.data);
|
|
136
|
+
}
|
|
137
|
+
// Points API response type guards
|
|
138
|
+
function isLeaderboardResponse(response) {
|
|
139
|
+
return !!(response &&
|
|
140
|
+
typeof response === 'object' &&
|
|
141
|
+
'success' in response &&
|
|
142
|
+
'data' in response &&
|
|
143
|
+
response.data &&
|
|
144
|
+
typeof response.data === 'object' &&
|
|
145
|
+
'leaderboard' in response.data);
|
|
146
|
+
}
|
|
147
|
+
function isSiteStatsResponse(response) {
|
|
148
|
+
return !!(response &&
|
|
149
|
+
typeof response === 'object' &&
|
|
150
|
+
'success' in response &&
|
|
151
|
+
'data' in response &&
|
|
152
|
+
response.data &&
|
|
153
|
+
typeof response.data === 'object' &&
|
|
154
|
+
'totalPoints' in response.data);
|
|
155
|
+
}
|
|
156
|
+
// Template response type guards
|
|
157
|
+
function isTemplateResponse(response) {
|
|
158
|
+
return !!(response &&
|
|
159
|
+
typeof response === 'object' &&
|
|
160
|
+
'success' in response &&
|
|
161
|
+
'data' in response &&
|
|
162
|
+
response.data &&
|
|
163
|
+
typeof response.data === 'object' &&
|
|
164
|
+
'template' in response.data &&
|
|
165
|
+
'verified' in response.data &&
|
|
166
|
+
response.data.template &&
|
|
167
|
+
typeof response.data.template === 'object' &&
|
|
168
|
+
'id' in response.data.template &&
|
|
169
|
+
'name' in response.data.template &&
|
|
170
|
+
'subject' in response.data.template &&
|
|
171
|
+
'body' in response.data.template);
|
|
172
|
+
}
|
|
173
|
+
function isTemplateListResponse(response) {
|
|
174
|
+
return !!(response &&
|
|
175
|
+
typeof response === 'object' &&
|
|
176
|
+
'success' in response &&
|
|
177
|
+
'data' in response &&
|
|
178
|
+
response.data &&
|
|
179
|
+
typeof response.data === 'object' &&
|
|
180
|
+
'templates' in response.data &&
|
|
181
|
+
'total' in response.data &&
|
|
182
|
+
'hasMore' in response.data &&
|
|
183
|
+
'verified' in response.data &&
|
|
184
|
+
Array.isArray(response.data.templates));
|
|
185
|
+
}
|
|
186
|
+
function isTemplateDeleteResponse(response) {
|
|
187
|
+
return !!(response &&
|
|
188
|
+
typeof response === 'object' &&
|
|
189
|
+
'success' in response &&
|
|
190
|
+
'data' in response &&
|
|
191
|
+
response.data &&
|
|
192
|
+
typeof response.data === 'object' &&
|
|
193
|
+
'message' in response.data &&
|
|
194
|
+
'verified' in response.data);
|
|
195
|
+
}
|
|
196
|
+
// Webhook response type guards
|
|
197
|
+
function isWebhookResponse(response) {
|
|
198
|
+
return !!(response &&
|
|
199
|
+
typeof response === 'object' &&
|
|
200
|
+
'success' in response &&
|
|
201
|
+
'data' in response &&
|
|
202
|
+
response.data &&
|
|
203
|
+
typeof response.data === 'object' &&
|
|
204
|
+
'webhook' in response.data &&
|
|
205
|
+
'verified' in response.data &&
|
|
206
|
+
response.data.webhook &&
|
|
207
|
+
typeof response.data.webhook === 'object' &&
|
|
208
|
+
'id' in response.data.webhook &&
|
|
209
|
+
'webhookUrl' in response.data.webhook);
|
|
210
|
+
}
|
|
211
|
+
function isWebhookListResponse(response) {
|
|
212
|
+
return !!(response &&
|
|
213
|
+
typeof response === 'object' &&
|
|
214
|
+
'success' in response &&
|
|
215
|
+
'data' in response &&
|
|
216
|
+
response.data &&
|
|
217
|
+
typeof response.data === 'object' &&
|
|
218
|
+
'webhooks' in response.data &&
|
|
219
|
+
'total' in response.data &&
|
|
220
|
+
'hasMore' in response.data &&
|
|
221
|
+
'verified' in response.data &&
|
|
222
|
+
Array.isArray(response.data.webhooks));
|
|
223
|
+
}
|
|
224
|
+
function isWebhookDeleteResponse(response) {
|
|
225
|
+
return !!(response &&
|
|
226
|
+
typeof response === 'object' &&
|
|
227
|
+
'success' in response &&
|
|
228
|
+
'data' in response &&
|
|
229
|
+
response.data &&
|
|
230
|
+
typeof response.data === 'object' &&
|
|
231
|
+
'message' in response.data &&
|
|
232
|
+
'verified' in response.data);
|
|
233
|
+
}
|
|
234
|
+
// Referral response type guards
|
|
235
|
+
function isReferralCodeResponse(response) {
|
|
236
|
+
return !!(response &&
|
|
237
|
+
typeof response === 'object' &&
|
|
238
|
+
'success' in response &&
|
|
239
|
+
'data' in response &&
|
|
240
|
+
response.data &&
|
|
241
|
+
typeof response.data === 'object' &&
|
|
242
|
+
'walletAddress' in response.data &&
|
|
243
|
+
'referralCode' in response.data &&
|
|
244
|
+
'createdAt' in response.data);
|
|
245
|
+
}
|
|
246
|
+
function isReferralStatsResponse(response) {
|
|
247
|
+
return !!(response &&
|
|
248
|
+
typeof response === 'object' &&
|
|
249
|
+
'success' in response &&
|
|
250
|
+
'data' in response &&
|
|
251
|
+
response.data &&
|
|
252
|
+
typeof response.data === 'object' &&
|
|
253
|
+
'total' in response.data &&
|
|
254
|
+
'consumptions' in response.data &&
|
|
255
|
+
Array.isArray(response.data.consumptions));
|
|
256
|
+
}
|
|
257
|
+
// Authentication status type guard
|
|
258
|
+
function isAuthenticationStatusResponse(response) {
|
|
259
|
+
return !!(response &&
|
|
260
|
+
typeof response === 'object' &&
|
|
261
|
+
'success' in response &&
|
|
262
|
+
'data' in response &&
|
|
263
|
+
response.data &&
|
|
264
|
+
typeof response.data === 'object' &&
|
|
265
|
+
'authenticated' in response.data &&
|
|
266
|
+
typeof response.data.authenticated === 'boolean');
|
|
267
|
+
}
|
|
268
|
+
// Block status type guard
|
|
269
|
+
function isBlockStatusResponse(response) {
|
|
270
|
+
return !!(response &&
|
|
271
|
+
typeof response === 'object' &&
|
|
272
|
+
'success' in response &&
|
|
273
|
+
'data' in response &&
|
|
274
|
+
response.data &&
|
|
275
|
+
typeof response.data === 'object' &&
|
|
276
|
+
'chains' in response.data &&
|
|
277
|
+
'totalChains' in response.data &&
|
|
278
|
+
'activeChains' in response.data &&
|
|
279
|
+
'timestamp' in response.data &&
|
|
280
|
+
Array.isArray(response.data.chains));
|
|
281
|
+
}
|
|
282
|
+
// Name service response type guards
|
|
283
|
+
function isNameServiceResponse(response) {
|
|
284
|
+
return !!(response &&
|
|
285
|
+
typeof response === 'object' &&
|
|
286
|
+
'success' in response &&
|
|
287
|
+
'data' in response &&
|
|
288
|
+
response.data &&
|
|
289
|
+
typeof response.data === 'object' &&
|
|
290
|
+
'names' in response.data &&
|
|
291
|
+
Array.isArray(response.data.names));
|
|
292
|
+
}
|
|
293
|
+
function isNameResolutionResponse(response) {
|
|
294
|
+
return !!(response &&
|
|
295
|
+
typeof response === 'object' &&
|
|
296
|
+
'success' in response &&
|
|
297
|
+
'data' in response &&
|
|
298
|
+
response.data &&
|
|
299
|
+
typeof response.data === 'object' &&
|
|
300
|
+
'walletAddress' in response.data &&
|
|
301
|
+
'chainType' in response.data);
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=indexer-guards.js.map
|