Skip to content

Commit 274074a

Browse files
committed
Added user address and profile methods
1 parent fbc5b41 commit 274074a

File tree

15 files changed

+354
-1
lines changed

15 files changed

+354
-1
lines changed

src/models/App.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export interface PublicApp {
2929
* App image
3030
*
3131
* @format URL
32+
* @example 'https://example.com/image.webp'
3233
*/
3334
image: string | null;
3435

@@ -41,6 +42,7 @@ export interface PublicApp {
4142
* App URL
4243
*
4344
* @format URL
45+
* @example 'https://example.com'
4446
*/
4547
url: string;
4648
}

src/models/Product.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export default interface Product {
4040
* Product image
4141
*
4242
* @format URL
43+
* @example 'https://example.com/image.webp'
4344
*/
4445
image: string | null;
4546

src/models/UserAddress.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
export enum UserAddressType {
2+
/**
3+
* Bitcoin
4+
*/
5+
BTC = 'BTC',
6+
7+
/**
8+
* Ethereum-like (Ethereum, Binance Smart Chain, Polygon, etc.)
9+
*/
10+
EVM = 'EVM',
11+
12+
/**
13+
* Litecoin
14+
*/
15+
LTC = 'LTC',
16+
17+
/**
18+
* Tron
19+
*/
20+
TRX = 'TRX'
21+
}
22+
23+
export default interface UserAddress {
24+
/**
25+
* Address ID
26+
*
27+
* @example '0660bfde-e576-467a-af63-69edaf85f8c2'
28+
*/
29+
id: string;
30+
31+
/**
32+
* Address name
33+
*
34+
* @example 'Main Ethereum wallet'
35+
*/
36+
name: string;
37+
38+
/**
39+
* Address
40+
*
41+
* @example '0x41ce73496136A0072013B9187550e30841eDeD74'
42+
*/
43+
address: string;
44+
45+
/**
46+
* Network type
47+
*
48+
* @example 'EVM'
49+
*/
50+
type: UserAddressType;
51+
52+
/**
53+
* Address creation timestamp
54+
*
55+
* @example '2024-07-31T00:48:53Z'
56+
*/
57+
createdAt: string;
58+
59+
/**
60+
* Address update timestamp
61+
*
62+
* @example '2024-07-31T00:49:28Z'
63+
*/
64+
updatedAt: string;
65+
}

src/models/UserProfile.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
export default interface UserProfile {
2+
/**
3+
* Profile name (title)
4+
*
5+
* @example 'Crypto trader, influencer'
6+
*/
7+
name: string | null;
8+
9+
/**
10+
* Profile description (bio)
11+
*
12+
* @example 'Experienced crypto trader specializing in market analysis, DeFi strategies, and risk management. Passionate about leveraging blockchain technology to capitalize on emerging trends and maximize returns.'
13+
*/
14+
description: string | null;
15+
16+
/**
17+
* Profile image URL
18+
*
19+
* @format URL
20+
* @example 'https://example.com/image.webp'
21+
*/
22+
image: string | null;
23+
24+
/**
25+
* Username
26+
*
27+
* @example 'john_doe'
28+
*/
29+
username: string | null;
30+
31+
/**
32+
* Username in Telegram (without starting `@`)
33+
*
34+
* @example 'john_doe'
35+
*/
36+
usernameTelegram: string | null;
37+
38+
/**
39+
* Username in X (without starting `@`)
40+
*
41+
* @example 'john_doe'
42+
*/
43+
usernameX: string | null;
44+
45+
/**
46+
* URL of user's website
47+
*
48+
* @format URL
49+
* @example 'https://example.com'
50+
*/
51+
websiteUrl: string | null;
52+
}

src/models/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ export { default as Network } from './Network';
66
export { default as PAT } from './PAT';
77
export { default as Product } from './Product';
88
export { default as Transaction } from './Transaction';
9+
export { default as UserAddress } from './UserAddress';
10+
export { default as UserProfile } from './UserProfile';
911
export * from './App';
1012
export * from './Invoice';
1113
export * from './PAT';
1214
export * from './Transaction';
15+
export * from './UserAddress';
1316
export * from './WebhookEvent';

src/requests/UserAddress.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { UserAddressType } from '../models';
2+
3+
export type UserAddressCreateRequest = {
4+
/**
5+
* Address ID
6+
*
7+
* @example '0660bfde-e576-467a-af63-69edaf85f8c2'
8+
*/
9+
id: string;
10+
11+
/**
12+
* Address name
13+
*
14+
* @example 'Main Ethereum wallet'
15+
*/
16+
name: string;
17+
18+
/**
19+
* Address
20+
*
21+
* @example '0x41ce73496136A0072013B9187550e30841eDeD74'
22+
*/
23+
address: string;
24+
25+
/**
26+
* Network type
27+
*
28+
* @example 'EVM'
29+
*/
30+
type: UserAddressType;
31+
};
32+
33+
export type UserAddressUpdateRequest = {
34+
/**
35+
* Address name
36+
*
37+
* @example 'Main Ethereum wallet'
38+
*/
39+
name?: string;
40+
};

src/requests/UserProfile.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
export type UserProfileUpdateRequest = {
2+
/**
3+
* Profile name (title)
4+
*
5+
* @example 'Crypto trader, influencer'
6+
*/
7+
name?: string | null;
8+
9+
/**
10+
* Profile description (bio)
11+
*
12+
* @example 'Experienced crypto trader specializing in market analysis, DeFi strategies, and risk management. Passionate about leveraging blockchain technology to capitalize on emerging trends and maximize returns.'
13+
*/
14+
description?: string | null;
15+
16+
/**
17+
* Profile image URL
18+
*
19+
* @format URL
20+
* @example 'https://example.com/image.webp'
21+
*/
22+
image?: string | null;
23+
24+
/**
25+
* Username
26+
*
27+
* @example 'john_doe'
28+
*/
29+
username?: string | null;
30+
31+
/**
32+
* Username in Telegram (without starting `@`)
33+
*
34+
* @example 'john_doe'
35+
*/
36+
usernameTelegram?: string | null;
37+
38+
/**
39+
* Username in X (without starting `@`)
40+
*
41+
* @example 'john_doe'
42+
*/
43+
usernameX?: string | null;
44+
45+
/**
46+
* URL of user's website
47+
*
48+
* @format URL
49+
* @example 'https://example.com'
50+
*/
51+
websiteUrl?: string | null;
52+
};

src/requests/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ export * from './Cryptocurrency';
44
export * from './Invoice';
55
export * from './PAT';
66
export * from './Transaction';
7+
export * from './UserAddress';
78
export * from './UserInvoice';
9+
export * from './UserProfile';

src/responses/UserAddress.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export type UserAddressCreateErrors = {
2+
name?: 'required' | 'ascii' | 'max';
3+
address?: 'required' | 'alphanum' | 'invalid';
4+
type?: 'required' | 'oneof';
5+
};
6+
7+
export type UserAddressUpdateErrors = {
8+
name?: 'ascii' | 'max';
9+
};

src/responses/UserProfile.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export type UserProfileUpdateErrors = {
2+
name?: 'ascii' | 'max';
3+
description?: 'ascii' | 'max';
4+
image?: 'ascii' | 'max' | 'invalid';
5+
username?: 'alphanum' | 'max' | 'taken';
6+
usernameTelegram?: 'username_telegram';
7+
usernameX?: 'username_x';
8+
websiteUrl?: 'http_url' | 'max';
9+
};

0 commit comments

Comments
 (0)