@cityofzion/bs-ethereum 0.8.0 → 0.8.2

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 -1
  2. package/.rush/temp/operation/build/state.json +1 -1
  3. package/.rush/temp/package-deps_build.json +4 -6
  4. package/.rush/temp/shrinkwrap-deps.json +2 -1
  5. package/bs-ethereum.build.log +1 -1
  6. package/dist/BSEthereum.d.ts +23 -23
  7. package/dist/BSEthereum.js +178 -178
  8. package/dist/BitqueryBDSEthereum.d.ts +14 -14
  9. package/dist/BitqueryBDSEthereum.js +197 -186
  10. package/dist/BitqueryEDSEthereum.d.ts +8 -8
  11. package/dist/BitqueryEDSEthereum.js +73 -73
  12. package/dist/GhostMarketNDSEthereum.d.ts +10 -10
  13. package/dist/GhostMarketNDSEthereum.js +77 -77
  14. package/dist/RpcBDSEthereum.d.ts +12 -12
  15. package/dist/RpcBDSEthereum.js +89 -89
  16. package/dist/assets/tokens/common.json +8 -8
  17. package/dist/constants.d.ts +16 -16
  18. package/dist/constants.js +33 -33
  19. package/dist/graphql.d.ts +124 -123
  20. package/dist/graphql.js +163 -162
  21. package/dist/index.d.ts +6 -6
  22. package/dist/index.js +22 -22
  23. package/jest.config.ts +13 -13
  24. package/jest.setup.ts +1 -1
  25. package/package.json +34 -34
  26. package/src/BSEthereum.ts +184 -184
  27. package/src/BitqueryBDSEthereum.ts +230 -220
  28. package/src/BitqueryEDSEthereum.ts +67 -67
  29. package/src/GhostMarketNDSEthereum.ts +122 -122
  30. package/src/RpcBDSEthereum.ts +88 -88
  31. package/src/__tests__/BDSEthereum.spec.ts +123 -123
  32. package/src/__tests__/BSEthereum.spec.ts +123 -123
  33. package/src/__tests__/BitqueryEDSEthereum.spec.ts +49 -49
  34. package/src/__tests__/GhostMarketNDSEthereum.spec.ts +45 -45
  35. package/src/assets/tokens/common.json +7 -7
  36. package/src/constants.ts +37 -37
  37. package/src/graphql.ts +291 -289
  38. package/src/index.ts +6 -6
  39. package/tsconfig.build.json +4 -4
  40. package/tsconfig.json +15 -15
  41. package/CHANGELOG.json +0 -22
  42. package/CHANGELOG.md +0 -11
package/src/graphql.ts CHANGED
@@ -1,289 +1,291 @@
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
- `
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
+ balance: number
211
+ balances:
212
+ | {
213
+ currency: {
214
+ address: string
215
+ symbol: string
216
+ name: string
217
+ decimals: number
218
+ }
219
+ value: number
220
+ }[]
221
+ | null
222
+ }[]
223
+ }
224
+ }
225
+ type BitQueryGetBalanceVariables = {
226
+ address: string
227
+ network: BitqueryNetwork
228
+ }
229
+ export const bitqueryGetBalanceQuery = gql<BitQueryGetBalanceResponse, BitQueryGetBalanceVariables>`
230
+ query getBalance($address: String!, $network: EthereumNetwork!) {
231
+ ethereum(network: $network) {
232
+ address(address: { is: $address }) {
233
+ balance
234
+ balances {
235
+ currency {
236
+ address
237
+ symbol
238
+ name
239
+ decimals
240
+ }
241
+ value
242
+ }
243
+ }
244
+ }
245
+ }
246
+ `
247
+ type BitQueryGetTokenPricesResponse = {
248
+ ethereum: {
249
+ dexTrades: {
250
+ baseCurrency: {
251
+ address: string
252
+ symbol: string
253
+ }
254
+ quoteCurrency: {
255
+ address: string
256
+ symbol: string
257
+ }
258
+ date: {
259
+ date: string
260
+ }
261
+ quotePrice: number
262
+ }[]
263
+ }
264
+ }
265
+ export type BitQueryGetTokenPricesVariables = {
266
+ after: string
267
+ network: BitqueryNetwork
268
+ }
269
+ export const bitqueryGetPricesQuery = gql<BitQueryGetTokenPricesResponse, BitQueryGetTokenPricesVariables>`
270
+ query getPrice($after: ISO8601DateTime!, $network: EthereumNetwork!) {
271
+ ethereum(network: $network) {
272
+ dexTrades(
273
+ options: { limitBy: { each: "baseCurrency.address", limit: 1 }, desc: "date.date" }
274
+ time: { after: $after }
275
+ ) {
276
+ quoteCurrency(quoteCurrency: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" }) {
277
+ symbol
278
+ address
279
+ }
280
+ baseCurrency {
281
+ symbol
282
+ address
283
+ }
284
+ date {
285
+ date
286
+ }
287
+ quotePrice
288
+ }
289
+ }
290
+ }
291
+ `
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
+ }
package/CHANGELOG.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "name": "@cityofzion/bs-ethereum",
3
- "entries": [
4
- {
5
- "version": "0.8.0",
6
- "tag": "@cityofzion/bs-ethereum_v0.8.0",
7
- "date": "Mon, 27 Nov 2023 22:13:46 GMT",
8
- "comments": {
9
- "minor": [
10
- {
11
- "comment": "Inserted within the TokenPricesResponse type the token hash"
12
- }
13
- ],
14
- "dependency": [
15
- {
16
- "comment": "Updating dependency \"@cityofzion/blockchain-service\" to `0.8.0`"
17
- }
18
- ]
19
- }
20
- }
21
- ]
22
- }
package/CHANGELOG.md DELETED
@@ -1,11 +0,0 @@
1
- # Change Log - @cityofzion/bs-ethereum
2
-
3
- This log was last generated on Mon, 27 Nov 2023 22:13:46 GMT and should not be manually modified.
4
-
5
- ## 0.8.0
6
- Mon, 27 Nov 2023 22:13:46 GMT
7
-
8
- ### Minor changes
9
-
10
- - Inserted within the TokenPricesResponse type the token hash
11
-