mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-07-01 05:51:41 +00:00
Update JS SDK version and migrate to the new JS API (#11)
This commit is contained in:
@ -1,13 +1,15 @@
|
||||
import {FluenceClient, registerServiceFunction} from "@fluencelabs/fluence";
|
||||
import {getAliasedData} from "../compiled/examples/dataAlias";
|
||||
import { FluencePeer } from '@fluencelabs/fluence';
|
||||
import { getAliasedData, registerNodeIdGetter } from '../compiled/examples/dataAlias';
|
||||
|
||||
export async function dataAliasCall(client: FluenceClient) {
|
||||
registerServiceFunction(client, "somesrv", "get", (args: any[], _) => {
|
||||
return {
|
||||
peerId: "peer id str",
|
||||
name: "name str"
|
||||
}
|
||||
})
|
||||
export async function dataAliasCall() {
|
||||
registerNodeIdGetter({
|
||||
get: () => {
|
||||
return {
|
||||
peerId: 'peer id str',
|
||||
name: 'name str',
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return await getAliasedData(client)
|
||||
return await getAliasedData();
|
||||
}
|
||||
|
Reference in New Issue
Block a user