@aboutcircles/sdk-rpc 0.1.27 → 0.1.29
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/client.d.ts.map +1 -1
- package/dist/client.js +20 -11
- package/dist/index.js +2 -2
- package/dist/methods/group.d.ts +30 -60
- package/dist/methods/group.d.ts.map +1 -1
- package/dist/methods/group.js +86 -160
- package/dist/methods/index.d.ts +1 -0
- package/dist/methods/index.d.ts.map +1 -1
- package/dist/methods/index.js +1 -0
- package/dist/methods/invitation.d.ts +99 -5
- package/dist/methods/invitation.d.ts.map +1 -1
- package/dist/methods/invitation.js +130 -164
- package/dist/methods/profile.d.ts +12 -4
- package/dist/methods/profile.d.ts.map +1 -1
- package/dist/methods/profile.js +16 -43
- package/dist/methods/query.d.ts +38 -9
- package/dist/methods/query.d.ts.map +1 -1
- package/dist/methods/query.js +38 -13
- package/dist/methods/sdk.d.ts +142 -0
- package/dist/methods/sdk.d.ts.map +1 -0
- package/dist/methods/sdk.js +165 -0
- package/dist/methods/token.d.ts +9 -15
- package/dist/methods/token.d.ts.map +1 -1
- package/dist/methods/token.js +14 -39
- package/dist/methods/transaction.d.ts +20 -21
- package/dist/methods/transaction.d.ts.map +1 -1
- package/dist/methods/transaction.js +32 -89
- package/dist/methods/trust.d.ts +30 -6
- package/dist/methods/trust.d.ts.map +1 -1
- package/dist/methods/trust.js +46 -50
- package/dist/pagedQuery.d.ts +7 -49
- package/dist/pagedQuery.d.ts.map +1 -1
- package/dist/pagedQuery.js +17 -146
- package/dist/rpc.d.ts +8 -3
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +14 -4
- package/dist/types.d.ts +4 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/methods/group.js
CHANGED
|
@@ -11,8 +11,8 @@ export class GroupMethods {
|
|
|
11
11
|
/**
|
|
12
12
|
* Find groups with optional filters
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Uses the native RPC method for efficient server-side filtering and pagination.
|
|
15
|
+
* Fetches all results using cursor-based pagination up to the specified limit.
|
|
16
16
|
*
|
|
17
17
|
* @param limit - Maximum number of groups to return (default: 50)
|
|
18
18
|
* @param params - Optional query parameters to filter groups
|
|
@@ -39,187 +39,78 @@ export class GroupMethods {
|
|
|
39
39
|
* });
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
async findGroups(limit = 50, params) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
results.push(...query.currentPage.results);
|
|
49
|
-
// If we have enough results, break
|
|
50
|
-
if (results.length >= limit) {
|
|
51
|
-
break;
|
|
42
|
+
async findGroups(limit = 50, params, cursor) {
|
|
43
|
+
const normalizedParams = params
|
|
44
|
+
? {
|
|
45
|
+
nameStartsWith: params.nameStartsWith,
|
|
46
|
+
symbolStartsWith: params.symbolStartsWith,
|
|
47
|
+
ownerIn: params.ownerIn?.map((owner) => normalizeAddress(owner)),
|
|
52
48
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
: undefined;
|
|
50
|
+
const response = await this.client.call('circles_findGroups', [limit, normalizedParams ?? null, cursor ?? null]);
|
|
51
|
+
const rows = checksumAddresses(response.results).map((row) => {
|
|
52
|
+
const enriched = row;
|
|
53
|
+
if (!enriched.owner && enriched.mint) {
|
|
54
|
+
return { ...enriched, owner: enriched.mint };
|
|
56
55
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return
|
|
56
|
+
return enriched;
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
hasMore: response.hasMore,
|
|
60
|
+
nextCursor: response.nextCursor,
|
|
61
|
+
results: rows,
|
|
62
|
+
};
|
|
60
63
|
}
|
|
61
64
|
/**
|
|
62
|
-
* Get group memberships for an avatar
|
|
65
|
+
* Get group memberships for an avatar
|
|
66
|
+
*
|
|
67
|
+
* Uses the native RPC method for efficient server-side queries.
|
|
68
|
+
* Fetches all results using cursor-based pagination up to the specified limit.
|
|
63
69
|
*
|
|
64
70
|
* @param avatar - Avatar address to query group memberships for
|
|
65
|
-
* @param limit -
|
|
66
|
-
* @
|
|
67
|
-
* @returns PagedQuery instance for iterating through memberships
|
|
71
|
+
* @param limit - Maximum number of memberships to return (default: 50)
|
|
72
|
+
* @returns Array of group membership rows
|
|
68
73
|
*
|
|
69
74
|
* @example
|
|
70
75
|
* ```typescript
|
|
71
|
-
* const
|
|
76
|
+
* const memberships = await rpc.group.getGroupMemberships(
|
|
72
77
|
* '0xde374ece6fa50e781e81aac78e811b33d16912c7',
|
|
73
78
|
* 50
|
|
74
79
|
* );
|
|
75
|
-
*
|
|
76
|
-
* console.log(query.currentPage.results);
|
|
80
|
+
* console.log(memberships);
|
|
77
81
|
* ```
|
|
78
82
|
*/
|
|
79
|
-
getGroupMemberships(avatar, limit = 50,
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
'blockNumber',
|
|
87
|
-
'timestamp',
|
|
88
|
-
'transactionIndex',
|
|
89
|
-
'logIndex',
|
|
90
|
-
'transactionHash',
|
|
91
|
-
'group',
|
|
92
|
-
'member',
|
|
93
|
-
'expiryTime',
|
|
94
|
-
],
|
|
95
|
-
filter: [
|
|
96
|
-
{
|
|
97
|
-
Type: 'FilterPredicate',
|
|
98
|
-
FilterType: 'Equals',
|
|
99
|
-
Column: 'member',
|
|
100
|
-
Value: normalized,
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
limit,
|
|
104
|
-
}, (row) => checksumAddresses(row));
|
|
83
|
+
async getGroupMemberships(avatar, limit = 50, cursor) {
|
|
84
|
+
const response = await this.client.call('circles_getGroupMemberships', [normalizeAddress(avatar), limit, cursor ?? null]);
|
|
85
|
+
return {
|
|
86
|
+
hasMore: response.hasMore,
|
|
87
|
+
nextCursor: response.nextCursor,
|
|
88
|
+
results: checksumAddresses(response.results),
|
|
89
|
+
};
|
|
105
90
|
}
|
|
106
91
|
/**
|
|
107
|
-
* Get
|
|
92
|
+
* Get members of a group
|
|
108
93
|
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
94
|
+
* Uses the native RPC method for efficient server-side queries.
|
|
95
|
+
* Fetches all results using cursor-based pagination up to the specified limit.
|
|
111
96
|
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* @param groupAddress - The address of the group token
|
|
117
|
-
* @param limit - Number of holders per page (default: 100)
|
|
118
|
-
* @returns PagedQuery instance for iterating through group token holders
|
|
97
|
+
* @param groupAddress - Group address to query members for
|
|
98
|
+
* @param limit - Maximum number of members to return (default: 100)
|
|
99
|
+
* @returns Array of group membership rows (members of the group)
|
|
119
100
|
*
|
|
120
101
|
* @example
|
|
121
102
|
* ```typescript
|
|
122
|
-
* const
|
|
123
|
-
*
|
|
124
|
-
* // Get first page (ordered by totalBalance DESC)
|
|
125
|
-
* await query.queryNextPage();
|
|
126
|
-
* console.log(query.currentPage.results[0]); // Holder with highest balance
|
|
127
|
-
*
|
|
128
|
-
* // Get next page if available
|
|
129
|
-
* if (query.currentPage.hasMore) {
|
|
130
|
-
* await query.queryNextPage();
|
|
131
|
-
* }
|
|
103
|
+
* const members = await rpc.group.getGroupMembers('0xGroupAddress...', 100);
|
|
104
|
+
* console.log(`Group has ${members.length} members`);
|
|
132
105
|
* ```
|
|
133
106
|
*/
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
cursorColumns: [
|
|
142
|
-
{
|
|
143
|
-
name: 'holder',
|
|
144
|
-
sortOrder: 'ASC', // Use holder for cursor-based pagination
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
orderColumns: [
|
|
148
|
-
{ Column: 'totalBalance', SortOrder: 'DESC' },
|
|
149
|
-
{ Column: 'holder', SortOrder: 'ASC' },
|
|
150
|
-
],
|
|
151
|
-
filter: [
|
|
152
|
-
{
|
|
153
|
-
Type: 'FilterPredicate',
|
|
154
|
-
FilterType: 'Equals',
|
|
155
|
-
Column: 'group',
|
|
156
|
-
Value: normalized,
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
limit,
|
|
160
|
-
rowTransformer: (row) => {
|
|
161
|
-
// Convert string values to bigint for specific fields
|
|
162
|
-
const transformed = {
|
|
163
|
-
...row,
|
|
164
|
-
totalBalance: BigInt(row.totalBalance),
|
|
165
|
-
demurragedTotalBalance: BigInt(row.demurragedTotalBalance),
|
|
166
|
-
};
|
|
167
|
-
return checksumAddresses(transformed);
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Get members of a group using cursor-based pagination
|
|
173
|
-
*
|
|
174
|
-
* Returns a PagedQuery instance that can be used to fetch members page by page
|
|
175
|
-
* using cursor-based pagination.
|
|
176
|
-
*
|
|
177
|
-
* @param groupAddress - The address of the group to query members for
|
|
178
|
-
* @param limit - Number of members per page (default: 100)
|
|
179
|
-
* @param sortOrder - Sort order for results (default: 'DESC')
|
|
180
|
-
* @returns PagedQuery instance for iterating through group members
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* ```typescript
|
|
184
|
-
* const query = rpc.group.getGroupMembers('0xGroupAddress...', 100);
|
|
185
|
-
*
|
|
186
|
-
* // Get first page
|
|
187
|
-
* await query.queryNextPage();
|
|
188
|
-
* console.log(query.currentPage.results);
|
|
189
|
-
*
|
|
190
|
-
* // Get next page if available
|
|
191
|
-
* if (query.currentPage.hasMore) {
|
|
192
|
-
* await query.queryNextPage();
|
|
193
|
-
* console.log(query.currentPage.results);
|
|
194
|
-
* }
|
|
195
|
-
* ```
|
|
196
|
-
*/
|
|
197
|
-
getGroupMembers(groupAddress, limit = 100, sortOrder = 'DESC') {
|
|
198
|
-
const normalized = normalizeAddress(groupAddress);
|
|
199
|
-
return new PagedQuery(this.client, {
|
|
200
|
-
namespace: 'V_CrcV2',
|
|
201
|
-
table: 'GroupMemberships',
|
|
202
|
-
sortOrder,
|
|
203
|
-
columns: [
|
|
204
|
-
'blockNumber',
|
|
205
|
-
'timestamp',
|
|
206
|
-
'transactionIndex',
|
|
207
|
-
'logIndex',
|
|
208
|
-
'transactionHash',
|
|
209
|
-
'group',
|
|
210
|
-
'member',
|
|
211
|
-
'expiryTime',
|
|
212
|
-
],
|
|
213
|
-
filter: [
|
|
214
|
-
{
|
|
215
|
-
Type: 'FilterPredicate',
|
|
216
|
-
FilterType: 'Equals',
|
|
217
|
-
Column: 'group',
|
|
218
|
-
Value: normalized,
|
|
219
|
-
},
|
|
220
|
-
],
|
|
221
|
-
limit,
|
|
222
|
-
}, (row) => checksumAddresses(row));
|
|
107
|
+
async getGroupMembers(groupAddress, limit = 100, cursor) {
|
|
108
|
+
const response = await this.client.call('circles_getGroupMembers', [normalizeAddress(groupAddress), limit, cursor ?? null]);
|
|
109
|
+
return {
|
|
110
|
+
hasMore: response.hasMore,
|
|
111
|
+
nextCursor: response.nextCursor,
|
|
112
|
+
results: checksumAddresses(response.results),
|
|
113
|
+
};
|
|
223
114
|
}
|
|
224
115
|
/**
|
|
225
116
|
* Get groups using cursor-based pagination
|
|
@@ -377,4 +268,39 @@ export class GroupMethods {
|
|
|
377
268
|
limit,
|
|
378
269
|
}, (row) => checksumAddresses(row));
|
|
379
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Get holders of a group token
|
|
273
|
+
*
|
|
274
|
+
* @param groupAddress - Group address (which is also the token address)
|
|
275
|
+
* @param limit - Maximum number of holders to return (default: 100)
|
|
276
|
+
* @returns PagedQuery instance for iterating through holders
|
|
277
|
+
*/
|
|
278
|
+
getGroupHolders(groupAddress, limit = 100) {
|
|
279
|
+
const normalized = normalizeAddress(groupAddress);
|
|
280
|
+
return new PagedQuery(this.client, {
|
|
281
|
+
namespace: 'V_Crc',
|
|
282
|
+
table: 'TokenBalances',
|
|
283
|
+
sortOrder: 'DESC',
|
|
284
|
+
columns: [
|
|
285
|
+
'blockNumber',
|
|
286
|
+
'timestamp',
|
|
287
|
+
'transactionIndex',
|
|
288
|
+
'logIndex',
|
|
289
|
+
'transactionHash',
|
|
290
|
+
'token',
|
|
291
|
+
'account',
|
|
292
|
+
'balance',
|
|
293
|
+
'lastChangedAt'
|
|
294
|
+
],
|
|
295
|
+
filter: [
|
|
296
|
+
{
|
|
297
|
+
Type: 'FilterPredicate',
|
|
298
|
+
FilterType: 'Equals',
|
|
299
|
+
Column: 'token',
|
|
300
|
+
Value: normalized,
|
|
301
|
+
}
|
|
302
|
+
],
|
|
303
|
+
limit,
|
|
304
|
+
}, (row) => checksumAddresses(row));
|
|
305
|
+
}
|
|
380
306
|
}
|
package/dist/methods/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export { TokenMethods } from './token.js';
|
|
|
8
8
|
export { InvitationMethods } from './invitation.js';
|
|
9
9
|
export { TransactionMethods } from './transaction.js';
|
|
10
10
|
export { GroupMethods } from './group.js';
|
|
11
|
+
export { SdkMethods } from './sdk.js';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/methods/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/methods/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/methods/index.js
CHANGED
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
import type { RpcClient } from '../client.js';
|
|
2
|
-
import type { Address, AvatarInfo } from '@aboutcircles/sdk-types';
|
|
2
|
+
import type { Address, AvatarInfo, ValidInvitersResponse, TrustInvitation, EscrowInvitation, AtScaleInvitation, InvitationOriginResponse, InvitationsFromResponse, AllInvitationsResponse } from '@aboutcircles/sdk-types';
|
|
3
3
|
/**
|
|
4
4
|
* Invitation RPC methods
|
|
5
|
+
*
|
|
6
|
+
* All methods delegate to dedicated RPC endpoints for server-side SQL optimization.
|
|
5
7
|
*/
|
|
6
8
|
export declare class InvitationMethods {
|
|
7
9
|
private client;
|
|
8
10
|
constructor(client: RpcClient);
|
|
9
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Get the invitation origin for an address — how they were invited to Circles
|
|
13
|
+
*
|
|
14
|
+
* @param address - The address of the invited avatar
|
|
15
|
+
* @returns Full invitation origin details or null if not registered
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const origin = await rpc.invitation.getInvitationOrigin('0xde374ece6fa50e781e81aac78e811b33d16912c7');
|
|
20
|
+
* console.log(origin?.invitationType); // 'v2_standard', 'v2_escrow', 'v2_at_scale', 'v1_signup'
|
|
21
|
+
* console.log(origin?.inviter); // '0x...' or null
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
getInvitationOrigin(address: Address): Promise<InvitationOriginResponse | null>;
|
|
10
25
|
/**
|
|
11
26
|
* Get the avatar that invited a specific avatar
|
|
12
27
|
*
|
|
28
|
+
* Uses `circles_getInvitationOrigin` for a single optimized query that checks
|
|
29
|
+
* all invitation mechanisms (at-scale, escrow, v2 standard, v1 signup).
|
|
30
|
+
*
|
|
13
31
|
* @param address - The address of the invited avatar
|
|
14
32
|
* @returns The address of the inviting avatar or undefined if not found
|
|
15
33
|
*
|
|
@@ -20,10 +38,22 @@ export declare class InvitationMethods {
|
|
|
20
38
|
* ```
|
|
21
39
|
*/
|
|
22
40
|
getInvitedBy(address: Address): Promise<Address | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* Get trust-based invitations (addresses that trust you with sufficient balance)
|
|
43
|
+
*
|
|
44
|
+
* Uses dedicated `circles_getTrustInvitations` endpoint.
|
|
45
|
+
*
|
|
46
|
+
* @param address - The address to check for trust invitations
|
|
47
|
+
* @param minimumBalance - Optional minimum balance threshold (as CRC string)
|
|
48
|
+
* @returns Array of trust invitations
|
|
49
|
+
*/
|
|
50
|
+
getTrustInvitations(address: Address, minimumBalance?: string): Promise<TrustInvitation[]>;
|
|
23
51
|
/**
|
|
24
52
|
* Get the list of avatars who have invited this avatar
|
|
25
53
|
* Checks v2 trust relations and validates that inviters have enough balance
|
|
26
54
|
*
|
|
55
|
+
* Uses the native RPC method for efficient server-side filtering and validation.
|
|
56
|
+
*
|
|
27
57
|
* @param address - The address to check for invitations
|
|
28
58
|
* @returns Array of avatar info for valid inviters
|
|
29
59
|
*
|
|
@@ -33,13 +63,23 @@ export declare class InvitationMethods {
|
|
|
33
63
|
* console.log(invitations); // Array of AvatarInfo
|
|
34
64
|
* ```
|
|
35
65
|
*/
|
|
36
|
-
getInvitations(address: Address): Promise<AvatarInfo[]>;
|
|
66
|
+
getInvitations(address: Address, minimumBalance?: string): Promise<AvatarInfo[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Fetch valid inviters along with balances and avatar info
|
|
69
|
+
*
|
|
70
|
+
* @param address - Address to find inviters for
|
|
71
|
+
* @param minimumBalance - Optional minimum balance to filter inviters
|
|
72
|
+
* @returns Valid inviters response as provided by the RPC host
|
|
73
|
+
*/
|
|
74
|
+
getValidInviters(address: Address, minimumBalance?: string): Promise<ValidInvitersResponse>;
|
|
37
75
|
/**
|
|
38
76
|
* Get the list of accounts that were invited by a specific avatar
|
|
39
77
|
*
|
|
78
|
+
* Uses dedicated `circles_getInvitationsFrom` endpoint with server-side SQL.
|
|
79
|
+
*
|
|
40
80
|
* @param address - The address of the inviter
|
|
41
81
|
* @param accepted - If true, returns accepted invitations; if false, returns pending invitations
|
|
42
|
-
* @returns
|
|
82
|
+
* @returns Enriched response with invited account info and avatar data
|
|
43
83
|
*
|
|
44
84
|
* @example
|
|
45
85
|
* ```typescript
|
|
@@ -48,14 +88,68 @@ export declare class InvitationMethods {
|
|
|
48
88
|
* '0xde374ece6fa50e781e81aac78e811b33d16912c7',
|
|
49
89
|
* true
|
|
50
90
|
* );
|
|
91
|
+
* console.log(accepted.results); // [{address, status: 'accepted', avatarInfo, ...}]
|
|
51
92
|
*
|
|
52
93
|
* // Get pending invitations
|
|
53
94
|
* const pending = await rpc.invitation.getInvitationsFrom(
|
|
54
95
|
* '0xde374ece6fa50e781e81aac78e811b33d16912c7',
|
|
55
96
|
* false
|
|
56
97
|
* );
|
|
98
|
+
* console.log(pending.results); // [{address, status: 'pending'}]
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
getInvitationsFrom(address: Address, accepted?: boolean): Promise<InvitationsFromResponse>;
|
|
102
|
+
/**
|
|
103
|
+
* Get escrow-based invitations for an address
|
|
104
|
+
*
|
|
105
|
+
* Uses dedicated `circles_getEscrowInvitations` endpoint which handles all filtering
|
|
106
|
+
* server-side (redeemed, revoked, refunded) in a single optimized SQL query.
|
|
107
|
+
*
|
|
108
|
+
* @param address - The address to check for escrow invitations
|
|
109
|
+
* @returns Array of active escrow invitations
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const escrowInvites = await rpc.invitation.getEscrowInvitations('0xde374ece6fa50e781e81aac78e811b33d16912c7');
|
|
114
|
+
* console.log(escrowInvites); // Array of EscrowInvitation
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
getEscrowInvitations(address: Address): Promise<EscrowInvitation[]>;
|
|
118
|
+
/**
|
|
119
|
+
* Get at-scale invitations for an address
|
|
120
|
+
*
|
|
121
|
+
* Uses dedicated `circles_getAtScaleInvitations` endpoint which checks for
|
|
122
|
+
* unclaimed pre-created accounts in a single optimized SQL query.
|
|
123
|
+
*
|
|
124
|
+
* @param address - The address to check for at-scale invitations
|
|
125
|
+
* @returns Array of at-scale invitations (unclaimed pre-created accounts)
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* const atScaleInvites = await rpc.invitation.getAtScaleInvitations('0xde374ece6fa50e781e81aac78e811b33d16912c7');
|
|
130
|
+
* console.log(atScaleInvites); // Array of AtScaleInvitation
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
getAtScaleInvitations(address: Address): Promise<AtScaleInvitation[]>;
|
|
134
|
+
/**
|
|
135
|
+
* Get all invitations from all sources (trust, escrow, at-scale)
|
|
136
|
+
* This is the recommended method to use for getting a complete view of available invitations
|
|
137
|
+
*
|
|
138
|
+
* Uses the optimized `circles_getAllInvitations` RPC method which fetches all invitation
|
|
139
|
+
* types in a single round-trip with server-side SQL JOINs for efficiency.
|
|
140
|
+
*
|
|
141
|
+
* @param address - The address to check for invitations
|
|
142
|
+
* @param minimumBalance - Optional minimum balance for trust-based invitations
|
|
143
|
+
* @returns All invitations from all sources
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* const allInvites = await rpc.invitation.getAllInvitations('0xde374ece6fa50e781e81aac78e811b33d16912c7');
|
|
148
|
+
* console.log(`Trust invites: ${allInvites.trustInvitations.length}`);
|
|
149
|
+
* console.log(`Escrow invites: ${allInvites.escrowInvitations.length}`);
|
|
150
|
+
* console.log(`At-scale invites: ${allInvites.atScaleInvitations.length}`);
|
|
57
151
|
* ```
|
|
58
152
|
*/
|
|
59
|
-
|
|
153
|
+
getAllInvitations(address: Address, minimumBalance?: string): Promise<AllInvitationsResponse>;
|
|
60
154
|
}
|
|
61
155
|
//# sourceMappingURL=invitation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation.d.ts","sourceRoot":"","sources":["../../src/methods/invitation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"invitation.d.ts","sourceRoot":"","sources":["../../src/methods/invitation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAGjC;;;;GAIG;AACH,qBAAa,iBAAiB;IAChB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,SAAS;IAErC;;;;;;;;;;;;OAYG;IACG,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;IASrF;;;;;;;;;;;;;;OAcG;IACG,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAQlE;;;;;;;;OAQG;IACG,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAShG;;;;;;;;;;;;;;OAcG;IACG,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAUtF;;;;;;OAMG;IACG,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAUjG;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,GAAE,OAAe,GAAG,OAAO,CAAC,uBAAuB,CAAC;IASvG;;;;;;;;;;;;;;OAcG;IACG,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IASzE;;;;;;;;;;;;;;OAcG;IACG,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAS3E;;;;;;;;;;;;;;;;;;OAkBG;IACG,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAWpG"}
|