Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chromia/ft4

Package Overview
Dependencies
Maintainers
5
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chromia/ft4 - npm Package Versions

23

1.0.1

Diff

joso-cw
published 1.0.0 •

Changelog

Source

[1.0.0] - 2024-07-04

Changed 🪙

  • Amount's times and dividedBy functions now accept Amount as argument as well.

Added ✅

  • Added hasCrosschainTransferExpired to check if a specific pending cross-chain transfer has expired.
  • Add getEnabledRegistrationStrategies to Connection interface
  • Added filter for pendingTransferStrategies to check expired or valid transfers only.
  • Added Filter type as a generic type to filter in queries.
joso-cw
published 0.8.0 •

Changelog

Source

[0.8.0] - 2024-05-29

Breaking 💔

  • Removed getAssetBySymbol (replaced with getAssetsBySymbol).
  • Updated registerCrosschainAsset to accept asset id instead of asset object.

Changed 🪙

  • Upgrade postchain client to 1.16.1

Added ✅

  • Added getAssetsBySymbol to query list of all assets with the same symbol.
  • Added getAssetDetailsForCrosschainRegistration, used to fetch asset details when registering a crosschain asset.
  • Added getTransferStrategyRules, used to fetch transfer strategy rules configuration.
  • Added getTransferStrategyRulesGroupedByStrategy, used to fetch transfer strategy rules configuration grouped by strategies and assets.
  • Add getEnabledRegistrationStrategies to Connection interface
  • Exported evmSignatures, registerAccountMessage, fetchLoginDetails.
joso-cw
published 0.7.0 •

Changelog

Source

[0.7.0] - 2024-04-23

Breaking 💔

  • registration.registerAccount now accepts an IClient instead of a Connection.
  • Removed the buildUnsigned method from TransactionBuilder.
  • All registration strategies can now be found inside the registrationStrategy-object. E.g., registrationStrategy.fee(...)
  • registerAccount has been renamed to registerAccountAdmin
  • Rename "signed" event to "built" in crosschainTransfer method
  • Remove function registerAccountEvmSignatures
  • Rename nonce query function to authDescriptorCounter and rename all the functions that call the query from getNonce to getAuthDescriptorCounter.

Changed 🪙

  • crosschainTransfer function returns a TransferRef, which can be used when resuming, reverting and recalling the transfer.
  • Changed return type of methods call and callWithoutNop in Session to Web3PromiEvent
  • Changed return type of methods in AuthenticatedAccount to Web3PromiEvent
  • Changed return type of registerAccount to Web3PromiEvent

Added ✅

  • Added ttl to crosschainTransfer, which specifies after how much time the transaction should become invalid and must be reverted back to the starting chain.

  • Possibility to revert uncompleted crosschain transfers after deadline has passed.

  • Possibility to recall unclaimed register account transfers after timeout has passed.

  • addWithAnchoring method in TransactionBuilder to get callback when transaction is anchored in a specific target chain.

  • sign and signAndSend methods in Session to add your signature to an existing transaction.

  • gtv object that contains functions for converting objects to/from gtv, e.g., gtv.authDescriptorFromGtv(...)

  • equals and compare methods to Amount.

  • Added deleteAllAuthDescriptorsExceptMain to AuthenticatedAccount interface.

  • Added updateMainAuthDescriptor function to AuthenticateAccount interface.

  • Added getMainAuthDescriptor to Account interface.

  • Added getAuthDescriptorById to Account interface.

  • Added enabledRegistrationStrategies query.

  • Added signTransactionWithKeyStores function.

  • Added functions to query "lock" accounts and asset balances locked in those accounts

    • getLockAccounts
    • getLockAccountsWithNonZeroBalances
    • getLockedAssetBalance
    • getLockedAssetAggregatedBalance
    • getLockedAssetBalances
    • getLockedAssetAggregatedBalances

Fixed 🔧

  • Fix TS client build.
  • Fix use of ethers library.
joso-cw
published 0.6.2 •

Changelog

Source

[0.6.2] - 2024-03-25

Fixed 🔧

  • Fix use of ethers library.
joso-cw
published 0.6.1 •

Changelog

Source

[0.6.1] - 2024-03-25

Fixed 🔧

  • Fix TS client build.
joso-cw
published 0.6.0 •

Changelog

Source

[0.6.0] - 2024-03-22

Breaking 💔

  • Rename FlagsType to AuthFlag, and changed it from an enum to an object to allow adding custom flags.

  • Method buildAndSend in TransactionBuilder no longer supports OnAnchoredHandler:s, use new method buildAndSendWithAnchoring instead.

  • Removed LoginManager type and the getLoginManager method in KeyStoreInteractor, added login method to KeyStoreInteractor instead.

  • Removed the Orchestrator from the public API, use new crosschainTransfer and resumeCrosschainTransfer methods in AuthenticatedAccount instead.

Migration

Instead of making cross-chain transfer with Orchestrator:

val orchestrator = await createOrchestrator(targetBlockchainRid, recipientId, assetId, amount, senderSession);

orchestrator.onTransferInit(() => { ... });
orchestrator.onTransferHop((brid) => { ... });
orchestrator.onTransferComplete(() => { ... });
orchestrator.onTransferError((error) => { ... });

await orchestrator.transfer();

now it has to be done like this:

await senderSession.account.crosschainTransfer(targetBlockchainRid, recipientId, assetId, amount)
  .on("signed", () => { ... })
  .on("init", (receipt: TransactionReceipt) => { ... })
  .on("hop", (blockchainRid: Buffer) => { ... });

Interrupted cross-chain transfers can be resumed like this:

await senderSession.account.resumeCrosschainTransfer(pendingTransfer)
  .on("hop", (blockchainRid: Buffer) => { ... })

Since logout method was removed from LoginManager in previous release, there is no longer need for LoginManager type. Login (adding disposable auth descriptors) can be performed by calling login on KeyStoreInteractor. So instead of

const { session } = await keyStoreInteractor.getLoginManager().login({ accountId });

now we login like this:

const { session } = await keyStoreInteractor.login({ accountId });

Changed 🪙

  • TransactionBuilder will wait for transactions to be anchored in system anchoring chain before invoking OnAnchoredHandler:s.
  • Methods buildAndSend and buildAndSendWithAnchoring in TransactionBuilder return Web3PromiEvent and emits events when transaction is built, sent and confirmed (only buildAndSendWithAnchoring).
  • logout function returned from KeyStoreInteractor.login() and registerAccount() will delete auth descriptors for disposable key.
  • TransactionBuilder will throw SigningError if signing fails for some reason (e.g. is rejected by user).
  • crosschainTransfer method will throw SigningError if signing fails for some reason (e.g. is rejected by user).

Added ✅

  • New method buildAndSendWithAnchoring in TransactionBuilder which will wait for anchoring in cluster and system anchoring chains before resolving promise.

  • New event signed in crosschainTransfer method which is emitted when the initTransfer transaction is signed.

  • getAssetsByType query function

  • Include isCrosschain flag in response from queries getTransferHistory, getTransferHistoryFromHeight and getTransferHistoryEntry.

  • Include blockchainRid in response from queries getTransferDetails and getTransferDetailsByAsset.

  • Include auth descriptor config (maxRules and maxNumberPerAccount) in Config.

  • Added loadOperationFromTransaction that receives RawGtx or SignedTransaction (encoded tx) and returns Operation at provided index

  • Added getLastPendingCrosschainTransaction to Account interface

joso-cw
published 0.5.0 •

Changelog

Source

[0.5.0] - 2024-02-29

Breaking 💔

  • updated postchain-client version to 1.15.0
  • Moved logout function from LoginManager to object returned from LoginManager.login() and registerAccount().
  • Moved loginKeyStore parameter from KeyStoreInteractor.getLoginManager() to LoginManager.login(LoginOptions).

Added ✅

  • account registration strategies

    • create on transfer
      • subscription
  • functions to directly create account with fee and subscription strategies

Fixed 🔧

  • uncaught exception triggered after creating evm keystore and when all accounts disconnected from wallet GUI
joso-cw
published 0.4.0 •

Changelog

Source

[0.4.0] - 2024-02-15

Changed 🪙

  • authenticator.getKeyHandlerForOperation will not return auth descriptors whose rules don't allow them to be used.
  • AuthDataService.getAllowedAuthDescriptors now accepts Buffer | string instead of Buffer only
  • Auth descriptor queries updated to include account_id in response.
  • Limit how many auth descriptors can be added to an account. Default value is 10 and maximum is 200.

Added ✅

  • AuthDescriptorValidator with hasExpired and isActive methods to check whether the auth descriptor is expired or active. An inactive auth descriptor is one that will be valid in the future, an expired one was valid in the past.

  • createAuthDescriptorValidator(authDataService, useCache) to use the above mentioned validator. If it uses cache, it will cache op_count of each auth descriptor and block_height as soon as it needs to query them.

  • Do not allow TransactionBuilder.build() or TransactionBuilder.buildUnsigned() if there are OnAnchoredHandlers

  • Default value for paginated queries has been changed from the previous 100, to instead use the value configured as default in the dApp on rell side

  • Upgrade postchain-client to 1.9.0

  • Added support for rules or TTL in login manager.

  • account registration with following strategies

    • open
    • create on transfer
      • open
      • fee

Bugfixes 🐛

  • Orchestrator and transaction builder waits until transaction is anchored in SAC before moving to next step

Breaking 💔

  • Removed pagination from auth descriptor queries

  • Change assetData to asset in TransferHistoryEntry.

  • Update addAuthDescriptor signature
    Old:

addAuthDescriptor(authDescriptor: AnyAuthDescriptorRegistration, newSigner: SignatureProvider | KeyPair)

New:

addAuthDescriptor(authDescriptor: AnyAuthDescriptorRegistration, keyStore: FtKeyStore)
  • Update LoginKeyStore interface Old:
interface LoginKeyStore {
  clear(accountId: Buffer);
  getKeyPair(accountId: Buffer): Promise<KeyPair | null>;
  createKeyPair(accountId: Buffer): Promise<KeyPair>;
}

New:

interface LoginKeyStore {
  clear(accountId: Buffer): Promise<void>;
  getKeyStore(accountId: Buffer): Promise<FtKeyStore | null>;
  generateKey(accountId: Buffer): Promise<FtKeyStore>;
}
joso-cw
published 0.3.2 •

Changelog

Source

[0.3.2] - 2024-02-06

Fixed

  • Fixes invalid parameter name for ft4.get_auth_handler_for_operation query
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc