@olane/o-client-limited 0.7.54 → 0.7.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { oLimitedConnection } from './o-limited-connection.js';
|
|
1
|
+
import { oNodeConnectionManager } from '@olane/o-node';
|
|
3
2
|
export declare class oLimitedConnectionManager extends oNodeConnectionManager {
|
|
4
3
|
private readonly _token?;
|
|
5
|
-
/**
|
|
6
|
-
* Override connect to return oPrivateConnection with _token injected
|
|
7
|
-
*/
|
|
8
|
-
connect(config: oNodeConnectionConfig): Promise<oLimitedConnection>;
|
|
9
4
|
}
|
|
10
5
|
//# sourceMappingURL=o-limited-connection-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o-limited-connection-manager.d.ts","sourceRoot":"","sources":["../../../src/connection/o-limited-connection-manager.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"o-limited-connection-manager.d.ts","sourceRoot":"","sources":["../../../src/connection/o-limited-connection-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAI9E,qBAAa,yBAA0B,SAAQ,sBAAsB;IACnE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;CAClC"}
|
|
@@ -1,34 +1,3 @@
|
|
|
1
1
|
import { oNodeConnectionManager } from '@olane/o-node';
|
|
2
|
-
import { oLimitedConnection } from './o-limited-connection.js';
|
|
3
2
|
export class oLimitedConnectionManager extends oNodeConnectionManager {
|
|
4
|
-
/**
|
|
5
|
-
* Override connect to return oPrivateConnection with _token injected
|
|
6
|
-
*/
|
|
7
|
-
async connect(config) {
|
|
8
|
-
const { address, nextHopAddress, callerAddress } = config;
|
|
9
|
-
// First time setup connection
|
|
10
|
-
try {
|
|
11
|
-
const addressKey = this.getAddressKey(nextHopAddress);
|
|
12
|
-
if (!addressKey) {
|
|
13
|
-
throw new Error(`Unable to extract address key from address: ${nextHopAddress.toString()}`);
|
|
14
|
-
}
|
|
15
|
-
const p2pConnection = await this.getOrCreateP2pConnection(nextHopAddress, addressKey);
|
|
16
|
-
const connection = new oLimitedConnection({
|
|
17
|
-
nextHopAddress: nextHopAddress,
|
|
18
|
-
address: address,
|
|
19
|
-
p2pConnection: p2pConnection,
|
|
20
|
-
callerAddress: callerAddress,
|
|
21
|
-
runOnLimitedConnection: true,
|
|
22
|
-
requestHandler: config.requestHandler,
|
|
23
|
-
});
|
|
24
|
-
return connection;
|
|
25
|
-
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
this.logger.error(`[${callerAddress?.toString() || 'unknown'}] Error connecting to address! Next hop:` +
|
|
28
|
-
nextHopAddress +
|
|
29
|
-
' With Address:' +
|
|
30
|
-
address.toString(), error);
|
|
31
|
-
throw error;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
3
|
}
|
|
@@ -72,6 +72,8 @@ describe('Bidirectional Communication', () => {
|
|
|
72
72
|
address: new oNodeAddress('o://relay'),
|
|
73
73
|
runOnLimitedConnection: true,
|
|
74
74
|
});
|
|
75
|
+
console.log('Using relay at addresses:', relay.p2pNode.getMultiaddrs());
|
|
76
|
+
// Connect receiver to relay
|
|
75
77
|
await receiver.use(relay.address, {
|
|
76
78
|
method: 'ping',
|
|
77
79
|
params: {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-client-limited",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.55",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"typescript": "5.4.5"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@olane/o-config": "0.7.
|
|
58
|
-
"@olane/o-core": "0.7.
|
|
59
|
-
"@olane/o-node": "0.7.
|
|
60
|
-
"@olane/o-protocol": "0.7.
|
|
61
|
-
"@olane/o-tool": "0.7.
|
|
57
|
+
"@olane/o-config": "0.7.55",
|
|
58
|
+
"@olane/o-core": "0.7.55",
|
|
59
|
+
"@olane/o-node": "0.7.55",
|
|
60
|
+
"@olane/o-protocol": "0.7.55",
|
|
61
|
+
"@olane/o-tool": "0.7.55",
|
|
62
62
|
"debug": "^4.4.1",
|
|
63
63
|
"dotenv": "^16.5.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "f7d02a1ecfb0d28b7b1009a7c3eb6d0d4863adc2"
|
|
66
66
|
}
|