@aboutcircles/sdk-types 0.1.24 → 0.1.25
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/rows.d.ts +21 -0
- package/dist/rows.d.ts.map +1 -0
- package/dist/rows.js +1 -0
- package/dist/rpc-responses.d.ts +165 -0
- package/dist/rpc-responses.d.ts.map +1 -0
- package/dist/rpc-responses.js +1 -0
- package/dist/transaction.d.ts +34 -0
- package/dist/transaction.d.ts.map +1 -0
- package/dist/transaction.js +1 -0
- package/package.json +1 -1
package/dist/rows.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Address, Hex } from './base';
|
|
2
|
+
export interface TransactionHistoryRow {
|
|
3
|
+
blockNumber: number;
|
|
4
|
+
timestamp: number;
|
|
5
|
+
transactionIndex: number;
|
|
6
|
+
logIndex: number;
|
|
7
|
+
transactionHash: Hex;
|
|
8
|
+
version: number;
|
|
9
|
+
from: Address;
|
|
10
|
+
to: Address;
|
|
11
|
+
operator?: Address;
|
|
12
|
+
id?: string;
|
|
13
|
+
value: string;
|
|
14
|
+
circles: string;
|
|
15
|
+
attoCircles: string;
|
|
16
|
+
crc: string;
|
|
17
|
+
attoCrc: string;
|
|
18
|
+
staticCircles: string;
|
|
19
|
+
staticAttoCircles: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../src/rows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,GAAG,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;CAC3B"}
|
package/dist/rows.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { Address } from './base';
|
|
2
|
+
import type { AvatarInfo, Profile } from './avatar';
|
|
3
|
+
/**
|
|
4
|
+
* Generic cursor-based paged response (mirrors Circles RPC PagedResponse)
|
|
5
|
+
*/
|
|
6
|
+
export interface PagedResponse<TResult> {
|
|
7
|
+
results: TResult[];
|
|
8
|
+
hasMore: boolean;
|
|
9
|
+
nextCursor: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface TrustStats {
|
|
12
|
+
trustsCount: number;
|
|
13
|
+
trustedByCount: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ProfileView {
|
|
16
|
+
address: Address;
|
|
17
|
+
avatarInfo?: AvatarInfo;
|
|
18
|
+
profile?: Profile;
|
|
19
|
+
trustStats: TrustStats;
|
|
20
|
+
v1Balance?: string;
|
|
21
|
+
v2Balance?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TrustNetworkSummary {
|
|
24
|
+
address: Address;
|
|
25
|
+
directTrustsCount: number;
|
|
26
|
+
directTrustedByCount: number;
|
|
27
|
+
mutualTrustsCount: number;
|
|
28
|
+
mutualTrusts: Address[];
|
|
29
|
+
networkReach: number;
|
|
30
|
+
}
|
|
31
|
+
export interface TrustRelationInfo {
|
|
32
|
+
address: Address;
|
|
33
|
+
avatarInfo?: AvatarInfo;
|
|
34
|
+
relationType: 'mutual' | 'trusts' | 'trustedBy';
|
|
35
|
+
}
|
|
36
|
+
export interface AggregatedTrustRelationsResponse {
|
|
37
|
+
address: Address;
|
|
38
|
+
mutual: TrustRelationInfo[];
|
|
39
|
+
trusts: TrustRelationInfo[];
|
|
40
|
+
trustedBy: TrustRelationInfo[];
|
|
41
|
+
}
|
|
42
|
+
export interface InviterInfo {
|
|
43
|
+
address: Address;
|
|
44
|
+
balance: string;
|
|
45
|
+
avatarInfo?: AvatarInfo;
|
|
46
|
+
}
|
|
47
|
+
export interface ValidInvitersResponse {
|
|
48
|
+
address: Address;
|
|
49
|
+
validInviters: InviterInfo[];
|
|
50
|
+
}
|
|
51
|
+
export interface ParticipantInfo {
|
|
52
|
+
avatarInfo?: AvatarInfo;
|
|
53
|
+
profile?: Profile | null;
|
|
54
|
+
}
|
|
55
|
+
export interface EnrichedTransactionEvent {
|
|
56
|
+
blockNumber: number;
|
|
57
|
+
timestamp: number;
|
|
58
|
+
transactionIndex: number;
|
|
59
|
+
logIndex: number;
|
|
60
|
+
transactionHash: string;
|
|
61
|
+
event: Record<string, unknown>;
|
|
62
|
+
}
|
|
63
|
+
export interface EnrichedTransaction {
|
|
64
|
+
blockNumber: number;
|
|
65
|
+
transactionHash: string;
|
|
66
|
+
transactionIndex: number;
|
|
67
|
+
logIndex: number;
|
|
68
|
+
event: Record<string, unknown>;
|
|
69
|
+
participants: Record<Address, ParticipantInfo>;
|
|
70
|
+
}
|
|
71
|
+
export interface ProfileSearchResponse {
|
|
72
|
+
query: string;
|
|
73
|
+
searchType: 'address' | 'text';
|
|
74
|
+
results: Profile[];
|
|
75
|
+
totalCount: number;
|
|
76
|
+
}
|
|
77
|
+
export interface EnrichedTransaction {
|
|
78
|
+
blockNumber: number;
|
|
79
|
+
timestamp: number;
|
|
80
|
+
transactionIndex: number;
|
|
81
|
+
logIndex: number;
|
|
82
|
+
transactionHash: string;
|
|
83
|
+
version: number;
|
|
84
|
+
from: Address;
|
|
85
|
+
to: Address;
|
|
86
|
+
operator?: Address;
|
|
87
|
+
id?: string;
|
|
88
|
+
value: string;
|
|
89
|
+
circles: string;
|
|
90
|
+
attoCircles: string;
|
|
91
|
+
crc: string;
|
|
92
|
+
attoCrc: string;
|
|
93
|
+
staticCircles: string;
|
|
94
|
+
staticAttoCircles: string;
|
|
95
|
+
fromProfile?: Profile;
|
|
96
|
+
toProfile?: Profile;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Invitation source types - indicates how the invitation was created
|
|
100
|
+
*/
|
|
101
|
+
export type InvitationSource = 'trust' | 'escrow' | 'atScale';
|
|
102
|
+
/**
|
|
103
|
+
* Base invitation info with source tracking
|
|
104
|
+
*/
|
|
105
|
+
export interface InvitationInfo {
|
|
106
|
+
/** The inviter's address */
|
|
107
|
+
address: Address;
|
|
108
|
+
/** How the invitation was created */
|
|
109
|
+
source: InvitationSource;
|
|
110
|
+
/** Avatar info for the inviter (if available) */
|
|
111
|
+
avatarInfo?: AvatarInfo;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Trust-based invitation - someone trusts you and has sufficient balance
|
|
115
|
+
*/
|
|
116
|
+
export interface TrustInvitation extends InvitationInfo {
|
|
117
|
+
source: 'trust';
|
|
118
|
+
/** Inviter's current CRC balance */
|
|
119
|
+
balance: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Escrow-based invitation - CRC tokens escrowed for you
|
|
123
|
+
*/
|
|
124
|
+
export interface EscrowInvitation extends InvitationInfo {
|
|
125
|
+
source: 'escrow';
|
|
126
|
+
/** Amount escrowed (in atto-circles) */
|
|
127
|
+
escrowedAmount: string;
|
|
128
|
+
/** Number of days the escrow has been active */
|
|
129
|
+
escrowDays: number;
|
|
130
|
+
/** Block number when escrow was created */
|
|
131
|
+
blockNumber: number;
|
|
132
|
+
/** Timestamp when escrow was created */
|
|
133
|
+
timestamp: number;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* At-scale invitation - pre-created account via referral system
|
|
137
|
+
*/
|
|
138
|
+
export interface AtScaleInvitation extends InvitationInfo {
|
|
139
|
+
source: 'atScale';
|
|
140
|
+
/** The original inviter who funded the invitation */
|
|
141
|
+
originInviter?: Address;
|
|
142
|
+
/** Block number when account was created */
|
|
143
|
+
blockNumber: number;
|
|
144
|
+
/** Timestamp when account was created */
|
|
145
|
+
timestamp: number;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Union type for all invitation types
|
|
149
|
+
*/
|
|
150
|
+
export type Invitation = TrustInvitation | EscrowInvitation | AtScaleInvitation;
|
|
151
|
+
/**
|
|
152
|
+
* Response containing all available invitations from all sources
|
|
153
|
+
*/
|
|
154
|
+
export interface AllInvitationsResponse {
|
|
155
|
+
address: Address;
|
|
156
|
+
/** Trust-based invitations (people who trust you with sufficient balance) */
|
|
157
|
+
trustInvitations: TrustInvitation[];
|
|
158
|
+
/** Escrow-based invitations (CRC escrowed for you) */
|
|
159
|
+
escrowInvitations: EscrowInvitation[];
|
|
160
|
+
/** At-scale invitations (pre-created accounts) */
|
|
161
|
+
atScaleInvitations: AtScaleInvitation[];
|
|
162
|
+
/** All invitations combined and sorted */
|
|
163
|
+
all: Invitation[];
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=rpc-responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-responses.d.ts","sourceRoot":"","sources":["../src/rpc-responses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,OAAO;IACpC,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG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iB,EAAE,gBAAgB,EAAE,CAAC;IACtC,kDAAkD;IAClD,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC,0CAA0C;IAC1C,GAAG,EAAE,UAAU,EAAE,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Address } from './base';
|
|
2
|
+
/**
|
|
3
|
+
* Transaction history types
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Transaction history row (base data from RPC)
|
|
7
|
+
* Might include conversions between different circle representations
|
|
8
|
+
*/
|
|
9
|
+
export interface TransactionHistoryRow {
|
|
10
|
+
blockNumber: number;
|
|
11
|
+
timestamp: number;
|
|
12
|
+
transactionIndex: number;
|
|
13
|
+
logIndex: number;
|
|
14
|
+
transactionHash: string;
|
|
15
|
+
version: number;
|
|
16
|
+
from: Address;
|
|
17
|
+
to: Address;
|
|
18
|
+
id: string;
|
|
19
|
+
tokenAddress: Address;
|
|
20
|
+
value: string;
|
|
21
|
+
/** Human-readable circle amount (demurraged) */
|
|
22
|
+
circles?: number;
|
|
23
|
+
/** Atto-circles (demurraged, 18 decimals) */
|
|
24
|
+
attoCircles?: bigint;
|
|
25
|
+
/** Static circles (inflationary, human-readable) */
|
|
26
|
+
staticCircles?: number;
|
|
27
|
+
/** Atto-static circles (inflationary, 18 decimals) */
|
|
28
|
+
staticAttoCircles?: bigint;
|
|
29
|
+
/** Time Circles (CRC) human-readable */
|
|
30
|
+
crc?: number;
|
|
31
|
+
/** Atto-CRC (18 decimals) */
|
|
32
|
+
attoCrc?: bigint;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sDAAsD;IACtD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|