@signalwire/core
Version:
Shared code for the SignalWire JS SDK
20 lines (17 loc) • 395 B
text/typescript
import { makeRPCRequest, makeRPCResponse } from './helpers'
export const RPCPing = () => {
return makeRPCRequest({
method: 'signalwire.ping',
params: {
timestamp: Date.now() / 1000,
},
})
}
export const RPCPingResponse = (id: string, timestamp?: number) => {
return makeRPCResponse({
id,
result: {
timestamp: timestamp || Date.now() / 1000,
},
})
}