@bonfida/spl-name-service 2.0.0-alpha.8 → 2.0.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.
@@ -2,7 +2,6 @@
2
2
  import { Buffer } from "buffer";
3
3
  import { Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
4
4
  import { Record } from "./types/record";
5
- import { RecordV2 } from "./record_v2";
6
5
  /**
7
6
  * Creates a name account with the given rent budget, allocated space, owner and class.
8
7
  *
@@ -95,7 +94,6 @@ export declare const createSubdomain: (connection: Connection, subdomain: string
95
94
  export declare const createRecordInstruction: (connection: Connection, domain: string, record: Record, data: string, owner: PublicKey, payer: PublicKey) => Promise<TransactionInstruction>;
96
95
  /**
97
96
  * This function can be used be create a record V2, it handles the serialization of the record data following SNS-IP 1 guidelines
98
- * @param connection The Solana RPC connection object
99
97
  * @param domain The .sol domain name
100
98
  * @param record The record enum object
101
99
  * @param recordV2 The `RecordV2` object that will be serialized into the record via the update instruction
@@ -103,7 +101,7 @@ export declare const createRecordInstruction: (connection: Connection, domain: s
103
101
  * @param payer The fee payer of the transaction
104
102
  * @returns
105
103
  */
106
- export declare const createRecordV2Instruction: (connection: Connection, domain: string, record: Record, recordV2: RecordV2, owner: PublicKey, payer: PublicKey) => Promise<TransactionInstruction>;
104
+ export declare const createRecordV2Instruction: (domain: string, record: Record, content: string, owner: PublicKey, payer: PublicKey) => TransactionInstruction;
107
105
  export declare const updateRecordInstruction: (connection: Connection, domain: string, record: Record, data: string, owner: PublicKey, payer: PublicKey) => Promise<TransactionInstruction[]>;
108
106
  /**
109
107
  * This function updates the content of a record V2. The data serialization follows the SNS-IP 1 guidelines
@@ -115,7 +113,7 @@ export declare const updateRecordInstruction: (connection: Connection, domain: s
115
113
  * @param payer The fee payer of the transaction
116
114
  * @returns The update record instructions
117
115
  */
118
- export declare const updateRecordV2Instruction: (connection: Connection, domain: string, record: Record, recordV2: RecordV2, owner: PublicKey, payer: PublicKey) => Promise<TransactionInstruction[]>;
116
+ export declare const updateRecordV2Instruction: (domain: string, record: Record, content: string, owner: PublicKey, payer: PublicKey) => TransactionInstruction;
119
117
  /**
120
118
  * This function deletes a record v2 and returns the rent to the fee payer
121
119
  * @param domain The .sol domain name
@@ -124,7 +122,10 @@ export declare const updateRecordV2Instruction: (connection: Connection, domain:
124
122
  * @param payer The fee payer of the transaction
125
123
  * @returns The delete transaction instruction
126
124
  */
127
- export declare const deleteRecordV2: (domain: string, record: Record, owner: PublicKey, payer: PublicKey) => Promise<TransactionInstruction>;
125
+ export declare const deleteRecordV2: (domain: string, record: Record, owner: PublicKey, payer: PublicKey) => TransactionInstruction;
126
+ export declare const validateRecordV2Content: (staleness: boolean, domain: string, record: Record, owner: PublicKey, payer: PublicKey, verifier: PublicKey) => TransactionInstruction;
127
+ export declare const writRoaRecordV2: (domain: string, record: Record, owner: PublicKey, payer: PublicKey, roaId: PublicKey) => TransactionInstruction;
128
+ export declare const ethValidateRecordV2Content: (domain: string, record: Record, owner: PublicKey, payer: PublicKey, signature: Buffer, expectedPubkey: Buffer) => TransactionInstruction;
128
129
  /**
129
130
  * This function can be used to create a SOL record (V1)
130
131
  * @param connection The Solana RPC connection object
@@ -137,3 +138,17 @@ export declare const deleteRecordV2: (domain: string, record: Record, owner: Pub
137
138
  */
138
139
  export declare const createSolRecordInstruction: (connection: Connection, domain: string, content: PublicKey, signer: PublicKey, signature: Uint8Array, payer: PublicKey) => Promise<TransactionInstruction[]>;
139
140
  export declare const updateSolRecordInstruction: (connection: Connection, domain: string, content: PublicKey, signer: PublicKey, signature: Uint8Array, payer: PublicKey) => Promise<(TransactionInstruction | TransactionInstruction[])[]>;
141
+ export declare const burnDomain: (domain: string, owner: PublicKey, target: PublicKey) => TransactionInstruction;
142
+ export declare const registerWithNft: (name: string, space: number, nameAccount: PublicKey, reverseLookupAccount: PublicKey, buyer: PublicKey, nftSource: PublicKey, nftMetadata: PublicKey, nftMint: PublicKey, masterEdition: PublicKey) => TransactionInstruction;
143
+ /**
144
+ * This function is used to transfer the ownership of a subdomain in the Solana Name Service.
145
+ *
146
+ * @param {Connection} connection - The Solana RPC connection object.
147
+ * @param {string} subdomain - The subdomain to transfer. It can be with or without .sol suffix (e.g., 'something.bonfida.sol' or 'something.bonfida').
148
+ * @param {PublicKey} newOwner - The public key of the new owner of the subdomain.
149
+ * @param {boolean} [isParentOwnerSigner=false] - A flag indicating whether the parent name owner is signing this transfer.
150
+ * @param {PublicKey} [owner] - The public key of the current owner of the subdomain. This is an optional parameter. If not provided, the owner will be resolved automatically. This can be helpful to build transactions when the subdomain does not exist yet.
151
+ *
152
+ * @returns {Promise<TransactionInstruction>} - A promise that resolves to a Solana instruction for the transfer operation.
153
+ */
154
+ export declare const transferSubdomain: (connection: Connection, subdomain: string, newOwner: PublicKey, isParentOwnerSigner?: boolean, owner?: PublicKey) => Promise<TransactionInstruction>;
@@ -45,3 +45,6 @@ export declare const REFERRERS: PublicKey[];
45
45
  export declare const TOKENS_SYM_MINT: Map<string, string>;
46
46
  export declare const PYTH_MAPPING_ACC: PublicKey;
47
47
  export declare const VAULT_OWNER: PublicKey;
48
+ export declare const CUSTOM_BG_TLD: PublicKey;
49
+ export declare const WOLVES_COLLECTION_METADATA: PublicKey;
50
+ export declare const METAPLEX_ID: PublicKey;
@@ -0,0 +1,7 @@
1
+ import { PublicKey } from "@solana/web3.js";
2
+ import { CustomBg } from "./types/custom-bg";
3
+ export declare const getCustomBgKeys: (domain: string, customBg: CustomBg) => {
4
+ domainKey: PublicKey;
5
+ bgKey: PublicKey;
6
+ };
7
+ export declare const getArtistPubkey: (bg: CustomBg) => PublicKey;
package/dist/error.d.ts CHANGED
@@ -21,10 +21,13 @@ export declare enum ErrorType {
21
21
  NoAccountData = "NoAccountData",
22
22
  InvalidInput = "InvalidInput",
23
23
  InvalidDomain = "InvalidDomain",
24
+ InvalidCustomBg = "InvalidCustomBackground",
24
25
  UnsupportedSignature = "UnsupportedSignature",
25
26
  RecordDoestNotSupportGuardianSig = "RecordDoestNotSupportGuardianSig",
26
27
  RecordIsNotSigned = "RecordIsNotSigned",
27
- UnsupportedSignatureType = "UnsupportedSignatureType"
28
+ UnsupportedSignatureType = "UnsupportedSignatureType",
29
+ InvalidSolRecordV2 = "InvalidSolRecordV2",
30
+ MissingVerifier = "MissingVerifier"
28
31
  }
29
32
  export declare class SNSError extends Error {
30
33
  type: ErrorType;