Commit Graph
86 Commits
Author SHA1 Message Date
peetzweg/ ca4802326c feat: ink! v5 (#5791)
* adds definitions and types according to ink v5 changes

* adds toV5 boilerplate code draft

* adds v5 flipper test contract code

* fix license dates

* adds test v5 toLatest test

* implements new scheme to determine event

* apply linter changes

* adds test result outputs

* change `EventRecord['topics'][0]` type to plain `Hash`

* adds testcases for decoding payload data of a ink!v4 and ink!v5 event

* changes `Abi.decodeEvent(data:Bytes)` method interface to `Abi.decodeEvent(record:EventRecord)` which includes the event and the topic for decoding.

* draft implementation with version metadata

* cleaner implementation of versioned Metadata by actually leveraging the `version` field included since v2 contract metadata

* trying to make linter happy

* makes `ContractMetadataSupported` in internal to `Abi` type and not exposing it externally.

* properly types unused parameter for tsc 🤷

* adds `@polkadot/types-support` dev dependency

* Update yarn.lock

* references `types-support` in `api-contract

* resolving change requests

* resolves linter warnings

* changes ContractMetadataV5 field to `u64` from `Text`

* adds contracts and contract metadata compiled with the most recent ink version

* implements decoding of anonymous events if possible

* removes done todo comments
2024-03-02 09:18:14 -05:00
Jaco 3bdf49b042 2024 (#5777) 2024-01-08 15:07:13 +02:00
Jaco d8136a8e61 Bump dev (w/ ts-eslint updates) (#5691) 2023-08-16 11:00:52 +03:00
Jaco c277b3d865 Adjust object index typings (#5671)
* Adjust object index typings

* CHANGELOG

* Remove dot-notation overrides

* Align overrides

* Ordering

* Revert lint formatting changes

* Bump common
2023-06-11 09:58:20 +03:00
Jaco 9c758cce95 Bump dev (w/ Node 16+ only) (#5603) 2023-04-21 13:47:31 +03:00
Jaco a7526ba5f3 Bump dev (#5591)
* Bump dev

* Adjust

* Adjust
2023-04-13 13:10:36 +03:00
Jaco 9fe2798b70 Use .js imports in src (#5526)
* Use .js imports in src

* Adjust

* Fix imports

* Bump dev

* Adjust with .js imports for typegen

* Adjust

* Adjust

* Remove target override
2023-03-09 12:19:12 +02:00
Jaco 6f19084a4d Move .isEmpty to $isEmpty (#5424)
* Move .isEmpty to $isEmpty

* Adjust usages
2023-01-19 11:07:29 +02:00
Jaco 2eb453c4ce Cleanup class variable linebreaks (#5422) 2023-01-19 08:52:14 +02:00
Jaco 2c949e0fc5 Update headers for 2023 (#5392) 2023-01-01 10:25:51 +02:00
Jaco b21cc0ae06 Pass through WeightV2 as-is (contracts) (#5336)
* Pass through WeightV2 as-is (contracts)

* Adjust convertWeight

* Adjust
2022-11-13 08:44:31 +02:00
Jun Jiang cad2b0fefe Update contract' gas to Weight type (#5324)
* Update contract' gas to Weight type

* Make Contracts Runtime Calls support WeightV2

* fix gasConsumed & gasConsumed type

* Regenerate contracts types

* Correct ContractCallOutcome

* `gasLimit` are optional

* Apply suggestion

* Add ContractCallRequestV1 and specify old rpc use that

* Add back getGas

* Port jg-ContractsApi-v2 (#5330)

* Run yarn build:metadata

* There is no 'ContractCallRequestV1', only 'ContractCallRequest'

* api.tx.contracts.call.meta no version field, _isOldWeight still work?
2022-11-13 08:30:33 +02:00
Jaco e0e86b1383 Small cleanups to contracts Weight detection (#5335) 2022-11-12 16:01:41 +02:00
Jaco 26d1d0d695 Add Weight{V1, V2} aliases (#5257) 2022-10-04 08:51:38 +03:00
Jaco 6983f8c883 Adjust contracts to pass either V1 or V2 weights (#5254)
* Adjust contracts to pass either V1 or V2 weights

* Adjust

* Formatting

* Adjust

* Fix build
2022-10-03 12:31:00 +03:00
Jaco e3ba160935 Bump metadata (#5251)
* Bump metadata

* Weight V2 as structure

* checkTypes

* Partial alias override

* Remove unused type import

* Use old weight calls on contracts (as available)

* Adjust

* merge master

* Adjust

* CHANGELOG

* CHANGELOG

* formatting

* Casting

* Adjust expectations
2022-10-03 08:41:43 +03:00
Jaco 62bfcf84dd Ensure call is exposed on rx (#5116)
* Ensure call is exposed on rx

* Adjust to only top-level detection

* .123npm

* Adjust check for contractsApi
2022-07-29 11:10:05 +03:00
Jaco d26f289199 Remove deprecated api-contract methods (#5110)
* Remove deprecated api-contract methods

* Remove checkTypes deprecated
2022-07-26 08:53:05 +03:00
Jaco 0c79e13aba Convert api-contract usage of api.rpc.* to api.call.* (#5107)
* Convert api-contract usage of api.rpc.* to api.call.*

* Cast call (augmentation not available in build)

* Revert tx check assert

* Call mock
2022-07-25 16:22:26 +03:00
Jaco fa5ec1b4a8 Adjust assert usage in api-contract (#5057) 2022-07-11 15:43:03 +03:00
Jaco 39ff956076 Expose constructoir meta on Blueprint/Code (#4486) 2022-01-21 15:56:27 +02:00
Jaco f5ce395371 Expose contract.{query, tx}.method.meta (#4485) 2022-01-21 13:40:21 +02:00
Jaco 8ba4ed5377 2022 (#4404) 2022-01-01 09:28:18 +02:00
Jaco 5d6c2dd9f2 DRY cleanups for contracts (#4395) 2021-12-26 10:03:28 +02:00
Keith Ingram a868233c2f Storage deposit limit changes (#4370) 2021-12-21 13:09:37 +02:00
Jaco 67ee8b08d9 Ensure *.d.ts files are generated in outputs (#4362)
* Ensure *.d.ts files are generated in outputs

* Adjust

* Additional dep

* Update

* Update refs
2021-12-20 10:00:10 +02:00
Andreea Eftene cffab6900d Add storage deposit support (#4304)
* add storage deposit support

* Revert "add storage deposit support"

This reverts commit 10eea6332b2756b23766df316a90ba4f244cb424.

* generate new metadata

* make it build

* add storage deposit in RPCs

* rename endowment to value

* support older nodes

* check the right things

* hide storage_deposit until better supported

* add the right defaults

* hardcode storageDepositLimit to null
2021-12-14 14:20:04 +02:00
Jaco a30329b47d Support for contracts metadata V2 (#4289)
* Support for contracts metadata V2

* Add & use latest

* Build interfaces

* conversion of V1 -> Latest

* spreads

* Use V2 in creation, aka s/name/label/

* Extract -> latest conversion

* Flatten

* Add V2 test contracts (tests are failing)

* V2, V1 & V1 catered for in Abi.spec.ts

* Explicit v0/v1 -> Latest conversions

* Adjust V2/V1/V0 check order

* Cleanup type assertions

* Save

* Remove eslint unsafe

* Flatten test exports

* Entries... last non-critical, OCD-driven change...

* tsc check fixes

* Conversion tests

* v1ToLatest renames

* Text[]

* Split conversion (ease of future change)

* V2 in V2 conversion

* Dedupe?

* Additional cleanups

* Adjust

* Flatten types

* Adjust

* filter versions adjustments

* additional, get it done.
2021-12-08 19:14:51 +02:00
Jaco 5eb3534d8e Bump dev (w/ eslint 8) (#4070)
* Bump dev (w/ eslint 8)

* Additional linting

* Additional

* More lint fixes

* Last batch

* Additional

* Cleanups
2021-10-17 14:49:26 +03:00
Jaco d053b86e23 Use Si V1 in contracts (w/ PortableRegistry usage) (#3988)
* Use Si V1 in contracts (w/ PortableRegistry usage)

* Type id lookups

* Fix build & linting

* Remove extra .toNumber() (VSCode has gone crazy)

* v1 tests

* Cleanup parsing

* Explicit type cast for v1 types

* Unneeded toNumber

* Align events exposure with messages/constructors

* dedupe

* Re-add typedef extraction tests

* with typedefs

* Override for always primitives

* displayName improvements

* Versioned project

* New structure

* Fixes

* Cleanups

* Ensure API registry is the default used

* Adjust arg & return encoding/decoding

* Recursive contract

* DoNotConstruct to Si type
2021-10-11 12:50:09 +03:00
Nantian db6c44615f fix bigint type (#3869) 2021-08-12 10:02:15 +02:00
Jaco a80df7d846 Swap CodecArg usage to unknown (#3845)
* Swap CodecArg usage to unknown

* Adjust Constructor defintion
2021-08-05 12:27:51 +02:00
Jaco ff3882f5f7 Bump common (w/ rxjs 7) (#3736)
* Bump common (w/ rxjs 7)

* Adjust

* pre bump

* Cleanup imports

* Add missing switchMap

* CHANGELOG

* Remove duplicate imports

* Bump common

* Direct rxjs import
2021-07-07 09:26:30 +02:00
Jaco 89c7d73951 Expose gasRequired (as available) (#3732) 2021-07-06 08:53:23 +02:00
Jaco bdaacfdd56 BN import from util (#3637)
* BN import from util

* Update packages/api-derive/src/staking/stakerRewards.ts
2021-06-11 12:52:21 +02:00
Jaco 165405bdc3 Contracts read for variable-length bytes (#3526) 2021-05-13 21:19:11 +02:00
Jaco 92bde9de6f Adjust ABI registry (#3516)
* Adjust ABI registry

* Remove V2 support

* instantiateWithCode mock
2021-05-11 10:58:20 +02:00
Jaco 80ab628643 Adjust contract call result decoding (#3510)
* Adjust types for node/node-template

* Adjust contract call result

* Adjust

* Raw directly

* CHANGELOG
2021-05-09 09:46:21 +02:00
Jaco 1113a3d2f8 Use BN_* constants in contract default params (#3507) 2021-05-07 14:41:08 +02:00
Jaco 4ba372d29b Remove deprecated api-contract methods (#3486)
* Remove deprectaed api-contract methods

* Remove deprecated read/exec from checkTypes
2021-05-05 11:54:25 +02:00
Jaco b1353edc84 Expose additional camelCase method on AbiMessage (maps to decorated name) (#3466) 2021-05-01 08:31:16 +02:00
Jaco Greeff 712d0425d0 Update ParaInfo types (#3348) 2021-03-23 10:38:28 +01:00
Jaco Greeff 88c3850d1b Warn on deprecated contracts interfaces (#3346) 2021-03-22 17:03:49 +01:00
VelikoandJaco Greeff 70fc95ef27 Fix contractEvents in ContractSubmittableResult (#3324)
* fix the autoaggregation of contract events 

apparently, the system event for contract emitted events has had its name changed

* fix the autoaggregation of contract events

apparently, the system event for contract emitted events has had its name changed

* Update packages/api-contract/src/base/Contract.ts

* Apply suggestions from code review

Co-authored-by: Jaco Greeff <jacogr@gmail.com>
2021-03-15 22:16:35 +01:00
Jaco Greeff 82787c96c6 Single put_code/deploy (new & backwards compat.) (#3143)
* Single put_code/deploy (new & backwards compat.)

* new-style

* old-style deploy?

* notice

* Cleanups

* linting

* grrr... Mac case-sensistivity

* Add createContract on BluePrint

* Adjust contracts check

* Adjust

* Adjust tests
2021-02-06 14:36:42 +01:00
Jaco Greeff a9c9fb5769 2021 (#3015) 2021-01-03 11:26:46 +01:00
Jaco Greeff 9e13b6f54e blockWeights.maxBlock for estimation (#3004) 2020-12-29 22:29:13 +01:00
Jaco Greeff 208fbb24d5 Build esm (& add x-rxjs package) (#2942) 2020-12-11 18:44:23 +01:00
Jaco Greeff 0cb7b34ff0 Update with new consumed Weight structures (#2928)
* Update with new consumed Weight structures

* dispatch(Info, Error} optional in result

* Update for maximumBlockWeight
2020-12-08 17:26:13 +01:00
Jaco Greeff 8e6a1c8fb1 Bump dev (sort imports) (#2923)
* Bump dev (sort imports)

* Resort

* Adjust ApiInterfaceRx
2020-12-07 16:26:19 +01:00