@temboplus/afloat 0.1.49 → 0.1.50
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/esm/src/features/wallet/contract.d.ts +7 -1
- package/esm/src/features/wallet/contract.d.ts.map +1 -1
- package/esm/src/features/wallet/contract.js +3 -1
- package/esm/src/features/wallet/repository.d.ts +3 -1
- package/esm/src/features/wallet/repository.d.ts.map +1 -1
- package/esm/src/features/wallet/repository.js +4 -2
- package/package.json +1 -1
- package/script/src/features/wallet/contract.d.ts +7 -1
- package/script/src/features/wallet/contract.d.ts.map +1 -1
- package/script/src/features/wallet/contract.js +3 -1
- package/script/src/features/wallet/repository.d.ts +3 -1
- package/script/src/features/wallet/repository.d.ts.map +1 -1
- package/script/src/features/wallet/repository.js +4 -2
|
@@ -39,7 +39,13 @@ export declare const contract: {
|
|
|
39
39
|
};
|
|
40
40
|
getBalance: {
|
|
41
41
|
method: "POST";
|
|
42
|
-
body: z.ZodObject<{
|
|
42
|
+
body: z.ZodObject<{
|
|
43
|
+
accountNo: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
accountNo?: string | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
accountNo?: string | undefined;
|
|
48
|
+
}>;
|
|
43
49
|
path: "/balance";
|
|
44
50
|
responses: {
|
|
45
51
|
201: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCnB,CAAC"}
|
|
@@ -12,7 +12,9 @@ export const contract = initContract().router({
|
|
|
12
12
|
getBalance: {
|
|
13
13
|
method: "POST",
|
|
14
14
|
path: "/balance",
|
|
15
|
-
body: z.object({
|
|
15
|
+
body: z.object({
|
|
16
|
+
accountNo: z.string().optional(),
|
|
17
|
+
}),
|
|
16
18
|
responses: {
|
|
17
19
|
201: z.object({
|
|
18
20
|
availableBalance: z.coerce.number(),
|
|
@@ -24,7 +24,9 @@ export declare class WalletRepo extends BaseRepository<typeof contract> {
|
|
|
24
24
|
* @throws {Error} If the balance fetch operation fails
|
|
25
25
|
* @returns {Promise<number>} The available balance amount
|
|
26
26
|
*/
|
|
27
|
-
getBalance(
|
|
27
|
+
getBalance(props: {
|
|
28
|
+
accountNo: string;
|
|
29
|
+
}): Promise<number>;
|
|
28
30
|
/**
|
|
29
31
|
* Retrieves all wallets associated with the current context.
|
|
30
32
|
* @throws {Error} If the wallet fetch operation fails
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,cAAc,CAAC,OAAO,QAAQ,CAAC;IAC7D;;;;;OAKG;gBACS,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,CAAA;KAAE;IAOxD;;;;;OAKG;IACG,UAAU,
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,cAAc,CAAC,OAAO,QAAQ,CAAC;IAC7D;;;;;OAKG;gBACS,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,CAAA;KAAE;IAOxD;;;;;OAKG;IACG,UAAU,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAsB/D;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAUrC;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,KAAK,EAAE;QACL,KAAK,CAAC,EAAE;YAAE,SAAS,EAAE,IAAI,CAAC;YAAC,OAAO,EAAE,IAAI,CAAA;SAAE,CAAC;QAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GACA,OAAO,CAAC,oBAAoB,EAAE,CAAC;CA2BnC"}
|
|
@@ -27,7 +27,7 @@ export class WalletRepo extends BaseRepository {
|
|
|
27
27
|
* @throws {Error} If the balance fetch operation fails
|
|
28
28
|
* @returns {Promise<number>} The available balance amount
|
|
29
29
|
*/
|
|
30
|
-
async getBalance() {
|
|
30
|
+
async getBalance(props) {
|
|
31
31
|
const auth = this.getAuthForPermissionCheck();
|
|
32
32
|
const requirePerm = Permissions.Wallet.ViewBalance;
|
|
33
33
|
if (!auth.checkPermission(requirePerm)) {
|
|
@@ -36,7 +36,9 @@ export class WalletRepo extends BaseRepository {
|
|
|
36
36
|
requiredPermissions: [requirePerm],
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
const result = await this.client.getBalance(
|
|
39
|
+
const result = await this.client.getBalance({
|
|
40
|
+
body: { accountNo: props.accountNo },
|
|
41
|
+
});
|
|
40
42
|
if (result.status === 201) {
|
|
41
43
|
return result.body.availableBalance;
|
|
42
44
|
}
|
package/package.json
CHANGED
|
@@ -39,7 +39,13 @@ export declare const contract: {
|
|
|
39
39
|
};
|
|
40
40
|
getBalance: {
|
|
41
41
|
method: "POST";
|
|
42
|
-
body: z.ZodObject<{
|
|
42
|
+
body: z.ZodObject<{
|
|
43
|
+
accountNo: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
accountNo?: string | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
accountNo?: string | undefined;
|
|
48
|
+
}>;
|
|
43
49
|
path: "/balance";
|
|
44
50
|
responses: {
|
|
45
51
|
201: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCnB,CAAC"}
|
|
@@ -15,7 +15,9 @@ exports.contract = (0, core_1.initContract)().router({
|
|
|
15
15
|
getBalance: {
|
|
16
16
|
method: "POST",
|
|
17
17
|
path: "/balance",
|
|
18
|
-
body: zod_1.z.object({
|
|
18
|
+
body: zod_1.z.object({
|
|
19
|
+
accountNo: zod_1.z.string().optional(),
|
|
20
|
+
}),
|
|
19
21
|
responses: {
|
|
20
22
|
201: zod_1.z.object({
|
|
21
23
|
availableBalance: zod_1.z.coerce.number(),
|
|
@@ -24,7 +24,9 @@ export declare class WalletRepo extends BaseRepository<typeof contract> {
|
|
|
24
24
|
* @throws {Error} If the balance fetch operation fails
|
|
25
25
|
* @returns {Promise<number>} The available balance amount
|
|
26
26
|
*/
|
|
27
|
-
getBalance(
|
|
27
|
+
getBalance(props: {
|
|
28
|
+
accountNo: string;
|
|
29
|
+
}): Promise<number>;
|
|
28
30
|
/**
|
|
29
31
|
* Retrieves all wallets associated with the current context.
|
|
30
32
|
* @throws {Error} If the wallet fetch operation fails
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,cAAc,CAAC,OAAO,QAAQ,CAAC;IAC7D;;;;;OAKG;gBACS,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,CAAA;KAAE;IAOxD;;;;;OAKG;IACG,UAAU,
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,cAAc,CAAC,OAAO,QAAQ,CAAC;IAC7D;;;;;OAKG;gBACS,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,CAAA;KAAE;IAOxD;;;;;OAKG;IACG,UAAU,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAsB/D;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAUrC;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,KAAK,EAAE;QACL,KAAK,CAAC,EAAE;YAAE,SAAS,EAAE,IAAI,CAAC;YAAC,OAAO,EAAE,IAAI,CAAA;SAAE,CAAC;QAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GACA,OAAO,CAAC,oBAAoB,EAAE,CAAC;CA2BnC"}
|
|
@@ -30,7 +30,7 @@ class WalletRepo extends base_repository_js_1.BaseRepository {
|
|
|
30
30
|
* @throws {Error} If the balance fetch operation fails
|
|
31
31
|
* @returns {Promise<number>} The available balance amount
|
|
32
32
|
*/
|
|
33
|
-
async getBalance() {
|
|
33
|
+
async getBalance(props) {
|
|
34
34
|
const auth = this.getAuthForPermissionCheck();
|
|
35
35
|
const requirePerm = permission_js_1.Permissions.Wallet.ViewBalance;
|
|
36
36
|
if (!auth.checkPermission(requirePerm)) {
|
|
@@ -39,7 +39,9 @@ class WalletRepo extends base_repository_js_1.BaseRepository {
|
|
|
39
39
|
requiredPermissions: [requirePerm],
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
const result = await this.client.getBalance(
|
|
42
|
+
const result = await this.client.getBalance({
|
|
43
|
+
body: { accountNo: props.accountNo },
|
|
44
|
+
});
|
|
43
45
|
if (result.status === 201) {
|
|
44
46
|
return result.body.availableBalance;
|
|
45
47
|
}
|