wapi-client 0.10.0 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/base-client.browser.cjs +18 -10
- package/dist/api/base-client.browser.js +18 -10
- package/dist/api/base-client.cjs +18 -10
- package/dist/api/base-client.d.ts +3 -1
- package/dist/api/base-client.js +18 -10
- package/dist/api/ws-client.browser.cjs +15 -8
- package/dist/api/ws-client.browser.js +15 -8
- package/dist/api/ws-client.cjs +16 -9
- package/dist/api/ws-client.d.ts +1 -1
- package/dist/api/ws-client.js +16 -9
- package/dist/client.browser.cjs +43 -0
- package/dist/client.browser.js +43 -0
- package/dist/client.cjs +44 -1
- package/dist/client.d.ts +43 -0
- package/dist/client.js +44 -1
- package/dist/fns/update-transfer/update-transfer.browser.cjs +2 -1
- package/dist/fns/update-transfer/update-transfer.browser.js +2 -1
- package/dist/fns/update-transfer/update-transfer.cjs +2 -1
- package/dist/fns/update-transfer/update-transfer.enums.d.ts +6 -0
- package/dist/fns/update-transfer/update-transfer.js +2 -1
- package/dist/fns/update-transfer/update-transfer.schema.input.json +3 -0
- package/dist/index.d.ts +6 -1
- package/dist/txs/update-transfer/update-transfer.schema.input.json +0 -4
- package/dist/types/index.d.ts +59 -3
- package/dist/wapi-client-web.iife.js +3 -3
- package/dist/wapi-client.iife.js +3 -3
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -805,6 +805,49 @@ export declare class Client {
|
|
|
805
805
|
/**
|
|
806
806
|
*
|
|
807
807
|
*
|
|
808
|
+
* ```javascript
|
|
809
|
+
*
|
|
810
|
+
* // setup
|
|
811
|
+
* await wapiClient.createDeposit(
|
|
812
|
+
* {
|
|
813
|
+
* wallet: 'newWallet',
|
|
814
|
+
* amount: 10,
|
|
815
|
+
* status: 'pending',
|
|
816
|
+
* identifier: 'depositUSD',
|
|
817
|
+
* token: 'USD',
|
|
818
|
+
* },
|
|
819
|
+
* {
|
|
820
|
+
* create_wallet_if_not_exists: true,
|
|
821
|
+
* },
|
|
822
|
+
* );
|
|
823
|
+
* await wapiClient.updateTransfer({
|
|
824
|
+
* transfer: 'depositUSD',
|
|
825
|
+
* status: 'finished',
|
|
826
|
+
* });
|
|
827
|
+
*
|
|
828
|
+
* const result = await wapiClient.exportBalanceHistory(
|
|
829
|
+
* {
|
|
830
|
+
* wallet: 'newWallet',
|
|
831
|
+
* token: 'USD',
|
|
832
|
+
* },
|
|
833
|
+
* {
|
|
834
|
+
* limit: 0,
|
|
835
|
+
* select: [
|
|
836
|
+
* 'transfer_identifier',
|
|
837
|
+
* 'pending_amount',
|
|
838
|
+
* 'finished_amount',
|
|
839
|
+
* 'pending_amount_from',
|
|
840
|
+
* 'pending_amount_to',
|
|
841
|
+
* 'amount',
|
|
842
|
+
* ],
|
|
843
|
+
* offset: 0,
|
|
844
|
+
* order: 'desc',
|
|
845
|
+
* tracking_id: 'mylogId',
|
|
846
|
+
* // transaction_id: Transaction.identifier, // created transaction identifier
|
|
847
|
+
* },
|
|
848
|
+
* );
|
|
849
|
+
*
|
|
850
|
+
* ```
|
|
808
851
|
*
|
|
809
852
|
* @param {ExportBalanceHistoryFnInput} input
|
|
810
853
|
* @param {ExportBalanceHistoryFnOptions} [options]
|
package/dist/client.js
CHANGED
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
isImportDataFnInput
|
|
51
51
|
} from "./fns/import-data/import-data.guards";
|
|
52
52
|
var _a;
|
|
53
|
-
var CLIENT_VERSION = (_a = '0.10.
|
|
53
|
+
var CLIENT_VERSION = (_a = '0.10.4') != null ? _a : "";
|
|
54
54
|
var Client = class {
|
|
55
55
|
/**
|
|
56
56
|
* @internal
|
|
@@ -762,6 +762,49 @@ var Client = class {
|
|
|
762
762
|
/**
|
|
763
763
|
*
|
|
764
764
|
*
|
|
765
|
+
* ```javascript
|
|
766
|
+
*
|
|
767
|
+
* // setup
|
|
768
|
+
* await wapiClient.createDeposit(
|
|
769
|
+
* {
|
|
770
|
+
* wallet: 'newWallet',
|
|
771
|
+
* amount: 10,
|
|
772
|
+
* status: 'pending',
|
|
773
|
+
* identifier: 'depositUSD',
|
|
774
|
+
* token: 'USD',
|
|
775
|
+
* },
|
|
776
|
+
* {
|
|
777
|
+
* create_wallet_if_not_exists: true,
|
|
778
|
+
* },
|
|
779
|
+
* );
|
|
780
|
+
* await wapiClient.updateTransfer({
|
|
781
|
+
* transfer: 'depositUSD',
|
|
782
|
+
* status: 'finished',
|
|
783
|
+
* });
|
|
784
|
+
*
|
|
785
|
+
* const result = await wapiClient.exportBalanceHistory(
|
|
786
|
+
* {
|
|
787
|
+
* wallet: 'newWallet',
|
|
788
|
+
* token: 'USD',
|
|
789
|
+
* },
|
|
790
|
+
* {
|
|
791
|
+
* limit: 0,
|
|
792
|
+
* select: [
|
|
793
|
+
* 'transfer_identifier',
|
|
794
|
+
* 'pending_amount',
|
|
795
|
+
* 'finished_amount',
|
|
796
|
+
* 'pending_amount_from',
|
|
797
|
+
* 'pending_amount_to',
|
|
798
|
+
* 'amount',
|
|
799
|
+
* ],
|
|
800
|
+
* offset: 0,
|
|
801
|
+
* order: 'desc',
|
|
802
|
+
* tracking_id: 'mylogId',
|
|
803
|
+
* // transaction_id: Transaction.identifier, // created transaction identifier
|
|
804
|
+
* },
|
|
805
|
+
* );
|
|
806
|
+
*
|
|
807
|
+
* ```
|
|
765
808
|
*
|
|
766
809
|
* @param {ExportBalanceHistoryFnInput} input
|
|
767
810
|
* @param {ExportBalanceHistoryFnOptions} [options]
|
|
@@ -40,7 +40,8 @@ function updateTransfer(options, input, fnOptions) {
|
|
|
40
40
|
transfer: (0, import_utils.getIdentifierFilter)(inputCopy.transfer),
|
|
41
41
|
update: {
|
|
42
42
|
status: inputCopy.status,
|
|
43
|
-
metadata: inputCopy.metadata
|
|
43
|
+
metadata: inputCopy.metadata,
|
|
44
|
+
extend_metadata: inputCopy.extend_metadata
|
|
44
45
|
},
|
|
45
46
|
options: inputCopy.options
|
|
46
47
|
});
|
|
@@ -16,7 +16,8 @@ function updateTransfer(options, input, fnOptions) {
|
|
|
16
16
|
transfer: getIdentifierFilter(inputCopy.transfer),
|
|
17
17
|
update: {
|
|
18
18
|
status: inputCopy.status,
|
|
19
|
-
metadata: inputCopy.metadata
|
|
19
|
+
metadata: inputCopy.metadata,
|
|
20
|
+
extend_metadata: inputCopy.extend_metadata
|
|
20
21
|
},
|
|
21
22
|
options: inputCopy.options
|
|
22
23
|
});
|
|
@@ -40,7 +40,8 @@ function updateTransfer(options, input, fnOptions) {
|
|
|
40
40
|
transfer: (0, import_utils.getIdentifierFilter)(inputCopy.transfer),
|
|
41
41
|
update: {
|
|
42
42
|
status: inputCopy.status,
|
|
43
|
-
metadata: inputCopy.metadata
|
|
43
|
+
metadata: inputCopy.metadata,
|
|
44
|
+
extend_metadata: inputCopy.extend_metadata
|
|
44
45
|
},
|
|
45
46
|
options: inputCopy.options
|
|
46
47
|
});
|
|
@@ -21,6 +21,12 @@ export interface UpdateTransferFnInput {
|
|
|
21
21
|
metadata?: {
|
|
22
22
|
[k: string]: unknown;
|
|
23
23
|
} | null;
|
|
24
|
+
/**
|
|
25
|
+
* Key/value object describing this transfer
|
|
26
|
+
*/
|
|
27
|
+
extend_metadata?: {
|
|
28
|
+
[k: string]: unknown;
|
|
29
|
+
} | null;
|
|
24
30
|
options?: UpdateTransferFnOptions;
|
|
25
31
|
}
|
|
26
32
|
/**
|
|
@@ -16,7 +16,8 @@ function updateTransfer(options, input, fnOptions) {
|
|
|
16
16
|
transfer: getIdentifierFilter(inputCopy.transfer),
|
|
17
17
|
update: {
|
|
18
18
|
status: inputCopy.status,
|
|
19
|
-
metadata: inputCopy.metadata
|
|
19
|
+
metadata: inputCopy.metadata,
|
|
20
|
+
extend_metadata: inputCopy.extend_metadata
|
|
20
21
|
},
|
|
21
22
|
options: inputCopy.options
|
|
22
23
|
});
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"metadata": {
|
|
17
17
|
"$ref": "/db/transfer/transfer.schema.json#/properties/metadata"
|
|
18
18
|
},
|
|
19
|
+
"extend_metadata": {
|
|
20
|
+
"$ref": "/db/transfer/transfer.schema.json#/properties/metadata"
|
|
21
|
+
},
|
|
19
22
|
"options": {
|
|
20
23
|
"$ref": "#/definitions/update_transfer_fn_options"
|
|
21
24
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -42,8 +42,13 @@ export type WapiClientOptions = WapiClientWsOptions | WapiClientHttpOptions;
|
|
|
42
42
|
* console.log('disconnected');
|
|
43
43
|
* },
|
|
44
44
|
* reconnect() {
|
|
45
|
-
* console.log('
|
|
45
|
+
* console.log('reconnect attempt');
|
|
46
|
+
* // return false; from this hook to prevent reconnecting
|
|
46
47
|
* },
|
|
48
|
+
* reconnectError(err) {
|
|
49
|
+
* console.error(err);
|
|
50
|
+
* // this hook will fire if websocket disconnects and fails to reconnect
|
|
51
|
+
* }
|
|
47
52
|
* preflight(msg) => {
|
|
48
53
|
* console.log('sending msg', msg);
|
|
49
54
|
* return true; // allow
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
"properties": {
|
|
63
63
|
"status": {
|
|
64
64
|
"description": "Status the transfer should be set as. Only pending transfers can be updated",
|
|
65
|
-
"default": "finished",
|
|
66
65
|
"$ref": "/db/consts.schema.json#/definitions/TransferStatus"
|
|
67
66
|
},
|
|
68
67
|
"metadata": {
|
|
@@ -75,9 +74,6 @@
|
|
|
75
74
|
"$ref": "/db/transfer/transfer.schema.json#/properties/updated_at"
|
|
76
75
|
}
|
|
77
76
|
},
|
|
78
|
-
"default": {
|
|
79
|
-
"status": "finished"
|
|
80
|
-
},
|
|
81
77
|
"additionalProperties": false
|
|
82
78
|
}
|
|
83
79
|
},
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9539,6 +9539,12 @@ declare module 'wapi-client/fns/update-transfer/update-transfer.enums' {
|
|
|
9539
9539
|
metadata?: {
|
|
9540
9540
|
[k: string]: unknown;
|
|
9541
9541
|
} | null;
|
|
9542
|
+
/**
|
|
9543
|
+
* Key/value object describing this transfer
|
|
9544
|
+
*/
|
|
9545
|
+
extend_metadata?: {
|
|
9546
|
+
[k: string]: unknown;
|
|
9547
|
+
} | null;
|
|
9542
9548
|
options?: UpdateTransferFnOptions;
|
|
9543
9549
|
}
|
|
9544
9550
|
/**
|
|
@@ -10912,8 +10918,13 @@ export * from 'wapi-client/fns/update-wallet/update-wallet.guards';
|
|
|
10912
10918
|
* console.log('disconnected');
|
|
10913
10919
|
* },
|
|
10914
10920
|
* reconnect() {
|
|
10915
|
-
* console.log('
|
|
10921
|
+
* console.log('reconnect attempt');
|
|
10922
|
+
* // return false; from this hook to prevent reconnecting
|
|
10916
10923
|
* },
|
|
10924
|
+
* reconnectError(err) {
|
|
10925
|
+
* console.error(err);
|
|
10926
|
+
* // this hook will fire if websocket disconnects and fails to reconnect
|
|
10927
|
+
* }
|
|
10917
10928
|
* preflight(msg) => {
|
|
10918
10929
|
* console.log('sending msg', msg);
|
|
10919
10930
|
* return true; // allow
|
|
@@ -11485,6 +11496,7 @@ declare module 'wapi-client/api/base-client' {
|
|
|
11485
11496
|
connected?: (socId: undefined | string) => void;
|
|
11486
11497
|
disconnected?: () => void;
|
|
11487
11498
|
reconnect?: () => void | boolean;
|
|
11499
|
+
reconnectError?: (err: Error) => void;
|
|
11488
11500
|
preflight?: (msg: JSONRPCRequest) => void | boolean;
|
|
11489
11501
|
message?: (msg: JSONRPCResponse) => void;
|
|
11490
11502
|
}
|
|
@@ -11505,8 +11517,9 @@ declare module 'wapi-client/api/base-client' {
|
|
|
11505
11517
|
constructor(connection: WebSocket | HttpConnectionClient, connectionType: WapiClientType, $connect?: Promise<ISocketId>);
|
|
11506
11518
|
protected _setConnected(value: boolean): void;
|
|
11507
11519
|
protected _setErrored(err: Error): void;
|
|
11520
|
+
protected _clearError(): void;
|
|
11508
11521
|
protected _send(input: JSONRPCRequest | JSONRPCResponse): void;
|
|
11509
|
-
protected _reconnect(): void;
|
|
11522
|
+
protected _reconnect(nrOfAttempts?: number | undefined): void;
|
|
11510
11523
|
close(): Promise<void>;
|
|
11511
11524
|
protected _connectionLost(): void;
|
|
11512
11525
|
protected _handleMessage(incoming: JSONRPCResponse | JSONRPCRequest): void;
|
|
@@ -11912,7 +11925,7 @@ declare module 'wapi-client/api/ws-client' {
|
|
|
11912
11925
|
constructor(initial: ConnectionWPromise, config: WapiConnectionOptions);
|
|
11913
11926
|
protected _setErrored(err: Error | AuthenticationError): void;
|
|
11914
11927
|
private _ready;
|
|
11915
|
-
protected _reconnect(): void;
|
|
11928
|
+
protected _reconnect(nrOfAttempts?: number | undefined): void;
|
|
11916
11929
|
private _heartbeat;
|
|
11917
11930
|
protected _send(input: JSONRPCRequest | JSONRPCResponse): void;
|
|
11918
11931
|
close(): Promise<void>;
|
|
@@ -12748,6 +12761,49 @@ declare module 'wapi-client/client' {
|
|
|
12748
12761
|
/**
|
|
12749
12762
|
*
|
|
12750
12763
|
*
|
|
12764
|
+
* ```javascript
|
|
12765
|
+
*
|
|
12766
|
+
* // setup
|
|
12767
|
+
* await wapiClient.createDeposit(
|
|
12768
|
+
* {
|
|
12769
|
+
* wallet: 'newWallet',
|
|
12770
|
+
* amount: 10,
|
|
12771
|
+
* status: 'pending',
|
|
12772
|
+
* identifier: 'depositUSD',
|
|
12773
|
+
* token: 'USD',
|
|
12774
|
+
* },
|
|
12775
|
+
* {
|
|
12776
|
+
* create_wallet_if_not_exists: true,
|
|
12777
|
+
* },
|
|
12778
|
+
* );
|
|
12779
|
+
* await wapiClient.updateTransfer({
|
|
12780
|
+
* transfer: 'depositUSD',
|
|
12781
|
+
* status: 'finished',
|
|
12782
|
+
* });
|
|
12783
|
+
*
|
|
12784
|
+
* const result = await wapiClient.exportBalanceHistory(
|
|
12785
|
+
* {
|
|
12786
|
+
* wallet: 'newWallet',
|
|
12787
|
+
* token: 'USD',
|
|
12788
|
+
* },
|
|
12789
|
+
* {
|
|
12790
|
+
* limit: 0,
|
|
12791
|
+
* select: [
|
|
12792
|
+
* 'transfer_identifier',
|
|
12793
|
+
* 'pending_amount',
|
|
12794
|
+
* 'finished_amount',
|
|
12795
|
+
* 'pending_amount_from',
|
|
12796
|
+
* 'pending_amount_to',
|
|
12797
|
+
* 'amount',
|
|
12798
|
+
* ],
|
|
12799
|
+
* offset: 0,
|
|
12800
|
+
* order: 'desc',
|
|
12801
|
+
* tracking_id: 'mylogId',
|
|
12802
|
+
* // transaction_id: Transaction.identifier, // created transaction identifier
|
|
12803
|
+
* },
|
|
12804
|
+
* );
|
|
12805
|
+
*
|
|
12806
|
+
* ```
|
|
12751
12807
|
*
|
|
12752
12808
|
* @param {ExportBalanceHistoryFnInput} input
|
|
12753
12809
|
* @param {ExportBalanceHistoryFnOptions} [options]
|