@buildonspark/issuer-sdk 0.1.15 → 0.1.16
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/CHANGELOG.md +7 -0
- package/dist/index.browser.d.ts +113 -113
- package/dist/index.node.cjs +1 -0
- package/dist/index.node.d.cts +113 -113
- package/dist/index.node.d.ts +113 -113
- package/dist/native/index.react-native.cjs +9 -8
- package/dist/native/index.react-native.d.cts +113 -113
- package/dist/native/index.react-native.d.ts +113 -113
- package/dist/native/index.react-native.js +8 -8
- package/package.json +3 -3
- package/src/tests/integration/multi-token-issuer.test.ts +8 -133
- package/src/tests/integration/token-creation.test.ts +4 -1
- package/src/tests/integration/token-invoices.test.ts +39 -24
- package/src/tests/integration/token-lifecycle.test.ts +33 -19
- package/src/tests/integration/token-minting.test.ts +16 -7
- package/src/tests/integration/token-monitoring.test.ts +29 -18
- package/src/tests/integration/token-outputs.test.ts +195 -85
- package/src/tests/integration/token-transfers.test.ts +46 -32
- package/src/tests/utils/multi-token-utils.ts +83 -0
package/CHANGELOG.md
CHANGED
package/dist/index.browser.d.ts
CHANGED
|
@@ -73,74 +73,74 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
73
73
|
private tokenFreezeService;
|
|
74
74
|
protected tracerId: string;
|
|
75
75
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
* Initializes a new IssuerSparkWallet instance.
|
|
77
|
+
* Inherits the generic static initialize from the base class.
|
|
78
|
+
*/
|
|
79
79
|
constructor(configOptions?: ConfigOptions$1, signer?: SparkSigner$1);
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
* Gets the token balance for the issuer's token.
|
|
82
|
+
* @deprecated Use getIssuerTokenBalances() instead. This method will be removed in a future version.
|
|
83
|
+
* @returns An object containing the token balance as a bigint
|
|
84
|
+
*
|
|
85
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
86
|
+
*/
|
|
87
87
|
getIssuerTokenBalance(): Promise<{
|
|
88
88
|
tokenIdentifier: Bech32mTokenIdentifier | undefined;
|
|
89
89
|
balance: bigint;
|
|
90
90
|
}>;
|
|
91
91
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
* Gets the token balances for the tokens that were issued by this user.
|
|
93
|
+
* @returns An array of objects containing the token identifier and balance
|
|
94
|
+
*/
|
|
95
95
|
getIssuerTokenBalances(): Promise<{
|
|
96
96
|
tokenIdentifier: Bech32mTokenIdentifier | undefined;
|
|
97
97
|
balance: bigint;
|
|
98
98
|
}[]>;
|
|
99
99
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
* Retrieves information about the issuer's token.
|
|
101
|
+
* @deprecated Use getIssuerTokensMetadata() instead. This method will be removed in a future version.
|
|
102
|
+
* @returns An object containing token information including public key, name, symbol, decimals, max supply, freeze status, and extra metadata
|
|
103
|
+
* @throws {SparkRequestError} If the token metadata cannot be retrieved
|
|
104
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
105
|
+
*/
|
|
106
106
|
getIssuerTokenMetadata(): Promise<IssuerTokenMetadata>;
|
|
107
107
|
/**
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
* Retrieves information about the tokens that were issued by this user.
|
|
109
|
+
* @param tokenIdentifiers - Optional array of specific token identifiers to fetch.
|
|
110
|
+
* If omitted, all tokens for this issuer are fetched.
|
|
111
|
+
* @returns An array of objects containing token information including public key, name, symbol, decimals, max supply, freeze status, and extra metadata
|
|
112
|
+
* @throws {SparkRequestError} If the token metadata cannot be retrieved
|
|
113
|
+
*/
|
|
114
114
|
getIssuerTokensMetadata(tokenIdentifiers?: Bech32mTokenIdentifier[]): Promise<IssuerTokenMetadata[]>;
|
|
115
115
|
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
* Retrieves the bech32m encoded token identifier for the issuer's token.
|
|
117
|
+
* @deprecated Use getIssuerTokenIdentifiers() instead. This method will be removed in a future version.
|
|
118
|
+
* @returns The bech32m encoded token identifier for the issuer's token
|
|
119
|
+
* @throws {SparkRequestError} If the token identifier cannot be retrieved
|
|
120
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
121
|
+
*/
|
|
122
122
|
getIssuerTokenIdentifier(): Promise<Bech32mTokenIdentifier>;
|
|
123
123
|
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
* Retrieves the bech32m encoded token identifier for the issuer's token.
|
|
125
|
+
* @returns The bech32m encoded token identifier for the issuer's token
|
|
126
|
+
* @throws {SparkRequestError} If the token identifier cannot be retrieved
|
|
127
|
+
*/
|
|
128
128
|
getIssuerTokenIdentifiers(): Promise<Bech32mTokenIdentifier[]>;
|
|
129
129
|
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
130
|
+
* Create a new token on Spark.
|
|
131
|
+
*
|
|
132
|
+
* @param params - Object containing token creation parameters.
|
|
133
|
+
* @param params.tokenName - The name of the token.
|
|
134
|
+
* @param params.tokenTicker - The ticker symbol for the token.
|
|
135
|
+
* @param params.decimals - The number of decimal places for the token.
|
|
136
|
+
* @param params.isFreezable - Whether the token can be frozen.
|
|
137
|
+
* @param [params.maxSupply=0n] - (Optional) The maximum supply of the token. Defaults to <code>0n</code>.
|
|
138
|
+
* @param params.extraMetadata - (Optional) This can be used to store additional bytes data to be associated with a token, like image data.
|
|
139
|
+
* @param params.returnIdentifierForCreate - (Optional) Whether to return the token identifier in addition to the transaction hash. Defaults to <code>false</code>.
|
|
140
|
+
* @returns The transaction hash of the announcement or TokenCreationDetails if `returnIdentifierForCreate` is true.
|
|
141
|
+
* @throws {SparkValidationError} If `decimals` is not a safe integer or other validation fails.
|
|
142
|
+
* @throws {SparkRequestError} If the announcement transaction cannot be broadcast.
|
|
143
|
+
*/
|
|
144
144
|
createToken(params: {
|
|
145
145
|
tokenName: string;
|
|
146
146
|
tokenTicker: string;
|
|
@@ -160,21 +160,21 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
160
160
|
returnIdentifierForCreate: true;
|
|
161
161
|
}): Promise<TokenCreationDetails>;
|
|
162
162
|
/**
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
* @deprecated Use mintTokens({ tokenAmount, tokenIdentifier }) instead. This method will be removed in a future version.
|
|
164
|
+
* @param amount - The amount of tokens to mint
|
|
165
|
+
* @returns The transaction ID of the mint operation
|
|
166
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
167
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
168
|
+
*/
|
|
169
169
|
mintTokens(amount: bigint): Promise<string>;
|
|
170
170
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
* Mints new tokens
|
|
172
|
+
* @param params - Object containing token minting parameters.
|
|
173
|
+
* @param params.tokenAmount - The amount of tokens to mint
|
|
174
|
+
* @param params.tokenIdentifier - The bech32m encoded token identifier
|
|
175
|
+
* @returns The transaction ID of the mint operation
|
|
176
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
177
|
+
*/
|
|
178
178
|
mintTokens({
|
|
179
179
|
tokenAmount,
|
|
180
180
|
tokenIdentifier
|
|
@@ -183,23 +183,23 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
183
183
|
tokenIdentifier: Bech32mTokenIdentifier;
|
|
184
184
|
}): Promise<string>;
|
|
185
185
|
/**
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
186
|
+
* Burns issuer's tokens
|
|
187
|
+
* @deprecated Use burnTokens({ tokenAmount, tokenIdentifier, selectedOutputs }) instead. This method will be removed in a future version.
|
|
188
|
+
* @param tokenAmount - The amount of tokens to burn
|
|
189
|
+
* @param selectedOutputs - Optional array of outputs to use for the burn operation
|
|
190
|
+
* @returns The transaction ID of the burn operation
|
|
191
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
192
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
193
|
+
*/
|
|
194
194
|
burnTokens(tokenAmount: bigint, selectedOutputs?: OutputWithPreviousTransactionData[]): Promise<string>;
|
|
195
195
|
/**
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
196
|
+
* Burns issuer's tokens
|
|
197
|
+
* @param params - Object containing token burning parameters.
|
|
198
|
+
* @param params.tokenAmount - The amount of tokens to burn
|
|
199
|
+
* @param params.tokenIdentifier - The bech32m encoded token identifier
|
|
200
|
+
* @param params.selectedOutputs - Optional array of outputs to use for the burn operation
|
|
201
|
+
* @returns The transaction ID of the burn operation
|
|
202
|
+
*/
|
|
203
203
|
burnTokens({
|
|
204
204
|
tokenAmount,
|
|
205
205
|
tokenIdentifier,
|
|
@@ -210,24 +210,24 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
210
210
|
selectedOutputs?: OutputWithPreviousTransactionData[];
|
|
211
211
|
}): Promise<string>;
|
|
212
212
|
/**
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
213
|
+
* Freezes tokens associated with a specific Spark address.
|
|
214
|
+
* @deprecated Use freezeToken({ tokenIdentifier, sparkAddress }) instead. This method will be removed in a future version.
|
|
215
|
+
* @param sparkAddress - The Spark address whose tokens should be frozen
|
|
216
|
+
* @returns An object containing the IDs of impacted outputs and the total amount of frozen tokens
|
|
217
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
218
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
219
|
+
*/
|
|
220
220
|
freezeTokens(sparkAddress: string): Promise<{
|
|
221
221
|
impactedTokenOutputs: TokenOutputRef[];
|
|
222
222
|
impactedTokenAmount: bigint;
|
|
223
223
|
}>;
|
|
224
224
|
/**
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
225
|
+
* Freezes tokens associated with a specific Spark address.
|
|
226
|
+
* @param params - Object containing token freezing parameters.
|
|
227
|
+
* @param params.tokenIdentifier - The bech32m encoded token identifier
|
|
228
|
+
* @param params.sparkAddress - The Spark address whose tokens should be frozen
|
|
229
|
+
* @returns An object containing the IDs of impacted outputs and the total amount of frozen tokens
|
|
230
|
+
*/
|
|
231
231
|
freezeTokens({
|
|
232
232
|
tokenIdentifier,
|
|
233
233
|
sparkAddress
|
|
@@ -239,26 +239,26 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
239
239
|
impactedTokenAmount: bigint;
|
|
240
240
|
}>;
|
|
241
241
|
/**
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
242
|
+
* Unfreezes previously frozen tokens associated with a specific Spark address.
|
|
243
|
+
* @deprecated Use unfreezeToken({ tokenIdentifier, sparkAddress }) instead. This method will be removed in a future version.
|
|
244
|
+
* @param sparkAddress - The Spark address whose tokens should be unfrozen
|
|
245
|
+
* @returns An object containing the IDs of impacted outputs and the total amount of unfrozen tokens
|
|
246
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
247
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
248
|
+
*/
|
|
249
249
|
unfreezeTokens(sparkAddress: string): Promise<{
|
|
250
250
|
impactedTokenOutputs: TokenOutputRef[];
|
|
251
251
|
impactedTokenAmount: bigint;
|
|
252
252
|
}>;
|
|
253
253
|
/**
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
254
|
+
* Unfreezes previously frozen tokens associated with a specific Spark address.
|
|
255
|
+
* @param params - Object containing token unfreezing parameters.
|
|
256
|
+
* @param params.tokenIdentifier - The bech32m encoded token identifier
|
|
257
|
+
* @param params.sparkAddress - The Spark address whose tokens should be unfrozen
|
|
258
|
+
* @returns An object containing the IDs of impacted outputs and the total amount of unfrozen tokens
|
|
259
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
260
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
261
|
+
*/
|
|
262
262
|
unfreezeTokens({
|
|
263
263
|
tokenIdentifier,
|
|
264
264
|
sparkAddress
|
|
@@ -270,17 +270,17 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
270
270
|
impactedTokenAmount: bigint;
|
|
271
271
|
}>;
|
|
272
272
|
/**
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
* Retrieves the distribution information for the issuer's token.
|
|
274
|
+
* @throws {SparkError} This feature is not yet supported
|
|
275
|
+
*/
|
|
276
276
|
getIssuerTokenDistribution(): Promise<TokenDistribution>;
|
|
277
277
|
/**
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
278
|
+
* This validates that the token belongs to this issuer.
|
|
279
|
+
* If a token is in the cache, it must belong to this issuer.
|
|
280
|
+
* @param tokenIdentifier - The bech32m encoded token identifier
|
|
281
|
+
* @throws {SparkValidationError} If the token is not found for this issuer
|
|
282
|
+
* @private
|
|
283
|
+
*/
|
|
284
284
|
private validateTokenIssuer;
|
|
285
285
|
protected getTraceName(methodName: string): string;
|
|
286
286
|
private wrapIssuerPublicMethod;
|
package/dist/index.node.cjs
CHANGED
package/dist/index.node.d.cts
CHANGED
|
@@ -73,74 +73,74 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
73
73
|
private tokenFreezeService;
|
|
74
74
|
protected tracerId: string;
|
|
75
75
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
* Initializes a new IssuerSparkWallet instance.
|
|
77
|
+
* Inherits the generic static initialize from the base class.
|
|
78
|
+
*/
|
|
79
79
|
constructor(configOptions?: ConfigOptions$1, signer?: SparkSigner$1);
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
* Gets the token balance for the issuer's token.
|
|
82
|
+
* @deprecated Use getIssuerTokenBalances() instead. This method will be removed in a future version.
|
|
83
|
+
* @returns An object containing the token balance as a bigint
|
|
84
|
+
*
|
|
85
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
86
|
+
*/
|
|
87
87
|
getIssuerTokenBalance(): Promise<{
|
|
88
88
|
tokenIdentifier: Bech32mTokenIdentifier | undefined;
|
|
89
89
|
balance: bigint;
|
|
90
90
|
}>;
|
|
91
91
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
* Gets the token balances for the tokens that were issued by this user.
|
|
93
|
+
* @returns An array of objects containing the token identifier and balance
|
|
94
|
+
*/
|
|
95
95
|
getIssuerTokenBalances(): Promise<{
|
|
96
96
|
tokenIdentifier: Bech32mTokenIdentifier | undefined;
|
|
97
97
|
balance: bigint;
|
|
98
98
|
}[]>;
|
|
99
99
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
* Retrieves information about the issuer's token.
|
|
101
|
+
* @deprecated Use getIssuerTokensMetadata() instead. This method will be removed in a future version.
|
|
102
|
+
* @returns An object containing token information including public key, name, symbol, decimals, max supply, freeze status, and extra metadata
|
|
103
|
+
* @throws {SparkRequestError} If the token metadata cannot be retrieved
|
|
104
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
105
|
+
*/
|
|
106
106
|
getIssuerTokenMetadata(): Promise<IssuerTokenMetadata>;
|
|
107
107
|
/**
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
* Retrieves information about the tokens that were issued by this user.
|
|
109
|
+
* @param tokenIdentifiers - Optional array of specific token identifiers to fetch.
|
|
110
|
+
* If omitted, all tokens for this issuer are fetched.
|
|
111
|
+
* @returns An array of objects containing token information including public key, name, symbol, decimals, max supply, freeze status, and extra metadata
|
|
112
|
+
* @throws {SparkRequestError} If the token metadata cannot be retrieved
|
|
113
|
+
*/
|
|
114
114
|
getIssuerTokensMetadata(tokenIdentifiers?: Bech32mTokenIdentifier[]): Promise<IssuerTokenMetadata[]>;
|
|
115
115
|
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
* Retrieves the bech32m encoded token identifier for the issuer's token.
|
|
117
|
+
* @deprecated Use getIssuerTokenIdentifiers() instead. This method will be removed in a future version.
|
|
118
|
+
* @returns The bech32m encoded token identifier for the issuer's token
|
|
119
|
+
* @throws {SparkRequestError} If the token identifier cannot be retrieved
|
|
120
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
121
|
+
*/
|
|
122
122
|
getIssuerTokenIdentifier(): Promise<Bech32mTokenIdentifier>;
|
|
123
123
|
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
* Retrieves the bech32m encoded token identifier for the issuer's token.
|
|
125
|
+
* @returns The bech32m encoded token identifier for the issuer's token
|
|
126
|
+
* @throws {SparkRequestError} If the token identifier cannot be retrieved
|
|
127
|
+
*/
|
|
128
128
|
getIssuerTokenIdentifiers(): Promise<Bech32mTokenIdentifier[]>;
|
|
129
129
|
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
130
|
+
* Create a new token on Spark.
|
|
131
|
+
*
|
|
132
|
+
* @param params - Object containing token creation parameters.
|
|
133
|
+
* @param params.tokenName - The name of the token.
|
|
134
|
+
* @param params.tokenTicker - The ticker symbol for the token.
|
|
135
|
+
* @param params.decimals - The number of decimal places for the token.
|
|
136
|
+
* @param params.isFreezable - Whether the token can be frozen.
|
|
137
|
+
* @param [params.maxSupply=0n] - (Optional) The maximum supply of the token. Defaults to <code>0n</code>.
|
|
138
|
+
* @param params.extraMetadata - (Optional) This can be used to store additional bytes data to be associated with a token, like image data.
|
|
139
|
+
* @param params.returnIdentifierForCreate - (Optional) Whether to return the token identifier in addition to the transaction hash. Defaults to <code>false</code>.
|
|
140
|
+
* @returns The transaction hash of the announcement or TokenCreationDetails if `returnIdentifierForCreate` is true.
|
|
141
|
+
* @throws {SparkValidationError} If `decimals` is not a safe integer or other validation fails.
|
|
142
|
+
* @throws {SparkRequestError} If the announcement transaction cannot be broadcast.
|
|
143
|
+
*/
|
|
144
144
|
createToken(params: {
|
|
145
145
|
tokenName: string;
|
|
146
146
|
tokenTicker: string;
|
|
@@ -160,21 +160,21 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
160
160
|
returnIdentifierForCreate: true;
|
|
161
161
|
}): Promise<TokenCreationDetails>;
|
|
162
162
|
/**
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
* @deprecated Use mintTokens({ tokenAmount, tokenIdentifier }) instead. This method will be removed in a future version.
|
|
164
|
+
* @param amount - The amount of tokens to mint
|
|
165
|
+
* @returns The transaction ID of the mint operation
|
|
166
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
167
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
168
|
+
*/
|
|
169
169
|
mintTokens(amount: bigint): Promise<string>;
|
|
170
170
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
* Mints new tokens
|
|
172
|
+
* @param params - Object containing token minting parameters.
|
|
173
|
+
* @param params.tokenAmount - The amount of tokens to mint
|
|
174
|
+
* @param params.tokenIdentifier - The bech32m encoded token identifier
|
|
175
|
+
* @returns The transaction ID of the mint operation
|
|
176
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
177
|
+
*/
|
|
178
178
|
mintTokens({
|
|
179
179
|
tokenAmount,
|
|
180
180
|
tokenIdentifier
|
|
@@ -183,23 +183,23 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
183
183
|
tokenIdentifier: Bech32mTokenIdentifier;
|
|
184
184
|
}): Promise<string>;
|
|
185
185
|
/**
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
186
|
+
* Burns issuer's tokens
|
|
187
|
+
* @deprecated Use burnTokens({ tokenAmount, tokenIdentifier, selectedOutputs }) instead. This method will be removed in a future version.
|
|
188
|
+
* @param tokenAmount - The amount of tokens to burn
|
|
189
|
+
* @param selectedOutputs - Optional array of outputs to use for the burn operation
|
|
190
|
+
* @returns The transaction ID of the burn operation
|
|
191
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
192
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
193
|
+
*/
|
|
194
194
|
burnTokens(tokenAmount: bigint, selectedOutputs?: OutputWithPreviousTransactionData[]): Promise<string>;
|
|
195
195
|
/**
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
196
|
+
* Burns issuer's tokens
|
|
197
|
+
* @param params - Object containing token burning parameters.
|
|
198
|
+
* @param params.tokenAmount - The amount of tokens to burn
|
|
199
|
+
* @param params.tokenIdentifier - The bech32m encoded token identifier
|
|
200
|
+
* @param params.selectedOutputs - Optional array of outputs to use for the burn operation
|
|
201
|
+
* @returns The transaction ID of the burn operation
|
|
202
|
+
*/
|
|
203
203
|
burnTokens({
|
|
204
204
|
tokenAmount,
|
|
205
205
|
tokenIdentifier,
|
|
@@ -210,24 +210,24 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
210
210
|
selectedOutputs?: OutputWithPreviousTransactionData[];
|
|
211
211
|
}): Promise<string>;
|
|
212
212
|
/**
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
213
|
+
* Freezes tokens associated with a specific Spark address.
|
|
214
|
+
* @deprecated Use freezeToken({ tokenIdentifier, sparkAddress }) instead. This method will be removed in a future version.
|
|
215
|
+
* @param sparkAddress - The Spark address whose tokens should be frozen
|
|
216
|
+
* @returns An object containing the IDs of impacted outputs and the total amount of frozen tokens
|
|
217
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
218
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
219
|
+
*/
|
|
220
220
|
freezeTokens(sparkAddress: string): Promise<{
|
|
221
221
|
impactedTokenOutputs: TokenOutputRef[];
|
|
222
222
|
impactedTokenAmount: bigint;
|
|
223
223
|
}>;
|
|
224
224
|
/**
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
225
|
+
* Freezes tokens associated with a specific Spark address.
|
|
226
|
+
* @param params - Object containing token freezing parameters.
|
|
227
|
+
* @param params.tokenIdentifier - The bech32m encoded token identifier
|
|
228
|
+
* @param params.sparkAddress - The Spark address whose tokens should be frozen
|
|
229
|
+
* @returns An object containing the IDs of impacted outputs and the total amount of frozen tokens
|
|
230
|
+
*/
|
|
231
231
|
freezeTokens({
|
|
232
232
|
tokenIdentifier,
|
|
233
233
|
sparkAddress
|
|
@@ -239,26 +239,26 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
239
239
|
impactedTokenAmount: bigint;
|
|
240
240
|
}>;
|
|
241
241
|
/**
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
242
|
+
* Unfreezes previously frozen tokens associated with a specific Spark address.
|
|
243
|
+
* @deprecated Use unfreezeToken({ tokenIdentifier, sparkAddress }) instead. This method will be removed in a future version.
|
|
244
|
+
* @param sparkAddress - The Spark address whose tokens should be unfrozen
|
|
245
|
+
* @returns An object containing the IDs of impacted outputs and the total amount of unfrozen tokens
|
|
246
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
247
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
248
|
+
*/
|
|
249
249
|
unfreezeTokens(sparkAddress: string): Promise<{
|
|
250
250
|
impactedTokenOutputs: TokenOutputRef[];
|
|
251
251
|
impactedTokenAmount: bigint;
|
|
252
252
|
}>;
|
|
253
253
|
/**
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
254
|
+
* Unfreezes previously frozen tokens associated with a specific Spark address.
|
|
255
|
+
* @param params - Object containing token unfreezing parameters.
|
|
256
|
+
* @param params.tokenIdentifier - The bech32m encoded token identifier
|
|
257
|
+
* @param params.sparkAddress - The Spark address whose tokens should be unfrozen
|
|
258
|
+
* @returns An object containing the IDs of impacted outputs and the total amount of unfrozen tokens
|
|
259
|
+
* @throws {SparkValidationError} If multiple tokens are found for this issuer
|
|
260
|
+
* @throws {SparkValidationError} If no tokens are found for this issuer
|
|
261
|
+
*/
|
|
262
262
|
unfreezeTokens({
|
|
263
263
|
tokenIdentifier,
|
|
264
264
|
sparkAddress
|
|
@@ -270,17 +270,17 @@ declare abstract class IssuerSparkWallet extends SparkWallet {
|
|
|
270
270
|
impactedTokenAmount: bigint;
|
|
271
271
|
}>;
|
|
272
272
|
/**
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
* Retrieves the distribution information for the issuer's token.
|
|
274
|
+
* @throws {SparkError} This feature is not yet supported
|
|
275
|
+
*/
|
|
276
276
|
getIssuerTokenDistribution(): Promise<TokenDistribution>;
|
|
277
277
|
/**
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
278
|
+
* This validates that the token belongs to this issuer.
|
|
279
|
+
* If a token is in the cache, it must belong to this issuer.
|
|
280
|
+
* @param tokenIdentifier - The bech32m encoded token identifier
|
|
281
|
+
* @throws {SparkValidationError} If the token is not found for this issuer
|
|
282
|
+
* @private
|
|
283
|
+
*/
|
|
284
284
|
private validateTokenIssuer;
|
|
285
285
|
protected getTraceName(methodName: string): string;
|
|
286
286
|
private wrapIssuerPublicMethod;
|