zano_web3 10.1.0 → 10.2.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/README.md +17 -142
- package/package.json +2 -5
- package/web/dist/constants/common/index.d.ts +4 -0
- package/web/dist/constants/common/index.js +12 -0
- package/web/dist/constants/common/index.js.map +1 -0
- package/web/dist/constants/index.d.ts +1 -0
- package/web/dist/constants/index.js +2 -0
- package/web/dist/constants/index.js.map +1 -0
- package/web/dist/index.d.ts +1 -0
- package/web/dist/index.js +1 -0
- package/web/dist/index.js.map +1 -1
- package/web/dist/types/params/companion-requests/accept-ionic-swap/index.d.ts +3 -0
- package/web/dist/types/params/companion-requests/accept-ionic-swap/index.js +2 -0
- package/web/dist/types/params/companion-requests/accept-ionic-swap/index.js.map +1 -0
- package/web/dist/types/params/companion-requests/add-whitelist-asset/index.d.ts +3 -0
- package/web/dist/types/params/companion-requests/add-whitelist-asset/index.js +2 -0
- package/web/dist/types/params/companion-requests/add-whitelist-asset/index.js.map +1 -0
- package/web/dist/types/params/companion-requests/burn-asset/index.d.ts +28 -0
- package/web/dist/types/params/companion-requests/burn-asset/index.js +2 -0
- package/web/dist/types/params/companion-requests/burn-asset/index.js.map +1 -0
- package/web/dist/types/params/companion-requests/create-alias/index.d.ts +3 -0
- package/web/dist/types/params/companion-requests/create-alias/index.js +2 -0
- package/web/dist/types/params/companion-requests/create-alias/index.js.map +1 -0
- package/web/dist/types/params/companion-requests/get-address-by-alias/index.d.ts +3 -0
- package/web/dist/types/params/companion-requests/get-address-by-alias/index.js +2 -0
- package/web/dist/types/params/companion-requests/get-address-by-alias/index.js.map +1 -0
- package/web/dist/types/params/companion-requests/get-ionic-swap-info/index.d.ts +3 -0
- package/web/dist/types/params/companion-requests/get-ionic-swap-info/index.js +2 -0
- package/web/dist/types/params/companion-requests/get-ionic-swap-info/index.js.map +1 -0
- package/web/dist/types/params/companion-requests/index.d.ts +4 -1
- package/web/dist/types/params/companion-requests/initialize-ionic-swap/index.d.ts +14 -0
- package/web/dist/types/params/companion-requests/initialize-ionic-swap/index.js +2 -0
- package/web/dist/types/params/companion-requests/initialize-ionic-swap/index.js.map +1 -0
- package/web/dist/types/params/companion-requests/request-message-sign/index.d.ts +3 -0
- package/web/dist/types/params/companion-requests/request-message-sign/index.js +2 -0
- package/web/dist/types/params/companion-requests/request-message-sign/index.js.map +1 -0
- package/web/dist/types/params/companion-requests/request-permissions/index.d.ts +7 -2
- package/web/dist/types/params/companion-requests/transfer/index.d.ts +22 -0
- package/web/dist/types/params/companion-requests/transfer/index.js +2 -0
- package/web/dist/types/params/companion-requests/transfer/index.js.map +1 -0
- package/web/dist/types/responses/companion-methods/accept-ionic-swap/index.d.ts +24 -0
- package/web/dist/types/responses/companion-methods/accept-ionic-swap/index.js +21 -0
- package/web/dist/types/responses/companion-methods/accept-ionic-swap/index.js.map +1 -0
- package/web/dist/types/responses/companion-methods/add-whitelist-asset/index.d.ts +48 -0
- package/web/dist/types/responses/companion-methods/add-whitelist-asset/index.js +40 -0
- package/web/dist/types/responses/companion-methods/add-whitelist-asset/index.js.map +1 -0
- package/web/dist/types/responses/companion-methods/burn-asset/index.d.ts +24 -0
- package/web/dist/types/responses/companion-methods/burn-asset/index.js +21 -0
- package/web/dist/types/responses/companion-methods/burn-asset/index.js.map +1 -0
- package/web/dist/types/responses/companion-methods/create-alias/index.d.ts +14 -1
- package/web/dist/types/responses/companion-methods/create-alias/index.js +12 -1
- package/web/dist/types/responses/companion-methods/create-alias/index.js.map +1 -1
- package/web/dist/types/responses/companion-methods/get-address-by-alias/index.d.ts +10 -2
- package/web/dist/types/responses/companion-methods/get-address-by-alias/index.js +7 -1
- package/web/dist/types/responses/companion-methods/get-address-by-alias/index.js.map +1 -1
- package/web/dist/types/responses/companion-methods/get-ionic-swap-info/index.d.ts +49 -0
- package/web/dist/types/responses/companion-methods/get-ionic-swap-info/index.js +32 -0
- package/web/dist/types/responses/companion-methods/get-ionic-swap-info/index.js.map +1 -0
- package/web/dist/types/responses/companion-methods/get-permissions/index.d.ts +21 -0
- package/web/dist/types/responses/companion-methods/get-permissions/index.js +10 -0
- package/web/dist/types/responses/companion-methods/get-permissions/index.js.map +1 -0
- package/web/dist/types/responses/companion-methods/get-wallet-balance/index.d.ts +73 -0
- package/web/dist/types/responses/companion-methods/get-wallet-balance/index.js +44 -0
- package/web/dist/types/responses/companion-methods/get-wallet-balance/index.js.map +1 -0
- package/web/dist/types/responses/companion-methods/get-whitelist/index.d.ts +29 -0
- package/web/dist/types/responses/companion-methods/get-whitelist/index.js +17 -0
- package/web/dist/types/responses/companion-methods/get-whitelist/index.js.map +1 -0
- package/web/dist/types/responses/companion-methods/index.d.ts +9 -0
- package/web/dist/types/responses/companion-methods/initialize-ionic-swap/index.d.ts +22 -0
- package/web/dist/types/responses/companion-methods/initialize-ionic-swap/index.js +21 -0
- package/web/dist/types/responses/companion-methods/initialize-ionic-swap/index.js.map +1 -0
- package/web/dist/types/responses/companion-methods/request-message-sign/index.d.ts +6 -2
- package/web/dist/types/responses/companion-methods/request-message-sign/index.js +13 -6
- package/web/dist/types/responses/companion-methods/request-message-sign/index.js.map +1 -1
- package/web/dist/types/responses/companion-methods/transfer/index.d.ts +35 -0
- package/web/dist/types/responses/companion-methods/transfer/index.js +25 -0
- package/web/dist/types/responses/companion-methods/transfer/index.js.map +1 -0
- package/web/dist/zano-wallet.d.ts +43 -6
- package/web/dist/zano-wallet.js +359 -14
- package/web/dist/zano-wallet.js.map +1 -1
- package/web/src/constants/common/index.ts +15 -0
- package/web/src/constants/index.ts +5 -0
- package/web/src/index.ts +1 -0
- package/web/src/types/params/companion-requests/accept-ionic-swap/index.ts +3 -0
- package/web/src/types/params/companion-requests/add-whitelist-asset/index.ts +3 -0
- package/web/src/types/params/companion-requests/burn-asset/index.ts +31 -0
- package/web/src/types/params/companion-requests/create-alias/index.ts +3 -0
- package/web/src/types/params/companion-requests/get-address-by-alias/index.ts +3 -0
- package/web/src/types/params/companion-requests/get-ionic-swap-info/index.ts +3 -0
- package/web/src/types/params/companion-requests/index.ts +4 -1
- package/web/src/types/params/companion-requests/initialize-ionic-swap/index.ts +15 -0
- package/web/src/types/params/companion-requests/request-message-sign/index.ts +3 -0
- package/web/src/types/params/companion-requests/request-permissions/index.ts +9 -2
- package/web/src/types/params/companion-requests/transfer/index.ts +17 -0
- package/web/src/types/responses/companion-methods/accept-ionic-swap/index.ts +33 -0
- package/web/src/types/responses/companion-methods/add-whitelist-asset/index.ts +53 -0
- package/web/src/types/responses/companion-methods/burn-asset/index.ts +33 -0
- package/web/src/types/responses/companion-methods/create-alias/index.ts +15 -1
- package/web/src/types/responses/companion-methods/get-address-by-alias/index.ts +13 -2
- package/web/src/types/responses/companion-methods/get-ionic-swap-info/index.ts +45 -0
- package/web/src/types/responses/companion-methods/get-permissions/index.ts +24 -0
- package/web/src/types/responses/companion-methods/get-wallet-balance/index.ts +57 -0
- package/web/src/types/responses/companion-methods/get-whitelist/index.ts +30 -0
- package/web/src/types/responses/companion-methods/index.ts +10 -1
- package/web/src/types/responses/companion-methods/initialize-ionic-swap/index.ts +31 -0
- package/web/src/types/responses/companion-methods/request-message-sign/index.ts +13 -6
- package/web/src/types/responses/companion-methods/transfer/index.ts +38 -0
- package/web/src/zano-wallet.ts +470 -15
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const acceptIonicSwapCompanionResponseSchema = z.union([
|
|
4
|
+
z.object({
|
|
5
|
+
data: z.union([
|
|
6
|
+
z.object({
|
|
7
|
+
result: z.object({
|
|
8
|
+
result_tx_id: z.string(),
|
|
9
|
+
})
|
|
10
|
+
}),
|
|
11
|
+
z.object({
|
|
12
|
+
error: z.object({
|
|
13
|
+
code: z.number().optional(),
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
]),
|
|
17
|
+
}),
|
|
18
|
+
z.object({
|
|
19
|
+
error: z.string(),
|
|
20
|
+
})
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
export type AcceptIonicSwapCompanionResponse = z.infer<typeof acceptIonicSwapCompanionResponseSchema>;
|
|
24
|
+
|
|
25
|
+
export type AcceptIonicSwapResponse = {
|
|
26
|
+
success: true;
|
|
27
|
+
data: {
|
|
28
|
+
result_tx_id: string;
|
|
29
|
+
}
|
|
30
|
+
} | {
|
|
31
|
+
success: false;
|
|
32
|
+
error: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
const addWhitelistAssetCompanionResponseAssetSchema = z.object({
|
|
4
|
+
current_supply: z.union([z.string(), z.number()]),
|
|
5
|
+
decimal_point: z.number(),
|
|
6
|
+
full_name: z.string(),
|
|
7
|
+
hidden_supply: z.boolean(),
|
|
8
|
+
meta_info: z.string(),
|
|
9
|
+
owner: z.string(),
|
|
10
|
+
owner_eth_pub_key: z.string(),
|
|
11
|
+
ticker: z.string(),
|
|
12
|
+
total_max_supply: z.union([z.string(), z.number()])
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type AddWhitelistAssetResponseAsset = z.infer<typeof addWhitelistAssetCompanionResponseAssetSchema>;
|
|
16
|
+
|
|
17
|
+
export const addWhitelistAssetCompanionResponseSchema = z.union([
|
|
18
|
+
z.object({
|
|
19
|
+
data: z.union([
|
|
20
|
+
z.object({
|
|
21
|
+
result: z.union([
|
|
22
|
+
z.object({
|
|
23
|
+
asset_descriptor: addWhitelistAssetCompanionResponseAssetSchema,
|
|
24
|
+
status: z.literal('OK'),
|
|
25
|
+
}),
|
|
26
|
+
z.object({
|
|
27
|
+
status: z.string().refine((value) => value !== 'OK', {
|
|
28
|
+
message: 'Status must not be OK',
|
|
29
|
+
}),
|
|
30
|
+
})
|
|
31
|
+
])
|
|
32
|
+
}),
|
|
33
|
+
z.object({
|
|
34
|
+
error: z.object({
|
|
35
|
+
code: z.number().optional(),
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
])
|
|
39
|
+
}),
|
|
40
|
+
z.object({
|
|
41
|
+
error: z.string(),
|
|
42
|
+
})
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
export type AddWhitelistAssetCompanionResponse = z.infer<typeof addWhitelistAssetCompanionResponseSchema>;
|
|
46
|
+
|
|
47
|
+
export type AddWhitelistAssetResponse = {
|
|
48
|
+
success: true;
|
|
49
|
+
data: AddWhitelistAssetResponseAsset;
|
|
50
|
+
} | {
|
|
51
|
+
success: false;
|
|
52
|
+
error: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const burnAssetCompanionResponseScheme = z.union([
|
|
4
|
+
z.object({
|
|
5
|
+
data: z.union([
|
|
6
|
+
z.object({
|
|
7
|
+
result: z.object({
|
|
8
|
+
tx_id: z.string(),
|
|
9
|
+
})
|
|
10
|
+
}),
|
|
11
|
+
z.object({
|
|
12
|
+
error: z.object({
|
|
13
|
+
code: z.number().optional(),
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
]),
|
|
17
|
+
}),
|
|
18
|
+
z.object({
|
|
19
|
+
error: z.string(),
|
|
20
|
+
})
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
export type BurnAssetCompanionResponse = z.infer<typeof burnAssetCompanionResponseScheme>;
|
|
24
|
+
|
|
25
|
+
export type BurnAssetResponse = {
|
|
26
|
+
success: true;
|
|
27
|
+
data: {
|
|
28
|
+
tx_id: string;
|
|
29
|
+
}
|
|
30
|
+
} | {
|
|
31
|
+
success: false;
|
|
32
|
+
error: string;
|
|
33
|
+
}
|
|
@@ -2,7 +2,18 @@ import z from 'zod';
|
|
|
2
2
|
|
|
3
3
|
export const createAliasCompanionResponseSchema = z.union([
|
|
4
4
|
z.object({
|
|
5
|
-
data: z.
|
|
5
|
+
data: z.object({
|
|
6
|
+
result: z.object({
|
|
7
|
+
tx_id: z.string(),
|
|
8
|
+
})
|
|
9
|
+
}),
|
|
10
|
+
}),
|
|
11
|
+
z.object({
|
|
12
|
+
data: z.object({
|
|
13
|
+
error: z.object({
|
|
14
|
+
code: z.number().optional(),
|
|
15
|
+
})
|
|
16
|
+
}),
|
|
6
17
|
}),
|
|
7
18
|
z.object({
|
|
8
19
|
error: z.string(),
|
|
@@ -13,6 +24,9 @@ export type CreateAliasCompanionResponse = z.infer<typeof createAliasCompanionRe
|
|
|
13
24
|
|
|
14
25
|
export type CreateAliasResponse = {
|
|
15
26
|
success: true;
|
|
27
|
+
data: {
|
|
28
|
+
tx_id: string;
|
|
29
|
+
};
|
|
16
30
|
} | {
|
|
17
31
|
success: false;
|
|
18
32
|
error: string;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
|
|
3
3
|
export const getAddressByAliasCompanionResponseSchema = z.union([
|
|
4
|
-
z.
|
|
4
|
+
z.object({
|
|
5
|
+
address: z.string(),
|
|
6
|
+
comment: z.string(),
|
|
7
|
+
tracking_key: z.string(),
|
|
8
|
+
}),
|
|
9
|
+
|
|
10
|
+
// Error responses
|
|
11
|
+
z.literal(''),
|
|
5
12
|
z.object({
|
|
6
13
|
error: z.string(),
|
|
7
14
|
})
|
|
@@ -11,7 +18,11 @@ export type GetAddressByAliasCompanionResponse = z.infer<typeof getAddressByAlia
|
|
|
11
18
|
|
|
12
19
|
export type GetAddressByAliasResponse = {
|
|
13
20
|
success: true;
|
|
14
|
-
data:
|
|
21
|
+
data: {
|
|
22
|
+
address: string;
|
|
23
|
+
comment: string;
|
|
24
|
+
tracking_key: string;
|
|
25
|
+
};
|
|
15
26
|
} | {
|
|
16
27
|
success: false;
|
|
17
28
|
error: string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
const getIonicSwapProposalInfoCompanionResponseInfoSchema = z.object({
|
|
4
|
+
proposal: z.object({
|
|
5
|
+
fee_paid_by_a: z.union([z.string(), z.number()]),
|
|
6
|
+
to_finalizer: z.array(z.object({
|
|
7
|
+
amount: z.union([z.string(), z.number()]),
|
|
8
|
+
asset_id: z.string(),
|
|
9
|
+
})),
|
|
10
|
+
to_initiator: z.array(z.object({
|
|
11
|
+
amount: z.union([z.string(), z.number()]),
|
|
12
|
+
asset_id: z.string(),
|
|
13
|
+
})),
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
export const getIonicSwapProposalInfoCompanionResponseSchema = z.union([
|
|
18
|
+
z.object({
|
|
19
|
+
data: z.object({
|
|
20
|
+
result: getIonicSwapProposalInfoCompanionResponseInfoSchema,
|
|
21
|
+
})
|
|
22
|
+
}),
|
|
23
|
+
z.object({
|
|
24
|
+
data: z.object({
|
|
25
|
+
error: z.object({
|
|
26
|
+
code: z.number().optional(),
|
|
27
|
+
})
|
|
28
|
+
}),
|
|
29
|
+
}),
|
|
30
|
+
z.object({
|
|
31
|
+
error: z.string(),
|
|
32
|
+
})
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
export type GetIonicSwapProposalInfoResponseInfo = z.infer<typeof getIonicSwapProposalInfoCompanionResponseInfoSchema>;
|
|
36
|
+
|
|
37
|
+
export type GetIonicSwapProposalInfoCompanionResponse = z.infer<typeof getIonicSwapProposalInfoCompanionResponseSchema>;
|
|
38
|
+
|
|
39
|
+
export type GetIonicSwapProposalInfoResponse = {
|
|
40
|
+
success: true;
|
|
41
|
+
data: GetIonicSwapProposalInfoResponseInfo;
|
|
42
|
+
} | {
|
|
43
|
+
success: false;
|
|
44
|
+
error: string;
|
|
45
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const getPermissionsCompanionResponseSchema = z.union([
|
|
4
|
+
z.object({
|
|
5
|
+
data: z.array(z.enum(['general', 'balance', 'history']))
|
|
6
|
+
}),
|
|
7
|
+
z.object({
|
|
8
|
+
error: z.string(),
|
|
9
|
+
})
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
export type GetPermissionsCompanionResponse = z.infer<typeof getPermissionsCompanionResponseSchema>;
|
|
13
|
+
|
|
14
|
+
export type GetPermissionsResponsePermission = 'general' | 'balance' | 'history';
|
|
15
|
+
|
|
16
|
+
export type GetPermissionsResponse = {
|
|
17
|
+
success: true;
|
|
18
|
+
data: {
|
|
19
|
+
permissions: GetPermissionsResponsePermission[];
|
|
20
|
+
};
|
|
21
|
+
} | {
|
|
22
|
+
success: false;
|
|
23
|
+
error: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
const getWalletBalanceCompanionResponseBalanceSchema = z.object({
|
|
4
|
+
balance: z.union([z.string(), z.number()]),
|
|
5
|
+
unlocked_balance: z.union([z.string(), z.number()]),
|
|
6
|
+
balances: z.array(z.object({
|
|
7
|
+
asset_info: z.object({
|
|
8
|
+
asset_id: z.string(),
|
|
9
|
+
current_supply: z.union([z.string(), z.number()]),
|
|
10
|
+
decimal_point: z.number(),
|
|
11
|
+
full_name: z.string(),
|
|
12
|
+
hidden_supply: z.custom<boolean>(),
|
|
13
|
+
meta_info: z.custom<string>(),
|
|
14
|
+
owner: z.custom<string>(),
|
|
15
|
+
owner_eth_pub_key: z.custom<string | undefined>(),
|
|
16
|
+
ticker: z.string(),
|
|
17
|
+
total_max_supply: z.union([z.string(), z.number()]),
|
|
18
|
+
}),
|
|
19
|
+
awaiting_in: z.custom<number | string>(),
|
|
20
|
+
awaiting_out: z.custom<number | string>(),
|
|
21
|
+
outs_amount_max: z.custom<number | string>(),
|
|
22
|
+
outs_amount_min: z.custom<number | string>(),
|
|
23
|
+
outs_count: z.custom<number | string>(),
|
|
24
|
+
total: z.union([z.string(), z.number()]),
|
|
25
|
+
unlocked: z.union([z.string(), z.number()]),
|
|
26
|
+
})),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export type GetWalletBalanceResponseBalance = z.infer<typeof getWalletBalanceCompanionResponseBalanceSchema>;
|
|
30
|
+
|
|
31
|
+
export const getWalletBalanceCompanionResponseSchema = z.union([
|
|
32
|
+
z.object({
|
|
33
|
+
data: z.object({
|
|
34
|
+
result: getWalletBalanceCompanionResponseBalanceSchema,
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
37
|
+
z.object({
|
|
38
|
+
data: z.object({
|
|
39
|
+
error: z.object({
|
|
40
|
+
code: z.number().optional(),
|
|
41
|
+
})
|
|
42
|
+
}),
|
|
43
|
+
}),
|
|
44
|
+
z.object({
|
|
45
|
+
error: z.string(),
|
|
46
|
+
})
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
export type GetWalletBalanceCompanionResponse = z.infer<typeof getWalletBalanceCompanionResponseSchema>;
|
|
50
|
+
|
|
51
|
+
export type GetWalletBalanceResponse = {
|
|
52
|
+
success: true;
|
|
53
|
+
data: GetWalletBalanceResponseBalance;
|
|
54
|
+
} | {
|
|
55
|
+
success: false;
|
|
56
|
+
error: string;
|
|
57
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
const getWhitelistCompanionResponseItemSchema = z.object({
|
|
4
|
+
asset_id: z.string(),
|
|
5
|
+
ticker: z.string(),
|
|
6
|
+
full_name: z.string(),
|
|
7
|
+
decimal_point: z.number(),
|
|
8
|
+
logo: z.string().optional(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type GetWhitelistResponseItem = z.infer<typeof getWhitelistCompanionResponseItemSchema>;
|
|
12
|
+
|
|
13
|
+
export const getWhitelistCompanionResponseSchema = z.union([
|
|
14
|
+
z.object({
|
|
15
|
+
data: z.array(getWhitelistCompanionResponseItemSchema),
|
|
16
|
+
}),
|
|
17
|
+
z.object({
|
|
18
|
+
error: z.string(),
|
|
19
|
+
})
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
export type GetWhitelistCompanionResponse = z.infer<typeof getWhitelistCompanionResponseSchema>;
|
|
23
|
+
|
|
24
|
+
export type GetWhitelistResponse = {
|
|
25
|
+
success: true;
|
|
26
|
+
data: GetWhitelistResponseItem[];
|
|
27
|
+
} | {
|
|
28
|
+
success: false;
|
|
29
|
+
error: string;
|
|
30
|
+
}
|
|
@@ -2,4 +2,13 @@ export { RequestPermissionsResponse } from './request-permissions';
|
|
|
2
2
|
export { GetWalletDataResponse, GetWalletDataResponseWallet } from './get-wallet-data';
|
|
3
3
|
export { GetAddressByAliasResponse } from './get-address-by-alias';
|
|
4
4
|
export { CreateAliasResponse } from './create-alias';
|
|
5
|
-
export { RequestMessageSignResponse, RequestMessageSignData } from './request-message-sign';
|
|
5
|
+
export { RequestMessageSignResponse, RequestMessageSignData } from './request-message-sign';
|
|
6
|
+
export { InitializeIonicSwapResponse } from './initialize-ionic-swap';
|
|
7
|
+
export { AcceptIonicSwapResponse } from './accept-ionic-swap';
|
|
8
|
+
export { GetPermissionsResponse, GetPermissionsResponsePermission } from './get-permissions';
|
|
9
|
+
export { GetWalletBalanceResponse, GetWalletBalanceResponseBalance } from './get-wallet-balance';
|
|
10
|
+
export { TransferResponse, TransferResponseInfo } from './transfer';
|
|
11
|
+
export { GetIonicSwapProposalInfoResponse, GetIonicSwapProposalInfoResponseInfo } from './get-ionic-swap-info';
|
|
12
|
+
export { GetWhitelistResponse, GetWhitelistResponseItem } from './get-whitelist';
|
|
13
|
+
export { AddWhitelistAssetResponse, AddWhitelistAssetResponseAsset } from './add-whitelist-asset';
|
|
14
|
+
export { BurnAssetResponse } from './burn-asset';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const initializeIonicSwapCompanionResponseSchema = z.union([
|
|
4
|
+
z.object({
|
|
5
|
+
data: z.union([
|
|
6
|
+
z.object({
|
|
7
|
+
result: z.object({
|
|
8
|
+
hex_raw_proposal: z.string(),
|
|
9
|
+
})
|
|
10
|
+
}),
|
|
11
|
+
z.object({
|
|
12
|
+
error: z.object({
|
|
13
|
+
code: z.number().optional(),
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
]),
|
|
17
|
+
}),
|
|
18
|
+
z.object({
|
|
19
|
+
error: z.string(),
|
|
20
|
+
})
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
export type InitializeIonicSwapCompanionResponse = z.infer<typeof initializeIonicSwapCompanionResponseSchema>;
|
|
24
|
+
|
|
25
|
+
export type InitializeIonicSwapResponse = {
|
|
26
|
+
success: true;
|
|
27
|
+
data: string;
|
|
28
|
+
} | {
|
|
29
|
+
success: false;
|
|
30
|
+
error: string;
|
|
31
|
+
}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
|
|
3
|
-
const requestMessageSignCompanionResponseDataSchema = z.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})
|
|
3
|
+
const requestMessageSignCompanionResponseDataSchema = z.union([
|
|
4
|
+
z.object({
|
|
5
|
+
result: z.object({
|
|
6
|
+
pkey: z.string(),
|
|
7
|
+
sig: z.string(),
|
|
8
|
+
})
|
|
9
|
+
}),
|
|
10
|
+
z.object({
|
|
11
|
+
error: z.object({
|
|
12
|
+
code: z.number().optional(),
|
|
13
|
+
})
|
|
14
|
+
}),
|
|
15
|
+
])
|
|
9
16
|
|
|
10
17
|
export const requestMessageSignCompanionResponseSchema = z.union([
|
|
11
18
|
z.object({
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
const transferCompanionResponseInfoSchema = z.object({
|
|
4
|
+
tx_hash: z.string(),
|
|
5
|
+
tx_size: z.union([z.number(), z.string()]),
|
|
6
|
+
tx_unsigned_hex: z.custom<string>(),
|
|
7
|
+
used_out_ids: z.custom<number[]>(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type TransferResponseInfo = z.infer<typeof transferCompanionResponseInfoSchema>;
|
|
11
|
+
|
|
12
|
+
export const transferCompanionResponseSchema = z.union([
|
|
13
|
+
z.object({
|
|
14
|
+
data: z.object({
|
|
15
|
+
result: transferCompanionResponseInfoSchema,
|
|
16
|
+
}),
|
|
17
|
+
}),
|
|
18
|
+
z.object({
|
|
19
|
+
data: z.object({
|
|
20
|
+
error: z.object({
|
|
21
|
+
code: z.number().optional(),
|
|
22
|
+
})
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
25
|
+
z.object({
|
|
26
|
+
error: z.string(),
|
|
27
|
+
})
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
export type TransferCompanionResponse = z.infer<typeof transferCompanionResponseSchema>;
|
|
31
|
+
|
|
32
|
+
export type TransferResponse = {
|
|
33
|
+
success: true;
|
|
34
|
+
data: TransferResponseInfo;
|
|
35
|
+
} | {
|
|
36
|
+
success: false;
|
|
37
|
+
error: string;
|
|
38
|
+
}
|