1. May 21, 2020
  2. May 20, 2020
  3. May 18, 2020
  4. May 16, 2020
    • Amaury Martiny's avatar
      refactor!: Pass mandatory registry everywhere (#141) · bd14e848
      Amaury Martiny authored
      BREAKING CHANGE:
      
      This refactor breaks compatibility with v1, as all functions now require a `{ metadataRpc?, registry }` last argument.
      
      #### Rationale
      
      In v1, by not passing any last argument, we implicitly used Kusama's most recent TypeRegistry. This was a handy shortcut, but might create hard-to-debug issues down the road (e.g. using another chain, or using Kusama with an incompatible spec version).
      
      In v2, we never default to Kusama anymore, and always require the user passing the registry (and sometimes the metadata too, if needed, see docs for details).
      
      Example 1:
      
      ```diff
      + // Get Kusama's registry at `specVersion`
      + const registry = getRegistry('Kusama', 'kusama', specVersion);
      
      const unsigned = methods.balances.transfer(
        { dest: '1F...', value: 23 },
        {
          // other info about tx
      -    metadataRpc: metadataRpc,
      - }
      +  }, {
      +    metadataRpc: metadataRpc,
      +    registry: registry
      +  }
      );
      ```
      
      Example 2:
      
      ```diff
      const unsigned = {...};
      const signature = '...';
      
      + // Get Kusama's registry at `specVersion`
      + const registry = getRegistry('Kusama', 'kusama', unsigned.specVersion);
      
      - const signed = createSigned(unsigned, signature);
      + const signed = createSigned(unsigned, signature, {
      +    metadataRpc: unsigned.metadata,
      +    registry,
      + });
      ```
      
      Here is the full list of breaking changes:
      - `decode` function taking 3 arguments was deprecated in v1, in favor or 2 arguments. In v2, `decode` takes exactly 2 arguments.
      - `createSigningPayload`, `createSignedTx`, `methods.*.*` functions all take a mandatory last argument `{ metadataRpc?, registry }`. Note that the `metadata` field has been renamed to `metadataRpc`. Whether a function needs `metadataRpc` is documented for each function.
      - `deriveAddress`'s 2nd argument `ss58Format` is now mandatory, and does not default to Kusama's prefix anymore.
      bd14e848
  5. May 11, 2020
  6. Apr 30, 2020
  7. Apr 27, 2020
  8. Apr 01, 2020
  9. Mar 31, 2020
  10. Mar 16, 2020
  11. Mar 12, 2020
  12. Mar 11, 2020
  13. Mar 10, 2020
  14. Feb 26, 2020
  15. Feb 12, 2020
  16. Feb 06, 2020
  17. Feb 03, 2020
  18. Jan 31, 2020
  19. Jan 21, 2020
  20. Jan 15, 2020
  21. Jan 03, 2020
  22. Jan 02, 2020
    • Amaury Martiny's avatar
      chore: Rename package to `@substrate/txwrapper` (#24) · 1028e927
      Amaury Martiny authored
      
      
      * Updagte package.json
      
      * Update README
      
      * Generate docs
      
      * Update README.md
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update README.md
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update docs/README.md
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update docs/README.md
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      1028e927
    • Amaury Martiny's avatar
      refactor: Put all available methods under `method.*` (#23) · 77176a3f
      Amaury Martiny authored
      BREAKING CHANGE:
      
      - Instead of importing methods (like `bond`, `balanceTransfer`) directly from the root, the package exposes a `methods` object in the root, and this object contains all available methods organized by pallet:
      
      ```diff
      - import { bond, balanceTransfer } from '@amaurymartiny/txwrapper';
      + import { methods } from '@amaurymartiny/txwrapper';
      
      - bond(...);
      - balanceTransfer(...);
      + methods.staking.bond(...);
      + methods.balances.tranfer({dest: '...', value: }, {blockHash: '0x...'});
      + methods.balances.transferKeepAlive(...);
      ```
      
      - All the methods under `methods.*.*` take now 2 arguments: the first one is the actual args specific to the tx method, and the second one is `BaseTxInfo`, common to all transactions
      
      ```typescript
      methods.staking.nominate({target: ['F1...']}, {blockHash: '0x..', ...});
      ```
      
      - `balances::transfer` arguments has been renamed from `{to, amount}` to `{dest, value}`, to reflect the rust codebase:
      
      ```typescript
      methods.balances.transfer({dest: '5....', value: 100}, {blockHash: '0x..', ...});
      ```
      77176a3f
  23. Dec 30, 2019
    • joe petrowski's avatar
      3f7dd01e
    • joe petrowski's avatar
      feat: Add staking functions (#19) · 28dd82c2
      joe petrowski authored
      * add staking functions first commit
      
      * fix nominate test and run linter
      
      * use yarn docs
      
      * move UnsignedTransaction into ./utils to enable generic tx construction
      
      * update docs for UnsignedTransaction move
      
      * rename TxInfo and TEST_TX_INFO to specify that they are for balance transfer
      
      * move TxInfo into interfaces to reduce duplicate code
      
      * make decode somewhat generic
      
      * rename util/interfaces to util/types
      
      * add encodings to tests
      28dd82c2
  24. Dec 16, 2019
  25. Dec 11, 2019
  26. Dec 06, 2019
  27. Dec 03, 2019
  28. Dec 02, 2019
  29. Nov 29, 2019