@xyo-network/xl1-protocol-sdk 1.16.16 → 1.16.18

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 (38) hide show
  1. package/package.json +5 -2
  2. package/dist/neutral/block/primitives/frames/spec/calculateFramesFromRange.spec.d.ts +0 -2
  3. package/dist/neutral/block/primitives/frames/spec/calculateFramesFromRange.spec.d.ts.map +0 -1
  4. package/dist/neutral/block/primitives/frames/spec/deepCalculateFramesFromRange.spec.d.ts +0 -2
  5. package/dist/neutral/block/primitives/frames/spec/deepCalculateFramesFromRange.spec.d.ts.map +0 -1
  6. package/dist/neutral/eip-712/spec/signAndVerify.spec.d.ts +0 -2
  7. package/dist/neutral/eip-712/spec/signAndVerify.spec.d.ts.map +0 -1
  8. package/dist/neutral/primitives/step/spec/completedStepRewardAddress.spec.d.ts +0 -2
  9. package/dist/neutral/primitives/step/spec/completedStepRewardAddress.spec.d.ts.map +0 -1
  10. package/dist/neutral/primitives/step/spec/stepTransferIndex.spec.d.ts +0 -2
  11. package/dist/neutral/primitives/step/spec/stepTransferIndex.spec.d.ts.map +0 -1
  12. package/dist/neutral/simple/network/spec/XyoNetwork.spec.d.ts +0 -2
  13. package/dist/neutral/simple/network/spec/XyoNetwork.spec.d.ts.map +0 -1
  14. package/dist/neutral/simple/permissions/spec/SimpleXyoPermissions.spec.d.ts +0 -2
  15. package/dist/neutral/simple/permissions/spec/SimpleXyoPermissions.spec.d.ts.map +0 -1
  16. package/dist/neutral/transaction/primitives/spec/transactionBlockByteCount.spec.d.ts +0 -2
  17. package/dist/neutral/transaction/primitives/spec/transactionBlockByteCount.spec.d.ts.map +0 -1
  18. package/dist/neutral/transaction/spec/signTransaction.spec.d.ts +0 -2
  19. package/dist/neutral/transaction/spec/signTransaction.spec.d.ts.map +0 -1
  20. package/dist/neutral/validation/block/error.spec.d.ts +0 -2
  21. package/dist/neutral/validation/block/error.spec.d.ts.map +0 -1
  22. package/dist/neutral/validation/lib/spec/isLocalhost.spec.d.ts +0 -2
  23. package/dist/neutral/validation/lib/spec/isLocalhost.spec.d.ts.map +0 -1
  24. package/dist/neutral/wallet/spec/paths.spec.d.ts +0 -2
  25. package/dist/neutral/wallet/spec/paths.spec.d.ts.map +0 -1
  26. package/src/block/primitives/frames/spec/__snapshots__/deepCalculateFramesFromRange.spec.ts.snap +0 -19417
  27. package/src/block/primitives/frames/spec/calculateFramesFromRange.spec.ts +0 -72
  28. package/src/block/primitives/frames/spec/deepCalculateFramesFromRange.spec.ts +0 -75
  29. package/src/eip-712/spec/signAndVerify.spec.ts +0 -27
  30. package/src/primitives/step/spec/completedStepRewardAddress.spec.ts +0 -28
  31. package/src/primitives/step/spec/stepTransferIndex.spec.ts +0 -23
  32. package/src/simple/network/spec/XyoNetwork.spec.ts +0 -77
  33. package/src/simple/permissions/spec/SimpleXyoPermissions.spec.ts +0 -93
  34. package/src/transaction/primitives/spec/transactionBlockByteCount.spec.ts +0 -245
  35. package/src/transaction/spec/signTransaction.spec.ts +0 -46
  36. package/src/validation/block/error.spec.ts +0 -20
  37. package/src/validation/lib/spec/isLocalhost.spec.ts +0 -20
  38. package/src/wallet/spec/paths.spec.ts +0 -28
@@ -1,46 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { Account } from '@xyo-network/account'
3
- import { BoundWitnessValidator } from '@xyo-network/boundwitness-validator'
4
- import type { TransactionBoundWitness } from '@xyo-network/xl1-protocol'
5
- import {
6
- describe, expect, it,
7
- } from 'vitest'
8
-
9
- import { signTransaction } from '../signTransaction.ts'
10
-
11
- describe('signTransaction', () => {
12
- it('successfully signs transaction', async () => {
13
- const bw = {
14
- $signatures: [],
15
- addresses: [],
16
- chain: '0000000000000000000000000000000000000000',
17
- exp: 1001,
18
- fees: {
19
- base: 'e8d4a51000',
20
- gasLimit: '038d7ea4c68000',
21
- gasPrice: '02540be400',
22
- priority: '00',
23
- },
24
- nbf: 1,
25
- payload_hashes: [
26
- '34e5eadb2ccfc7005e224bfa6c3d10c32087d63238005efeaef9c67a85ed6fa2',
27
- 'eb28b0213854d3b5f255806c2261e568fabcef8afa8b7d7f504bee35d9bce917',
28
- ],
29
- payload_schemas: [
30
- 'network.xyo.hash',
31
- 'network.xyo.id',
32
- ],
33
- previous_hashes: [],
34
- schema: 'network.xyo.boundwitness',
35
- script: [
36
- 'elevate|34e5eadb2ccfc7005e224bfa6c3d10c32087d63238005efeaef9c67a85ed6fa2',
37
- ],
38
- } as any as TransactionBoundWitness
39
- const account = await Account.random()
40
- bw.from = account.address
41
- const signed = await signTransaction(bw, account)
42
- expect(signed).toBeDefined()
43
- const validationErrors = await new BoundWitnessValidator(signed).validate()
44
- expect(validationErrors.length).toBe(0)
45
- })
46
- })
@@ -1,20 +0,0 @@
1
- import type { Address, Hash } from '@xylabs/sdk-js'
2
- import type { HydratedBlock } from '@xyo-network/xl1-protocol'
3
- import {
4
- describe, expect, it,
5
- } from 'vitest'
6
-
7
- import { HydratedBlockStateValidationError } from './error.ts'
8
-
9
- describe('HydratedBlockStateValidationError', () => {
10
- it('should be able display chainId', () => {
11
- const error: HydratedBlockStateValidationError = new HydratedBlockStateValidationError(
12
- '2234567890abcdef1234567890abcdef12345678' as Hash, // Mock Hash
13
- '1234567890abcdef1234567890abcdef12345678' as Address, // Mock Address
14
- {} as HydratedBlock, // Mock HydratedBlock
15
- 'Test Error',
16
- [new Error('Inner error')],
17
- )
18
- expect(error).toBeDefined()
19
- })
20
- })
@@ -1,20 +0,0 @@
1
- import {
2
- describe, expect, it,
3
- } from 'vitest'
4
-
5
- import { isLocalhost } from '../isLocalhost.ts'
6
-
7
- describe('is.ts type guards', () => {
8
- describe('isLocalhost', () => {
9
- it('correctly identifies localhost strings', () => {
10
- expect(isLocalhost('localhost')).toBe(true)
11
- expect(isLocalhost('127.0.0.1')).toBe(true)
12
- expect(isLocalhost('::1')).toBe(true)
13
- expect(isLocalhost('example.localhost')).toBe(true)
14
-
15
- expect(isLocalhost('example.com')).toBe(false)
16
- expect(isLocalhost('')).toBe(false)
17
- expect(isLocalhost('local')).toBe(false)
18
- })
19
- })
20
- })
@@ -1,28 +0,0 @@
1
- /* eslint-disable @stylistic/max-len */
2
- import type { Address } from '@xylabs/sdk-js'
3
- import {
4
- describe, expect, it,
5
- } from 'vitest'
6
-
7
- import { generateXyoBaseWalletFromPhrase } from '../generateXyoBaseWalletFromPhrase.ts'
8
-
9
- describe('generateXyoWalletFromPhrase', () => {
10
- const cases: [string, Address][] = [
11
- ['soft stock horn gas screen eager warrior capital chair hamster act ritual pole favorite reject pupil lamp fox eager gospel around before oyster impose', '8789005ecc0ba7be1b8c73573c772b569586140e' as Address],
12
- ['feel word measure clean wire logic crumble require claw agree process animal doctor acoustic phone fury struggle exist child venture delay afraid grant wreck', '1fb0361af69fd563f69f0b3bcb6561b43e3ef7d8' as Address],
13
- ['congress proof lunar return illness stone tourist fine guard catch dry pen spatial clerk reopen resemble law humor metal entire sugar nasty voyage august', '58c0ff5f646794d463ffac5f8b5bfa031a8c3975' as Address],
14
- ['sight immune weird plastic strategy debate key enter gentle custom inject another connect knock lumber illegal easy lucky goose forest baby unfold nature gap', 'e4e65e0bcba8f1b4d276aedb366ffa33d8c64ccf' as Address],
15
- ['two that lady agree diesel thing path nuclear reopen favorite damp style limit sort tumble flat record one topple demise tag image differ give', '0873350b19bb5bebe17a3eff350218e54ab9e87e' as Address],
16
- ['tattoo melt despair brown zone stone mango link actor transfer detail owner crumble toy young current olive embody panther harsh kick wool tilt keen', '0e609cabc6a3364aed62fc360d1752e4f1369c28' as Address],
17
- ['connect umbrella knee title jealous funny modify dinner know unfold sing train siege squeeze monkey kid bullet aisle enact carpet evolve artist rice shuffle', '3b84ea92b81b201b8efda1cc95f3a86b8db0865c' as Address],
18
- ['kite hand april ready marriage idea enforce now people luxury core animal detail renew announce combine country taxi relief april fatal arrow explain panda', '1ffe9e39aca66726dd616ba46296755195a15a47' as Address],
19
- ['pyramid leaf person total remove spend banana skull blouse evolve jewel heart daring chapter grid hand day defy evolve aunt exist elevator nature crop', '5028e3e8e4ce7f890ad37f19eac0ba54ee4dfbbc' as Address],
20
- ['surface tongue decline aerobic letter deer small ankle liberty begin copy elevator tent latin flight bitter large pizza bright sudden cry short pattern table', '3d4755603738f6555508341c48c59456e8021e04' as Address],
21
- ]
22
- it.each(cases)('should generate the default wallet path correctly', async (phrase, address) => {
23
- const wallet = await generateXyoBaseWalletFromPhrase(phrase)
24
- const child = await wallet.derivePath('0')
25
- expect(child).toBeDefined()
26
- expect(child.address).toBe(address)
27
- })
28
- })