Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@burstjs/contracts
Advanced tools
Generic HTTP client that is used as a network provider for @burst/core.
@burstjs/contracts
can be used with NodeJS or Web. Two formats are available
Install using npm:
npm install @burstjs/contracts
or using yarn:
yarn add @burstjs/contracts
// TO DO
<script>
Each package is available as bundled standalone library using IIFE.
This way burstJS can be used also within <script>
-Tags.
This might be useful for Wordpress and/or other PHP applications.
Just import the package using the HTML <script>
tag.
<script src='https://cdn.jsdelivr.net/npm/@burstjs/http/dist/burstjs.http.min.js'></script>
// TO DO
See more here:
@burstjs/contracts Online Documentation
Helper class for contracts
A contract owns additional data, which is split in 8 byte blocks. The content is encoded in hexadecimal representation and big endianness. This class facilitates access to these data
Calculates the minimum creation fee of the contract
Counts the code pages for given machine code
Generates a method call message of a contracts public method. The message can be sent using for example
[[MessageApi.sendMessage]] with messageIsText = false
or [[ContractApi.callContractMethod]]]
Extracts a variables value as hexadecimal string from a contract's machine data
This is a generic function to extract arbitrary data from a contract. It's recommended to use the [[ContractDataView]] class instead
Helper class for contracts
A contract owns additional data, which is split in 8 byte blocks. The content is encoded in hexadecimal representation and big endianness. This class facilitates access to these data
Kind: inner class of contracts
The length of a contracts variable (considering Hex notation)
Kind: instance method of ContractDataView
Returns:
Get the contract
Kind: instance method of ContractDataView
Returns:
The number of code pages
Get a variable as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get multiple data blocks as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
count | Number of blocks |
Get a variable as decimal (string)
Kind: instance method of ContractDataView
Returns:
The data as a decimal string sequence
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a variable at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a hexadecimal data block of arbitrary length at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
length | The length of the data block (must be a multiple of 2) |
Calculates the minimum creation fee of the contract
Returns:
The minimum fee
Param | Description |
---|---|
hexCode | The contracts code in hex form |
isCIP20active | If is true, the fee calculation for active CIP20 is applied (lowered fees), otherwise the legacy calculation (BRS <V2.5) is applied |
Kind: inner class of contracts
The length of a contracts variable (considering Hex notation)
Kind: instance method of ContractDataView
Returns:
Get the contract
Kind: instance method of ContractDataView
Returns:
The number of code pages
Get a variable as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get multiple data blocks as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
count | Number of blocks |
Get a variable as decimal (string)
Kind: instance method of ContractDataView
Returns:
The data as a decimal string sequence
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a variable at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a hexadecimal data block of arbitrary length at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
length | The length of the data block (must be a multiple of 2) |
Internal: Size of Code Pages in bytes
Kind: inner class of contracts
The length of a contracts variable (considering Hex notation)
Kind: instance method of ContractDataView
Returns:
Get the contract
Kind: instance method of ContractDataView
Returns:
The number of code pages
Get a variable as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get multiple data blocks as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
count | Number of blocks |
Get a variable as decimal (string)
Kind: instance method of ContractDataView
Returns:
The data as a decimal string sequence
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a variable at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a hexadecimal data block of arbitrary length at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
length | The length of the data block (must be a multiple of 2) |
Counts the code pages for given machine code
Returns:
The number of code pages for the passed code
Param | Description |
---|---|
hexCode | The contracts code in hex form |
Kind: inner class of contracts
The length of a contracts variable (considering Hex notation)
Kind: instance method of ContractDataView
Returns:
Get the contract
Kind: instance method of ContractDataView
Returns:
The number of code pages
Get a variable as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get multiple data blocks as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
count | Number of blocks |
Get a variable as decimal (string)
Kind: instance method of ContractDataView
Returns:
The data as a decimal string sequence
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a variable at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a hexadecimal data block of arbitrary length at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
length | The length of the data block (must be a multiple of 2) |
Generates a method call message of a contracts public method. The message can be sent using for example
[[MessageApi.sendMessage]] with messageIsText = false
or [[ContractApi.callContractMethod]]]
Returns:
A hex string that can be used as contracts transaction message
Param | Description |
---|---|
args | The argument object |
Kind: inner class of contracts
The length of a contracts variable (considering Hex notation)
Kind: instance method of ContractDataView
Returns:
Get the contract
Kind: instance method of ContractDataView
Returns:
The number of code pages
Get a variable as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get multiple data blocks as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
count | Number of blocks |
Get a variable as decimal (string)
Kind: instance method of ContractDataView
Returns:
The data as a decimal string sequence
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a variable at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a hexadecimal data block of arbitrary length at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
length | The length of the data block (must be a multiple of 2) |
Extracts a variables value as hexadecimal string from a contract's machine data
This is a generic function to extract arbitrary data from a contract. It's recommended to use the [[ContractDataView]] class instead
Returns:
The value as hexadecimal string (already considering endianness)
Param | Description |
---|---|
contract | The contract |
position | The variables position |
length | The length of data to be extracted |
Kind: inner class of contracts
The length of a contracts variable (considering Hex notation)
Kind: instance method of ContractDataView
Returns:
Get the contract
Kind: instance method of ContractDataView
Returns:
The number of code pages
Get a variable as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get multiple data blocks as string
Kind: instance method of ContractDataView
Returns:
The data as string (Utf-8)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
count | Number of blocks |
Get a variable as decimal (string)
Kind: instance method of ContractDataView
Returns:
The data as a decimal string sequence
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a variable at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
Get a hexadecimal data block of arbitrary length at given position/index
Kind: instance method of ContractDataView
Returns:
The data as hexadecimal string (in little endianness)
Param | Description |
---|---|
index | The index of variable (starting at 0) |
length | The length of the data block (must be a multiple of 2) |
Kind: global function
Internal:
Param |
---|
value |
FAQs
Smart Contracts package for BURST
We found that @burstjs/contracts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.