@solana/rpc-graphql 2.0.0-experimental.eb5fd16 → 2.0.0-experimental.fbd3974
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/LICENSE +1 -1
- package/README.md +1172 -30
- package/dist/index.browser.cjs +4982 -3
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +4983 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +4983 -4
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +4982 -3
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +4983 -4
- package/dist/index.node.js.map +1 -1
- package/dist/types/cache.d.ts.map +1 -0
- package/dist/types/context.d.ts +14 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/rpc.d.ts.map +1 -0
- package/dist/types/schema/account/index.d.ts +3 -0
- package/dist/types/schema/account/index.d.ts.map +1 -0
- package/dist/types/schema/account/query.d.ts +38 -0
- package/dist/types/schema/account/query.d.ts.map +1 -0
- package/dist/types/schema/account/types.d.ts +5 -0
- package/dist/types/schema/account/types.d.ts.map +1 -0
- package/dist/types/schema/block/index.d.ts +3 -0
- package/dist/types/schema/block/index.d.ts.map +1 -0
- package/dist/types/schema/block/query.d.ts +42 -0
- package/dist/types/schema/block/query.d.ts.map +1 -0
- package/dist/types/schema/block/types.d.ts +7 -0
- package/dist/types/schema/block/types.d.ts.map +1 -0
- package/dist/types/schema/inputs.d.ts +9 -0
- package/dist/types/schema/inputs.d.ts.map +1 -0
- package/dist/types/schema/picks.d.ts +36 -0
- package/dist/types/schema/picks.d.ts.map +1 -0
- package/dist/types/schema/program-accounts/index.d.ts +2 -0
- package/dist/types/schema/program-accounts/index.d.ts.map +1 -0
- package/dist/types/schema/program-accounts/query.d.ts +47 -0
- package/dist/types/schema/program-accounts/query.d.ts.map +1 -0
- package/dist/types/schema/scalars.d.ts +3 -0
- package/dist/types/schema/scalars.d.ts.map +1 -0
- package/dist/types/schema/transaction/index.d.ts +3 -0
- package/dist/types/schema/transaction/index.d.ts.map +1 -0
- package/dist/types/schema/transaction/query.d.ts +33 -0
- package/dist/types/schema/transaction/query.d.ts.map +1 -0
- package/dist/types/schema/transaction/types.d.ts +12 -0
- package/dist/types/schema/transaction/types.d.ts.map +1 -0
- package/package.json +17 -15
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/cache.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IACzB,KAAK,IAAI,IAAI,CAAC;IACd,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;IAC9D,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1E;AAwBD,wBAAgB,kBAAkB,IAAI,YAAY,CAkCjD"}
|
package/dist/types/context.d.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
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 { AccountQueryArgs } from './schema/account/query';
|
|
6
|
+
import { BlockQueryArgs } from './schema/block';
|
|
7
|
+
import { ProgramAccountsQueryArgs } from './schema/program-accounts';
|
|
8
|
+
import { TransactionQueryArgs } from './schema/transaction/query';
|
|
4
9
|
export interface RpcGraphQLContext {
|
|
5
10
|
cache: GraphQLCache;
|
|
11
|
+
resolveAccount(args: AccountQueryArgs, info?: GraphQLResolveInfo): ReturnType<typeof resolveAccount>;
|
|
12
|
+
resolveBlock(args: BlockQueryArgs): ReturnType<typeof resolveBlock>;
|
|
13
|
+
resolveProgramAccounts(args: ProgramAccountsQueryArgs): ReturnType<typeof resolveProgramAccounts>;
|
|
14
|
+
resolveTransaction(args: TransactionQueryArgs): ReturnType<typeof resolveTransaction>;
|
|
6
15
|
rpc: Rpc<SolanaRpcMethods>;
|
|
7
16
|
}
|
|
17
|
+
declare function resolveAccount({ address, encoding, ...config }: AccountQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>, info?: GraphQLResolveInfo): Promise<{} | undefined>;
|
|
18
|
+
declare function resolveBlock({ slot, encoding, ...config }: BlockQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>): Promise<{} | null | undefined>;
|
|
19
|
+
declare function resolveProgramAccounts({ programAddress, encoding, ...config }: ProgramAccountsQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>): Promise<{} | undefined>;
|
|
20
|
+
declare function resolveTransaction({ signature, encoding, ...config }: TransactionQueryArgs, cache: GraphQLCache, rpc: Rpc<SolanaRpcMethods>): Promise<{} | null | undefined>;
|
|
8
21
|
export declare function createSolanaGraphQLContext(rpc: Rpc<SolanaRpcMethods>): RpcGraphQLContext;
|
|
22
|
+
export {};
|
|
9
23
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,iDAAiD,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAsB,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,YAAY,CAAC;IACpB,cAAc,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IACrG,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;IACpE,sBAAsB,CAAC,IAAI,EAAE,wBAAwB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;IAClG,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;IACtF,GAAG,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC9B;AAGD,iBAAe,cAAc,CACzB,EAAE,OAAO,EAAE,QAAuB,EAAE,GAAG,MAAM,EAAE,EAAE,gBAAgB,EACjE,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,GAAG,CAAC,gBAAgB,CAAC,EAC1B,IAAI,CAAC,EAAE,kBAAkB,2BAsD5B;AAED,iBAAe,YAAY,CACvB,EAAE,IAAI,EAAE,QAAuB,EAAE,GAAG,MAAM,EAAE,EAAE,cAAc,EAC5D,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,GAAG,CAAC,gBAAgB,CAAC,kCAkB7B;AAED,iBAAe,sBAAsB,CACjC,EAAE,cAAc,EAAE,QAAuB,EAAE,GAAG,MAAM,EAAE,EAAE,wBAAwB,EAChF,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,GAAG,CAAC,gBAAgB,CAAC,2BAwC7B;AAED,iBAAe,kBAAkB,CAC7B,EAAE,SAAS,EAAE,QAAuB,EAAE,GAAG,MAAM,EAAE,EAAE,oBAAoB,EACvE,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,GAAG,CAAC,gBAAgB,CAAC,kCAyC7B;AAED,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,GAAG,CAAC,gBAAgB,CAAC,GAAG,iBAAiB,CAkBxF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../src/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,iDAAiD,CAAC;AACtE,OAAO,EAAE,OAAO,EAAqB,aAAa,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAE5E,OAAO,EAA8B,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAM1E,MAAM,WAAW,UAAU;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,CACD,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,cAAc,CAAC,EAAE;QAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAC1D,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,aAAa,CAAC;CACzB;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,gBAAgB,CAAC,GAAG,UAAU,CA4BvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/schema/account/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Base58EncodedAddress } from '@solana/addresses';
|
|
2
|
+
import { DataSlice, Slot } from '@solana/rpc-core/dist/types/rpc-methods/common';
|
|
3
|
+
import { Commitment } from '@solana/rpc-types';
|
|
4
|
+
import { RpcGraphQLContext } from '../../context';
|
|
5
|
+
export type AccountQueryArgs = {
|
|
6
|
+
address: Base58EncodedAddress;
|
|
7
|
+
commitment?: Commitment;
|
|
8
|
+
dataSlice?: DataSlice;
|
|
9
|
+
encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed';
|
|
10
|
+
minContextSlot?: Slot;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Account root query for GraphQL
|
|
14
|
+
*/
|
|
15
|
+
export declare const accountQuery: () => {
|
|
16
|
+
account: {
|
|
17
|
+
args: {
|
|
18
|
+
address: {
|
|
19
|
+
type: import("graphql").GraphQLList<import("graphql").GraphQLScalarType<string, string>>;
|
|
20
|
+
};
|
|
21
|
+
commitment: {
|
|
22
|
+
type: import("graphql").GraphQLEnumType;
|
|
23
|
+
};
|
|
24
|
+
dataSlice: {
|
|
25
|
+
type: import("graphql").GraphQLInputObjectType;
|
|
26
|
+
};
|
|
27
|
+
encoding: {
|
|
28
|
+
type: import("graphql").GraphQLEnumType;
|
|
29
|
+
};
|
|
30
|
+
minContextSlot: {
|
|
31
|
+
type: import("graphql").GraphQLScalarType<unknown, unknown>;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
resolve: (_parent: unknown, args: AccountQueryArgs, context: RpcGraphQLContext, info: any) => Promise<{} | undefined>;
|
|
35
|
+
type: import("graphql").GraphQLInterfaceType;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/schema/account/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAKlD,MAAM,MAAM,gBAAgB,GAAG;IAC3B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,aAAa,GAAG,YAAY,CAAC;IAC9D,cAAc,CAAC,EAAE,IAAI,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;2BAUE,OAAO,QAAQ,gBAAgB,WAAW,iBAAiB,QAAQ,GAAG;;;CAI/F,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GraphQLInterfaceType, GraphQLObjectType } from 'graphql';
|
|
2
|
+
export declare const tokenAmountType: () => GraphQLObjectType<any, any>;
|
|
3
|
+
export declare const accountInterface: () => GraphQLInterfaceType;
|
|
4
|
+
export declare const accountTypes: () => GraphQLObjectType<any, any>[];
|
|
5
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/schema/account/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAqB,MAAM,SAAS,CAAC;AAMrF,eAAO,MAAM,eAAe,mCAa3B,CAAC;AAuBF,eAAO,MAAM,gBAAgB,QAAO,oBA4CnC,CAAC;AAoWF,eAAO,MAAM,YAAY,qCAcxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/schema/block/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Slot } from '@solana/rpc-core/dist/types/rpc-methods/common';
|
|
2
|
+
import { Commitment } from '@solana/rpc-types';
|
|
3
|
+
import { TransactionVersion } from '@solana/transactions';
|
|
4
|
+
import { RpcGraphQLContext } from '../../context';
|
|
5
|
+
export type BlockQueryArgs = {
|
|
6
|
+
slot: Slot;
|
|
7
|
+
commitment?: Commitment;
|
|
8
|
+
encoding?: 'base58' | 'base64' | 'json' | 'jsonParsed';
|
|
9
|
+
maxSupportedTransactionVersion?: Exclude<TransactionVersion, 'legacy'>;
|
|
10
|
+
rewards?: boolean;
|
|
11
|
+
transactionDetails?: 'accounts' | 'full' | 'none' | 'signatures';
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Block root query for GraphQL
|
|
15
|
+
*/
|
|
16
|
+
export declare const blockQuery: () => {
|
|
17
|
+
block: {
|
|
18
|
+
args: {
|
|
19
|
+
commitment: {
|
|
20
|
+
type: import("graphql").GraphQLEnumType;
|
|
21
|
+
};
|
|
22
|
+
encoding: {
|
|
23
|
+
type: import("graphql").GraphQLEnumType;
|
|
24
|
+
};
|
|
25
|
+
maxSupportedTransactionVersion: {
|
|
26
|
+
type: import("graphql").GraphQLScalarType<string, string>;
|
|
27
|
+
};
|
|
28
|
+
rewards: {
|
|
29
|
+
type: import("graphql").GraphQLScalarType<boolean, boolean>;
|
|
30
|
+
};
|
|
31
|
+
slot: {
|
|
32
|
+
type: import("graphql").GraphQLList<import("graphql").GraphQLScalarType<unknown, unknown>>;
|
|
33
|
+
};
|
|
34
|
+
transactionDetails: {
|
|
35
|
+
type: import("graphql").GraphQLEnumType;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
resolve: (_parent: unknown, args: BlockQueryArgs, context: RpcGraphQLContext) => Promise<{} | null | undefined>;
|
|
39
|
+
type: import("graphql").GraphQLInterfaceType;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/schema/block/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gDAAgD,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAKlD,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAC;IACvD,8BAA8B,CAAC,EAAE,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;CACpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;2BAUI,OAAO,QAAQ,cAAc,WAAW,iBAAiB;;;CAGlF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GraphQLInterfaceType, GraphQLObjectType } from 'graphql';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for a block
|
|
4
|
+
*/
|
|
5
|
+
export declare const blockInterface: () => GraphQLInterfaceType;
|
|
6
|
+
export declare const blockTypes: () => GraphQLObjectType<any, any>[];
|
|
7
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/schema/block/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA0DlE;;GAEG;AACH,eAAO,MAAM,cAAc,4BAqB1B,CAAC;AA0DF,eAAO,MAAM,UAAU,qCAStB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GraphQLEnumType, GraphQLInputObjectType } from 'graphql';
|
|
2
|
+
export declare const accountEncodingInputType: () => GraphQLEnumType;
|
|
3
|
+
export declare const blockTransactionDetailsInputType: () => GraphQLEnumType;
|
|
4
|
+
export declare const commitmentInputType: () => GraphQLEnumType;
|
|
5
|
+
export declare const dataSliceInputType: () => GraphQLInputObjectType;
|
|
6
|
+
export declare const maxSupportedTransactionVersionInputType: () => GraphQLEnumType;
|
|
7
|
+
export declare const programAccountFilterInputType: () => GraphQLInputObjectType;
|
|
8
|
+
export declare const transactionEncodingInputType: () => GraphQLEnumType;
|
|
9
|
+
//# sourceMappingURL=inputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../../src/schema/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAKlE,eAAO,MAAM,wBAAwB,uBAoBpC,CAAC;AAGF,eAAO,MAAM,gCAAgC,uBAoB5C,CAAC;AAGF,eAAO,MAAM,mBAAmB,uBAiB/B,CAAC;AAGF,eAAO,MAAM,kBAAkB,8BAU9B,CAAC;AAGF,eAAO,MAAM,uCAAuC,uBAcnD,CAAC;AAGF,eAAO,MAAM,6BAA6B,8BAYzC,CAAC;AAGF,eAAO,MAAM,4BAA4B,uBAoBxC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType } from 'graphql';
|
|
2
|
+
type GraphQLType = GraphQLEnumType | GraphQLInputObjectType | GraphQLInterfaceType | GraphQLObjectType | GraphQLScalarType | GraphQLUnionType;
|
|
3
|
+
export declare function boolean(): {
|
|
4
|
+
type: GraphQLScalarType<boolean, boolean>;
|
|
5
|
+
};
|
|
6
|
+
export declare function bigint(): {
|
|
7
|
+
type: GraphQLScalarType<unknown, unknown>;
|
|
8
|
+
};
|
|
9
|
+
export declare function float(): {
|
|
10
|
+
type: GraphQLScalarType<number, number>;
|
|
11
|
+
};
|
|
12
|
+
export declare function number(): {
|
|
13
|
+
type: GraphQLScalarType<number, number>;
|
|
14
|
+
};
|
|
15
|
+
export declare function string(): {
|
|
16
|
+
type: GraphQLScalarType<string, string>;
|
|
17
|
+
};
|
|
18
|
+
export declare function type<TFieldType extends GraphQLType>(fieldType: TFieldType): {
|
|
19
|
+
type: TFieldType;
|
|
20
|
+
};
|
|
21
|
+
export declare function nonNull<TFieldType extends GraphQLType>(fieldType: {
|
|
22
|
+
type: TFieldType;
|
|
23
|
+
}): {
|
|
24
|
+
type: GraphQLList<TFieldType>;
|
|
25
|
+
};
|
|
26
|
+
export declare function list<TElementType extends GraphQLType>(elementType: {
|
|
27
|
+
type: TElementType;
|
|
28
|
+
}): {
|
|
29
|
+
type: GraphQLList<TElementType>;
|
|
30
|
+
};
|
|
31
|
+
type ConstructorParametersOf<T> = T extends new (...args: infer P) => unknown ? P : never;
|
|
32
|
+
export declare function object(name: string, fields: ConstructorParametersOf<typeof GraphQLObjectType>[0]['fields']): {
|
|
33
|
+
type: GraphQLObjectType;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=picks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picks.d.ts","sourceRoot":"","sources":["../../../src/schema/picks.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,eAAe,EAEf,sBAAsB,EAEtB,oBAAoB,EACpB,WAAW,EAEX,iBAAiB,EACjB,iBAAiB,EAEjB,gBAAgB,EACnB,MAAM,SAAS,CAAC;AAIjB,KAAK,WAAW,GACV,eAAe,GACf,sBAAsB,GACtB,oBAAoB,GACpB,iBAAiB,GACjB,iBAAiB,GACjB,gBAAgB,CAAC;AAEvB,wBAAgB,OAAO;;EAEtB;AAGD,wBAAgB,MAAM;;EAGrB;AAED,wBAAgB,KAAK;;EAEpB;AACD,wBAAgB,MAAM;;EAErB;AAED,wBAAgB,MAAM;;EAErB;AAED,wBAAgB,IAAI,CAAC,UAAU,SAAS,WAAW,EAC/C,SAAS,EAAE,UAAU,GACtB;IACC,IAAI,EAAE,UAAU,CAAC;CACpB,CAIA;AAED,wBAAgB,OAAO,CAAC,UAAU,SAAS,WAAW,EAAE,SAAS,EAAE;IAC/D,IAAI,EAAE,UAAU,CAAC;CACpB,GAAG;IACA,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;CACjC,CAIA;AAED,wBAAgB,IAAI,CAAC,YAAY,SAAS,WAAW,EAAE,WAAW,EAAE;IAChE,IAAI,EAAE,YAAY,CAAC;CACtB,GAAG;IACA,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CACnC,CAIA;AAED,KAAK,uBAAuB,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC;AAE1F,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,uBAAuB,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GACvE;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAO7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/schema/program-accounts/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Base58EncodedAddress } from '@solana/addresses';
|
|
2
|
+
import { DataSlice, GetProgramAccountsDatasizeFilter, GetProgramAccountsMemcmpFilter, Slot } from '@solana/rpc-core/dist/types/rpc-methods/common';
|
|
3
|
+
import { Commitment } from '@solana/rpc-types';
|
|
4
|
+
import { GraphQLList } from 'graphql';
|
|
5
|
+
import { RpcGraphQLContext } from '../../context';
|
|
6
|
+
export type ProgramAccountsQueryArgs = {
|
|
7
|
+
programAddress: Base58EncodedAddress;
|
|
8
|
+
commitment?: Commitment;
|
|
9
|
+
dataSlice?: DataSlice;
|
|
10
|
+
encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed';
|
|
11
|
+
filters: (GetProgramAccountsMemcmpFilter | GetProgramAccountsDatasizeFilter)[];
|
|
12
|
+
minContextSlot?: Slot;
|
|
13
|
+
withContext?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Program accounts root query for GraphQL
|
|
17
|
+
*/
|
|
18
|
+
export declare const programAccountsQuery: () => {
|
|
19
|
+
programAccounts: {
|
|
20
|
+
args: {
|
|
21
|
+
commitment: {
|
|
22
|
+
type: import("graphql").GraphQLEnumType;
|
|
23
|
+
};
|
|
24
|
+
dataSlice: {
|
|
25
|
+
type: import("graphql").GraphQLInputObjectType;
|
|
26
|
+
};
|
|
27
|
+
encoding: {
|
|
28
|
+
type: import("graphql").GraphQLEnumType;
|
|
29
|
+
};
|
|
30
|
+
filters: {
|
|
31
|
+
type: GraphQLList<import("graphql").GraphQLInputObjectType>;
|
|
32
|
+
};
|
|
33
|
+
minContextSlot: {
|
|
34
|
+
type: import("graphql").GraphQLScalarType<unknown, unknown>;
|
|
35
|
+
};
|
|
36
|
+
programAddress: {
|
|
37
|
+
type: GraphQLList<import("graphql").GraphQLScalarType<string, string>>;
|
|
38
|
+
};
|
|
39
|
+
withContext: {
|
|
40
|
+
type: import("graphql").GraphQLScalarType<string, string>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
resolve: (_parent: unknown, args: ProgramAccountsQueryArgs, context: RpcGraphQLContext) => Promise<{} | undefined>;
|
|
44
|
+
type: GraphQLList<import("graphql").GraphQLInterfaceType>;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/schema/program-accounts/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACH,SAAS,EACT,gCAAgC,EAChC,8BAA8B,EAC9B,IAAI,EACP,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAUlD,MAAM,MAAM,wBAAwB,GAAG;IACnC,cAAc,EAAE,oBAAoB,CAAC;IACrC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,aAAa,GAAG,YAAY,CAAC;IAC9D,OAAO,EAAE,CAAC,8BAA8B,GAAG,gCAAgC,CAAC,EAAE,CAAC;IAC/E,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;2BAWN,OAAO,QAAQ,wBAAwB,WAAW,iBAAiB;;;CAI5F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalars.d.ts","sourceRoot":"","sources":["../../../src/schema/scalars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAQ,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,YAAY,gDAkBnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/schema/transaction/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Commitment } from '@solana/rpc-types';
|
|
2
|
+
import { TransactionSignature, TransactionVersion } from '@solana/transactions';
|
|
3
|
+
import { RpcGraphQLContext } from '../../context';
|
|
4
|
+
export type TransactionQueryArgs = {
|
|
5
|
+
signature: TransactionSignature;
|
|
6
|
+
commitment?: Commitment;
|
|
7
|
+
encoding?: 'base58' | 'base64' | 'json' | 'jsonParsed';
|
|
8
|
+
maxSupportedTransactionVersion?: Exclude<TransactionVersion, 'legacy'>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Transaction root query for GraphQL
|
|
12
|
+
*/
|
|
13
|
+
export declare const transactionQuery: () => {
|
|
14
|
+
transaction: {
|
|
15
|
+
args: {
|
|
16
|
+
commitment: {
|
|
17
|
+
type: import("graphql").GraphQLEnumType;
|
|
18
|
+
};
|
|
19
|
+
encoding: {
|
|
20
|
+
type: import("graphql").GraphQLEnumType;
|
|
21
|
+
};
|
|
22
|
+
maxSupportedTransactionVersion: {
|
|
23
|
+
type: import("graphql").GraphQLEnumType;
|
|
24
|
+
};
|
|
25
|
+
signature: {
|
|
26
|
+
type: import("graphql").GraphQLList<import("graphql").GraphQLScalarType<string, string>>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
resolve: (_parent: unknown, args: TransactionQueryArgs, context: RpcGraphQLContext) => Promise<{} | null | undefined>;
|
|
30
|
+
type: import("graphql").GraphQLInterfaceType;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/schema/transaction/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAKlD,MAAM,MAAM,oBAAoB,GAAG;IAC/B,SAAS,EAAE,oBAAoB,CAAC;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAC;IACvD,8BAA8B,CAAC,EAAE,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;CAC1E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;2BAQF,OAAO,QAAQ,oBAAoB,WAAW,iBAAiB;;;CAIxF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GraphQLInterfaceType, GraphQLObjectType, GraphQLUnionType } from 'graphql';
|
|
2
|
+
export declare const tokenBalance: () => GraphQLObjectType<any, any>;
|
|
3
|
+
export declare const transactionStatus: () => GraphQLUnionType;
|
|
4
|
+
export declare const reward: () => GraphQLObjectType<any, any>;
|
|
5
|
+
export declare const returnData: () => GraphQLObjectType<any, any>;
|
|
6
|
+
export declare const transactionMetaLoadedAddresses: () => GraphQLObjectType<any, any>;
|
|
7
|
+
/**
|
|
8
|
+
* Interface for a transaction
|
|
9
|
+
*/
|
|
10
|
+
export declare const transactionInterface: () => GraphQLInterfaceType;
|
|
11
|
+
export declare const transactionTypes: () => GraphQLObjectType<any, any>[];
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/schema/transaction/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAe,iBAAiB,EAAqB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAOpH,eAAO,MAAM,YAAY,mCAqCxB,CAAC;AAGF,eAAO,MAAM,iBAAiB,wBAoB7B,CAAC;AAGF,eAAO,MAAM,MAAM,mCAalB,CAAC;AAiBF,eAAO,MAAM,UAAU,mCAUtB,CAAC;AAiBF,eAAO,MAAM,8BAA8B,mCAU1C,CAAC;AAkpIF;;GAEG;AACH,eAAO,MAAM,oBAAoB,4BAqBhC,CAAC;AAqEF,eAAO,MAAM,gBAAgB,qCAuB5B,CAAC"}
|
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.fbd3974",
|
|
4
4
|
"description": "A library for resolving GraphQl query calls to the Solana JSON RPC API",
|
|
5
5
|
"exports": {
|
|
6
6
|
"browser": {
|
|
@@ -50,29 +50,31 @@
|
|
|
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/rpc-core": "2.0.0-experimental.
|
|
72
|
-
"@solana/rpc-
|
|
70
|
+
"@solana/addresses": "2.0.0-experimental.fbd3974",
|
|
71
|
+
"@solana/rpc-core": "2.0.0-experimental.fbd3974",
|
|
72
|
+
"@solana/rpc-types": "2.0.0-experimental.fbd3974",
|
|
73
|
+
"@solana/rpc-transport": "2.0.0-experimental.fbd3974",
|
|
74
|
+
"@solana/transactions": "2.0.0-experimental.fbd3974",
|
|
73
75
|
"build-scripts": "0.0.0",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
+
"tsconfig": "0.0.0",
|
|
77
|
+
"test-config": "0.0.0"
|
|
76
78
|
},
|
|
77
79
|
"bundlewatch": {
|
|
78
80
|
"defaultCompression": "gzip",
|
|
@@ -87,14 +89,14 @@
|
|
|
87
89
|
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
|
|
88
90
|
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --watch",
|
|
89
91
|
"publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
|
|
90
|
-
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/*",
|
|
92
|
+
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
|
|
91
93
|
"test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
92
94
|
"test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
93
95
|
"test:treeshakability:browser": "agadoo dist/index.browser.js",
|
|
94
96
|
"test:treeshakability:native": "agadoo dist/index.native.js",
|
|
95
97
|
"test:treeshakability:node": "agadoo dist/index.node.js",
|
|
96
98
|
"test:typecheck": "tsc --noEmit",
|
|
97
|
-
"test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --silent
|
|
98
|
-
"test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --silent
|
|
99
|
+
"test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --silent",
|
|
100
|
+
"test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --silent"
|
|
99
101
|
}
|
|
100
102
|
}
|