Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@allianceblock/abridge-sdk
Advanced tools
Readme
Initializes the RouterSDK
constructor(signerOrProvider, optionalParams)
- signerOrProvider - JsonRpcSigner (userWallet) | JsonRpcProvider
- optionalParams:
- routerABI: RouterContractABI
- erc20ABI: ERC20Permit
- routerAddress: address
- validators: array
- threshold: number
- validatorTargetVersion: string
- blackListedTokens: array
i.e. [{chainId: 1, tokenAddress: '0x123qwe'}]
Checks if some of the optional parameters are given and sets them, if there is a missing optional parameter a default value is used
Set validatorUrl
This method receives an object and returns a random property from it
Send transaction. The nativeToken is retrieved and based on the chainId of the nativeToken, one of the following methods in the Router contract are called:
- lock
- burnAndTransfer
- burn
Please Note: The feeTokenAddress
needs to be passed if not native fee (ALBT/WALBT) is chosen.
Please Note: If we want to bridge nativeCurrency, we need to pass bridgedTokenIsNativeToken
Returns unsigned lock/burnAndTransfer/burn transaction which should be signed.
- targetChainId: string - ID of the target chain
- tokenAddress: string - Address of the deployed token
- amount: number - Amount of token to be send
- receiver - Recipient wallet address
- feeTokenAddress - Address of the fee token
- bridgedTokenIsNativeToken - Boolean (in case that we are bridging native currency)
Send transaction with Permit
enabled. The nativeToken is retrieved and based on the chainId of the nativeToken, one of the following methods in the Router contract are called:
Returns unsigned lockWithPermit/burnWithPermit transaction
Please Note: The feeTokenAddress
needs to be passed if not native fee (ALBT/WALBT) is chosen.
Please Note: If we want to bridge nativeCurrency, we need to pass bridgedTokenIsNativeToken
- targetChainId: string - ID of the target chain
- tokenAddress: string - Address of the deployed token
- amount: number - Amount of token to be send
- receiver - Recipient wallet address
- v: number
- r: any
- s: string
- deadline: number - Milliseconds
- feeTokenAddress - Address of the fee token
- bridgedTokenIsNativeToken - Boolean (in case that we are bridging native currency)
v, r, s
represent one signature with different formatting
Mints wrapped token or unlocks the native one Returns unsigned claim transaction
- transfer: info needed claim the transaction
Returns the amount of token with this tokenAddress of the user ({ balance, tokenDecimals })
- tokenAddress: string - Address of the deployed token
- userAddress: string - User wallet address
Returns the maximum approved amount of a token Returns ({ balance, tokenDecimals })
- tokenAddress: string - Address of the deployed token
- userAddress: string - User wallet address
Checks if the token has been approved Returns boolean
- tokenAddress: string - Address of the deployed token
- userAddress: string - User wallet address
- bridgedTokenIsNativeTokenOrNonDefaultFee - Boolean
- (optional) threshold: number
Approve amount
of token
Returns unsigned transaction
- tokenAddress: string - Address of the deployed token
- amount: number - Amount of token to be approved
- bridgedTokenIsNativeTokenOrNonDefaultFee - Boolean
Calls approve with ethers.constants.MaxUint256 amount Returns unsigned transaction
- tokenAddress: string - Address of the deployed token
- bridgedTokenIsNativeTokenOrNonDefaultFee - Boolean
Returns the amount of service fee in WEI
Returns the amount of external fee in WEI
Returns all the transactions for userAddress
held in the specified chain
If page
is not specified, all claims are returned.
The header returns two additional params:
x-total-count: Number of total results
x-total-pages: Number of all pages
- userAddress: string - User wallet address
- targetChainId: string - ID of the target chain
- page [optional] Get the claims per page and return the requested page
Returns the version of the current validator that is attached to.
Returns all the wrapped tokens from the specified chainId
- chainId: string - ID of the chain
Returns the claimed
status of the transfer
- transfer - single transfer object
Returns the token name by given token address
- tokenAddress: string - Address of the deployed token
Returns the token symbol by given token address
- tokenAddress: string - Address of the deployed token
Returns the token decimals by given token address
- tokenAddress: string - Address of the deployed token
Returns the token name, symbol and decimals by given token address
- tokenAddress: string - Address of the deployed token
Returns the fee amount for the chosen token
- tokenAddress: string - Address of the token
Returns the address, name, symbol and decimals of the wrapped token
- nativeTokenAddress: string - Address of the deployed native token
- nativeChainId: string - ID of the source chain
Returns the native token
- wrappedTokenAddress: string - Address of the deployed wrapped token
Returns the address, name, symbol and decimals of the ALBT token used for token FEE into the different networks
Formats the given signatures and returns the fixed ones
- signatures: signature[] - Signatures list of the validators
FAQs
NPM package for the AB Bridge SDK
The npm package @allianceblock/abridge-sdk receives a total of 1 weekly downloads. As such, @allianceblock/abridge-sdk popularity was classified as not popular.
We found that @allianceblock/abridge-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.