@midnightntwrk/wallet-sdk-indexer-client 1.2.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/README.md +86 -0
- package/dist/effect/Backpressure.d.ts +97 -0
- package/dist/effect/Backpressure.js +146 -0
- package/dist/effect/ConnectionHelper.d.ts +4 -0
- package/dist/effect/ConnectionHelper.js +41 -0
- package/dist/effect/HttpQueryClient.d.ts +4 -0
- package/dist/effect/HttpQueryClient.js +50 -0
- package/dist/effect/Query.d.ts +39 -0
- package/dist/effect/Query.js +47 -0
- package/dist/effect/QueryClient.d.ts +15 -0
- package/dist/effect/QueryClient.js +15 -0
- package/dist/effect/QueryRunner.d.ts +11 -0
- package/dist/effect/QueryRunner.js +23 -0
- package/dist/effect/Subscription.d.ts +25 -0
- package/dist/effect/Subscription.js +56 -0
- package/dist/effect/SubscriptionClient.d.ts +23 -0
- package/dist/effect/SubscriptionClient.js +15 -0
- package/dist/effect/WsSubscriptionClient.d.ts +4 -0
- package/dist/effect/WsSubscriptionClient.js +89 -0
- package/dist/effect/index.d.ts +8 -0
- package/dist/effect/index.js +20 -0
- package/dist/effect/test/backpressure.test.d.ts +1 -0
- package/dist/effect/test/backpressure.test.js +146 -0
- package/dist/effect/test/connectionHelper.test.d.ts +1 -0
- package/dist/effect/test/connectionHelper.test.js +34 -0
- package/dist/effect/test/httpQueryClient.spied.test.d.ts +1 -0
- package/dist/effect/test/httpQueryClient.spied.test.js +37 -0
- package/dist/effect/test/httpQueryClient.test.d.ts +1 -0
- package/dist/effect/test/httpQueryClient.test.js +32 -0
- package/dist/effect/test/queryRunner.spied.test.d.ts +1 -0
- package/dist/effect/test/queryRunner.spied.test.js +46 -0
- package/dist/effect/test/wsSubscriptionClient.spied.test.d.ts +1 -0
- package/dist/effect/test/wsSubscriptionClient.spied.test.js +37 -0
- package/dist/effect/test/wsSubscriptionClient.test.d.ts +1 -0
- package/dist/effect/test/wsSubscriptionClient.test.js +32 -0
- package/dist/graphql/generated/fragment-masking.d.ts +19 -0
- package/dist/graphql/generated/fragment-masking.js +16 -0
- package/dist/graphql/generated/gql.d.ts +61 -0
- package/dist/graphql/generated/gql.js +17 -0
- package/dist/graphql/generated/graphql.d.ts +1021 -0
- package/dist/graphql/generated/graphql.js +700 -0
- package/dist/graphql/generated/index.d.ts +2 -0
- package/dist/graphql/generated/index.js +2 -0
- package/dist/graphql/queries/BlockHash.d.ts +6 -0
- package/dist/graphql/queries/BlockHash.js +24 -0
- package/dist/graphql/queries/Connect.d.ts +6 -0
- package/dist/graphql/queries/Connect.js +19 -0
- package/dist/graphql/queries/Disconnect.d.ts +6 -0
- package/dist/graphql/queries/Disconnect.js +19 -0
- package/dist/graphql/queries/FetchTermsAndConditions.d.ts +6 -0
- package/dist/graphql/queries/FetchTermsAndConditions.js +26 -0
- package/dist/graphql/queries/TransactionHistoryDetail.d.ts +6 -0
- package/dist/graphql/queries/TransactionHistoryDetail.js +30 -0
- package/dist/graphql/queries/TransactionStatus.d.ts +6 -0
- package/dist/graphql/queries/TransactionStatus.js +34 -0
- package/dist/graphql/queries/index.d.ts +6 -0
- package/dist/graphql/queries/index.js +18 -0
- package/dist/graphql/queries/test/BlockHash.test.d.ts +1 -0
- package/dist/graphql/queries/test/BlockHash.test.js +84 -0
- package/dist/graphql/subscriptions/DustLedgerEvents.d.ts +6 -0
- package/dist/graphql/subscriptions/DustLedgerEvents.js +24 -0
- package/dist/graphql/subscriptions/ShieldedTransactions.d.ts +8 -0
- package/dist/graphql/subscriptions/ShieldedTransactions.js +54 -0
- package/dist/graphql/subscriptions/UnshieldedTransactions.d.ts +8 -0
- package/dist/graphql/subscriptions/UnshieldedTransactions.js +68 -0
- package/dist/graphql/subscriptions/ZswapEvents.d.ts +6 -0
- package/dist/graphql/subscriptions/ZswapEvents.js +24 -0
- package/dist/graphql/subscriptions/index.d.ts +4 -0
- package/dist/graphql/subscriptions/index.js +16 -0
- package/dist/graphql/subscriptions/test/ShieldedTransactions.test.d.ts +1 -0
- package/dist/graphql/subscriptions/test/ShieldedTransactions.test.js +55 -0
- package/dist/graphql/subscriptions/test/UnshieldedTransactions.test.d.ts +1 -0
- package/dist/graphql/subscriptions/test/UnshieldedTransactions.test.js +52 -0
- package/dist/graphql/subscriptions/test/ZswapEvents.test.d.ts +1 -0
- package/dist/graphql/subscriptions/test/ZswapEvents.test.js +50 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +15 -0
- package/package.json +57 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function useFragment(_documentNode, fragmentType) {
|
|
2
|
+
return fragmentType;
|
|
3
|
+
}
|
|
4
|
+
export function makeFragmentData(data, _fragment) {
|
|
5
|
+
return data;
|
|
6
|
+
}
|
|
7
|
+
export function isFragmentReady(queryNode, fragmentNode, data) {
|
|
8
|
+
const deferredFields = queryNode.__meta__
|
|
9
|
+
?.deferredFields;
|
|
10
|
+
if (!deferredFields)
|
|
11
|
+
return true;
|
|
12
|
+
const fragDef = fragmentNode.definitions[0];
|
|
13
|
+
const fragName = fragDef?.name?.value;
|
|
14
|
+
const fields = (fragName && deferredFields[fragName]) || [];
|
|
15
|
+
return fields.length > 0 && fields.every((field) => data && field in data);
|
|
16
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as types from './graphql.js';
|
|
2
|
+
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
3
|
+
/**
|
|
4
|
+
* Map of all GraphQL operations in the project.
|
|
5
|
+
*
|
|
6
|
+
* This map has several performance disadvantages:
|
|
7
|
+
*
|
|
8
|
+
* 1. It is not tree-shakeable, so it will include all operations in the project.
|
|
9
|
+
* 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.
|
|
10
|
+
* 3. It does not support dead code elimination, so it will add unused operations.
|
|
11
|
+
*
|
|
12
|
+
* Therefore it is highly recommended to use the babel or swc plugin for production. Learn more about it here:
|
|
13
|
+
* https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
|
|
14
|
+
*/
|
|
15
|
+
type Documents = {
|
|
16
|
+
'\n query BlockHash($offset: BlockOffset) {\n block(offset: $offset) {\n height\n hash\n ledgerParameters\n timestamp\n }\n }\n ': typeof types.BlockHashDocument;
|
|
17
|
+
'\n mutation Connect($viewingKey: ViewingKey!) {\n connect(viewingKey: $viewingKey)\n }\n ': typeof types.ConnectDocument;
|
|
18
|
+
'\n mutation Disconnect($sessionId: HexEncoded!) {\n disconnect(sessionId: $sessionId)\n }\n ': typeof types.DisconnectDocument;
|
|
19
|
+
'\n query FetchTermsAndConditions {\n block {\n systemParameters {\n termsAndConditions {\n hash\n url\n }\n }\n }\n }\n ': typeof types.FetchTermsAndConditionsDocument;
|
|
20
|
+
'\n query TransactionHistoryDetail($transactionHash: HexEncoded!) {\n transactions(offset: {hash: $transactionHash}) {\n __typename\n hash\n block {\n timestamp\n }\n ... on RegularTransaction {\n transactionResult {\n status\n }\n }\n }\n }\n ': typeof types.TransactionHistoryDetailDocument;
|
|
21
|
+
'\n query TransactionStatus($transactionId: HexEncoded!) {\n transactions(offset: {identifier: $transactionId}) {\n __typename\n ... on RegularTransaction {\n identifiers\n transactionResult {\n segments {\n id\n success\n }\n status\n __typename\n }\n }\n }\n }\n ': typeof types.TransactionStatusDocument;
|
|
22
|
+
'\n subscription DustLedgerEvents($id: Int) {\n dustLedgerEvents(id: $id) {\n type: __typename\n id\n raw\n maxId\n }\n }\n ': typeof types.DustLedgerEventsDocument;
|
|
23
|
+
'\n subscription ShieldedTransactions($sessionId: HexEncoded!, $index: Int) {\n shieldedTransactions(sessionId: $sessionId, index: $index) {\n __typename\n ... on ShieldedTransactionsProgress {\n highestEndIndex\n highestCheckedEndIndex\n highestRelevantEndIndex\n }\n ... on RelevantTransaction {\n transaction {\n id\n raw\n hash\n protocolVersion\n identifiers\n startIndex\n endIndex\n fees {\n paidFees\n estimatedFees\n }\n transactionResult {\n status\n segments {\n id\n success\n }\n }\n }\n collapsedMerkleTree {\n startIndex\n endIndex\n update\n protocolVersion\n }\n }\n }\n }\n ': typeof types.ShieldedTransactionsDocument;
|
|
24
|
+
'\n subscription UnshieldedTransactions($address: UnshieldedAddress!, $transactionId: Int) {\n unshieldedTransactions(address: $address, transactionId: $transactionId) {\n ... on UnshieldedTransaction {\n type: __typename\n transaction {\n type: __typename\n id\n hash\n protocolVersion\n block {\n timestamp\n }\n ... on RegularTransaction {\n identifiers\n fees {\n paidFees\n estimatedFees\n }\n transactionResult {\n status\n segments {\n id\n success\n }\n }\n }\n }\n createdUtxos {\n owner\n tokenType\n value\n outputIndex\n intentHash\n ctime\n registeredForDustGeneration\n }\n spentUtxos {\n owner\n tokenType\n value\n outputIndex\n intentHash\n ctime\n registeredForDustGeneration\n }\n }\n ... on UnshieldedTransactionsProgress {\n type: __typename\n highestTransactionId\n }\n }\n }\n ': typeof types.UnshieldedTransactionsDocument;
|
|
25
|
+
'\n subscription ZswapEvents($id: Int) {\n zswapLedgerEvents(id: $id) {\n id\n raw\n protocolVersion\n maxId\n }\n }\n ': typeof types.ZswapEventsDocument;
|
|
26
|
+
};
|
|
27
|
+
declare const documents: Documents;
|
|
28
|
+
/**
|
|
29
|
+
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const query = gql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* The query argument is unknown!
|
|
37
|
+
* Please regenerate the types.
|
|
38
|
+
*/
|
|
39
|
+
export declare function gql(source: string): unknown;
|
|
40
|
+
/** The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */
|
|
41
|
+
export declare function gql(source: '\n query BlockHash($offset: BlockOffset) {\n block(offset: $offset) {\n height\n hash\n ledgerParameters\n timestamp\n }\n }\n '): (typeof documents)['\n query BlockHash($offset: BlockOffset) {\n block(offset: $offset) {\n height\n hash\n ledgerParameters\n timestamp\n }\n }\n '];
|
|
42
|
+
/** The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */
|
|
43
|
+
export declare function gql(source: '\n mutation Connect($viewingKey: ViewingKey!) {\n connect(viewingKey: $viewingKey)\n }\n '): (typeof documents)['\n mutation Connect($viewingKey: ViewingKey!) {\n connect(viewingKey: $viewingKey)\n }\n '];
|
|
44
|
+
/** The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */
|
|
45
|
+
export declare function gql(source: '\n mutation Disconnect($sessionId: HexEncoded!) {\n disconnect(sessionId: $sessionId)\n }\n '): (typeof documents)['\n mutation Disconnect($sessionId: HexEncoded!) {\n disconnect(sessionId: $sessionId)\n }\n '];
|
|
46
|
+
/** The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */
|
|
47
|
+
export declare function gql(source: '\n query FetchTermsAndConditions {\n block {\n systemParameters {\n termsAndConditions {\n hash\n url\n }\n }\n }\n }\n '): (typeof documents)['\n query FetchTermsAndConditions {\n block {\n systemParameters {\n termsAndConditions {\n hash\n url\n }\n }\n }\n }\n '];
|
|
48
|
+
/** The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */
|
|
49
|
+
export declare function gql(source: '\n query TransactionHistoryDetail($transactionHash: HexEncoded!) {\n transactions(offset: {hash: $transactionHash}) {\n __typename\n hash\n block {\n timestamp\n }\n ... on RegularTransaction {\n transactionResult {\n status\n }\n }\n }\n }\n '): (typeof documents)['\n query TransactionHistoryDetail($transactionHash: HexEncoded!) {\n transactions(offset: {hash: $transactionHash}) {\n __typename\n hash\n block {\n timestamp\n }\n ... on RegularTransaction {\n transactionResult {\n status\n }\n }\n }\n }\n '];
|
|
50
|
+
/** The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */
|
|
51
|
+
export declare function gql(source: '\n query TransactionStatus($transactionId: HexEncoded!) {\n transactions(offset: {identifier: $transactionId}) {\n __typename\n ... on RegularTransaction {\n identifiers\n transactionResult {\n segments {\n id\n success\n }\n status\n __typename\n }\n }\n }\n }\n '): (typeof documents)['\n query TransactionStatus($transactionId: HexEncoded!) {\n transactions(offset: {identifier: $transactionId}) {\n __typename\n ... on RegularTransaction {\n identifiers\n transactionResult {\n segments {\n id\n success\n }\n status\n __typename\n }\n }\n }\n }\n '];
|
|
52
|
+
/** The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */
|
|
53
|
+
export declare function gql(source: '\n subscription DustLedgerEvents($id: Int) {\n dustLedgerEvents(id: $id) {\n type: __typename\n id\n raw\n maxId\n }\n }\n '): (typeof documents)['\n subscription DustLedgerEvents($id: Int) {\n dustLedgerEvents(id: $id) {\n type: __typename\n id\n raw\n maxId\n }\n }\n '];
|
|
54
|
+
/** The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */
|
|
55
|
+
export declare function gql(source: '\n subscription ShieldedTransactions($sessionId: HexEncoded!, $index: Int) {\n shieldedTransactions(sessionId: $sessionId, index: $index) {\n __typename\n ... on ShieldedTransactionsProgress {\n highestEndIndex\n highestCheckedEndIndex\n highestRelevantEndIndex\n }\n ... on RelevantTransaction {\n transaction {\n id\n raw\n hash\n protocolVersion\n identifiers\n startIndex\n endIndex\n fees {\n paidFees\n estimatedFees\n }\n transactionResult {\n status\n segments {\n id\n success\n }\n }\n }\n collapsedMerkleTree {\n startIndex\n endIndex\n update\n protocolVersion\n }\n }\n }\n }\n '): (typeof documents)['\n subscription ShieldedTransactions($sessionId: HexEncoded!, $index: Int) {\n shieldedTransactions(sessionId: $sessionId, index: $index) {\n __typename\n ... on ShieldedTransactionsProgress {\n highestEndIndex\n highestCheckedEndIndex\n highestRelevantEndIndex\n }\n ... on RelevantTransaction {\n transaction {\n id\n raw\n hash\n protocolVersion\n identifiers\n startIndex\n endIndex\n fees {\n paidFees\n estimatedFees\n }\n transactionResult {\n status\n segments {\n id\n success\n }\n }\n }\n collapsedMerkleTree {\n startIndex\n endIndex\n update\n protocolVersion\n }\n }\n }\n }\n '];
|
|
56
|
+
/** The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */
|
|
57
|
+
export declare function gql(source: '\n subscription UnshieldedTransactions($address: UnshieldedAddress!, $transactionId: Int) {\n unshieldedTransactions(address: $address, transactionId: $transactionId) {\n ... on UnshieldedTransaction {\n type: __typename\n transaction {\n type: __typename\n id\n hash\n protocolVersion\n block {\n timestamp\n }\n ... on RegularTransaction {\n identifiers\n fees {\n paidFees\n estimatedFees\n }\n transactionResult {\n status\n segments {\n id\n success\n }\n }\n }\n }\n createdUtxos {\n owner\n tokenType\n value\n outputIndex\n intentHash\n ctime\n registeredForDustGeneration\n }\n spentUtxos {\n owner\n tokenType\n value\n outputIndex\n intentHash\n ctime\n registeredForDustGeneration\n }\n }\n ... on UnshieldedTransactionsProgress {\n type: __typename\n highestTransactionId\n }\n }\n }\n '): (typeof documents)['\n subscription UnshieldedTransactions($address: UnshieldedAddress!, $transactionId: Int) {\n unshieldedTransactions(address: $address, transactionId: $transactionId) {\n ... on UnshieldedTransaction {\n type: __typename\n transaction {\n type: __typename\n id\n hash\n protocolVersion\n block {\n timestamp\n }\n ... on RegularTransaction {\n identifiers\n fees {\n paidFees\n estimatedFees\n }\n transactionResult {\n status\n segments {\n id\n success\n }\n }\n }\n }\n createdUtxos {\n owner\n tokenType\n value\n outputIndex\n intentHash\n ctime\n registeredForDustGeneration\n }\n spentUtxos {\n owner\n tokenType\n value\n outputIndex\n intentHash\n ctime\n registeredForDustGeneration\n }\n }\n ... on UnshieldedTransactionsProgress {\n type: __typename\n highestTransactionId\n }\n }\n }\n '];
|
|
58
|
+
/** The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */
|
|
59
|
+
export declare function gql(source: '\n subscription ZswapEvents($id: Int) {\n zswapLedgerEvents(id: $id) {\n id\n raw\n protocolVersion\n maxId\n }\n }\n '): (typeof documents)['\n subscription ZswapEvents($id: Int) {\n zswapLedgerEvents(id: $id) {\n id\n raw\n protocolVersion\n maxId\n }\n }\n '];
|
|
60
|
+
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import * as types from './graphql.js';
|
|
3
|
+
const documents = {
|
|
4
|
+
'\n query BlockHash($offset: BlockOffset) {\n block(offset: $offset) {\n height\n hash\n ledgerParameters\n timestamp\n }\n }\n ': types.BlockHashDocument,
|
|
5
|
+
'\n mutation Connect($viewingKey: ViewingKey!) {\n connect(viewingKey: $viewingKey)\n }\n ': types.ConnectDocument,
|
|
6
|
+
'\n mutation Disconnect($sessionId: HexEncoded!) {\n disconnect(sessionId: $sessionId)\n }\n ': types.DisconnectDocument,
|
|
7
|
+
'\n query FetchTermsAndConditions {\n block {\n systemParameters {\n termsAndConditions {\n hash\n url\n }\n }\n }\n }\n ': types.FetchTermsAndConditionsDocument,
|
|
8
|
+
'\n query TransactionHistoryDetail($transactionHash: HexEncoded!) {\n transactions(offset: {hash: $transactionHash}) {\n __typename\n hash\n block {\n timestamp\n }\n ... on RegularTransaction {\n transactionResult {\n status\n }\n }\n }\n }\n ': types.TransactionHistoryDetailDocument,
|
|
9
|
+
'\n query TransactionStatus($transactionId: HexEncoded!) {\n transactions(offset: {identifier: $transactionId}) {\n __typename\n ... on RegularTransaction {\n identifiers\n transactionResult {\n segments {\n id\n success\n }\n status\n __typename\n }\n }\n }\n }\n ': types.TransactionStatusDocument,
|
|
10
|
+
'\n subscription DustLedgerEvents($id: Int) {\n dustLedgerEvents(id: $id) {\n type: __typename\n id\n raw\n maxId\n }\n }\n ': types.DustLedgerEventsDocument,
|
|
11
|
+
'\n subscription ShieldedTransactions($sessionId: HexEncoded!, $index: Int) {\n shieldedTransactions(sessionId: $sessionId, index: $index) {\n __typename\n ... on ShieldedTransactionsProgress {\n highestEndIndex\n highestCheckedEndIndex\n highestRelevantEndIndex\n }\n ... on RelevantTransaction {\n transaction {\n id\n raw\n hash\n protocolVersion\n identifiers\n startIndex\n endIndex\n fees {\n paidFees\n estimatedFees\n }\n transactionResult {\n status\n segments {\n id\n success\n }\n }\n }\n collapsedMerkleTree {\n startIndex\n endIndex\n update\n protocolVersion\n }\n }\n }\n }\n ': types.ShieldedTransactionsDocument,
|
|
12
|
+
'\n subscription UnshieldedTransactions($address: UnshieldedAddress!, $transactionId: Int) {\n unshieldedTransactions(address: $address, transactionId: $transactionId) {\n ... on UnshieldedTransaction {\n type: __typename\n transaction {\n type: __typename\n id\n hash\n protocolVersion\n block {\n timestamp\n }\n ... on RegularTransaction {\n identifiers\n fees {\n paidFees\n estimatedFees\n }\n transactionResult {\n status\n segments {\n id\n success\n }\n }\n }\n }\n createdUtxos {\n owner\n tokenType\n value\n outputIndex\n intentHash\n ctime\n registeredForDustGeneration\n }\n spentUtxos {\n owner\n tokenType\n value\n outputIndex\n intentHash\n ctime\n registeredForDustGeneration\n }\n }\n ... on UnshieldedTransactionsProgress {\n type: __typename\n highestTransactionId\n }\n }\n }\n ': types.UnshieldedTransactionsDocument,
|
|
13
|
+
'\n subscription ZswapEvents($id: Int) {\n zswapLedgerEvents(id: $id) {\n id\n raw\n protocolVersion\n maxId\n }\n }\n ': types.ZswapEventsDocument,
|
|
14
|
+
};
|
|
15
|
+
export function gql(source) {
|
|
16
|
+
return documents[source] ?? {};
|
|
17
|
+
}
|