@cityofzion/bs-neo3 0.9.2 → 0.10.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.
@@ -1,6 +1,7 @@
1
1
  import { sleep } from './utils/sleep'
2
2
  import { BSNeo3 } from '../BSNeo3'
3
3
  import { generateMnemonic } from '@cityofzion/bs-asteroid-sdk'
4
+ import TransportNodeHid from '@ledgerhq/hw-transport-node-hid'
4
5
 
5
6
  let bsNeo3: BSNeo3
6
7
 
@@ -120,6 +121,31 @@ describe('BSNeo3', () => {
120
121
  expect(transactionHash).toEqual(expect.any(String))
121
122
  })
122
123
 
124
+ it.skip('Should be able to transfer with ledger', async () => {
125
+ const transport = await TransportNodeHid.create()
126
+ const publicKey = await bsNeo3.ledgerService.getPublicKey(transport)
127
+
128
+ const account = bsNeo3.generateAccountFromPublicKey(publicKey)
129
+
130
+ const balance = await bsNeo3.blockchainDataService.getBalance(account.address)
131
+ const gasBalance = balance.find(b => b.token.symbol === bsNeo3.feeToken.symbol)
132
+ expect(Number(gasBalance?.amount)).toBeGreaterThan(0.00000001)
133
+
134
+ const transactionHash = await bsNeo3.transfer({
135
+ senderAccount: account,
136
+ intent: {
137
+ amount: '1',
138
+ receiverAddress: 'NPRMF5bmYuW23DeDJqsDJenhXkAPSJyuYe',
139
+ tokenHash: bsNeo3.feeToken.hash,
140
+ tokenDecimals: bsNeo3.feeToken.decimals,
141
+ },
142
+ isLedger: true,
143
+ ledgerTransport: transport,
144
+ })
145
+
146
+ expect(transactionHash).toEqual(expect.any(String))
147
+ }, 60000)
148
+
123
149
  it.skip('Should be able to claim', async () => {
124
150
  const account = bsNeo3.generateAccountFromKey(process.env.TESTNET_PRIVATE_KEY as string)
125
151
 
@@ -12,6 +12,7 @@ describe('GhostMarketNDSNeo3', () => {
12
12
  contractHash: '0xaa4fb927b3fe004e689a278d188689c9f050a8b2',
13
13
  tokenId: 'SVBLTUYxMTY1',
14
14
  })
15
+
15
16
  expect(nft).toEqual(
16
17
  expect.objectContaining({
17
18
  id: 'SVBLTUYxMTY1',
@@ -22,6 +23,10 @@ describe('GhostMarketNDSNeo3', () => {
22
23
  image: expect.any(String),
23
24
  isSVG: expect.any(Boolean),
24
25
  name: 'Pink Moon Fish',
26
+ creator: {
27
+ address: 'NQJpnvRaLvPqu8Mm5Bx3d1uJEttwJBN2p9',
28
+ name: undefined,
29
+ },
25
30
  })
26
31
  )
27
32
  })