Skip to content

Releases: dev-protocol/dev-kit-js

Agent APIs

02 Feb 04:11
Compare
Choose a tag to compare

The new API: Agent APIs

Dev Kit used to provide only low-level APIs, so you needed to understand the differences in interfaces between networks.

With Agent APIs, there is only one API to know for one use case with Agent APIs. Agent APIs create and cache the appropriate contract instances from the given provider. positionsCreate API to start staking is the first one.

The following code is an example of staking 100 DEV on a Property Tokens:

import { positionsCreate } from '@devprotocol/dev-kit/agent'

positionsCreate({
    provider: ethersProvider,
    destination: '0x.....',
    amount: '100000000000000000000'
})

Destructive change in return values

APIs that mutate the state of contracts have traditionally used Promise<boolean> as the return value. Since version 6.x, their return value has changed to Promise<TransactionResponse>.

The APIs where affected are as follows:

  • Dev.transfer
  • Dev.approve
  • Dev.transferFrom
  • Dev.deposit
  • Lockup.withdrawByPosition
  • Lockup.withdraw
  • Lockup.depositToPosition
  • Lockup.migrateToSTokens
  • MarketFactory.create
  • Property.transfer
  • Property.approve
  • Property.transferFrom
  • Property.changeName
  • Property.changeSymbol
  • PolicyFactory.create
  • STokens.freezeTokenURI
  • STokens.setTokenURIImage
  • Withdraw.withdraw

version 5.8.1

30 Nov 13:42
Compare
Choose a tag to compare

What's Changed

Full Changelog: v5.8.0...v5.8.1

v4.4.4

15 Jun 01:09
Compare
Choose a tag to compare