Skip to content

Commit 91b0643

Browse files
committed
Add uploadData for JSON data
Signed-off-by: Andrew Richardson <[email protected]>
1 parent 7d2b4fa commit 91b0643

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/firefly.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import {
5656
FireFlyContractAPIQueryRequest,
5757
FireFlyContractInvokeRequest,
5858
FireFlyContractQueryRequest,
59+
FireFlyDataRequest,
5960
} from './interfaces';
6061
import { FireFlyWebSocket, FireFlyWebSocketCallback } from './websocket';
6162
import HttpBase, { mapConfig } from './http';
@@ -152,6 +153,13 @@ export default class FireFly extends HttpBase {
152153
return response.data;
153154
}
154155

156+
async uploadData(
157+
data: FireFlyDataRequest,
158+
options?: FireFlyCreateOptions,
159+
): Promise<FireFlyDataResponse> {
160+
return this.createOne<FireFlyDataResponse>('/data', data, options);
161+
}
162+
155163
async uploadDataBlob(
156164
blob: string | Buffer | Readable,
157165
filename: string,

0 commit comments

Comments
 (0)