squarefi-bff-api-module 1.4.0 → 1.5.0
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/types.d.ts +27 -0
- package/dist/api/wallets.d.ts +4 -1
- package/dist/api/wallets.js +8 -5
- package/package.json +1 -1
- package/src/api/types.ts +29 -0
- package/src/api/wallets.ts +17 -11
package/dist/api/types.d.ts
CHANGED
|
@@ -738,7 +738,34 @@ export declare namespace API {
|
|
|
738
738
|
record_type: WalletTransactionRecordType | string;
|
|
739
739
|
meta?: WalletTransactionMeta;
|
|
740
740
|
}
|
|
741
|
+
interface DetailedTransaction {
|
|
742
|
+
id: number;
|
|
743
|
+
amount: number;
|
|
744
|
+
created_at: string;
|
|
745
|
+
from: string;
|
|
746
|
+
info: string;
|
|
747
|
+
status: string;
|
|
748
|
+
to: string;
|
|
749
|
+
txid: string;
|
|
750
|
+
type: WalletTransactionType | string;
|
|
751
|
+
wallet_id: string;
|
|
752
|
+
method: WalletTransactionMethod | string;
|
|
753
|
+
meta: WalletTransactionMeta;
|
|
754
|
+
record_type: WalletTransactionRecordType | string;
|
|
755
|
+
currency: API.Currencies.Currency;
|
|
756
|
+
}
|
|
757
|
+
namespace GetByUuid {
|
|
758
|
+
type Request = {
|
|
759
|
+
wallet_uuid: string;
|
|
760
|
+
uuid: string;
|
|
761
|
+
};
|
|
762
|
+
}
|
|
741
763
|
namespace TransactionList {
|
|
764
|
+
type Request = {
|
|
765
|
+
wallet_uuid: string;
|
|
766
|
+
limit?: number;
|
|
767
|
+
offset?: number;
|
|
768
|
+
};
|
|
742
769
|
type Response = {
|
|
743
770
|
total: number;
|
|
744
771
|
data: Transaction[];
|
package/dist/api/wallets.d.ts
CHANGED
|
@@ -13,6 +13,9 @@ export declare const wallets: {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
transactions: {
|
|
16
|
-
|
|
16
|
+
byWalletUuid: {
|
|
17
|
+
getAll: ({ wallet_uuid, limit, offset, }: API.Wallets.WalletTransactions.TransactionList.Request) => Promise<API.Wallets.WalletTransactions.TransactionList.Response>;
|
|
18
|
+
getByUuid: ({ wallet_uuid, uuid }: API.Wallets.WalletTransactions.GetByUuid.Request) => Promise<API.Wallets.WalletTransactions.DetailedTransaction>;
|
|
19
|
+
};
|
|
17
20
|
};
|
|
18
21
|
};
|
package/dist/api/wallets.js
CHANGED
|
@@ -27,10 +27,13 @@ exports.wallets = {
|
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
transactions: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
byWalletUuid: {
|
|
31
|
+
getAll: (_a) => __awaiter(void 0, [_a], void 0, function* ({ wallet_uuid, limit = constants_1.defaultPaginationParams.limit, offset = constants_1.defaultPaginationParams.offset, }) {
|
|
32
|
+
return apiClientFactory_1.apiClientV2.getRequest(`/wallets/${wallet_uuid}/transactions`, {
|
|
33
|
+
params: { limit, offset },
|
|
34
|
+
});
|
|
35
|
+
}),
|
|
36
|
+
getByUuid: ({ wallet_uuid, uuid }) => apiClientFactory_1.apiClientV2.getRequest(`/wallets/${wallet_uuid}/transactions/${uuid}`),
|
|
37
|
+
},
|
|
35
38
|
},
|
|
36
39
|
};
|
package/package.json
CHANGED
package/src/api/types.ts
CHANGED
|
@@ -834,7 +834,36 @@ export namespace API {
|
|
|
834
834
|
meta?: WalletTransactionMeta;
|
|
835
835
|
}
|
|
836
836
|
|
|
837
|
+
export interface DetailedTransaction {
|
|
838
|
+
id: number;
|
|
839
|
+
amount: number;
|
|
840
|
+
created_at: string;
|
|
841
|
+
from: string;
|
|
842
|
+
info: string;
|
|
843
|
+
status: string;
|
|
844
|
+
to: string;
|
|
845
|
+
txid: string;
|
|
846
|
+
type: WalletTransactionType | string;
|
|
847
|
+
wallet_id: string;
|
|
848
|
+
method: WalletTransactionMethod | string;
|
|
849
|
+
meta: WalletTransactionMeta;
|
|
850
|
+
record_type: WalletTransactionRecordType | string;
|
|
851
|
+
currency: API.Currencies.Currency;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
export namespace GetByUuid {
|
|
855
|
+
export type Request = {
|
|
856
|
+
wallet_uuid: string;
|
|
857
|
+
uuid: string;
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
|
|
837
861
|
export namespace TransactionList {
|
|
862
|
+
export type Request = {
|
|
863
|
+
wallet_uuid: string;
|
|
864
|
+
limit?: number;
|
|
865
|
+
offset?: number;
|
|
866
|
+
};
|
|
838
867
|
export type Response = {
|
|
839
868
|
total: number;
|
|
840
869
|
data: Transaction[];
|
package/src/api/wallets.ts
CHANGED
|
@@ -21,16 +21,22 @@ export const wallets = {
|
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
transactions: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
byWalletUuid: {
|
|
25
|
+
getAll: async ({
|
|
26
|
+
wallet_uuid,
|
|
27
|
+
limit = defaultPaginationParams.limit,
|
|
28
|
+
offset = defaultPaginationParams.offset,
|
|
29
|
+
}: API.Wallets.WalletTransactions.TransactionList.Request) =>
|
|
30
|
+
apiClientV2.getRequest<API.Wallets.WalletTransactions.TransactionList.Response>(
|
|
31
|
+
`/wallets/${wallet_uuid}/transactions`,
|
|
32
|
+
{
|
|
33
|
+
params: { limit, offset },
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
getByUuid: ({ wallet_uuid, uuid }: API.Wallets.WalletTransactions.GetByUuid.Request) =>
|
|
37
|
+
apiClientV2.getRequest<API.Wallets.WalletTransactions.DetailedTransaction>(
|
|
38
|
+
`/wallets/${wallet_uuid}/transactions/${uuid}`
|
|
39
|
+
),
|
|
40
|
+
},
|
|
35
41
|
},
|
|
36
42
|
};
|