interledgerjs / ilp-connector

Reference implementation of an Interledger connector.
Other
135 stars 53 forks source link

Example run error #500

Closed Srtake closed 3 years ago

Srtake commented 3 years ago

Description

I tried to run the example code in examples/example-using-LPI-V2.js, but got an error: UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'expiresAt' of undefined at Object.serializeIldcpRequest ($PROJECT_DIR\node_modules\ilp-protocol-ildcp\src\index.ts:47:24)

Analysis

In line 25 of example-using-LPI-V2.js, sendData() accepts the return value of Ildcp.serializeIldcpRequest() as its parameter, which needs to input a IldcpRequest object. However, there is not any object input.

Excepted Behaviour

Code run successfully and log It worked! in console, as line 35 says.

sentientwaffle commented 3 years ago

@Srtake Thank you for reporting this! It looks like serializeIldcpRequest's API changed at some point but the example wasn't updated.