mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-22 08:31:42 +00:00
update aqua
This commit is contained in:
@ -15,9 +15,8 @@ import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
export async function betterMessage(client: FluenceClient, relay: string, config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
const r = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withTTL(config?.ttl || 5000)
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
@ -72,7 +71,10 @@ export async function betterMessage(client: FluenceClient, relay: string, config
|
||||
.handleTimeout(() => {
|
||||
reject('Request timed out for betterMessage');
|
||||
})
|
||||
.build();
|
||||
if(config?.ttl) {
|
||||
r.withTTL(config.ttl)
|
||||
}
|
||||
request = r.build();
|
||||
});
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
|
Reference in New Issue
Block a user