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: 2 additions & 0 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@fluencelabs/avm-runner-interface": "^0.2.0",
"async": "3.2.0",
"bs58": "4.0.1",
"buffer": "^6.0.3",
"cids": "0.8.1",
"it-length-prefixed": "3.0.1",
"it-pipe": "1.1.0",
Expand All @@ -40,7 +41,8 @@
"peer-id": "=0.15.4",
"rxjs": "^7.3.0",
"ts-pattern": "^3.3.3",
"uuid": "8.3.0"
"uuid": "8.3.0",
"browser-or-node": "^2.0.0"
},
"devDependencies": {
"@fluencelabs/aqua": "^0.5.3-258",
Expand Down
4 changes: 4 additions & 0 deletions src/internal/Buffer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { isBrowser } from 'browser-or-node';
import { Buffer as BufferPolyfill } from 'buffer';

export default isBrowser ? BufferPolyfill : Buffer;
1 change: 1 addition & 0 deletions src/internal/FluenceConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import PeerId from 'peer-id';
import { Multiaddr } from 'multiaddr';
import { all as allow_all } from 'libp2p-websockets/src/filters';
import { Connection } from 'libp2p-interfaces/src/topology';
import Buffer from './Buffer';

export const PROTOCOL_NAME = '/fluence/particle/2.0.0';

Expand Down
1 change: 1 addition & 0 deletions src/internal/FluencePeer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { AvmRunner, InterpreterResult, LogLevel } from '@fluencelabs/avm-runner-
import { AvmRunnerBackground } from '@fluencelabs/avm-runner-background';
import { defaultSigGuard, Sig } from './builtins/Sig';
import { registerSig } from './_aqua/services';
import Buffer from './Buffer';

/**
* Node of the Fluence network specified as a pair of node's multiaddr and it's peer id
Expand Down
1 change: 1 addition & 0 deletions src/internal/Particle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { CallResultsArray, LogLevel } from '@fluencelabs/avm-runner-interface';
import log from 'loglevel';
import { ParticleContext } from './commonTypes';
import { dataToString, jsonify } from './utils';
import Buffer from './Buffer';

export class Particle {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion src/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import log from 'loglevel';
import { CallServiceData, CallServiceResult, CallServiceResultType, ResultCodes } from './commonTypes';
import { FluencePeer } from './FluencePeer';
import { Particle, ParticleExecutionStage } from './Particle';
import { LogLevel as AvmLoglevel } from '@fluencelabs/avm-runner-interface';
import Buffer from './Buffer';

export const MakeServiceCall = (fn: (args: any[]) => CallServiceResultType) => {
return (req: CallServiceData): CallServiceResult => {
Expand Down