Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | 2023-11-19 | 1.8 kB | |
v2.1.0 source code.tar.gz | 2023-11-19 | 113.5 kB | |
v2.1.0 source code.zip | 2023-11-19 | 133.9 kB | |
Totals: 3 Items | 249.2 kB | 1 |
Added
api.initSocket()
now accepts an instance ofWebSocketClient
as an argument:
```js const socket = new WebSocketClient({ / ... / })
api.initSocket(socket) // instead of api.socket = socket ```
- Improved the
encodeMessage()
anddecodeMessage()
functions to accept public keys as Uint8Array or Buffer
```js import {encodeMessage, createKeypairFromPassphrase} from 'adamant-api'
const {publicKey} = createKeypairFromPassphrase('...') const message = encodeMessage(,, publicKey) // No need to convert public key to string ```
decodeMessage()
allows passing a key pair instead of a passphrase:
```js import {decodeMessage, createKeypairFromPassphrase} from 'adamant-api'
const keyPair = createKeypairFromPassphrase('...') const message = decodeMessage(,, keyPair,) // <- It won't create a key pair from passphrase again ```
- TypeScript: Export transaction handlers TypeScript utils:
SingleTransactionHandler
,AnyTransactionHandler
,TransactionHandler<T extends AnyTransaction>
Fixed
- TypeScript: Fixed typing for
AdamantApiOptions
by addingLogLevelName
as possible value forlogLevel
property.
For example, you can now use 'log'
instead of LogLevel.Log
in TypeScript:
ts
const api = new AdamantApi({ /* ... */ logLevel: 'log' })
- TypeScript: Added missing declaration modules to npm that led to the error:
Could not find a declaration file for module 'coininfo'.
/// <reference path="../../types/coininfo.d.ts" />
- TypeScript:
amount
property inChatTransactionData
(createChatTransaction()
argument) is now truly optional:
diff
- amount: number | undefined;
+ amount?: number;