@solana/rpc-graphql 2.0.0-experimental.e662875 → 2.0.0-experimental.e72afd8
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 +127 -147
- package/dist/index.browser.cjs +2359 -4785
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +2355 -4786
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +2355 -4782
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +2359 -4781
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +2355 -4782
- package/dist/index.node.js.map +1 -1
- package/dist/types/context.d.ts +18 -16
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/loaders/account.d.ts +7 -0
- package/dist/types/loaders/account.d.ts.map +1 -0
- package/dist/types/loaders/block.d.ts +7 -0
- package/dist/types/loaders/block.d.ts.map +1 -0
- package/dist/types/loaders/common/resolve-info.d.ts +3 -0
- package/dist/types/loaders/common/resolve-info.d.ts.map +1 -0
- package/dist/types/loaders/program-accounts.d.ts +9 -0
- package/dist/types/loaders/program-accounts.d.ts.map +1 -0
- package/dist/types/loaders/transaction.d.ts +7 -0
- package/dist/types/loaders/transaction.d.ts.map +1 -0
- package/dist/types/loaders/transformers/account.d.ts +8 -0
- package/dist/types/loaders/transformers/account.d.ts.map +1 -0
- package/dist/types/loaders/transformers/block.d.ts +6 -0
- package/dist/types/loaders/transformers/block.d.ts.map +1 -0
- package/dist/types/loaders/transformers/transaction.d.ts +5 -0
- package/dist/types/loaders/transformers/transaction.d.ts.map +1 -0
- package/dist/types/resolvers/account.d.ts +5 -12
- package/dist/types/resolvers/account.d.ts.map +1 -0
- package/dist/types/rpc.d.ts +5 -3
- package/dist/types/rpc.d.ts.map +1 -0
- package/dist/types/schema/account.d.ts +112 -0
- package/dist/types/schema/account.d.ts.map +1 -0
- package/dist/types/schema/block.d.ts +17 -0
- package/dist/types/schema/block.d.ts.map +1 -0
- package/dist/types/schema/common/inputs.d.ts +3 -0
- package/dist/types/schema/common/inputs.d.ts.map +1 -0
- package/dist/types/schema/common/scalars.d.ts +45 -0
- package/dist/types/schema/common/scalars.d.ts.map +1 -0
- package/dist/types/schema/common/types.d.ts +27 -0
- package/dist/types/schema/common/types.d.ts.map +1 -0
- package/dist/types/schema/index.d.ts +2 -0
- package/dist/types/schema/index.d.ts.map +1 -0
- package/dist/types/schema/instruction.d.ts +949 -0
- package/dist/types/schema/instruction.d.ts.map +1 -0
- package/dist/types/schema/program-accounts.d.ts +12 -0
- package/dist/types/schema/program-accounts.d.ts.map +1 -0
- package/dist/types/schema/transaction.d.ts +16 -0
- package/dist/types/schema/transaction.d.ts.map +1 -0
- package/package.json +11 -8
- package/dist/types/cache.d.ts +0 -7
- package/dist/types/resolvers/block.d.ts +0 -6
- package/dist/types/resolvers/program-accounts.d.ts +0 -6
- package/dist/types/resolvers/transaction.d.ts +0 -6
- package/dist/types/schema/account/index.d.ts +0 -3
- package/dist/types/schema/account/query.d.ts +0 -38
- package/dist/types/schema/account/types.d.ts +0 -6
- package/dist/types/schema/block/index.d.ts +0 -3
- package/dist/types/schema/block/query.d.ts +0 -42
- package/dist/types/schema/block/types.d.ts +0 -7
- package/dist/types/schema/inputs.d.ts +0 -9
- package/dist/types/schema/picks.d.ts +0 -36
- package/dist/types/schema/program-accounts/index.d.ts +0 -2
- package/dist/types/schema/program-accounts/query.d.ts +0 -47
- package/dist/types/schema/scalars.d.ts +0 -3
- package/dist/types/schema/transaction/index.d.ts +0 -3
- package/dist/types/schema/transaction/query.d.ts +0 -34
- package/dist/types/schema/transaction/types.d.ts +0 -12
package/README.md
CHANGED
|
@@ -130,11 +130,12 @@ The `Account` interface contains common fields across all accounts.
|
|
|
130
130
|
|
|
131
131
|
```graphql
|
|
132
132
|
interface Account {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
address: String
|
|
134
|
+
encoding: String
|
|
135
|
+
executable: Boolean
|
|
136
|
+
lamports: BigInt
|
|
137
|
+
owner: Account
|
|
138
|
+
rentEpoch: BigInt
|
|
138
139
|
}
|
|
139
140
|
```
|
|
140
141
|
|
|
@@ -641,38 +642,13 @@ The `Transaction` interface contains common fields across all transactions.
|
|
|
641
642
|
|
|
642
643
|
```graphql
|
|
643
644
|
interface Transaction {
|
|
644
|
-
|
|
645
|
-
encoding: String
|
|
646
|
-
meta: TransactionMeta
|
|
647
|
-
slot: BigInt
|
|
645
|
+
blockTime: String
|
|
646
|
+
encoding: String
|
|
647
|
+
meta: TransactionMeta
|
|
648
|
+
slot: BigInt
|
|
648
649
|
}
|
|
649
650
|
```
|
|
650
651
|
|
|
651
|
-
Notice the `TransactionMetaInterface` type present in the transaction
|
|
652
|
-
interface.
|
|
653
|
-
|
|
654
|
-
```graphql
|
|
655
|
-
interface TransactionMeta {
|
|
656
|
-
computeUnitsConsumed: BigInt,
|
|
657
|
-
err: String,
|
|
658
|
-
fee: BigInt,
|
|
659
|
-
format: String,
|
|
660
|
-
loadedAddresses: TransactionMetaLoadedAddresses,
|
|
661
|
-
logMessages: [String],
|
|
662
|
-
postBalances: [BigInt],
|
|
663
|
-
postTokenBalances: [TokenBalance],
|
|
664
|
-
preBalances: [BigInt],
|
|
665
|
-
preTokenBalances: [TokenBalance],
|
|
666
|
-
returnData: ReturnData,
|
|
667
|
-
rewards: [Reward],
|
|
668
|
-
status: TransactionStatus,
|
|
669
|
-
}
|
|
670
|
-
```
|
|
671
|
-
|
|
672
|
-
The `TransactionMeta` interface is required since the field `innerInstructions`
|
|
673
|
-
will depend on the encoding level requested for the transaction. This also
|
|
674
|
-
applies to the actual `transaction` object itself.
|
|
675
|
-
|
|
676
652
|
Similar to account types, any transaction can be queried by these fields
|
|
677
653
|
without specifying the specific transaction type or the transaction meta
|
|
678
654
|
type.
|
|
@@ -745,14 +721,14 @@ Similar to accounts, transactions with encoded data are also supported.
|
|
|
745
721
|
|
|
746
722
|
Specific instruction types can be used in the transaction's instructions. The
|
|
747
723
|
default instruction if it cannot be parsed using `jsonParsed` is the JSON
|
|
748
|
-
version dubbed `
|
|
724
|
+
version dubbed `GenericInstruction`.
|
|
749
725
|
|
|
750
726
|
```typescript
|
|
751
727
|
const source = `
|
|
752
728
|
query myQuery($signature: String!, $commitment: Commitment) {
|
|
753
729
|
transaction(signature: $signature, commitment: $commitment) {
|
|
754
|
-
... on
|
|
755
|
-
|
|
730
|
+
... on TransactionParsed {
|
|
731
|
+
data {
|
|
756
732
|
message {
|
|
757
733
|
accountKeys {
|
|
758
734
|
pubkey
|
|
@@ -761,7 +737,7 @@ const source = `
|
|
|
761
737
|
writable
|
|
762
738
|
}
|
|
763
739
|
instructions {
|
|
764
|
-
... on
|
|
740
|
+
... on GenericInstruction {
|
|
765
741
|
accounts
|
|
766
742
|
data
|
|
767
743
|
programId
|
|
@@ -785,7 +761,7 @@ const result = await rpcGraphQL.query(source, variableValues);
|
|
|
785
761
|
```
|
|
786
762
|
data: {
|
|
787
763
|
transaction: {
|
|
788
|
-
|
|
764
|
+
data: {
|
|
789
765
|
message: {
|
|
790
766
|
accountKeys: [
|
|
791
767
|
{
|
|
@@ -824,16 +800,16 @@ instructions, they can be queried using specific instruction types.
|
|
|
824
800
|
const source = `
|
|
825
801
|
query myQuery($signature: String!, $commitment: Commitment) {
|
|
826
802
|
transaction(signature: $signature, commitment: $commitment) {
|
|
827
|
-
... on
|
|
828
|
-
|
|
803
|
+
... on TransactionParsed {
|
|
804
|
+
data {
|
|
829
805
|
message {
|
|
830
806
|
instructions {
|
|
831
807
|
... on CreateAccountInstruction {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
808
|
+
data {
|
|
809
|
+
lamports
|
|
810
|
+
space
|
|
811
|
+
}
|
|
812
|
+
meta {
|
|
837
813
|
program
|
|
838
814
|
}
|
|
839
815
|
}
|
|
@@ -856,15 +832,15 @@ const result = await rpcGraphQL.query(source, variableValues);
|
|
|
856
832
|
```
|
|
857
833
|
data: {
|
|
858
834
|
transaction: {
|
|
859
|
-
|
|
835
|
+
data: {
|
|
860
836
|
message: {
|
|
861
837
|
instructions: [
|
|
862
838
|
{
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
839
|
+
data: {
|
|
840
|
+
lamports: 890880n,
|
|
841
|
+
space: 0n,
|
|
842
|
+
},
|
|
843
|
+
meta: {
|
|
868
844
|
program: 'system',
|
|
869
845
|
},
|
|
870
846
|
}
|
|
@@ -891,7 +867,7 @@ const source = `
|
|
|
891
867
|
encoding: $encoding,
|
|
892
868
|
) {
|
|
893
869
|
... on TransactionBase64 {
|
|
894
|
-
|
|
870
|
+
data
|
|
895
871
|
}
|
|
896
872
|
}
|
|
897
873
|
}
|
|
@@ -909,7 +885,7 @@ const result = await rpcGraphQL.query(source, variableValues);
|
|
|
909
885
|
```
|
|
910
886
|
data: {
|
|
911
887
|
transaction: {
|
|
912
|
-
|
|
888
|
+
data: 'WzIsIDU0LCA5LCAgNzYsIDM1LCA2NCwgOCwgOCwgNCwgMywgMiwgNV0=',
|
|
913
889
|
},
|
|
914
890
|
}
|
|
915
891
|
```
|
|
@@ -927,57 +903,57 @@ in the transaction response.
|
|
|
927
903
|
const source = `
|
|
928
904
|
query myQuery($signature: String!, $commitment: Commitment) {
|
|
929
905
|
transaction(signature: $signature, commitment: $commitment) {
|
|
930
|
-
... on
|
|
931
|
-
|
|
906
|
+
... on TransactionParsed {
|
|
907
|
+
data {
|
|
932
908
|
message {
|
|
933
909
|
instructions {
|
|
934
910
|
... on SplTokenTransferInstruction {
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
decimals
|
|
951
|
-
}
|
|
911
|
+
data {
|
|
912
|
+
amount
|
|
913
|
+
authority {
|
|
914
|
+
address
|
|
915
|
+
lamports
|
|
916
|
+
}
|
|
917
|
+
destination {
|
|
918
|
+
... on TokenAccount {
|
|
919
|
+
data {
|
|
920
|
+
address
|
|
921
|
+
mint {
|
|
922
|
+
... on MintAccount {
|
|
923
|
+
data {
|
|
924
|
+
address
|
|
925
|
+
decimals
|
|
952
926
|
}
|
|
953
927
|
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
928
|
+
}
|
|
929
|
+
owner {
|
|
930
|
+
address
|
|
931
|
+
lamports
|
|
958
932
|
}
|
|
959
933
|
}
|
|
960
934
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
935
|
+
}
|
|
936
|
+
source {
|
|
937
|
+
... on TokenAccount {
|
|
938
|
+
data {
|
|
939
|
+
address
|
|
940
|
+
mint {
|
|
941
|
+
... on MintAccount {
|
|
942
|
+
data {
|
|
943
|
+
address
|
|
944
|
+
decimals
|
|
971
945
|
}
|
|
972
946
|
}
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
947
|
+
}
|
|
948
|
+
owner {
|
|
949
|
+
address
|
|
950
|
+
lamports
|
|
977
951
|
}
|
|
978
952
|
}
|
|
979
953
|
}
|
|
980
954
|
}
|
|
955
|
+
}
|
|
956
|
+
meta {
|
|
981
957
|
program
|
|
982
958
|
}
|
|
983
959
|
}
|
|
@@ -1000,50 +976,50 @@ const result = await rpcGraphQL.query(source, variableValues);
|
|
|
1000
976
|
```
|
|
1001
977
|
data: {
|
|
1002
978
|
transaction: {
|
|
1003
|
-
|
|
979
|
+
data: {
|
|
1004
980
|
message: {
|
|
1005
981
|
instructions: [
|
|
1006
982
|
{
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
},
|
|
1040
|
-
}
|
|
983
|
+
data: {
|
|
984
|
+
amount: '50',
|
|
985
|
+
authority: {
|
|
986
|
+
address: 'AHPPMhzDQix9sKULBqeaQ5BUZgrKdz8tg6DzPxsofB12',
|
|
987
|
+
lamports: 890880n,
|
|
988
|
+
},
|
|
989
|
+
destination: {
|
|
990
|
+
data: {
|
|
991
|
+
address: '2W8mUY75zxqwAcpirn75r3Cc7TStMirFyHwKqo13fmB1',
|
|
992
|
+
mint: data: {
|
|
993
|
+
address: '8poKMotB2cEYVv5sbjrdyssASZj1vwYCe7GJFeXo2QP7',
|
|
994
|
+
decimals: 6,
|
|
995
|
+
},
|
|
996
|
+
owner: {
|
|
997
|
+
address: '7tRxJ2znbTFpwW9XaMMiDsXDudoPEUXRcpDpm8qjWgAZ',
|
|
998
|
+
lamports: 890880n,
|
|
999
|
+
},
|
|
1000
|
+
}
|
|
1001
|
+
},
|
|
1002
|
+
source: {
|
|
1003
|
+
data: {
|
|
1004
|
+
parsed: {
|
|
1005
|
+
info: {
|
|
1006
|
+
address: 'BqFCPqXUm4cq6jaZZx1TDTvUR1wdEuNNwAHBEVR6mJhM',
|
|
1007
|
+
mint: data: {
|
|
1008
|
+
address: '8poKMotB2cEYVv5sbjrdyssASZj1vwYCe7GJFeXo2QP7',
|
|
1009
|
+
decimals: 6,
|
|
1010
|
+
},
|
|
1011
|
+
owner: {
|
|
1012
|
+
address: '3dPmVLMD7PC5faZNyJUH9WFrUxAsbjydJfoozwmR1wDG',
|
|
1013
|
+
lamports: e890880n,
|
|
1014
|
+
},
|
|
1041
1015
|
}
|
|
1042
1016
|
}
|
|
1043
|
-
}
|
|
1017
|
+
}
|
|
1044
1018
|
},
|
|
1045
|
-
program: 'spl-token',
|
|
1046
1019
|
},
|
|
1020
|
+
meta: {
|
|
1021
|
+
program: 'spl-token',
|
|
1022
|
+
}
|
|
1047
1023
|
}
|
|
1048
1024
|
]
|
|
1049
1025
|
},
|
|
@@ -1068,19 +1044,21 @@ const source = `
|
|
|
1068
1044
|
blockhash
|
|
1069
1045
|
parentSlot
|
|
1070
1046
|
rewards {
|
|
1071
|
-
|
|
1047
|
+
commission
|
|
1048
|
+
lamports
|
|
1049
|
+
rewardType
|
|
1072
1050
|
}
|
|
1073
1051
|
transactions {
|
|
1074
|
-
... on
|
|
1075
|
-
|
|
1052
|
+
... on TransactionParsed {
|
|
1053
|
+
data {
|
|
1076
1054
|
message {
|
|
1077
1055
|
instructions {
|
|
1078
1056
|
... on CreateAccountInstruction {
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1057
|
+
data {
|
|
1058
|
+
lamports
|
|
1059
|
+
space
|
|
1060
|
+
}
|
|
1061
|
+
meta {
|
|
1084
1062
|
program
|
|
1085
1063
|
}
|
|
1086
1064
|
}
|
|
@@ -1120,20 +1098,22 @@ data: {
|
|
|
1120
1098
|
}
|
|
1121
1099
|
],
|
|
1122
1100
|
transactions: [
|
|
1123
|
-
{
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1101
|
+
data: {
|
|
1102
|
+
{
|
|
1103
|
+
message: {
|
|
1104
|
+
instructions: [
|
|
1105
|
+
{
|
|
1106
|
+
data: {
|
|
1129
1107
|
lamports: 890880n,
|
|
1130
1108
|
space: 0n,
|
|
1131
1109
|
},
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1110
|
+
meta: {
|
|
1111
|
+
program: 'system',
|
|
1112
|
+
},
|
|
1113
|
+
}
|
|
1114
|
+
]
|
|
1115
|
+
},
|
|
1116
|
+
}
|
|
1137
1117
|
}
|
|
1138
1118
|
],
|
|
1139
1119
|
},
|