@solana/rpc-graphql 2.0.0-experimental.dacecb7 → 2.0.0-experimental.e662875
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 +1108 -30
- package/dist/index.browser.cjs +3269 -401
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +3269 -401
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +3269 -401
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +3269 -401
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +3269 -401
- package/dist/index.node.js.map +1 -1
- package/dist/types/context.d.ts +6 -6
- package/dist/types/resolvers/account.d.ts +15 -0
- package/dist/types/resolvers/block.d.ts +6 -0
- package/dist/types/resolvers/program-accounts.d.ts +6 -0
- package/dist/types/resolvers/transaction.d.ts +6 -0
- package/dist/types/schema/account/query.d.ts +4 -4
- package/dist/types/schema/account/types.d.ts +1 -0
- package/dist/types/schema/block/query.d.ts +2 -2
- package/dist/types/schema/program-accounts/query.d.ts +4 -4
- package/dist/types/schema/transaction/query.d.ts +5 -4
- package/package.json +13 -11
- package/dist/types/schema/program-accounts/types.d.ts +0 -3
package/dist/types/context.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { SolanaRpcMethods } from '@solana/rpc-core';
|
|
2
2
|
import { Rpc } from '@solana/rpc-transport/dist/types/json-rpc-types';
|
|
3
|
+
import { GraphQLResolveInfo } from 'graphql';
|
|
3
4
|
import { GraphQLCache } from './cache';
|
|
5
|
+
import { resolveAccount } from './resolvers/account';
|
|
6
|
+
import { resolveBlock } from './resolvers/block';
|
|
7
|
+
import { resolveProgramAccounts } from './resolvers/program-accounts';
|
|
8
|
+
import { resolveTransaction } from './resolvers/transaction';
|
|
4
9
|
import { AccountQueryArgs } from './schema/account/query';
|
|
5
10
|
import { BlockQueryArgs } from './schema/block';
|
|
6
11
|
import { ProgramAccountsQueryArgs } from './schema/program-accounts';
|
|
7
12
|
import { TransactionQueryArgs } from './schema/transaction/query';
|
|
8
13
|
export interface RpcGraphQLContext {
|
|
9
14
|
cache: GraphQLCache;
|
|
10
|
-
resolveAccount(args: AccountQueryArgs): ReturnType<typeof resolveAccount>;
|
|
15
|
+
resolveAccount(args: AccountQueryArgs, info?: GraphQLResolveInfo): ReturnType<typeof resolveAccount>;
|
|
11
16
|
resolveBlock(args: BlockQueryArgs): ReturnType<typeof resolveBlock>;
|
|
12
17
|
resolveProgramAccounts(args: ProgramAccountsQueryArgs): ReturnType<typeof resolveProgramAccounts>;
|
|
13
18
|
resolveTransaction(args: TransactionQueryArgs): ReturnType<typeof resolveTransaction>;
|
|
14
19
|
rpc: Rpc<SolanaRpcMethods>;
|
|
15
20
|
}
|
|
16
|
-
declare function resolveAccount({ address, encoding, ...config }: AccountQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>): Promise<{} | null | undefined>;
|
|
17
|
-
declare function resolveBlock({ slot, encoding, ...config }: BlockQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>): Promise<{} | null | undefined>;
|
|
18
|
-
declare function resolveProgramAccounts({ programAddress, encoding, ...config }: ProgramAccountsQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>): Promise<{} | undefined>;
|
|
19
|
-
declare function resolveTransaction({ signature, encoding, ...config }: TransactionQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>): Promise<{} | null | undefined>;
|
|
20
21
|
export declare function createSolanaGraphQLContext(rpc: Rpc<SolanaRpcMethods>): RpcGraphQLContext;
|
|
21
|
-
export {};
|
|
22
22
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SolanaRpcMethods } from '@solana/rpc-core';
|
|
2
|
+
import { Rpc } from '@solana/rpc-transport/dist/types/json-rpc-types';
|
|
3
|
+
import { GraphQLResolveInfo } from 'graphql';
|
|
4
|
+
import { GraphQLCache } from '../cache';
|
|
5
|
+
import { AccountQueryArgs } from '../schema/account';
|
|
6
|
+
export declare function refineJsonParsedAccountData(jsonParsedData: any): {
|
|
7
|
+
data: any;
|
|
8
|
+
meta: {
|
|
9
|
+
program: any;
|
|
10
|
+
space: any;
|
|
11
|
+
type: any;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare function resolveAccount({ address, encoding, ...config }: AccountQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>, info?: GraphQLResolveInfo): Promise<{} | undefined>;
|
|
15
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SolanaRpcMethods } from '@solana/rpc-core';
|
|
2
|
+
import { Rpc } from '@solana/rpc-transport/dist/types/json-rpc-types';
|
|
3
|
+
import { GraphQLCache } from '../cache';
|
|
4
|
+
import { BlockQueryArgs } from '../schema/block';
|
|
5
|
+
export declare function resolveBlock({ slot, encoding, ...config }: BlockQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>): Promise<{} | null | undefined>;
|
|
6
|
+
//# sourceMappingURL=block.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SolanaRpcMethods } from '@solana/rpc-core';
|
|
2
|
+
import { Rpc } from '@solana/rpc-transport/dist/types/json-rpc-types';
|
|
3
|
+
import { GraphQLCache } from '../cache';
|
|
4
|
+
import { ProgramAccountsQueryArgs } from '../schema/program-accounts';
|
|
5
|
+
export declare function resolveProgramAccounts({ programAddress, encoding, ...config }: ProgramAccountsQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>): Promise<{} | undefined>;
|
|
6
|
+
//# sourceMappingURL=program-accounts.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SolanaRpcMethods } from '@solana/rpc-core';
|
|
2
|
+
import { Rpc } from '@solana/rpc-transport/dist/types/json-rpc-types';
|
|
3
|
+
import { GraphQLCache } from '../cache';
|
|
4
|
+
import { TransactionQueryArgs } from '../schema/transaction';
|
|
5
|
+
export declare function resolveTransaction({ signature, encoding, ...config }: TransactionQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>): Promise<{} | null | undefined>;
|
|
6
|
+
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Commitment } from '@solana/rpc-core';
|
|
1
|
+
import { Address } from '@solana/addresses';
|
|
3
2
|
import { DataSlice, Slot } from '@solana/rpc-core/dist/types/rpc-methods/common';
|
|
3
|
+
import { Commitment } from '@solana/rpc-types';
|
|
4
4
|
import { RpcGraphQLContext } from '../../context';
|
|
5
5
|
export type AccountQueryArgs = {
|
|
6
|
-
address:
|
|
6
|
+
address: Address;
|
|
7
7
|
commitment?: Commitment;
|
|
8
8
|
dataSlice?: DataSlice;
|
|
9
9
|
encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed';
|
|
@@ -31,7 +31,7 @@ export declare const accountQuery: () => {
|
|
|
31
31
|
type: import("graphql").GraphQLScalarType<unknown, unknown>;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
resolve: (_parent: unknown, args: AccountQueryArgs, context: RpcGraphQLContext) => Promise<{} |
|
|
34
|
+
resolve: (_parent: unknown, args: AccountQueryArgs, context: RpcGraphQLContext, info: any) => Promise<{} | undefined>;
|
|
35
35
|
type: import("graphql").GraphQLInterfaceType;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GraphQLInterfaceType, GraphQLObjectType } from 'graphql';
|
|
2
2
|
export declare const tokenAmountType: () => GraphQLObjectType<any, any>;
|
|
3
|
+
export declare const jsonParsedMeta: () => GraphQLObjectType<any, any>;
|
|
3
4
|
export declare const accountInterface: () => GraphQLInterfaceType;
|
|
4
5
|
export declare const accountTypes: () => GraphQLObjectType<any, any>[];
|
|
5
6
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Commitment } from '@solana/rpc-core';
|
|
2
1
|
import { Slot } from '@solana/rpc-core/dist/types/rpc-methods/common';
|
|
2
|
+
import { Commitment } from '@solana/rpc-types';
|
|
3
3
|
import { TransactionVersion } from '@solana/transactions';
|
|
4
4
|
import { RpcGraphQLContext } from '../../context';
|
|
5
5
|
export type BlockQueryArgs = {
|
|
6
6
|
slot: Slot;
|
|
7
7
|
commitment?: Commitment;
|
|
8
|
-
encoding?: 'base58' | 'base64' | '
|
|
8
|
+
encoding?: 'base58' | 'base64' | 'jsonParsed';
|
|
9
9
|
maxSupportedTransactionVersion?: Exclude<TransactionVersion, 'legacy'>;
|
|
10
10
|
rewards?: boolean;
|
|
11
11
|
transactionDetails?: 'accounts' | 'full' | 'none' | 'signatures';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Commitment } from '@solana/rpc-core';
|
|
1
|
+
import { Address } from '@solana/addresses';
|
|
3
2
|
import { DataSlice, GetProgramAccountsDatasizeFilter, GetProgramAccountsMemcmpFilter, Slot } from '@solana/rpc-core/dist/types/rpc-methods/common';
|
|
3
|
+
import { Commitment } from '@solana/rpc-types';
|
|
4
4
|
import { GraphQLList } from 'graphql';
|
|
5
5
|
import { RpcGraphQLContext } from '../../context';
|
|
6
6
|
export type ProgramAccountsQueryArgs = {
|
|
7
|
-
programAddress:
|
|
7
|
+
programAddress: Address;
|
|
8
8
|
commitment?: Commitment;
|
|
9
9
|
dataSlice?: DataSlice;
|
|
10
10
|
encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed';
|
|
@@ -41,7 +41,7 @@ export declare const programAccountsQuery: () => {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
resolve: (_parent: unknown, args: ProgramAccountsQueryArgs, context: RpcGraphQLContext) => Promise<{} | undefined>;
|
|
44
|
-
type: GraphQLList<import("graphql").
|
|
44
|
+
type: GraphQLList<import("graphql").GraphQLInterfaceType>;
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Signature } from '@solana/keys';
|
|
2
|
+
import { Commitment } from '@solana/rpc-types';
|
|
3
|
+
import { TransactionVersion } from '@solana/transactions';
|
|
3
4
|
import { RpcGraphQLContext } from '../../context';
|
|
4
5
|
export type TransactionQueryArgs = {
|
|
5
|
-
signature:
|
|
6
|
+
signature: Signature;
|
|
6
7
|
commitment?: Commitment;
|
|
7
|
-
encoding?: 'base58' | 'base64' | '
|
|
8
|
+
encoding?: 'base58' | 'base64' | 'jsonParsed';
|
|
8
9
|
maxSupportedTransactionVersion?: Exclude<TransactionVersion, 'legacy'>;
|
|
9
10
|
};
|
|
10
11
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/rpc-graphql",
|
|
3
|
-
"version": "2.0.0-experimental.
|
|
3
|
+
"version": "2.0.0-experimental.e662875",
|
|
4
4
|
"description": "A library for resolving GraphQl query calls to the Solana JSON RPC API",
|
|
5
5
|
"exports": {
|
|
6
6
|
"browser": {
|
|
@@ -50,27 +50,29 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@solana/eslint-config-solana": "^1.0.2",
|
|
53
|
-
"@swc/jest": "^0.2.
|
|
54
|
-
"@types/jest": "^29.5.
|
|
53
|
+
"@swc/jest": "^0.2.29",
|
|
54
|
+
"@types/jest": "^29.5.6",
|
|
55
55
|
"@typescript-eslint/eslint-plugin": "^6.3.0",
|
|
56
56
|
"@typescript-eslint/parser": "^6.3.0",
|
|
57
57
|
"agadoo": "^3.0.0",
|
|
58
58
|
"eslint": "^8.45.0",
|
|
59
|
-
"eslint-plugin-jest": "^27.2
|
|
59
|
+
"eslint-plugin-jest": "^27.4.2",
|
|
60
60
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
61
|
-
"jest": "^29.
|
|
62
|
-
"jest-environment-jsdom": "^29.
|
|
61
|
+
"jest": "^29.7.0",
|
|
62
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
63
63
|
"jest-fetch-mock-fork": "^3.0.4",
|
|
64
|
-
"jest-runner-eslint": "^2.1.
|
|
64
|
+
"jest-runner-eslint": "^2.1.2",
|
|
65
65
|
"jest-runner-prettier": "^1.0.0",
|
|
66
66
|
"prettier": "^2.8",
|
|
67
67
|
"tsup": "7.2.0",
|
|
68
68
|
"typescript": "^5.1.6",
|
|
69
69
|
"version-from-git": "^1.1.1",
|
|
70
|
-
"@solana/addresses": "2.0.0-experimental.
|
|
71
|
-
"@solana/
|
|
72
|
-
"@solana/rpc-
|
|
73
|
-
"@solana/
|
|
70
|
+
"@solana/addresses": "2.0.0-experimental.e662875",
|
|
71
|
+
"@solana/keys": "2.0.0-experimental.e662875",
|
|
72
|
+
"@solana/rpc-core": "2.0.0-experimental.e662875",
|
|
73
|
+
"@solana/rpc-types": "2.0.0-experimental.e662875",
|
|
74
|
+
"@solana/rpc-transport": "2.0.0-experimental.e662875",
|
|
75
|
+
"@solana/transactions": "2.0.0-experimental.e662875",
|
|
74
76
|
"build-scripts": "0.0.0",
|
|
75
77
|
"test-config": "0.0.0",
|
|
76
78
|
"tsconfig": "0.0.0"
|