Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hazae41/cubane
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.19
Choose a base ref
...
head repository: hazae41/cubane
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 19 commits
  • 53 files changed
  • 1 contributor

Commits on May 20, 2024

  1. readme

    hazae41 committed May 20, 2024
    Copy the full SHA
    e6d8621 View commit details

Commits on Jul 7, 2024

  1. fix

    hazae41 committed Jul 7, 2024
    Copy the full SHA
    3169e2d View commit details
  2. fix

    hazae41 committed Jul 7, 2024
    Copy the full SHA
    3a25f87 View commit details
  3. 0.1.20

    hazae41 committed Jul 7, 2024
    Copy the full SHA
    44749a5 View commit details
  4. fix

    hazae41 committed Jul 7, 2024
    Copy the full SHA
    1aae643 View commit details
  5. 0.1.21

    hazae41 committed Jul 7, 2024
    Copy the full SHA
    6ffd9cb View commit details

Commits on Aug 10, 2024

  1. fix

    hazae41 committed Aug 10, 2024
    Copy the full SHA
    5e7dd09 View commit details
  2. split build

    hazae41 committed Aug 10, 2024
    Copy the full SHA
    b4976b3 View commit details
  3. 0.1.22

    hazae41 committed Aug 10, 2024
    Copy the full SHA
    ed66c61 View commit details
  4. 0.1.23

    hazae41 committed Aug 10, 2024
    Copy the full SHA
    b3f81d0 View commit details

Commits on Aug 31, 2024

  1. d

    hazae41 committed Aug 31, 2024
    Copy the full SHA
    9ff20ac View commit details

Commits on Sep 1, 2024

  1. d

    hazae41 committed Sep 1, 2024
    Copy the full SHA
    2a467f7 View commit details
  2. 0.2.0

    hazae41 committed Sep 1, 2024
    Copy the full SHA
    1e29363 View commit details
  3. d

    hazae41 committed Sep 1, 2024
    Copy the full SHA
    9b8ca53 View commit details
  4. d

    hazae41 committed Sep 1, 2024
    Copy the full SHA
    18c4f34 View commit details
  5. 0.2.1

    hazae41 committed Sep 1, 2024
    Copy the full SHA
    fa24473 View commit details
  6. clean

    hazae41 committed Sep 1, 2024
    Copy the full SHA
    af2f58e View commit details
  7. d

    hazae41 committed Sep 1, 2024
    Copy the full SHA
    89b7dbd View commit details

Commits on Nov 23, 2024

  1. f

    hazae41 committed Nov 23, 2024
    Copy the full SHA
    a0cc0a0 View commit details
Showing with 2,028 additions and 1,682 deletions.
  1. +7 −53 README.md
  2. +789 −537 package-lock.json
  3. +28 −25 package.json
  4. +24 −0 rollup.config.bench.js
  5. +1 −28 rollup.config.js
  6. +24 −0 rollup.config.test.js
  7. +23 −19 src/index.bench.ts
  8. +0 −16 src/index.test.ts
  9. +3 −3 src/libs/bigint/bigint.ts
  10. +27 −0 src/libs/copiable/index.ts
  11. +1 −0 src/libs/nullable/index.ts
  12. +3 −3 src/libs/number/number.ts
  13. +0 −11 src/libs/records/records.ts
  14. +0 −21 src/mods/abi/decode.ts
  15. +0 −21 src/mods/abi/encode.ts
  16. +18 −10 src/mods/abi/index.test.ts
  17. +9 −2 src/mods/abi/json/json.test.ts
  18. +3 −8 src/mods/abi/signature/signature.ts
  19. +9 −2 src/mods/abi/typed/index.bench.ts
  20. +13 −6 src/mods/abi/typed/index.test.ts
  21. +13 −39 src/mods/abi/typed/index.ts
  22. +11 −4 src/mods/abi/types/address/address.test.ts
  23. +4 −4 src/mods/abi/types/address/address.ts
  24. +15 −8 src/mods/abi/types/bool/bool.test.ts
  25. +9 −8 src/mods/abi/types/bytes/dynamic.ts
  26. +10 −3 src/mods/abi/types/bytes/index.test.ts
  27. +10 −9 src/mods/abi/types/bytes/static.macro.ts
  28. +257 −256 src/mods/abi/types/bytes/static.ts
  29. +5 −5 src/mods/abi/types/function/function.ts
  30. +7 −7 src/mods/abi/types/int/int.macro.ts
  31. +15 −8 src/mods/abi/types/int/int.test.ts
  32. +224 −224 src/mods/abi/types/int/int.ts
  33. +8 −7 src/mods/abi/types/string/string.ts
  34. +6 −6 src/mods/abi/types/uint/uint.macro.ts
  35. +12 −5 src/mods/abi/types/uint/uint.test.ts
  36. +192 −192 src/mods/abi/types/uint/uint.ts
  37. +9 −2 src/mods/ens/index.bench.ts
  38. +11 −4 src/mods/ens/index.test.ts
  39. +11 −30 src/mods/ens/index.ts
  40. +30 −22 src/mods/rlp/index.test.ts
  41. +3 −9 src/mods/rlp/rlp.ts
  42. +22 −2 src/mods/rlp/types/list.ts
  43. +25 −1 src/mods/rlp/types/string.ts
  44. +9 −2 src/mods/types/address/index.bench.ts
  45. +5 −2 src/mods/types/address/index.test.ts
  46. +4 −4 src/mods/types/address/index.ts
  47. +4 −4 src/mods/types/fixed/index.ts
  48. +18 −15 src/mods/types/helpers/generic.ts
  49. +10 −13 src/mods/types/signature/index.ts
  50. +14 −8 src/mods/types/signer/index.test.ts
  51. +13 −13 src/mods/types/signer/index.ts
  52. +59 −0 src/mods/types/transaction/index.ts
  53. +1 −1 tsconfig.json
60 changes: 7 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -78,63 +78,17 @@ See https://github.com/hazae41/symbol-dispose-polyfill for more

You can bring your own implementation for some algorithms

#### Keccak256 (required)
#### Keccak256 (required for almost everything)

Noble-hashes includes a small implementation of Keccak256
See https://github.com/hazae41/keccak256 for setup

https://github.com/paulmillr/noble-hashes
#### Secp256k1 (required for signatures)

```bash
npm i @noble/hashes
```

`keccak256.ts`

```typescript
import { Keccak256 } from "@hazae41/keccak256"

Keccak256.set(await Keccak256.fromNoble())
```

See https://github.com/hazae41/keccak256 for more

#### Secp256k1 (recommended)

Noble-curves includes a small implementation of Secp256k1

https://github.com/paulmillr/noble-curves

```bash
npm i @noble/curves
```

`secp256k1.ts`

```typescript
import { Secp256k1 } from "@hazae41/secp256k1"

Secp256k1.set(await Secp256k1.fromNoble())
```

See https://github.com/hazae41/secp256k1 for more
See https://github.com/hazae41/secp256k1 for setup

#### Base16 (optional)

Scure-base includes a small implementation of Base16

```bash
npm i @scure/base
```

`base16.ts`

```typescript
import { Base16 } from "@hazae41/base16"

Base16.set(await Base16.fromBufferOrScure())
```

See https://github.com/hazae41/base16 for more
See https://github.com/hazae41/base16 for setup

## Usage

@@ -240,7 +194,7 @@ const dog = RlpString.from(Bytes.fromUtf8("dog"))
const catAndDog = RlpList.from([cat, dog])

const bytes = Writable.writeToBytesOrThrow(catAndDog)
const hex = "0x" + Base16.get().encodeOrThrow(bytes)
const hex = "0x" + Base16.get().getOrThrow().encodeOrThrow(bytes)
```

### Signatures
@@ -260,7 +214,7 @@ const privateKeyExt = new ExtPrivateKey(Secp256k1.get().PrivateKey.importOrThrow

const signatureExt = privateKeyExt.signPersonalMessageOrThrow(message)
const signatureBytes = signatureExt.value.exportOrThrow().copyAndDispose()
const signatureZeroHex = `0x${Base16.get().encodeOrThrow(signatureBytes)}`
const signatureZeroHex = `0x${Base16.get().getOrThrow().encodeOrThrow(signatureBytes)}`
```

#### Recovering personal message
Loading