@bonfida/spl-name-service 2.1.3 → 2.3.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,112 @@
1
+ /// <reference types="node" />
2
+ import { Buffer } from "buffer";
3
+ import { Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
4
+ /**
5
+ * Creates a name account with the given rent budget, allocated space, owner and class.
6
+ *
7
+ * @param connection The solana connection object to the RPC node
8
+ * @param name The name of the new account
9
+ * @param space The space in bytes allocated to the account
10
+ * @param payerKey The allocation cost payer
11
+ * @param nameOwner The pubkey to be set as owner of the new name account
12
+ * @param lamports The budget to be set for the name account. If not specified, it'll be the minimum for rent exemption
13
+ * @param nameClass The class of this new name
14
+ * @param parentName The parent name of the new name. If specified its owner needs to sign
15
+ * @returns
16
+ */
17
+ declare function createNameRegistry(connection: Connection, name: string, space: number, payerKey: PublicKey, nameOwner: PublicKey, lamports?: number, nameClass?: PublicKey, parentName?: PublicKey): Promise<TransactionInstruction>;
18
+ /**
19
+ * Overwrite the data of the given name registry.
20
+ *
21
+ * @param connection The solana connection object to the RPC node
22
+ * @param name The name of the name registry to update
23
+ * @param offset The offset to which the data should be written into the registry
24
+ * @param input_data The data to be written
25
+ * @param nameClass The class of this name, if it exsists
26
+ * @param nameParent The parent name of this name, if it exists
27
+ */
28
+ declare function updateNameRegistryData(connection: Connection, name: string, offset: number, input_data: Buffer, nameClass?: PublicKey, nameParent?: PublicKey): Promise<TransactionInstruction>;
29
+ /**
30
+ * Change the owner of a given name account.
31
+ *
32
+ * @param connection The solana connection object to the RPC node
33
+ * @param name The name of the name account
34
+ * @param newOwner The new owner to be set
35
+ * @param nameClass The class of this name, if it exsists
36
+ * @param nameParent The parent name of this name, if it exists
37
+ * @param parentOwner Parent name owner
38
+ * @returns
39
+ */
40
+ declare function transferNameOwnership(connection: Connection, name: string, newOwner: PublicKey, nameClass?: PublicKey, nameParent?: PublicKey, parentOwner?: PublicKey): Promise<TransactionInstruction>;
41
+ /**
42
+ * Delete the name account and transfer the rent to the target.
43
+ *
44
+ * @param connection The solana connection object to the RPC node
45
+ * @param name The name of the name account
46
+ * @param refundTargetKey The refund destination address
47
+ * @param nameClass The class of this name, if it exsists
48
+ * @param nameParent The parent name of this name, if it exists
49
+ * @returns
50
+ */
51
+ declare function deleteNameRegistry(connection: Connection, name: string, refundTargetKey: PublicKey, nameClass?: PublicKey, nameParent?: PublicKey): Promise<TransactionInstruction>;
52
+ export declare const devnet: {
53
+ utils: {
54
+ getNameAccountKeySync: (hashed_name: Buffer, nameClass?: PublicKey, nameParent?: PublicKey) => PublicKey;
55
+ reverseLookup: (connection: Connection, nameAccount: PublicKey) => Promise<string>;
56
+ _deriveSync: (name: string, parent?: PublicKey, classKey?: PublicKey) => {
57
+ pubkey: PublicKey;
58
+ hashed: Buffer;
59
+ };
60
+ getDomainKeySync: (domain: string) => {
61
+ isSub: boolean;
62
+ parent: PublicKey;
63
+ pubkey: PublicKey;
64
+ hashed: Buffer;
65
+ } | {
66
+ isSub: boolean;
67
+ parent: undefined;
68
+ pubkey: PublicKey;
69
+ hashed: Buffer;
70
+ };
71
+ getReverseKeySync: (domain: string, isSub?: boolean) => PublicKey;
72
+ };
73
+ constants: {
74
+ /**
75
+ * The Solana Name Service program ID
76
+ */
77
+ NAME_PROGRAM_ID: PublicKey;
78
+ /**
79
+ * Hash prefix used to derive domain name addresses
80
+ */
81
+ HASH_PREFIX: string;
82
+ /**
83
+ * The `.sol` TLD
84
+ */
85
+ ROOT_DOMAIN_ACCOUNT: PublicKey;
86
+ /**
87
+ * The Registry program ID
88
+ */
89
+ REGISTER_PROGRAM_ID: PublicKey;
90
+ /**
91
+ * The reverse look up class
92
+ */
93
+ REVERSE_LOOKUP_CLASS: PublicKey;
94
+ USDC_MINT: PublicKey;
95
+ REFERRERS: PublicKey[];
96
+ TOKENS_SYM_MINT: Map<string, string>;
97
+ PYTH_MAPPING_ACC: PublicKey;
98
+ VAULT_OWNER: PublicKey;
99
+ };
100
+ bindings: {
101
+ createNameRegistry: typeof createNameRegistry;
102
+ updateNameRegistryData: typeof updateNameRegistryData;
103
+ transferNameOwnership: typeof transferNameOwnership;
104
+ deleteNameRegistry: typeof deleteNameRegistry;
105
+ registerDomainName: (connection: Connection, name: string, space: number, buyer: PublicKey, buyerTokenAccount: PublicKey, mint?: PublicKey, referrerKey?: PublicKey) => Promise<TransactionInstruction[][]>;
106
+ createReverseName: (nameAccount: PublicKey, name: string, feePayer: PublicKey, parentName?: PublicKey, parentNameOwner?: PublicKey) => Promise<TransactionInstruction[][]>;
107
+ createSubdomain: (connection: Connection, subdomain: string, owner: PublicKey, space?: number) => Promise<TransactionInstruction[][]>;
108
+ burnDomain: (domain: string, owner: PublicKey, target: PublicKey) => TransactionInstruction;
109
+ transferSubdomain: (connection: Connection, subdomain: string, newOwner: PublicKey, isParentOwnerSigner?: boolean, owner?: PublicKey) => Promise<TransactionInstruction>;
110
+ };
111
+ };
112
+ export {};
@@ -50,3 +50,12 @@ export declare const getFavoriteDomain: (connection: Connection, owner: PublicKe
50
50
  reverse: string;
51
51
  stale: boolean;
52
52
  }>;
53
+ /**
54
+ * This function can be used to retrieve the favorite domains for multiple wallets, up to a maximum of 100.
55
+ * If a wallet does not have a favorite domain, the result will be 'undefined' instead of the human readable domain as a string.
56
+ * This function is optimized for network efficiency, making only four RPC calls, three of which are executed in parallel using Promise.all, thereby reducing the overall execution time.
57
+ * @param connection The Solana RPC connection object
58
+ * @param wallets An array of PublicKeys representing the wallets
59
+ * @returns A promise that resolves to an array of strings or undefined, representing the favorite domains or lack thereof for each wallet
60
+ */
61
+ export declare const getMultipleFavoriteDomains: (connection: Connection, wallets: PublicKey[]) => Promise<(string | undefined)[]>;