@cityofzion/bs-neo3 0.10.0 → 0.11.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.
- package/dist/BSNeo3.d.ts +3 -2
- package/dist/BSNeo3.js +19 -5
- package/dist/DoraBDSNeo3.d.ts +0 -1
- package/dist/DoraBDSNeo3.js +11 -12
- package/dist/DoraESNeo3.d.ts +1 -1
- package/dist/DoraESNeo3.js +19 -5
- package/dist/FlamingoEDSNeo3.d.ts +1 -2
- package/dist/FlamingoEDSNeo3.js +20 -5
- package/dist/GhostMarketNDSNeo3.d.ts +1 -1
- package/dist/GhostMarketNDSNeo3.js +17 -3
- package/dist/LedgerServiceNeo3.d.ts +3 -1
- package/dist/LedgerServiceNeo3.js +3 -0
- package/dist/RpcBDSNeo3.d.ts +4 -4
- package/dist/RpcBDSNeo3.js +17 -17
- package/package.json +6 -3
- package/.eslintignore +0 -13
- package/.eslintrc.cjs +0 -22
- package/.rush/temp/operation/build/all.log +0 -1
- package/.rush/temp/operation/build/state.json +0 -3
- package/.rush/temp/package-deps_build.json +0 -32
- package/.rush/temp/shrinkwrap-deps.json +0 -520
- package/CHANGELOG.json +0 -83
- package/CHANGELOG.md +0 -40
- package/bs-neo3.build.log +0 -1
- package/jest.config.ts +0 -13
- package/jest.setup.ts +0 -1
- package/src/BSNeo3.ts +0 -254
- package/src/DoraBDSNeo3.ts +0 -188
- package/src/DoraESNeo3.ts +0 -19
- package/src/FlamingoEDSNeo3.ts +0 -41
- package/src/GhostMarketNDSNeo3.ts +0 -121
- package/src/LedgerServiceNeo3.ts +0 -107
- package/src/RpcBDSNeo3.ts +0 -161
- package/src/__tests__/BDSNeo3.spec.ts +0 -124
- package/src/__tests__/BSNeo3.spec.ts +0 -175
- package/src/__tests__/DoraESNeo3.spec.ts +0 -23
- package/src/__tests__/FlamingoEDSNeo3.spec.ts +0 -48
- package/src/__tests__/GhostMarketNDSNeo3.spec.ts +0 -48
- package/src/__tests__/utils/sleep.ts +0 -1
- package/src/assets/tokens/common.json +0 -14
- package/src/assets/tokens/mainnet.json +0 -116
- package/src/constants.ts +0 -29
- package/src/index.ts +0 -6
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -14
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { DoraESNeo3 } from '../DoraESNeo3'
|
|
2
|
-
|
|
3
|
-
let doraESNeo3: DoraESNeo3
|
|
4
|
-
|
|
5
|
-
describe('DoraESNeo3', () => {
|
|
6
|
-
beforeAll(() => {
|
|
7
|
-
doraESNeo3 = new DoraESNeo3('mainnet')
|
|
8
|
-
})
|
|
9
|
-
it('Should return a transaction url', async () => {
|
|
10
|
-
const hash = '0x775d824a54d4e9bebf3c522a7d8dede550348323d833ce68fbcf0ab953d579e8'
|
|
11
|
-
const url = doraESNeo3.buildTransactionUrl(hash)
|
|
12
|
-
|
|
13
|
-
expect(url).toEqual(`https://dora.coz.io/transaction/neo3/mainnet/${hash}`)
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
it('Should return a nft url', async () => {
|
|
17
|
-
const contractHash = '0x577a51f7d39162c9de1db12a6b319c848e4c54e5'
|
|
18
|
-
const tokenId = 'rAI='
|
|
19
|
-
const url = doraESNeo3.buildNftUrl({ contractHash, tokenId })
|
|
20
|
-
|
|
21
|
-
expect(url).toEqual(`https://dora.coz.io/nft/neo3/mainnet/${contractHash}/${tokenId}`)
|
|
22
|
-
})
|
|
23
|
-
})
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { FlamingoEDSNeo3 } from '../FlamingoEDSNeo3'
|
|
2
|
-
|
|
3
|
-
let flamingoEDSNeo3: FlamingoEDSNeo3
|
|
4
|
-
|
|
5
|
-
describe('FlamingoEDSNeo3', () => {
|
|
6
|
-
beforeAll(() => {
|
|
7
|
-
flamingoEDSNeo3 = new FlamingoEDSNeo3('mainnet')
|
|
8
|
-
})
|
|
9
|
-
it('Should return a list with prices of tokens using USD', async () => {
|
|
10
|
-
const tokenPriceList = await flamingoEDSNeo3.getTokenPrices('USD')
|
|
11
|
-
|
|
12
|
-
tokenPriceList.forEach(tokenPrice => {
|
|
13
|
-
expect(tokenPrice).toEqual({
|
|
14
|
-
price: expect.any(Number),
|
|
15
|
-
symbol: expect.any(String),
|
|
16
|
-
hash: expect.any(String),
|
|
17
|
-
})
|
|
18
|
-
})
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
it('Should return a list with prices of tokens using BRL', async () => {
|
|
22
|
-
const tokenPriceListInUSD = await flamingoEDSNeo3.getTokenPrices('USD')
|
|
23
|
-
const tokenPriceList = await flamingoEDSNeo3.getTokenPrices('BRL')
|
|
24
|
-
|
|
25
|
-
tokenPriceList.forEach((tokenPrice, index) => {
|
|
26
|
-
expect(tokenPrice.price).toBeGreaterThan(tokenPriceListInUSD[index].price)
|
|
27
|
-
expect(tokenPrice).toEqual({
|
|
28
|
-
price: expect.any(Number),
|
|
29
|
-
symbol: expect.any(String),
|
|
30
|
-
hash: expect.any(String),
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
it('Should return a list with prices of tokens using EUR', async () => {
|
|
36
|
-
const tokenPriceListInUSD = await flamingoEDSNeo3.getTokenPrices('USD')
|
|
37
|
-
const tokenPriceList = await flamingoEDSNeo3.getTokenPrices('EUR')
|
|
38
|
-
|
|
39
|
-
tokenPriceList.forEach((tokenPrice, index) => {
|
|
40
|
-
expect(tokenPrice.price).toBeLessThan(tokenPriceListInUSD[index].price)
|
|
41
|
-
expect(tokenPrice).toEqual({
|
|
42
|
-
price: expect.any(Number),
|
|
43
|
-
symbol: expect.any(String),
|
|
44
|
-
hash: expect.any(String),
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
})
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { GhostMarketNDSNeo3 } from '../GhostMarketNDSNeo3'
|
|
2
|
-
|
|
3
|
-
let ghostMarketNDSNeo3: GhostMarketNDSNeo3
|
|
4
|
-
|
|
5
|
-
describe('GhostMarketNDSNeo3', () => {
|
|
6
|
-
beforeAll(() => {
|
|
7
|
-
ghostMarketNDSNeo3 = new GhostMarketNDSNeo3('mainnet')
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
it('Get NFT', async () => {
|
|
11
|
-
const nft = await ghostMarketNDSNeo3.getNft({
|
|
12
|
-
contractHash: '0xaa4fb927b3fe004e689a278d188689c9f050a8b2',
|
|
13
|
-
tokenId: 'SVBLTUYxMTY1',
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
expect(nft).toEqual(
|
|
17
|
-
expect.objectContaining({
|
|
18
|
-
id: 'SVBLTUYxMTY1',
|
|
19
|
-
contractHash: '0xaa4fb927b3fe004e689a278d188689c9f050a8b2',
|
|
20
|
-
symbol: 'TTM',
|
|
21
|
-
collectionImage: expect.any(String),
|
|
22
|
-
collectionName: 'TOTHEMOON',
|
|
23
|
-
image: expect.any(String),
|
|
24
|
-
isSVG: expect.any(Boolean),
|
|
25
|
-
name: 'Pink Moon Fish',
|
|
26
|
-
creator: {
|
|
27
|
-
address: 'NQJpnvRaLvPqu8Mm5Bx3d1uJEttwJBN2p9',
|
|
28
|
-
name: undefined,
|
|
29
|
-
},
|
|
30
|
-
})
|
|
31
|
-
)
|
|
32
|
-
})
|
|
33
|
-
it('Get NFTS by address', async () => {
|
|
34
|
-
const nfts = await ghostMarketNDSNeo3.getNftsByAddress({
|
|
35
|
-
address: 'NNmTVFrSPhe7zjgN6iq9cLgXJwLZziUKV6',
|
|
36
|
-
})
|
|
37
|
-
expect(nfts.items.length).toBeGreaterThan(0)
|
|
38
|
-
nfts.items.forEach(nft => {
|
|
39
|
-
expect(nft).toEqual(
|
|
40
|
-
expect.objectContaining({
|
|
41
|
-
symbol: expect.any(String),
|
|
42
|
-
id: expect.any(String),
|
|
43
|
-
contractHash: expect.any(String),
|
|
44
|
-
})
|
|
45
|
-
)
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"symbol": "LRB",
|
|
4
|
-
"name": "LyrebirdToken",
|
|
5
|
-
"hash": "0x8c07b4c9f5bc170a3922eac4f5bb7ef17b0acc8b",
|
|
6
|
-
"decimals": 8
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"symbol": "USDL",
|
|
10
|
-
"name": "LyrebirdUSDToken",
|
|
11
|
-
"hash": "0xa8c51aa0c177187aeed3db88bdfa908ccbc9b1a5",
|
|
12
|
-
"decimals": 8
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"symbol": "FLM",
|
|
16
|
-
"name": "FLM",
|
|
17
|
-
"hash": "0xf0151f528127558851b39c2cd8aa47da7418ab28",
|
|
18
|
-
"decimals": 8
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"symbol": "fCAKE",
|
|
22
|
-
"name": "fCAKE",
|
|
23
|
-
"hash": "0xe65b462b90516012826f8a9c4c285d8c750e3a77",
|
|
24
|
-
"decimals": 18
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"symbol": "WING",
|
|
28
|
-
"name": "WING",
|
|
29
|
-
"hash": "0xeeccd60ed722111f8400434dac3ba42c14d8beb1",
|
|
30
|
-
"decimals": 9
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"symbol": "fWETH",
|
|
34
|
-
"name": "fWETH",
|
|
35
|
-
"hash": "0xc14b601252aa5dfa6166cf35fe5ccd2e35f3fdf5",
|
|
36
|
-
"decimals": 18
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"symbol": "fWBTC",
|
|
40
|
-
"name": "fWBTC",
|
|
41
|
-
"hash": "0xd6abe115ecb75e1fa0b42f5e85934ce8c1ae2893",
|
|
42
|
-
"decimals": 8
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"symbol": "SWTH",
|
|
46
|
-
"name": "SWTHToken",
|
|
47
|
-
"hash": "0x78e1330db47634afdb5ea455302ba2d12b8d549f",
|
|
48
|
-
"decimals": 8
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"symbol": "pONT",
|
|
52
|
-
"name": "pONT",
|
|
53
|
-
"hash": "0x8122bc2212ec971690a044b37a6f52a9349b702b",
|
|
54
|
-
"decimals": 9
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"symbol": "fUSDT",
|
|
58
|
-
"name": "fUSDT",
|
|
59
|
-
"hash": "0xcd48b160c1bbc9d74997b803b9a7ad50a4bef020",
|
|
60
|
-
"decimals": 6
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"symbol": "FLUND",
|
|
64
|
-
"name": "FLUND",
|
|
65
|
-
"hash": "0xa9603a59e21d29e37ac39cf1b5f5abf5006b22a3",
|
|
66
|
-
"decimals": 8
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"symbol": "GM",
|
|
70
|
-
"name": "GhostMarketToken",
|
|
71
|
-
"hash": "0x9b049f1283515eef1d3f6ac610e1595ed25ca3e9",
|
|
72
|
-
"decimals": 8
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"symbol": "NUDES",
|
|
76
|
-
"name": "Nudes",
|
|
77
|
-
"hash": "0x340720c7107ef5721e44ed2ea8e314cce5c130fa",
|
|
78
|
-
"decimals": 8
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"symbol": "CANDY",
|
|
82
|
-
"name": "NeoCandy",
|
|
83
|
-
"hash": "0x88da18a5bca86ec8206d9b4960a7d0c4355a432f",
|
|
84
|
-
"decimals": 9
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"symbol": "DOGER",
|
|
88
|
-
"name": "DogeRift",
|
|
89
|
-
"hash": "0x322b5a366ca724801a1aa01e669b5f3d7f8c7f6f",
|
|
90
|
-
"decimals": 8
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"symbol": "DOGEF",
|
|
94
|
-
"name": "DogeFood",
|
|
95
|
-
"hash": "0xa3291b66f70d4687fc0e41977d8acb0699f235ae",
|
|
96
|
-
"decimals": 8
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"symbol": "SOM",
|
|
100
|
-
"name": "Som",
|
|
101
|
-
"hash": "0x2d4c6cf0417209a7eb410160344e224e74f87195",
|
|
102
|
-
"decimals": 8
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"symbol": "LAMBO",
|
|
106
|
-
"name": "BoomerFund",
|
|
107
|
-
"hash": "0xafdd6abedf066ff8c5fbc868cc89f80eac467142",
|
|
108
|
-
"decimals": 8
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"symbol": "bNEO",
|
|
112
|
-
"hash": "0x48c40d4666f93408be1bef038b6722404d9a4c2a",
|
|
113
|
-
"decimals": 8,
|
|
114
|
-
"name": "BurgerNEO"
|
|
115
|
-
}
|
|
116
|
-
]
|
package/src/constants.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { NetworkType, Token } from '@cityofzion/blockchain-service'
|
|
2
|
-
import commom from './assets/tokens/common.json'
|
|
3
|
-
import mainnet from './assets/tokens/mainnet.json'
|
|
4
|
-
|
|
5
|
-
export const TOKENS: Record<NetworkType, Token[]> = {
|
|
6
|
-
mainnet: [...commom, ...mainnet],
|
|
7
|
-
testnet: commom,
|
|
8
|
-
custom: commom,
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const NEO_NS_HASH = '0x50ac1c37690cc2cfc594472833cf57505d5f46de'
|
|
12
|
-
|
|
13
|
-
export const DEFAULT_URL_BY_NETWORK_TYPE: Record<NetworkType, string> = {
|
|
14
|
-
mainnet: 'https://mainnet1.neo.coz.io:443',
|
|
15
|
-
testnet: 'https://testnet1.neo.coz.io:443',
|
|
16
|
-
custom: 'http://127.0.0.1:50012',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const GHOSTMARKET_URL_BY_NETWORK_TYPE: Partial<Record<NetworkType, string>> = {
|
|
20
|
-
mainnet: 'https://api.ghostmarket.io/api/v2',
|
|
21
|
-
testnet: 'https://api-testnet.ghostmarket.io/api/v2',
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const GHOSTMARKET_CHAIN_BY_NETWORK_TYPE: Partial<Record<NetworkType, string>> = {
|
|
25
|
-
mainnet: 'n3',
|
|
26
|
-
testnet: 'n3t',
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const DERIVATION_PATH = "m/44'/888'/0'/0/?"
|
package/src/index.ts
DELETED
package/tsconfig.build.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"lib": ["ESNext"],
|
|
5
|
-
"outDir": "./dist"
|
|
6
|
-
},
|
|
7
|
-
"include": ["src"],
|
|
8
|
-
"exclude": ["node_modules"],
|
|
9
|
-
"typedocOptions": {
|
|
10
|
-
"entryPoints": ["./src/index.ts"],
|
|
11
|
-
"out": "docs",
|
|
12
|
-
"exclude": "**/node_modules/**"
|
|
13
|
-
}
|
|
14
|
-
}
|