@cityofzion/bs-ethereum 0.7.2 → 0.8.0

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.
Files changed (42) hide show
  1. package/.rush/temp/operation/build/all.log +1 -0
  2. package/.rush/temp/operation/build/state.json +3 -0
  3. package/.rush/temp/package-deps_build.json +9 -7
  4. package/.rush/temp/shrinkwrap-deps.json +366 -0
  5. package/CHANGELOG.json +22 -0
  6. package/CHANGELOG.md +11 -0
  7. package/bs-ethereum.build.log +1 -2
  8. package/dist/BSEthereum.d.ts +23 -23
  9. package/dist/BSEthereum.js +178 -178
  10. package/dist/BitqueryBDSEthereum.d.ts +14 -13
  11. package/dist/BitqueryBDSEthereum.js +186 -185
  12. package/dist/BitqueryEDSEthereum.d.ts +8 -8
  13. package/dist/BitqueryEDSEthereum.js +73 -72
  14. package/dist/GhostMarketNDSEthereum.d.ts +10 -10
  15. package/dist/GhostMarketNDSEthereum.js +77 -77
  16. package/dist/RpcBDSEthereum.d.ts +12 -11
  17. package/dist/RpcBDSEthereum.js +89 -88
  18. package/dist/assets/tokens/common.json +8 -8
  19. package/dist/constants.d.ts +16 -16
  20. package/dist/constants.js +33 -33
  21. package/dist/graphql.d.ts +123 -123
  22. package/dist/graphql.js +162 -162
  23. package/dist/index.d.ts +6 -6
  24. package/dist/index.js +22 -22
  25. package/jest.config.ts +13 -13
  26. package/jest.setup.ts +1 -1
  27. package/package.json +33 -33
  28. package/src/BSEthereum.ts +184 -184
  29. package/src/BitqueryBDSEthereum.ts +220 -218
  30. package/src/BitqueryEDSEthereum.ts +67 -66
  31. package/src/GhostMarketNDSEthereum.ts +122 -122
  32. package/src/RpcBDSEthereum.ts +88 -86
  33. package/src/__tests__/BDSEthereum.spec.ts +123 -123
  34. package/src/__tests__/BSEthereum.spec.ts +123 -123
  35. package/src/__tests__/BitqueryEDSEthereum.spec.ts +49 -46
  36. package/src/__tests__/GhostMarketNDSEthereum.spec.ts +45 -45
  37. package/src/assets/tokens/common.json +7 -7
  38. package/src/constants.ts +37 -37
  39. package/src/graphql.ts +289 -289
  40. package/src/index.ts +6 -6
  41. package/tsconfig.build.json +4 -4
  42. package/tsconfig.json +15 -15
package/src/graphql.ts CHANGED
@@ -1,289 +1,289 @@
1
- import { gql } from '@urql/core'
2
-
3
- type BitqueryNetwork = 'ethereum' | 'goerli'
4
-
5
- export type BitqueryTransaction = {
6
- block: {
7
- timestamp: {
8
- unixtime: number
9
- }
10
- height: number
11
- }
12
- transaction: {
13
- gasValue: number
14
- hash: string
15
- }
16
- amount: number
17
- currency: {
18
- address: string
19
- tokenType: string
20
- decimals: number
21
- symbol: string
22
- name: string
23
- }
24
- sender: {
25
- address: string
26
- }
27
- receiver: {
28
- address: string
29
- }
30
- entityId: string
31
- }
32
-
33
- type BitQueryGetTransactionsByAddressResponse = {
34
- ethereum: {
35
- sent: BitqueryTransaction[]
36
- received: BitqueryTransaction[]
37
- sentCount: {
38
- count: number
39
- }[]
40
- receiverCount: {
41
- count: number
42
- }[]
43
- }
44
- }
45
-
46
- type BitQueryGetTransactionsByAddressVariables = {
47
- address: string
48
- limit: number
49
- offset: number
50
- network: BitqueryNetwork
51
- }
52
-
53
- export const bitqueryGetTransactionsByAddressQuery = gql<
54
- BitQueryGetTransactionsByAddressResponse,
55
- BitQueryGetTransactionsByAddressVariables
56
- >`
57
- query getTransactions($address: String!, $limit: Int!, $offset: Int!, $network: EthereumNetwork!) {
58
- ethereum(network: $network) {
59
- sent: transfers(
60
- options: { limit: $limit, offset: $offset, desc: "block.timestamp.unixtime" }
61
- sender: { is: $address }
62
- ) {
63
- block {
64
- timestamp {
65
- unixtime
66
- }
67
- height
68
- }
69
- amount
70
- currency {
71
- address
72
- tokenType
73
- symbol
74
- decimals
75
- name
76
- }
77
- sender {
78
- address
79
- }
80
- receiver {
81
- address
82
- }
83
- transaction {
84
- gasValue
85
- hash
86
- }
87
- entityId
88
- }
89
- received: transfers(
90
- options: { limit: $limit, offset: $offset, desc: "block.timestamp.unixtime" }
91
- receiver: { is: $address }
92
- ) {
93
- block {
94
- timestamp {
95
- unixtime
96
- }
97
- height
98
- }
99
- amount
100
- currency {
101
- address
102
- tokenType
103
- }
104
- sender {
105
- address
106
- }
107
- receiver {
108
- address
109
- }
110
- transaction {
111
- gasValue
112
- hash
113
- }
114
- entityId
115
- }
116
- sentCount: transfers(sender: { is: $address }) {
117
- count
118
- }
119
- receiverCount: transfers(receiver: { is: $address }) {
120
- count
121
- }
122
- }
123
- }
124
- `
125
-
126
- type BitQueryGetTransactionResponse = {
127
- ethereum: {
128
- transfers: BitqueryTransaction[]
129
- }
130
- }
131
- type BitQueryGetTransactionVariables = {
132
- hash: string
133
- network: BitqueryNetwork
134
- }
135
- export const bitqueryGetTransactionQuery = gql<BitQueryGetTransactionResponse, BitQueryGetTransactionVariables>`
136
- query getTransaction($hash: String!, $network: EthereumNetwork!) {
137
- ethereum(network: $network) {
138
- transfers(txHash: { is: $hash }) {
139
- block {
140
- timestamp {
141
- unixtime
142
- }
143
- height
144
- }
145
- amount
146
- currency {
147
- address
148
- tokenType
149
- }
150
- sender {
151
- address
152
- }
153
- receiver {
154
- address
155
- }
156
- transaction {
157
- gasValue
158
- hash
159
- }
160
- entityId
161
- }
162
- }
163
- }
164
- `
165
-
166
- type BitQueryGetContractResponse = {
167
- ethereum: {
168
- smartContractCalls: {
169
- smartContract: {
170
- address: {
171
- address: string
172
- }
173
- currency: {
174
- symbol: string
175
- name: string
176
- decimals: number
177
- tokenType: string
178
- }
179
- }
180
- }[]
181
- }
182
- }
183
- type BitQueryGetTokenInfoVariables = {
184
- hash: string
185
- network: BitqueryNetwork
186
- }
187
- export const bitqueryGetTokenInfoQuery = gql<BitQueryGetContractResponse, BitQueryGetTokenInfoVariables>`
188
- query getTokenInfo($hash: String!, $network: EthereumNetwork!) {
189
- ethereum(network: $network) {
190
- smartContractCalls(smartContractAddress: { is: $hash }) {
191
- smartContract {
192
- address {
193
- address
194
- }
195
- currency {
196
- symbol
197
- name
198
- decimals
199
- tokenType
200
- }
201
- }
202
- }
203
- }
204
- }
205
- `
206
-
207
- type BitQueryGetBalanceResponse = {
208
- ethereum: {
209
- address: {
210
- balances:
211
- | {
212
- currency: {
213
- address: string
214
- symbol: string
215
- name: string
216
- decimals: number
217
- }
218
- value: number
219
- }[]
220
- | null
221
- }[]
222
- }
223
- }
224
- type BitQueryGetBalanceVariables = {
225
- address: string
226
- network: BitqueryNetwork
227
- }
228
- export const bitqueryGetBalanceQuery = gql<BitQueryGetBalanceResponse, BitQueryGetBalanceVariables>`
229
- query getBalance($address: String!, $network: EthereumNetwork!) {
230
- ethereum(network: $network) {
231
- address(address: { is: $address }) {
232
- balances {
233
- currency {
234
- address
235
- symbol
236
- name
237
- decimals
238
- }
239
- value
240
- }
241
- }
242
- }
243
- }
244
- `
245
- type BitQueryGetTokenPricesResponse = {
246
- ethereum: {
247
- dexTrades: {
248
- baseCurrency: {
249
- address: string
250
- symbol: string
251
- }
252
- quoteCurrency: {
253
- address: string
254
- symbol: string
255
- }
256
- date: {
257
- date: string
258
- }
259
- quotePrice: number
260
- }[]
261
- }
262
- }
263
- export type BitQueryGetTokenPricesVariables = {
264
- after: string
265
- network: BitqueryNetwork
266
- }
267
- export const bitqueryGetPricesQuery = gql<BitQueryGetTokenPricesResponse, BitQueryGetTokenPricesVariables>`
268
- query getPrice($after: ISO8601DateTime!, $network: EthereumNetwork!) {
269
- ethereum(network: $network) {
270
- dexTrades(
271
- options: { limitBy: { each: "baseCurrency.address", limit: 1 }, desc: "date.date" }
272
- time: { after: $after }
273
- ) {
274
- quoteCurrency(quoteCurrency: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" }) {
275
- symbol
276
- address
277
- }
278
- baseCurrency {
279
- symbol
280
- address
281
- }
282
- date {
283
- date
284
- }
285
- quotePrice
286
- }
287
- }
288
- }
289
- `
1
+ import { gql } from '@urql/core'
2
+
3
+ type BitqueryNetwork = 'ethereum' | 'goerli'
4
+
5
+ export type BitqueryTransaction = {
6
+ block: {
7
+ timestamp: {
8
+ unixtime: number
9
+ }
10
+ height: number
11
+ }
12
+ transaction: {
13
+ gasValue: number
14
+ hash: string
15
+ }
16
+ amount: number
17
+ currency: {
18
+ address: string
19
+ tokenType: string
20
+ decimals: number
21
+ symbol: string
22
+ name: string
23
+ }
24
+ sender: {
25
+ address: string
26
+ }
27
+ receiver: {
28
+ address: string
29
+ }
30
+ entityId: string
31
+ }
32
+
33
+ type BitQueryGetTransactionsByAddressResponse = {
34
+ ethereum: {
35
+ sent: BitqueryTransaction[]
36
+ received: BitqueryTransaction[]
37
+ sentCount: {
38
+ count: number
39
+ }[]
40
+ receiverCount: {
41
+ count: number
42
+ }[]
43
+ }
44
+ }
45
+
46
+ type BitQueryGetTransactionsByAddressVariables = {
47
+ address: string
48
+ limit: number
49
+ offset: number
50
+ network: BitqueryNetwork
51
+ }
52
+
53
+ export const bitqueryGetTransactionsByAddressQuery = gql<
54
+ BitQueryGetTransactionsByAddressResponse,
55
+ BitQueryGetTransactionsByAddressVariables
56
+ >`
57
+ query getTransactions($address: String!, $limit: Int!, $offset: Int!, $network: EthereumNetwork!) {
58
+ ethereum(network: $network) {
59
+ sent: transfers(
60
+ options: { limit: $limit, offset: $offset, desc: "block.timestamp.unixtime" }
61
+ sender: { is: $address }
62
+ ) {
63
+ block {
64
+ timestamp {
65
+ unixtime
66
+ }
67
+ height
68
+ }
69
+ amount
70
+ currency {
71
+ address
72
+ tokenType
73
+ symbol
74
+ decimals
75
+ name
76
+ }
77
+ sender {
78
+ address
79
+ }
80
+ receiver {
81
+ address
82
+ }
83
+ transaction {
84
+ gasValue
85
+ hash
86
+ }
87
+ entityId
88
+ }
89
+ received: transfers(
90
+ options: { limit: $limit, offset: $offset, desc: "block.timestamp.unixtime" }
91
+ receiver: { is: $address }
92
+ ) {
93
+ block {
94
+ timestamp {
95
+ unixtime
96
+ }
97
+ height
98
+ }
99
+ amount
100
+ currency {
101
+ address
102
+ tokenType
103
+ }
104
+ sender {
105
+ address
106
+ }
107
+ receiver {
108
+ address
109
+ }
110
+ transaction {
111
+ gasValue
112
+ hash
113
+ }
114
+ entityId
115
+ }
116
+ sentCount: transfers(sender: { is: $address }) {
117
+ count
118
+ }
119
+ receiverCount: transfers(receiver: { is: $address }) {
120
+ count
121
+ }
122
+ }
123
+ }
124
+ `
125
+
126
+ type BitQueryGetTransactionResponse = {
127
+ ethereum: {
128
+ transfers: BitqueryTransaction[]
129
+ }
130
+ }
131
+ type BitQueryGetTransactionVariables = {
132
+ hash: string
133
+ network: BitqueryNetwork
134
+ }
135
+ export const bitqueryGetTransactionQuery = gql<BitQueryGetTransactionResponse, BitQueryGetTransactionVariables>`
136
+ query getTransaction($hash: String!, $network: EthereumNetwork!) {
137
+ ethereum(network: $network) {
138
+ transfers(txHash: { is: $hash }) {
139
+ block {
140
+ timestamp {
141
+ unixtime
142
+ }
143
+ height
144
+ }
145
+ amount
146
+ currency {
147
+ address
148
+ tokenType
149
+ }
150
+ sender {
151
+ address
152
+ }
153
+ receiver {
154
+ address
155
+ }
156
+ transaction {
157
+ gasValue
158
+ hash
159
+ }
160
+ entityId
161
+ }
162
+ }
163
+ }
164
+ `
165
+
166
+ type BitQueryGetContractResponse = {
167
+ ethereum: {
168
+ smartContractCalls: {
169
+ smartContract: {
170
+ address: {
171
+ address: string
172
+ }
173
+ currency: {
174
+ symbol: string
175
+ name: string
176
+ decimals: number
177
+ tokenType: string
178
+ }
179
+ }
180
+ }[]
181
+ }
182
+ }
183
+ type BitQueryGetTokenInfoVariables = {
184
+ hash: string
185
+ network: BitqueryNetwork
186
+ }
187
+ export const bitqueryGetTokenInfoQuery = gql<BitQueryGetContractResponse, BitQueryGetTokenInfoVariables>`
188
+ query getTokenInfo($hash: String!, $network: EthereumNetwork!) {
189
+ ethereum(network: $network) {
190
+ smartContractCalls(smartContractAddress: { is: $hash }, options: { limit: 1 }) {
191
+ smartContract {
192
+ address {
193
+ address
194
+ }
195
+ currency {
196
+ symbol
197
+ name
198
+ decimals
199
+ tokenType
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+ `
206
+
207
+ type BitQueryGetBalanceResponse = {
208
+ ethereum: {
209
+ address: {
210
+ balances:
211
+ | {
212
+ currency: {
213
+ address: string
214
+ symbol: string
215
+ name: string
216
+ decimals: number
217
+ }
218
+ value: number
219
+ }[]
220
+ | null
221
+ }[]
222
+ }
223
+ }
224
+ type BitQueryGetBalanceVariables = {
225
+ address: string
226
+ network: BitqueryNetwork
227
+ }
228
+ export const bitqueryGetBalanceQuery = gql<BitQueryGetBalanceResponse, BitQueryGetBalanceVariables>`
229
+ query getBalance($address: String!, $network: EthereumNetwork!) {
230
+ ethereum(network: $network) {
231
+ address(address: { is: $address }) {
232
+ balances {
233
+ currency {
234
+ address
235
+ symbol
236
+ name
237
+ decimals
238
+ }
239
+ value
240
+ }
241
+ }
242
+ }
243
+ }
244
+ `
245
+ type BitQueryGetTokenPricesResponse = {
246
+ ethereum: {
247
+ dexTrades: {
248
+ baseCurrency: {
249
+ address: string
250
+ symbol: string
251
+ }
252
+ quoteCurrency: {
253
+ address: string
254
+ symbol: string
255
+ }
256
+ date: {
257
+ date: string
258
+ }
259
+ quotePrice: number
260
+ }[]
261
+ }
262
+ }
263
+ export type BitQueryGetTokenPricesVariables = {
264
+ after: string
265
+ network: BitqueryNetwork
266
+ }
267
+ export const bitqueryGetPricesQuery = gql<BitQueryGetTokenPricesResponse, BitQueryGetTokenPricesVariables>`
268
+ query getPrice($after: ISO8601DateTime!, $network: EthereumNetwork!) {
269
+ ethereum(network: $network) {
270
+ dexTrades(
271
+ options: { limitBy: { each: "baseCurrency.address", limit: 1 }, desc: "date.date" }
272
+ time: { after: $after }
273
+ ) {
274
+ quoteCurrency(quoteCurrency: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" }) {
275
+ symbol
276
+ address
277
+ }
278
+ baseCurrency {
279
+ symbol
280
+ address
281
+ }
282
+ date {
283
+ date
284
+ }
285
+ quotePrice
286
+ }
287
+ }
288
+ }
289
+ `
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
- export * from './BSEthereum'
2
- export * from './GhostMarketNDSEthereum'
3
- export * from './constants'
4
- export * from './BitqueryBDSEthereum'
5
- export * from './BitqueryEDSEthereum'
6
- export * from './RpcBDSEthereum'
1
+ export * from './BSEthereum'
2
+ export * from './GhostMarketNDSEthereum'
3
+ export * from './constants'
4
+ export * from './BitqueryBDSEthereum'
5
+ export * from './BitqueryEDSEthereum'
6
+ export * from './RpcBDSEthereum'
@@ -1,4 +1,4 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "exclude": ["src/__tests__"]
4
- }
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "exclude": ["src/__tests__"]
4
+ }
package/tsconfig.json CHANGED
@@ -1,15 +1,15 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "lib": ["ESNext"],
5
- "outDir": "./dist",
6
- "strict": true
7
- },
8
- "include": ["src"],
9
- "exclude": ["node_modules"],
10
- "typedocOptions": {
11
- "entryPoints": ["./src/index.ts"],
12
- "out": "docs",
13
- "exclude": "**/node_modules/**"
14
- }
15
- }
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "lib": ["ESNext"],
5
+ "outDir": "./dist",
6
+ "strict": true
7
+ },
8
+ "include": ["src"],
9
+ "exclude": ["node_modules"],
10
+ "typedocOptions": {
11
+ "entryPoints": ["./src/index.ts"],
12
+ "out": "docs",
13
+ "exclude": "**/node_modules/**"
14
+ }
15
+ }