rwa-tokenized-sdk 0.1.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.
@@ -0,0 +1,280 @@
1
+ import type { ParsedRWAPropertyInfo, LaunchPropertyParams, RWASDKConfig, LaunchPropertyResult } from "../types";
2
+ /**
3
+ * RWA Factory Client
4
+ *
5
+ * Usage:
6
+ * ```typescript
7
+ * import { createRWAClient } from '@synq/sdk'
8
+ *
9
+ * const rwa = createRWAClient({
10
+ * factoryAddress: '0x...',
11
+ * chainId: 5001
12
+ * })
13
+ *
14
+ * // Launch a property
15
+ * const result = await rwa.launchProperty(params, signer)
16
+ *
17
+ * // Get all properties
18
+ * const properties = await rwa.getAllProperties(provider)
19
+ * ```
20
+ */
21
+ export declare function createRWAClient(config: RWASDKConfig): {
22
+ /**
23
+ * Launch a new RWA property
24
+ *
25
+ * @param params Property launch parameters
26
+ * @param signerOrProvider Signer (for write) or Provider (for read)
27
+ * @returns Transaction hash and property address
28
+ */
29
+ launchProperty(params: LaunchPropertyParams, signerOrProvider: any): Promise<LaunchPropertyResult>;
30
+ /**
31
+ * Get all property addresses
32
+ */
33
+ getAllProperties(provider: any): Promise<string[]>;
34
+ /**
35
+ * Get total number of properties
36
+ */
37
+ getPropertyCount(provider: any): Promise<bigint>;
38
+ /**
39
+ * Get property address by index
40
+ */
41
+ getProperty(index: bigint | number, provider: any): Promise<string>;
42
+ /**
43
+ * Get property information from factory
44
+ */
45
+ getPropertyInfo(propertyAddress: string, provider: any): Promise<ParsedRWAPropertyInfo>;
46
+ /**
47
+ * Get all properties for a user
48
+ */
49
+ getUserProperties(userAddress: string, provider: any): Promise<string[]>;
50
+ /**
51
+ * Get user's property count
52
+ */
53
+ getUserPropertyCount(userAddress: string, provider: any): Promise<bigint>;
54
+ /**
55
+ * Check if an address is a valid property
56
+ */
57
+ isValidProperty(propertyAddress: string, provider: any): Promise<boolean>;
58
+ /**
59
+ * Get property details directly from property contract
60
+ */
61
+ getPropertyDetails(propertyAddress: string, provider: any): Promise<ParsedRWAPropertyInfo>;
62
+ /**
63
+ * Get token balance for a user
64
+ */
65
+ getTokenBalance(propertyAddress: string, userAddress: string, provider: any): Promise<bigint>;
66
+ /**
67
+ * Get factory address
68
+ */
69
+ getFactoryAddress(): string;
70
+ /**
71
+ * Get user property by index
72
+ */
73
+ getUserPropertyByIndex(userAddress: string, index: bigint | number, provider: any): Promise<string>;
74
+ /**
75
+ * Get factory owner address
76
+ */
77
+ getFactoryOwner(provider: any): Promise<string>;
78
+ /**
79
+ * Renounce factory ownership (only owner)
80
+ */
81
+ renounceFactoryOwnership(signer: any): Promise<string>;
82
+ /**
83
+ * Transfer factory ownership (only owner)
84
+ */
85
+ transferFactoryOwnership(newOwner: string, signer: any): Promise<string>;
86
+ /**
87
+ * Get batch token balances for multiple accounts and token IDs
88
+ */
89
+ getBatchTokenBalances(propertyAddress: string, accounts: string[], tokenIds: (bigint | number)[], provider: any): Promise<bigint[]>;
90
+ /**
91
+ * Transfer tokens from one address to another
92
+ *
93
+ * @param propertyAddress Property contract address
94
+ * @param from Sender address
95
+ * @param to Recipient address
96
+ * @param tokenId Token ID (usually 1 for PROPERTY_TOKEN_ID)
97
+ * @param amount Amount to transfer
98
+ * @param data Additional data (optional, can be empty bytes)
99
+ * @param signer Signer (must be the sender or approved operator)
100
+ * @returns Transaction hash
101
+ */
102
+ transferTokens(propertyAddress: string, from: string, to: string, tokenId: bigint | number, amount: bigint | string, signer: any, data?: string): Promise<string>;
103
+ /**
104
+ * Batch transfer tokens from one address to another
105
+ *
106
+ * @param propertyAddress Property contract address
107
+ * @param from Sender address
108
+ * @param to Recipient address
109
+ * @param tokenIds Array of token IDs
110
+ * @param amounts Array of amounts to transfer
111
+ * @param signer Signer (must be the sender or approved operator)
112
+ * @param data Additional data (optional, can be empty bytes)
113
+ * @returns Transaction hash
114
+ */
115
+ batchTransferTokens(propertyAddress: string, from: string, to: string, tokenIds: (bigint | number)[], amounts: (bigint | string)[], signer: any, data?: string): Promise<string>;
116
+ /**
117
+ * Approve or revoke operator approval for all tokens
118
+ *
119
+ * @param propertyAddress Property contract address
120
+ * @param operator Operator address to approve/revoke
121
+ * @param approved Whether to approve (true) or revoke (false)
122
+ * @param signer Signer (must be the token owner)
123
+ * @returns Transaction hash
124
+ */
125
+ setApprovalForAll(propertyAddress: string, operator: string, approved: boolean, signer: any): Promise<string>;
126
+ /**
127
+ * Check if an operator is approved for all tokens
128
+ */
129
+ isApprovedForAll(propertyAddress: string, account: string, operator: string, provider: any): Promise<boolean>;
130
+ /**
131
+ * Check if contract supports a specific interface (ERC165)
132
+ */
133
+ supportsInterface(propertyAddress: string, interfaceId: string, provider: any): Promise<boolean>;
134
+ /**
135
+ * Get property owner address
136
+ */
137
+ getPropertyOwner(propertyAddress: string, provider: any): Promise<string>;
138
+ /**
139
+ * Renounce property ownership (only owner)
140
+ */
141
+ renouncePropertyOwnership(propertyAddress: string, signer: any): Promise<string>;
142
+ /**
143
+ * Transfer property ownership (only owner)
144
+ */
145
+ transferPropertyOwnership(propertyAddress: string, newOwner: string, signer: any): Promise<string>;
146
+ };
147
+ /**
148
+ * Default factory address (can be overridden)
149
+ */
150
+ export declare const DEFAULT_FACTORY_ADDRESS = "0x7d7aF5715e5671e0E3126b2428Dc2629bD9061e3";
151
+ /**
152
+ * Create RWA client with default factory address
153
+ */
154
+ export declare function createDefaultRWAClient(overrides?: Partial<RWASDKConfig>): {
155
+ /**
156
+ * Launch a new RWA property
157
+ *
158
+ * @param params Property launch parameters
159
+ * @param signerOrProvider Signer (for write) or Provider (for read)
160
+ * @returns Transaction hash and property address
161
+ */
162
+ launchProperty(params: LaunchPropertyParams, signerOrProvider: any): Promise<LaunchPropertyResult>;
163
+ /**
164
+ * Get all property addresses
165
+ */
166
+ getAllProperties(provider: any): Promise<string[]>;
167
+ /**
168
+ * Get total number of properties
169
+ */
170
+ getPropertyCount(provider: any): Promise<bigint>;
171
+ /**
172
+ * Get property address by index
173
+ */
174
+ getProperty(index: bigint | number, provider: any): Promise<string>;
175
+ /**
176
+ * Get property information from factory
177
+ */
178
+ getPropertyInfo(propertyAddress: string, provider: any): Promise<ParsedRWAPropertyInfo>;
179
+ /**
180
+ * Get all properties for a user
181
+ */
182
+ getUserProperties(userAddress: string, provider: any): Promise<string[]>;
183
+ /**
184
+ * Get user's property count
185
+ */
186
+ getUserPropertyCount(userAddress: string, provider: any): Promise<bigint>;
187
+ /**
188
+ * Check if an address is a valid property
189
+ */
190
+ isValidProperty(propertyAddress: string, provider: any): Promise<boolean>;
191
+ /**
192
+ * Get property details directly from property contract
193
+ */
194
+ getPropertyDetails(propertyAddress: string, provider: any): Promise<ParsedRWAPropertyInfo>;
195
+ /**
196
+ * Get token balance for a user
197
+ */
198
+ getTokenBalance(propertyAddress: string, userAddress: string, provider: any): Promise<bigint>;
199
+ /**
200
+ * Get factory address
201
+ */
202
+ getFactoryAddress(): string;
203
+ /**
204
+ * Get user property by index
205
+ */
206
+ getUserPropertyByIndex(userAddress: string, index: bigint | number, provider: any): Promise<string>;
207
+ /**
208
+ * Get factory owner address
209
+ */
210
+ getFactoryOwner(provider: any): Promise<string>;
211
+ /**
212
+ * Renounce factory ownership (only owner)
213
+ */
214
+ renounceFactoryOwnership(signer: any): Promise<string>;
215
+ /**
216
+ * Transfer factory ownership (only owner)
217
+ */
218
+ transferFactoryOwnership(newOwner: string, signer: any): Promise<string>;
219
+ /**
220
+ * Get batch token balances for multiple accounts and token IDs
221
+ */
222
+ getBatchTokenBalances(propertyAddress: string, accounts: string[], tokenIds: (bigint | number)[], provider: any): Promise<bigint[]>;
223
+ /**
224
+ * Transfer tokens from one address to another
225
+ *
226
+ * @param propertyAddress Property contract address
227
+ * @param from Sender address
228
+ * @param to Recipient address
229
+ * @param tokenId Token ID (usually 1 for PROPERTY_TOKEN_ID)
230
+ * @param amount Amount to transfer
231
+ * @param data Additional data (optional, can be empty bytes)
232
+ * @param signer Signer (must be the sender or approved operator)
233
+ * @returns Transaction hash
234
+ */
235
+ transferTokens(propertyAddress: string, from: string, to: string, tokenId: bigint | number, amount: bigint | string, signer: any, data?: string): Promise<string>;
236
+ /**
237
+ * Batch transfer tokens from one address to another
238
+ *
239
+ * @param propertyAddress Property contract address
240
+ * @param from Sender address
241
+ * @param to Recipient address
242
+ * @param tokenIds Array of token IDs
243
+ * @param amounts Array of amounts to transfer
244
+ * @param signer Signer (must be the sender or approved operator)
245
+ * @param data Additional data (optional, can be empty bytes)
246
+ * @returns Transaction hash
247
+ */
248
+ batchTransferTokens(propertyAddress: string, from: string, to: string, tokenIds: (bigint | number)[], amounts: (bigint | string)[], signer: any, data?: string): Promise<string>;
249
+ /**
250
+ * Approve or revoke operator approval for all tokens
251
+ *
252
+ * @param propertyAddress Property contract address
253
+ * @param operator Operator address to approve/revoke
254
+ * @param approved Whether to approve (true) or revoke (false)
255
+ * @param signer Signer (must be the token owner)
256
+ * @returns Transaction hash
257
+ */
258
+ setApprovalForAll(propertyAddress: string, operator: string, approved: boolean, signer: any): Promise<string>;
259
+ /**
260
+ * Check if an operator is approved for all tokens
261
+ */
262
+ isApprovedForAll(propertyAddress: string, account: string, operator: string, provider: any): Promise<boolean>;
263
+ /**
264
+ * Check if contract supports a specific interface (ERC165)
265
+ */
266
+ supportsInterface(propertyAddress: string, interfaceId: string, provider: any): Promise<boolean>;
267
+ /**
268
+ * Get property owner address
269
+ */
270
+ getPropertyOwner(propertyAddress: string, provider: any): Promise<string>;
271
+ /**
272
+ * Renounce property ownership (only owner)
273
+ */
274
+ renouncePropertyOwnership(propertyAddress: string, signer: any): Promise<string>;
275
+ /**
276
+ * Transfer property ownership (only owner)
277
+ */
278
+ transferPropertyOwnership(propertyAddress: string, newOwner: string, signer: any): Promise<string>;
279
+ };
280
+ //# sourceMappingURL=rwa.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rwa.d.ts","sourceRoot":"","sources":["../../client/rwa.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,qBAA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