
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@rsksmart/bridges-core-sdk
Advanced tools
Core module of all the RSK bridges SDKs that contains common functionality
This is the core module shared by all the bridges in the monorepo. This has common functionality such as logic to call the blockchain, HTTP client configuration, common valitadions and the configuration objects to initialize each bridges product.
This repo also contains a submodule which can be imported with the path @rsksmart/bridges-core-sdk/initialization
. That helps the user to initialize multiple bridges at once (have in count that every bridge package still provides its own contructor and ways to initialize it specificly).
To use core initialization you need to use the init()
function, provide the common configuration fields, and in the bridges
field add all the keys for the bridges you want to initialize, for each key the value that you'll provide is the specific configuration for that bridge or {}
if you want to initialize that bridge with its default configuration
// this would initialize flyover with custom config and tokenbridge with default config
const { flyover, tokenbridge } = await init({
network: 'Regtest',
allowInsecureConnections: true,
bridges: {
flyover: {
captchaTokenResolver: async () => Promise.resolve('')
},
tokenbridge: {}
}
})
One advantage of using initialization module is that you can lazy load the bridges. If you provide an unexisting bridge name the funciton will return and error. Also if you provide an existing bridge name but you don't have that package installed on your project the function will return and error.
This comes with one drawback, even when the SDK ensures that any lazy loaded bridge error is catched, you can find problems with some code bundlers that don't support external dependencies dynamic importing. If your bundler doesn't support that and you can't fix it via bundler configuration the only solution that you have is to install all the bridges packages even if you're not using them all. If your bundler does suport external dependency dynamic importing then you shouldn't have any problem.
If you need to connect to RSK to execute some operation then you need to create an RSKConnection and provide it to your bridge object
const rsk = await RskConnection.createUsingStandard(window.ethereum)
const flyover = new Flyover({ rskConnection: rsk, network: 'Regtest' })
or you can set it after creation
const rsk = await RskConnection.createUsingStandard(window.ethereum)
await flyover.connectToRsk(rsk)
There are multiple ways to create the connection, all of them are specified in the RskConnection
class JSDocs
FAQs
Core module of all the RSK bridges SDKs that contains common functionality
The npm package @rsksmart/bridges-core-sdk receives a total of 44 weekly downloads. As such, @rsksmart/bridges-core-sdk popularity was classified as not popular.
We found that @rsksmart/bridges-core-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.