API

Charged

Parameters

  • params ChargedConstructor Charged parameter object.

Examples

const charged = new Charged({providers: window.ethereum});
const allStateAddresses = await charged.utils.getStateAddress();

const polygonProvider = [
 { 
   network: 137, 
   service: {alchemy: process.env.ALCHEMY_POLYGON_KEY}
 }
];
const charged = new Charged({providers: polygonProvider})

ChargedConstructor

Charged class constructor object parameter.

Type: Objectarrow-up-right

Properties

  • providers (Arrayarrow-up-right<NetworkProvider> | providers.Provider | providers.ExternalProvider)? Provider for connection to the Ethereum network.

  • signer Signer? Needed to send signed transactions to the Ethereum Network to execute state changing operations.

  • config ConfigurationParameters

Utilities

Examples

Returns UtilsService

getStateAddress

Get the address of the chargedState contract.

Returns stringarrow-up-right state contract address

getSettingsAddress

Get the address of the chargedSettings contract.

Returns stringarrow-up-right settings contract address

getManagersAddress

Get the address of the chargedManagers contract.

Returns stringarrow-up-right manager contract address

getFeesForDeposit

Get the deposit fee of the protocol.

Returns stringarrow-up-right protocol fee amount.

NFT

Parameters

Examples

Returns NftService Instance of the NFT connected to the charged particle protocol

getMass

Gets the amount of asset tokens that have been deposited into the Particle.

Parameters

  • walletManagerId WalletManagerId The ID of the wallet manager to check.

  • assetToken stringarrow-up-right The address of the asset token to check.

Returns BigNumber The Amount of underlying assets held within the token.

getCharge

Gets the amount of interest that the particle has generated.

Parameters

  • walletManagerId WalletManagerId The ID of the Wallet Manager.

  • assetToken stringarrow-up-right The address of the asset Token to check.

Returns BigNumber The amount of interest generated.

getKinectics

Gets the amount of LP Tokens that the Particle has generated.

Parameters

  • walletManagerId WalletManagerId The ID of the Wallet Manager.

  • assetToken stringarrow-up-right The Address of the Asset Token to check.

Returns BigNumber The amount of LP tokens that have been generated.

getBonds

Gets the total amount of ERC721 tokens that the Particle holds.

Parameters

Returns BigNumber The total amount of ERC721 tokens that are held within the Particle.

getCreatorAnnuities

Gets the amount of creator annuities reserved for the creator for the specified NFT.

Returns address The address of the creator.

Returns numberarrow-up-right The percentage amount of annuities reserved for the creator.

getCreatorAnnuitiesRedirect

Get the address that receives creator annuities for a given Particle/ Defaults to creator address if it has not been redirected.

Returns address The address of the creator.

Returns numberarrow-up-right The percentage amount of annuities reserved for the creator.

tokenURI

Gets the tokenUri using the tokenId and contractAddress of the Particle.

Returns stringarrow-up-right Token metadata URI.

getDischargeState

Gets the Discharge timelock state of the Particle.

Parameters

Returns [booleanarrow-up-right, booleanarrow-up-right, BigNumber, BigNumber] [allowFromAll, isApproved, timelock, empLockExpiry]

getReleaseState

Gets the Discharge timelock state of the Particle.

Parameters

Returns [booleanarrow-up-right, booleanarrow-up-right, BigNumber, BigNumber] [allowFromAll, isApproved, timelock, empLockExpiry]

getBondsState

Gets the Bonds Timelock state of the Particle.

Parameters

Returns booleanarrow-up-right allowFromAll

Returns booleanarrow-up-right isApproved

Returns BigNumber timelock

Returns BigNumber tempLockExpiry

energize

Fund particle with asset token Must be called by the account providing the asset. Account must also approve THIS contract as operator as asset.

If you are getting gas limit errors this may be because you forgot to approve the contract as operator of asset

Parameters

  • walletManagerId WalletManagerId The Asset-Pair to Energize the Token with

  • assetToken stringarrow-up-right The Address of the Asset Token being used

  • assetAmount BigNumberish The Amount of Asset Token to Energize the Token with

  • chainId numberarrow-up-right? Optional parameter that allows for the user to specify which network to write to

Examples

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

discharge

Allows the owner or operator of the token to collect or transfer the interest generated from the token without removing the underlying asset that is held within the token.

Parameters

  • receiver stringarrow-up-right The address to receive the discharged asset tokens.

  • walletManagerId WalletManagerId The wallet manager of that assets to discharge from the token.

  • assetToken stringarrow-up-right The address of the asset token being discharged.

  • chainId numberarrow-up-right? Optional parameter that allows for the user to specify which network to write to.j

Examples

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

dischargeAmount

Allows the owner or operator of the Token to collect or transfer a specific amount of the interest generated from the token without removing the underlying Asset that is held within the token.

Parameters

  • receiver stringarrow-up-right The address to receive the discharged asset tokens.

  • walletManagerId WalletManagerId The wallet manager of the assets to discharge from the token.

  • assetToken stringarrow-up-right The address of the asset token being discharged.

  • assetAmount BigNumberish The specific amount of asset token to discharge from the particle.

  • chainId numberarrow-up-right? Optional parameter that allows for the user to specify which network to write to.

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

dischargeForCreator

Allows the Creator of the Token to collect or transfer a their portion of the interest (if any) generated from the token without removing the underlying Asset that is held within the token.

Parameters

  • receiver stringarrow-up-right The address to receive the discharged asset tokens

  • walletManagerId WalletManagerId The wallet manager of the assets to discharge from the token

  • assetToken stringarrow-up-right The address of the asset token being discharged

  • assetAmount BigNumberish The specific amount of asset token to discharge from the particle

  • chainId numberarrow-up-right? Optional parameter that allows for the user to specify which network to write to

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

release

Releases the full amount of asset + interest held within the particle by LP of the assets. To release NFT assets from your particle, see break bond.

Parameters

  • receiver stringarrow-up-right The address to receive the released asset tokens.

  • walletManagerId WalletManagerId The wallet manager of the assets to release from the token.

  • assetToken stringarrow-up-right The address of the asset token being released.

  • chainId numberarrow-up-right? Optional parameter that allows for the user to specify which network to write to.

Examples

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

releaseAmount

Releases a partial amount of asset + interest held within the particle by LP of the assets.

Parameters

  • receiver stringarrow-up-right The address to receive the released asset tokens

  • walletManagerId WalletManagerId The wallet manager of the assets to release from the token

  • assetToken stringarrow-up-right The address of the asset token being released

  • assetAmount BigNumberish The specific amount of asset token to release from the particle

  • chainId numberarrow-up-right? Optional parameter that allows for the user to specify which network to write to

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

bond

Deposit other NFT assets into the particle. Must be called by the account providing the asset. Account must approve THIS contract as operator of asset.

Parameters

Examples

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

breakBond

Release NFT assets from the particle.

Parameters

Examples

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction

Solidity Contract Methodarrow-up-right

releaseTimelock

Sets a timelock on the ability to release the assets of a particle.

Parameters

  • unlockBlock numberarrow-up-right The Ethereum block number to timelock until (~15 seconds per block).

  • chainId numberarrow-up-right? Optional parameter that allows for the user to specify which network to write to.

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

dischargeTimelock

Sets a timelock on the ability to discharge the assets of a particle

Parameters

  • unlockBlock numberarrow-up-right The Ethereum block number to timelock until (~15 seconds per block).

  • chainId numberarrow-up-right? Optional parameter that allows for the user to specify which network to write to.

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

bondsTimelock

Sets a timelock on the ability to break the covalent bond of a particle

Parameters

  • unlockBlock numberarrow-up-right The Ethereum block number to timelock until (~15 seconds per block).

  • chainId numberarrow-up-right? Optional parameter that allows for the user to specify which network to write to.

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

setCreatorAnnuities

Sets the custom configuration for creators of proton-based NFTs Must be called by account that created and owns the particle

Parameters

  • creator stringarrow-up-right The creator's address of the proton-based NFT.

  • annuityPercent BigNumberish The percentage of interest-annuities to reserve for the creator. In decimal this can range from 0 - 10000. 5712 would be 57.12%..

  • chainId numberarrow-up-right? Optional parameter that allows for the user to specify which network to write to.

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

setCreatorAnnuitiesRedirect

Sets a custom receiver address for the creator annuities Must be called by account that created and owns the particle

Parameters

Returns Promisearrow-up-right<ContractTransaction> - Details from the transaction.

Solidity Contract Methodarrow-up-right

Last updated

Was this helpful?