@n1xyz/nord-ts 0.1.9 → 0.1.10
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/NordUser.d.ts +10 -2
- package/dist/client/NordUser.js +11 -3
- package/package.json +1 -1
|
@@ -136,15 +136,23 @@ export declare class NordUser {
|
|
|
136
136
|
* @param tokenId - Token ID
|
|
137
137
|
* @param recipient - Recipient address; defaults to the user's address
|
|
138
138
|
* @param sendOptions - Send options for .sendTransaction
|
|
139
|
-
* @returns Transaction signature
|
|
139
|
+
* @returns Transaction signature and buffer account
|
|
140
140
|
* @throws {NordError} If required parameters are missing or operation fails
|
|
141
|
+
*
|
|
142
|
+
* The buffer account is used to correlate the deposit for when it gets queued.
|
|
143
|
+
* Note that even though there may technically be multiple deposits with the same
|
|
144
|
+
* buffer account, in the case of this method, there will only be one as it discards
|
|
145
|
+
* the buffer after performing the deposit.
|
|
141
146
|
*/
|
|
142
147
|
deposit({ amount, tokenId, recipient, sendOptions, }: Readonly<{
|
|
143
148
|
amount: number;
|
|
144
149
|
tokenId: number;
|
|
145
150
|
recipient?: PublicKey;
|
|
146
151
|
sendOptions?: SendOptions;
|
|
147
|
-
}>): Promise<
|
|
152
|
+
}>): Promise<{
|
|
153
|
+
signature: string;
|
|
154
|
+
buffer: PublicKey;
|
|
155
|
+
}>;
|
|
148
156
|
/**
|
|
149
157
|
* Get a new nonce for actions
|
|
150
158
|
*
|
package/dist/client/NordUser.js
CHANGED
|
@@ -132,7 +132,7 @@ export class NordUser {
|
|
|
132
132
|
* @throws {NordError} If required parameters are missing or operation fails
|
|
133
133
|
*/
|
|
134
134
|
async depositSpl(amount, tokenId, recipient) {
|
|
135
|
-
return this.deposit({ amount, tokenId, recipient });
|
|
135
|
+
return this.deposit({ amount, tokenId, recipient }).then((x) => x.signature);
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
138
|
* Deposit SPL tokens to the app
|
|
@@ -141,8 +141,13 @@ export class NordUser {
|
|
|
141
141
|
* @param tokenId - Token ID
|
|
142
142
|
* @param recipient - Recipient address; defaults to the user's address
|
|
143
143
|
* @param sendOptions - Send options for .sendTransaction
|
|
144
|
-
* @returns Transaction signature
|
|
144
|
+
* @returns Transaction signature and buffer account
|
|
145
145
|
* @throws {NordError} If required parameters are missing or operation fails
|
|
146
|
+
*
|
|
147
|
+
* The buffer account is used to correlate the deposit for when it gets queued.
|
|
148
|
+
* Note that even though there may technically be multiple deposits with the same
|
|
149
|
+
* buffer account, in the case of this method, there will only be one as it discards
|
|
150
|
+
* the buffer after performing the deposit.
|
|
146
151
|
*/
|
|
147
152
|
async deposit({ amount, tokenId, recipient, sendOptions, }) {
|
|
148
153
|
try {
|
|
@@ -169,7 +174,10 @@ export class NordUser {
|
|
|
169
174
|
const signedTx = await this.transactionSignFn(tx);
|
|
170
175
|
signedTx.partialSign(extraSigner);
|
|
171
176
|
const signature = await this.nord.solanaConnection.sendRawTransaction(signedTx.serialize(), sendOptions);
|
|
172
|
-
return
|
|
177
|
+
return {
|
|
178
|
+
signature,
|
|
179
|
+
buffer: extraSigner.publicKey,
|
|
180
|
+
};
|
|
173
181
|
}
|
|
174
182
|
catch (error) {
|
|
175
183
|
throw new NordError(`Failed to deposit ${amount} of token ID ${tokenId}`, { cause: error });
|