Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/fluence-js/aqua/src/services.aqua
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ service Sig("sig"):
verify(signature: []u8, data: []u8) -> bool

-- Gets service's public key.
get_pub_key() -> string
get_peer_id() -> string
4 changes: 2 additions & 2 deletions packages/fluence-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluencelabs/fluence",
"version": "0.23.8",
"version": "0.24.0",
"description": "TypeScript implementation of Fluence Peer",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
Expand Down Expand Up @@ -28,7 +28,7 @@
"@fluencelabs/avm": "0.27.0",
"@fluencelabs/connection": "workspace:0.2.0",
"@fluencelabs/interfaces": "workspace:0.1.0",
"@fluencelabs/keypair": "workspace:0.1.0",
"@fluencelabs/keypair": "workspace:0.2.0",
"@fluencelabs/marine-js": "0.3.9",
"async": "3.2.3",
"base64-js": "^1.5.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This file is auto-generated. Do not edit manually: changes may be erased.
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
* Aqua version: 0.7.0-287
* Aqua version: 0.7.2-314
*
*/
import { Fluence, FluencePeer } from '../../index';
Expand Down
2 changes: 1 addition & 1 deletion packages/fluence-js/src/__test__/_aqua/marine-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This file is auto-generated. Do not edit manually: changes may be erased.
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
* Aqua version: 0.7.0-285
* Aqua version: 0.7.2-314
*
*/
import { Fluence, FluencePeer } from '../../index';
Expand Down
6 changes: 3 additions & 3 deletions packages/fluence-js/src/__test__/_aqua/sig-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This file is auto-generated. Do not edit manually: changes may be erased.
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
* Aqua version: 0.7.0-285
* Aqua version: 0.7.2-314
*
*/
import { Fluence, FluencePeer } from '../../index';
Expand Down Expand Up @@ -49,7 +49,7 @@ export function registerDataProvider(...args: any) {
}

export interface SigDef {
get_pub_key: (callParams: CallParams<null>) => string | Promise<string>;
get_peer_id: (callParams: CallParams<null>) => string | Promise<string>;
sign: (
data: number[],
callParams: CallParams<'data'>,
Expand All @@ -73,7 +73,7 @@ export function registerSig(...args: any) {
functions: {
tag: 'labeledProduct',
fields: {
get_pub_key: {
get_peer_id: {
tag: 'arrow',
domain: {
tag: 'nil',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ describe('Sig service tests', () => {

const res = await sig.sign(
testData,
makeTetraplet((await KeyPair.randomEd25519()).toB58String(), 'registry', 'get_key_bytes'),
makeTetraplet((await KeyPair.randomEd25519()).getPeerId(), 'registry', 'get_key_bytes'),
);

await expect(res.success).toBe(false);
Expand Down
6 changes: 3 additions & 3 deletions packages/fluence-js/src/internal/_aqua/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This file is auto-generated. Do not edit manually: changes may be erased.
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
* Aqua version: 0.7.0-285
* Aqua version: 0.7.2-314
*
*/
import { Fluence, FluencePeer } from '../../index';
Expand All @@ -12,7 +12,7 @@ import { CallParams, callFunction, registerService } from '../../internal/compil
// Services

export interface SigDef {
get_pub_key: (callParams: CallParams<null>) => string | Promise<string>;
get_peer_id: (callParams: CallParams<null>) => string | Promise<string>;
sign: (
data: number[],
callParams: CallParams<'data'>,
Expand All @@ -36,7 +36,7 @@ export function registerSig(...args: any) {
functions: {
tag: 'labeledProduct',
fields: {
get_pub_key: {
get_peer_id: {
tag: 'arrow',
domain: {
tag: 'nil',
Expand Down
4 changes: 2 additions & 2 deletions packages/fluence-js/src/internal/builtins/Sig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export class Sig implements SigDef {
/**
* Gets the public key of KeyPair. Required by aqua
*/
get_pub_key() {
return this._keyPair.toB58String();
get_peer_id() {
return this._keyPair.getPeerId();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/fluence-js/src/internal/ephemeral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class EphemeralNetwork {
this._send(peer.getStatus().peerId!, nextPeerIds, particle);
};
const kp = await keyPairFromBase64Sk(x.sk);
if (kp.toB58String() !== x.peerId) {
if (kp.getPeerId() !== x.peerId) {
throw new Error(`Invalid config: peer id ${x.peerId} does not match the secret key ${x.sk}`);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/fluence-keypair/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluencelabs/keypair",
"version": "0.1.0",
"version": "0.2.0",
"description": "Keypair implementation for Fluence JS Peer",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/fluence-keypair/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class KeyPair {
return new KeyPair(lib2p2Pid);
}

toB58String(): string {
getPeerId(): string {
return this.Libp2pPeerId.toB58String();
}

Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.