@loyal-labs/private-transactions 0.2.4 → 0.2.5
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/index.js
CHANGED
|
@@ -22265,7 +22265,9 @@ var telegram_private_transfer_default = {
|
|
|
22265
22265
|
{
|
|
22266
22266
|
name: "UsernameDeposit",
|
|
22267
22267
|
docs: [
|
|
22268
|
-
"A deposit account for a telegram username and token mint."
|
|
22268
|
+
"A deposit account for a telegram username and token mint.",
|
|
22269
|
+
"",
|
|
22270
|
+
"Telegram username is always lowercase (a-z, 0-9 and underscores)"
|
|
22269
22271
|
],
|
|
22270
22272
|
type: {
|
|
22271
22273
|
kind: "struct",
|
|
@@ -22756,7 +22758,18 @@ class LoyalPrivateTransactionsClient {
|
|
|
22756
22758
|
delegationProgram: DELEGATION_PROGRAM_ID,
|
|
22757
22759
|
systemProgram: SystemProgram.programId
|
|
22758
22760
|
};
|
|
22759
|
-
const
|
|
22761
|
+
const delegationWatcher = waitForAccountOwnerChange(this.baseProgram.provider.connection, depositPda, DELEGATION_PROGRAM_ID);
|
|
22762
|
+
let signature;
|
|
22763
|
+
try {
|
|
22764
|
+
console.log("delegateDeposit Accounts:", prettyStringify(accounts));
|
|
22765
|
+
signature = await this.baseProgram.methods.delegate(user, tokenMint).accountsPartial(accounts).rpc(rpcOptions);
|
|
22766
|
+
console.log("delegateDeposit: waiting for depositPda owner to be DELEGATION_PROGRAM_ID on base connection...");
|
|
22767
|
+
await delegationWatcher.wait();
|
|
22768
|
+
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
22769
|
+
} catch (e) {
|
|
22770
|
+
await delegationWatcher.cancel();
|
|
22771
|
+
throw e;
|
|
22772
|
+
}
|
|
22760
22773
|
return signature;
|
|
22761
22774
|
}
|
|
22762
22775
|
async delegateUsernameDeposit(params) {
|
|
@@ -22784,7 +22797,18 @@ class LoyalPrivateTransactionsClient {
|
|
|
22784
22797
|
systemProgram: SystemProgram.programId
|
|
22785
22798
|
};
|
|
22786
22799
|
accounts.validator = validator ?? null;
|
|
22787
|
-
const
|
|
22800
|
+
const delegationWatcher = waitForAccountOwnerChange(this.baseProgram.provider.connection, depositPda, DELEGATION_PROGRAM_ID);
|
|
22801
|
+
let signature;
|
|
22802
|
+
try {
|
|
22803
|
+
console.log("delegateUsernameDeposit Accounts:", prettyStringify(accounts));
|
|
22804
|
+
signature = await this.baseProgram.methods.delegateUsernameDeposit(username, tokenMint).accountsPartial(accounts).rpc(rpcOptions);
|
|
22805
|
+
console.log("delegateUsernameDeposit: waiting for depositPda owner to be DELEGATION_PROGRAM_ID on base connection...");
|
|
22806
|
+
await delegationWatcher.wait();
|
|
22807
|
+
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
22808
|
+
} catch (e) {
|
|
22809
|
+
await delegationWatcher.cancel();
|
|
22810
|
+
throw e;
|
|
22811
|
+
}
|
|
22788
22812
|
return signature;
|
|
22789
22813
|
}
|
|
22790
22814
|
async undelegateDeposit(params) {
|
|
@@ -1820,7 +1820,9 @@ export type TelegramPrivateTransfer = {
|
|
|
1820
1820
|
{
|
|
1821
1821
|
"name": "usernameDeposit";
|
|
1822
1822
|
"docs": [
|
|
1823
|
-
"A deposit account for a telegram username and token mint."
|
|
1823
|
+
"A deposit account for a telegram username and token mint.",
|
|
1824
|
+
"",
|
|
1825
|
+
"Telegram username is always lowercase (a-z, 0-9 and underscores)"
|
|
1824
1826
|
];
|
|
1825
1827
|
"type": {
|
|
1826
1828
|
"kind": "struct";
|