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

@agoric/captp

Package Overview
Dependencies
Maintainers
4
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agoric/captp - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

6

lib/captp.js

@@ -232,2 +232,6 @@ // This logic was mostly lifted from @agoric/swingset-vat liveSlots.js

// Abort a connection.
const abort = exception =>
dispatch({ type: 'CTP_ABORT', exception });
// Return a dispatch function.

@@ -246,3 +250,3 @@ const dispatch = obj => {

return harden({ dispatch, getBootstrap });
return harden({ abort, dispatch, getBootstrap });
}

2

package.json
{
"name": "@agoric/captp",
"version": "1.0.2",
"version": "1.1.0",
"description": "Capability Transfer Protocol for distributed objects",

@@ -5,0 +5,0 @@ "keywords": [

@@ -7,13 +7,20 @@ # `@agoric/captp`

```
import makeCapTP from '@agoric/captp';
import { E } from '@agoric/eventual-send';
NOTE: `myconn` below is not part of the CapTP library, it represents a connection
object that you have created where `makeCapTP` is called on both sides of the
connection, passing in the function to send a JSON-able object on the connection, and returning
a `dispatch` function to receive a decoded JSON object from the connection.
// Create a message handler and bootstrap.
```js
import { E, makeCapTP } from '@agoric/captp';
// Create a message dispatcher and bootstrap.
// Messages on myconn are exchanged with JSON-able objects.
const [handler, getBootstrap] = makeCapTP('myid', myconn.send, myBootstrap);
myconn.onReceive = obj => handler[obj.type](obj);
const { dispatch, getBootstrap, abort } = makeCapTP('myid', myconn.send, myBootstrap);
myconn.onReceive = obj => dispatch(obj);
// Get the remote's bootstrap object and call a remote method.
E(getBootstrap()).method(args).then(res => console.log('got res', res));
// Tear down the CapTP connection if it fails (e.g. connection is closed).
abort(Error('Connection aborted by user.'));
```

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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