@aboutcircles/sdk 0.1.9 → 0.1.11

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/Sdk.d.ts CHANGED
@@ -63,18 +63,15 @@ export declare class Sdk {
63
63
  * Register as a human in the Circles ecosystem
64
64
  *
65
65
  * This function:
66
- * 1. Checks for pending invitations from inviters in the InvitationEscrow
67
- * 2. If invitations exist, redeems one to claim escrowed tokens
68
- * 3. Otherwise, checks if the specified inviter has enough unwrapped CRC
69
- * 4. Creates and uploads profile data to IPFS
70
- * 5. Registers the human with the profile CID
71
- * 6. Returns a HumanAvatar instance for the registered account
66
+ * 1. Creates and uploads profile data to IPFS
67
+ * 2. Registers the human with the profile CID
68
+ * 3. Returns a HumanAvatar instance for the registered account
72
69
  *
73
70
  * Requirements:
74
71
  * - Contract runner must be configured to execute transactions
75
- * - Either: pending invitations from inviters, OR inviter has 96+ CRC unwrapped
72
+ * - An inviter address must be provided
76
73
  *
77
- * @param inviter Address of the inviting avatar (fallback if no invitations found)
74
+ * @param inviter Address of the inviting avatar
78
75
  * @param profile Profile data with name, description, etc.
79
76
  * @returns HumanAvatar instance for the newly registered human
80
77
  *
package/dist/Sdk.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Sdk.d.ts","sourceRoot":"","sources":["../src/Sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,cAAc,EACd,OAAO,EAEP,YAAY,EACZ,SAAS,EAEV,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAiB,IAAI,EAAkC,MAAM,wBAAwB,CAAC;AAE7F,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAI7E,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,KAAG,OAAO,CAAC,OAAO,CAAC;QAIhE;;;;;;;;;;;;;;;;;;;WAmBG;mCAEa,OAAO,UACd,MAAM,cACF,SAAS;MAItB;IAEF;;OAEG;IACH,SAAgB,MAAM;QACpB;;;;WAIG;0BACqB,OAAO,KAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;QAIhE;;;;;;;;;;;;;;;;;;;;;;;;;;;WA2BG;mCAEa,OAAO,UACd,MAAM,cACF,KAAK,GAAG,MAAM;QAK3B;;;;;;;;;;;;;;;;;;;WAmBG;sCACiC,OAAO,KAAG,OAAO,CAAC,YAAY,EAAE,CAAC;QAcrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA6BG;mCACwB,OAAO,UAAS,MAAM,KAAS,UAAU,CAAC,mBAAmB,CAAC;MAGzF;CACH"}
package/dist/Sdk.js CHANGED
@@ -120,18 +120,15 @@ export class Sdk {
120
120
  * Register as a human in the Circles ecosystem
121
121
  *
122
122
  * This function:
123
- * 1. Checks for pending invitations from inviters in the InvitationEscrow
124
- * 2. If invitations exist, redeems one to claim escrowed tokens
125
- * 3. Otherwise, checks if the specified inviter has enough unwrapped CRC
126
- * 4. Creates and uploads profile data to IPFS
127
- * 5. Registers the human with the profile CID
128
- * 6. Returns a HumanAvatar instance for the registered account
123
+ * 1. Creates and uploads profile data to IPFS
124
+ * 2. Registers the human with the profile CID
125
+ * 3. Returns a HumanAvatar instance for the registered account
129
126
  *
130
127
  * Requirements:
131
128
  * - Contract runner must be configured to execute transactions
132
- * - Either: pending invitations from inviters, OR inviter has 96+ CRC unwrapped
129
+ * - An inviter address must be provided
133
130
  *
134
- * @param inviter Address of the inviting avatar (fallback if no invitations found)
131
+ * @param inviter Address of the inviting avatar
135
132
  * @param profile Profile data with name, description, etc.
136
133
  * @returns HumanAvatar instance for the newly registered human
137
134
  *
@@ -149,28 +146,7 @@ export class Sdk {
149
146
  }
150
147
  const contractRunner = this.contractRunner;
151
148
  const senderAddress = this.senderAddress;
152
- // List of transactions to execute
153
- const transactions = [];
154
- // Step 1: Check for pending invitations in the InvitationEscrow
155
- const inviters = await this.core.invitationEscrow.getInviters(senderAddress);
156
- if (inviters.length > 0) {
157
- // Redeem the invitation from the first available inviter
158
- const redeemTx = this.core.invitationEscrow.redeemInvitation(inviters[0]);
159
- transactions.push(redeemTx);
160
- }
161
- else {
162
- // No invitations found, check if inviter has enough unwrapped CRC
163
- // Minimum required: 96 CRC (after demurrage it becomes valid amount)
164
- const minRequiredCRC = BigInt(96e18); // 96 CRC in atto-circles
165
- // Get the token ID for the inviter's personal token
166
- const tokenId = await this.core.hubV2.toTokenId(inviter);
167
- // Check balance at the Inviter address
168
- const balance = await this.core.hubV2.balanceOf(inviter, tokenId);
169
- if (balance < minRequiredCRC) {
170
- throw SdkError.insufficientBalance('96 CRC', `${Number(balance) / 1e18} CRC`, 'unwrapped CRC');
171
- }
172
- }
173
- // Step 2: Create and upload profile to IPFS
149
+ // Step 1: Create and upload profile to IPFS
174
150
  let profileCid;
175
151
  if (typeof profile === 'string') {
176
152
  // Profile is already a CID
@@ -182,12 +158,11 @@ export class Sdk {
182
158
  }
183
159
  // Convert CID to metadata digest hex (format expected by registerHuman)
184
160
  const metadataDigest = cidV0ToHex(profileCid);
185
- // Step 3: Call registerHuman with profile data
161
+ // Step 2: Call registerHuman with profile data
186
162
  const registerTx = this.core.hubV2.registerHuman(inviter, metadataDigest);
187
- transactions.push(registerTx);
188
- // Step 4: Execute all transactions
189
- await contractRunner.sendTransaction(transactions);
190
- // Step 5: Return a HumanAvatar instance for the newly registered account
163
+ // Step 3: Execute the transaction
164
+ await contractRunner.sendTransaction([registerTx]);
165
+ // Step 4: Return a HumanAvatar instance for the newly registered account
191
166
  const avatarInfo = await this.rpc.avatar.getAvatarInfo(senderAddress);
192
167
  return new HumanAvatar(senderAddress, this.core, contractRunner, avatarInfo // @todo remove any
193
168
  );
@@ -1,7 +1,8 @@
1
- import type { Address, AvatarRow, ContractRunner, TokenBalanceRow, GroupMembershipRow, GroupRow } from '@aboutcircles/sdk-types';
1
+ import type { Address, AvatarRow, ContractRunner, TokenBalanceRow, GroupMembershipRow, GroupRow, TransactionRequest } from '@aboutcircles/sdk-types';
2
2
  import type { TransactionReceipt, Hex } from 'viem';
3
3
  import type { Core } from '@aboutcircles/sdk-core';
4
4
  import { CommonAvatar, type PathfindingOptions } from './CommonAvatar';
5
+ import { type ProxyInviter } from '@aboutcircles/sdk-invitations';
5
6
  /**
6
7
  * HumanAvatar class implementation
7
8
  * Provides a simplified, user-friendly wrapper around Circles protocol for human avatars
@@ -51,163 +52,114 @@ export declare class HumanAvatar extends CommonAvatar {
51
52
  */
52
53
  replenish: (options?: PathfindingOptions) => Promise<TransactionReceipt>;
53
54
  };
54
- readonly invite: {
55
+ readonly invitation: {
55
56
  /**
56
- * Invite someone to Circles by escrowing 100 CRC tokens
57
+ * Get a referral code for inviting a new user who doesn't have a Safe wallet yet
57
58
  *
58
- * This batches two transactions atomically:
59
- * 1. Establishes trust with the invitee (with indefinite expiry)
60
- * 2. Transfers 100 of your personal CRC tokens to the InvitationEscrow contract
59
+ * This function:
60
+ * 1. Generates a new private key and signer address for the invitee
61
+ * 2. Finds proxy inviters (intermediaries in trust graph)
62
+ * 3. Builds transaction batch to transfer 96 CRC to the invitation module
63
+ * 4. Saves the referral data to the backend
64
+ * 5. Returns transactions and the generated private key
61
65
  *
62
- * The tokens are held in escrow until the invitee redeems the invitation by registering.
66
+ * The private key should be shared with the invitee to claim their account.
63
67
  *
64
68
  * Requirements:
65
- * - You must have at least 100 CRC available
66
- * - Invitee must not be already registered in Circles
67
- * - You can only have one active invitation per invitee
68
- *
69
- * @param invitee The address to invite
70
- * @returns Transaction response
71
- *
72
- * @example
73
- * ```typescript
74
- * // Invite someone with 100 CRC (automatically establishes trust)
75
- * await avatar.invite.send('0x123...');
76
- * ```
77
- */
78
- send: (invitee: Address) => Promise<TransactionReceipt>;
79
- /**
80
- * Revoke a previously sent invitation
69
+ * - You must have at least 96 CRC available (directly or via proxy inviters)
70
+ * - Referrals service must be configured
81
71
  *
82
- * This returns the escrowed tokens (with demurrage applied) back to you
83
- * as wrapped ERC20 tokens.
84
- *
85
- * @param invitee The address whose invitation to revoke
86
- * @returns Transaction response
72
+ * @returns Object containing transactions to execute and the private key to share
87
73
  *
88
74
  * @example
89
75
  * ```typescript
90
- * await avatar.invite.revoke('0x123...');
76
+ * const { transactions, privateKey } = await avatar.invitation.getReferralCode();
77
+ * // Execute transactions
78
+ * await avatar.runner.sendTransaction(transactions);
79
+ * // Share privateKey with invitee
91
80
  * ```
92
81
  */
93
- revoke: (invitee: Address) => Promise<TransactionReceipt>;
82
+ getReferralCode: () => Promise<{
83
+ transactions: TransactionRequest[];
84
+ privateKey: `0x${string}`;
85
+ }>;
94
86
  /**
95
- * Revoke all active invitations at once
87
+ * Invite a user who already has a Safe wallet but is not yet registered in Circles
96
88
  *
97
- * This returns all escrowed tokens (with demurrage applied) back to you
98
- * as wrapped ERC20 tokens in a single transaction.
89
+ * Use this when inviting someone who has an existing Safe wallet but is not
90
+ * yet registered in Circles Hub.
99
91
  *
100
- * @returns Transaction response
92
+ * @param invitee Address of the invitee (must have existing Safe wallet, NOT registered in Circles)
93
+ * @returns Array of transactions to execute
101
94
  *
102
95
  * @example
103
96
  * ```typescript
104
- * await avatar.invite.revokeAll();
97
+ * const transactions = await avatar.invitation.invite('0xInviteeAddress');
98
+ * await avatar.runner.sendTransaction(transactions);
105
99
  * ```
106
100
  */
107
- revokeAll: () => Promise<TransactionReceipt>;
101
+ invite: (invitee: Address) => Promise<TransactionRequest[]>;
108
102
  /**
109
- * Redeem an invitation received from an inviter
103
+ * Get proxy inviters who can facilitate invitations
110
104
  *
111
- * This claims the escrowed tokens from a specific inviter and refunds
112
- * all other inviters' escrows back to them.
105
+ * Proxy inviters are addresses that:
106
+ * - Trust this avatar (or have mutual trust)
107
+ * - Are trusted by the invitation module
108
+ * - Have sufficient balance to cover invitation fees (96 CRC per invite)
113
109
  *
114
- * @param inviter The address of the inviter whose invitation to redeem
115
- * @returns Transaction response
110
+ * @returns Array of proxy inviters with their addresses and possible invite counts
116
111
  *
117
112
  * @example
118
113
  * ```typescript
119
- * // Get all inviters first
120
- * const inviters = await avatar.invite.getInviters();
121
- *
122
- * // Redeem invitation from the first inviter
123
- * await avatar.invite.redeem(inviters[0]);
124
- * ```
125
- */
126
- redeem: (inviter: Address) => Promise<TransactionReceipt>;
127
- /**
128
- * Get all addresses that have sent invitations to you
129
- *
130
- * @returns Array of inviter addresses
131
- *
132
- * @example
133
- * ```typescript
134
- * const inviters = await avatar.invite.getInviters();
135
- * console.log(`You have ${inviters.length} pending invitations`);
114
+ * const proxyInviters = await avatar.invitation.getProxyInviters();
115
+ * proxyInviters.forEach(inviter => {
116
+ * console.log(`${inviter.address}: can invite ${inviter.possibleInvites} people`);
117
+ * });
136
118
  * ```
137
119
  */
138
- getInviters: () => Promise<Address[]>;
120
+ getProxyInviters: () => Promise<ProxyInviter[]>;
139
121
  /**
140
- * Get all addresses you have invited
122
+ * Find a path from this avatar to the invitation module
141
123
  *
142
- * @returns Array of invitee addresses
124
+ * @param proxyInviterAddress Optional specific proxy inviter to route through
125
+ * @returns PathfindingResult containing the transfer path
143
126
  *
144
127
  * @example
145
128
  * ```typescript
146
- * const invitees = await avatar.invite.getInvitees();
147
- * console.log(`You have invited ${invitees.length} people`);
129
+ * const path = await avatar.invitation.findInvitePath();
130
+ * console.log('Max flow:', path.maxFlow);
148
131
  * ```
149
132
  */
150
- getInvitees: () => Promise<Address[]>;
133
+ findInvitePath: (proxyInviterAddress?: Address) => Promise<import("@aboutcircles/sdk-types").PathfindingResult>;
151
134
  /**
152
- * Get the escrowed amount and days since escrow for a specific invitation
135
+ * Compute the deterministic Safe address for a given signer
153
136
  *
154
- * The amount returned has demurrage applied, so it decreases over time.
137
+ * Uses CREATE2 to predict the Safe address without deployment.
155
138
  *
156
- * @param inviter The inviter address (when checking invitations you received)
157
- * @param invitee The invitee address (when checking invitations you sent)
158
- * @returns Object with escrowedAmount (in atto-circles) and days since escrow
139
+ * @param signer The signer public address
140
+ * @returns The deterministic Safe address
159
141
  *
160
142
  * @example
161
143
  * ```typescript
162
- * // Check an invitation you sent
163
- * const { escrowedAmount, days_ } = await avatar.invite.getEscrowedAmount(
164
- * avatar.address,
165
- * '0xinvitee...'
166
- * );
167
- * console.log(`Escrowed: ${CirclesConverter.attoCirclesToCircles(escrowedAmount)} CRC`);
168
- * console.log(`Days since escrow: ${days_}`);
169
- *
170
- * // Check an invitation you received
171
- * const { escrowedAmount, days_ } = await avatar.invite.getEscrowedAmount(
172
- * '0xinviter...',
173
- * avatar.address
174
- * );
144
+ * const safeAddress = avatar.invitation.computeAddress('0xSignerAddress');
175
145
  * ```
176
146
  */
177
- getEscrowedAmount: (inviter: Address, invitee: Address) => Promise<import("@aboutcircles/sdk-types").EscrowedAmountAndDays>;
147
+ computeAddress: (signer: Address) => Address;
178
148
  /**
179
- * Generate new invitations and return associated secrets and signer addresses
180
- *
181
- * This function:
182
- * 1. Calls invitationFarm.claimInvites() to get invitation IDs via eth_call
183
- * 2. Generates random secrets for each invitation
184
- * 3. Derives signer addresses from the secrets using ECDSA
185
- * 4. Batches the claimInvites write call with safeBatchTransferFrom to transfer
186
- * invitation tokens (96 CRC each) to the invitation module
187
- * 5. Returns the list of secrets and corresponding signers
188
- *
189
- * The data field in the batch transfer contains the count of generated secrets,
190
- * which the contract uses to validate the transfer.
191
- *
192
- * @param numberOfInvites The number of invitations to generate
193
- * @returns Promise containing arrays of secrets and signers for each generated invitation
149
+ * Generate new invitations using the InvitationFarm
194
150
  *
195
- * @throws {SdkError} If the transaction fails or invitations cannot be claimed
151
+ * @param count Number of invitations to generate
152
+ * @returns Promise containing secrets, signers, and transaction receipt
196
153
  *
197
154
  * @example
198
155
  * ```typescript
199
- * // Generate 5 invitations
200
- * const result = await avatar.invite.generateInvites(5n);
201
- *
202
- * console.log('Generated invitations:');
203
- * result.secrets.forEach((secret, index) => {
204
- * console.log(`Invitation ${index + 1}:`);
205
- * console.log(` Secret: ${secret}`);
206
- * console.log(` Signer: ${result.signers[index]}`);
156
+ * const result = await avatar.invitation.generateInvites(5);
157
+ * result.secrets.forEach((secret, i) => {
158
+ * console.log(`Invite ${i + 1}: ${result.signers[i]}`);
207
159
  * });
208
160
  * ```
209
161
  */
210
- generateInvites: (numberOfInvites: bigint) => Promise<{
162
+ generateInvites: (count: number) => Promise<{
211
163
  secrets: Hex[];
212
164
  signers: Address[];
213
165
  transactionReceipt: TransactionReceipt;
@@ -1 +1 @@
1
- {"version":3,"file":"HumanAvatar.d.ts","sourceRoot":"","sources":["../../src/avatars/HumanAvatar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EACT,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,QAAQ,EAET,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAOnD,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEvE;;;;;;GAMG;AACH,qBAAa,WAAY,SAAQ,YAAY;gBAEzC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,cAAc,CAAC,EAAE,cAAc,EAC/B,UAAU,CAAC,EAAE,SAAS;IASxB,SAAgB,QAAQ;wBACF,OAAO,CAAC,MAAM,CAAC;gCAIP,OAAO,CAAC,eAAe,EAAE,CAAC;8BAI5B,OAAO,CAAC,MAAM,CAAC;QAIzC;;;;;;;;;;;;;WAaG;wCAEmC,kBAAkB,KAAG,OAAO,CAAC,MAAM,CAAC;QAiB1E;;;;;;;;;;;;;;;;;;WAkBG;8BACyB,kBAAkB,KAAG,OAAO,CAAC,kBAAkB,CAAC;MAqB5E;IAWF,SAAgB,MAAM;QACpB;;;;;;;;;;;;;;;;;;;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