@bonfida/spl-name-service 0.1.34 → 0.1.35
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/bindings.d.ts +13 -0
- package/dist/bindings.js +24 -1
- package/dist/bindings.js.map +1 -1
- package/dist/instructions.d.ts +13 -0
- package/dist/instructions.js +103 -1
- package/dist/instructions.js.map +1 -1
- package/package.json +1 -1
- package/src/bindings.ts +69 -1
- package/src/instructions.ts +127 -2
package/dist/bindings.d.ts
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
3
3
|
export declare const NAME_PROGRAM_ID: PublicKey;
|
|
4
4
|
export declare const HASH_PREFIX = "SPL Name Service";
|
|
5
|
+
export declare const REGISTER_PROGRAM_ID: PublicKey;
|
|
6
|
+
export declare const PYTH_FIDDA_PRICE_ACC: PublicKey;
|
|
7
|
+
export declare const BONFIDA_FIDA_BNB: PublicKey;
|
|
8
|
+
export declare const ROOT_DOMAIN_ACCOUNT: PublicKey;
|
|
5
9
|
/**
|
|
6
10
|
* Creates a name account with the given rent budget, allocated space, owner and class.
|
|
7
11
|
*
|
|
@@ -51,3 +55,12 @@ export declare function transferNameOwnership(connection: Connection, name: stri
|
|
|
51
55
|
* @returns
|
|
52
56
|
*/
|
|
53
57
|
export declare function deleteNameRegistry(connection: Connection, name: string, refundTargetKey: PublicKey, nameClass?: PublicKey, nameParent?: PublicKey): Promise<TransactionInstruction>;
|
|
58
|
+
/**
|
|
59
|
+
* This function can be used to register a .sol domain
|
|
60
|
+
* @param name The domain name to register e.g bonfida if you want to register bonfida.sol
|
|
61
|
+
* @param space The domain name account size (max 10kB)
|
|
62
|
+
* @param buyer The public key of the buyer
|
|
63
|
+
* @param buyerTokenAccount The buyer FIDA token account
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
export declare const registerDomainName: (name: string, space: number, buyer: PublicKey, buyerTokenAccount: PublicKey) => Promise<TransactionInstruction[][]>;
|
package/dist/bindings.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteNameRegistry = exports.transferNameOwnership = exports.updateNameRegistryData = exports.createNameRegistry = exports.HASH_PREFIX = exports.NAME_PROGRAM_ID = void 0;
|
|
3
|
+
exports.registerDomainName = exports.deleteNameRegistry = exports.transferNameOwnership = exports.updateNameRegistryData = exports.createNameRegistry = exports.ROOT_DOMAIN_ACCOUNT = exports.BONFIDA_FIDA_BNB = exports.PYTH_FIDDA_PRICE_ACC = exports.REGISTER_PROGRAM_ID = exports.HASH_PREFIX = exports.NAME_PROGRAM_ID = void 0;
|
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
|
5
5
|
const instructions_1 = require("./instructions");
|
|
6
6
|
const state_1 = require("./state");
|
|
@@ -9,6 +9,10 @@ const utils_2 = require("./utils");
|
|
|
9
9
|
////////////////////////////////////////////////////////////
|
|
10
10
|
exports.NAME_PROGRAM_ID = new web3_js_1.PublicKey("namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX");
|
|
11
11
|
exports.HASH_PREFIX = "SPL Name Service";
|
|
12
|
+
exports.REGISTER_PROGRAM_ID = new web3_js_1.PublicKey("jCebN34bUfdeUYJT13J1yG16XWQpt5PDx6Mse9GUqhR");
|
|
13
|
+
exports.PYTH_FIDDA_PRICE_ACC = new web3_js_1.PublicKey("ETp9eKXVv1dWwHSpsXRUuXHmw24PwRkttCGVgpZEY9zF");
|
|
14
|
+
exports.BONFIDA_FIDA_BNB = new web3_js_1.PublicKey("AUoZ3YAhV3b2rZeEH93UMZHXUZcTramBvb4d9YEVySkc");
|
|
15
|
+
exports.ROOT_DOMAIN_ACCOUNT = new web3_js_1.PublicKey("58PwtjSDuFHuUkYjH9BYnnQKHfwo9reZhC2zMJv9JPkx");
|
|
12
16
|
////////////////////////////////////////////////////////////
|
|
13
17
|
/**
|
|
14
18
|
* Creates a name account with the given rent budget, allocated space, owner and class.
|
|
@@ -120,4 +124,23 @@ async function deleteNameRegistry(connection, name, refundTargetKey, nameClass,
|
|
|
120
124
|
return changeAuthoritiesInstr;
|
|
121
125
|
}
|
|
122
126
|
exports.deleteNameRegistry = deleteNameRegistry;
|
|
127
|
+
/**
|
|
128
|
+
* This function can be used to register a .sol domain
|
|
129
|
+
* @param name The domain name to register e.g bonfida if you want to register bonfida.sol
|
|
130
|
+
* @param space The domain name account size (max 10kB)
|
|
131
|
+
* @param buyer The public key of the buyer
|
|
132
|
+
* @param buyerTokenAccount The buyer FIDA token account
|
|
133
|
+
* @returns
|
|
134
|
+
*/
|
|
135
|
+
const registerDomainName = async (name, space, buyer, buyerTokenAccount) => {
|
|
136
|
+
const [centralState] = await web3_js_1.PublicKey.findProgramAddress([exports.REGISTER_PROGRAM_ID.toBuffer()], exports.REGISTER_PROGRAM_ID);
|
|
137
|
+
const hashed = await utils_2.getHashedName(name);
|
|
138
|
+
const nameAccount = await utils_2.getNameAccountKey(hashed, undefined, exports.ROOT_DOMAIN_ACCOUNT);
|
|
139
|
+
const hashedReverseLookup = await utils_2.getHashedName(nameAccount.toBase58());
|
|
140
|
+
const reverseLookupAccount = await utils_2.getNameAccountKey(hashedReverseLookup, centralState);
|
|
141
|
+
const [derived_state] = await web3_js_1.PublicKey.findProgramAddress([nameAccount.toBuffer()], exports.REGISTER_PROGRAM_ID);
|
|
142
|
+
const ix = new instructions_1.createV2Instruction({ name, space }).getInstruction(exports.REGISTER_PROGRAM_ID, web3_js_1.SYSVAR_RENT_PUBKEY, exports.NAME_PROGRAM_ID, exports.ROOT_DOMAIN_ACCOUNT, nameAccount, reverseLookupAccount, centralState, buyer, buyerTokenAccount, exports.BONFIDA_FIDA_BNB, derived_state);
|
|
143
|
+
return [[], [ix]];
|
|
144
|
+
};
|
|
145
|
+
exports.registerDomainName = registerDomainName;
|
|
123
146
|
//# sourceMappingURL=bindings.js.map
|
package/dist/bindings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindings.js","sourceRoot":"","sources":["../src/bindings.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"bindings.js","sourceRoot":"","sources":["../src/bindings.ts"],"names":[],"mappings":";;;AAAA,6CAMyB;AACzB,iDAMwB;AACxB,mCAA4C;AAC5C,mCAAoC;AACpC,mCAKiB;AAEjB,4DAA4D;AAE/C,QAAA,eAAe,GAAG,IAAI,mBAAS,CAC1C,6CAA6C,CAC9C,CAAC;AACW,QAAA,WAAW,GAAG,kBAAkB,CAAC;AAEjC,QAAA,mBAAmB,GAAG,IAAI,mBAAS,CAC9C,6CAA6C,CAC9C,CAAC;AACW,QAAA,oBAAoB,GAAG,IAAI,mBAAS,CAC/C,8CAA8C,CAC/C,CAAC;AACW,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAC3C,8CAA8C,CAC/C,CAAC;AACW,QAAA,mBAAmB,GAAG,IAAI,mBAAS,CAC9C,8CAA8C,CAC/C,CAAC;AAEF,4DAA4D;AAC5D;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,kBAAkB,CACtC,UAAsB,EACtB,IAAY,EACZ,KAAa,EACb,QAAmB,EACnB,SAAoB,EACpB,QAAiB,EACjB,SAAqB,EACrB,UAAsB;IAEtB,MAAM,WAAW,GAAG,MAAM,qBAAa,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,cAAc,GAAG,MAAM,yBAAiB,CAC5C,WAAW,EACX,SAAS,EACT,UAAU,CACX,CAAC;IAEF,MAAM,OAAO,GAAG,QAAQ;QACtB,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,MAAM,UAAU,CAAC,iCAAiC,CAAC,KAAK,CAAC,CAAC;IAE9D,IAAI,eAAsC,CAAC;IAC3C,IAAI,UAAU,EAAE;QACd,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,oBA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IACF,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,mBAAS,CAAC,kBAAkB,CACvD,CAAC,2BAAmB,CAAC,QAAQ,EAAE,CAAC,EAChC,2BAAmB,CACpB,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,qBAAa,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,WAAW,GAAG,MAAM,yBAAiB,CACzC,MAAM,EACN,SAAS,EACT,2BAAmB,CACpB,CAAC;IAEF,MAAM,mBAAmB,GAAG,MAAM,qBAAa,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxE,MAAM,oBAAoB,GAAG,MAAM,yBAAiB,CAClD,mBAAmB,EACnB,YAAY,CACb,CAAC;IAEF,MAAM,CAAC,aAAa,CAAC,GAAG,MAAM,mBAAS,CAAC,kBAAkB,CACxD,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,EACxB,2BAAmB,CACpB,CAAC;IAEF,MAAM,EAAE,GAAG,IAAI,kCAAmB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,cAAc,CAChE,2BAAmB,EACnB,4BAAkB,EAClB,uBAAe,EACf,2BAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,KAAK,EACL,iBAAiB,EACjB,wBAAgB,EAChB,aAAa,CACd,CAAC;IAEF,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC;AA5CW,QAAA,kBAAkB,sBA4C7B"}
|
package/dist/instructions.d.ts
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
3
3
|
import { Numberu32, Numberu64 } from "./utils";
|
|
4
|
+
import { Schema } from "borsh";
|
|
4
5
|
export declare function createInstruction(nameProgramId: PublicKey, systemProgramId: PublicKey, nameKey: PublicKey, nameOwnerKey: PublicKey, payerKey: PublicKey, hashed_name: Buffer, lamports: Numberu64, space: Numberu32, nameClassKey?: PublicKey, nameParent?: PublicKey, nameParentOwner?: PublicKey): TransactionInstruction;
|
|
5
6
|
export declare function updateInstruction(nameProgramId: PublicKey, nameAccountKey: PublicKey, offset: Numberu32, input_data: Buffer, nameUpdateSigner: PublicKey): TransactionInstruction;
|
|
6
7
|
export declare function transferInstruction(nameProgramId: PublicKey, nameAccountKey: PublicKey, newOwnerKey: PublicKey, currentNameOwnerKey: PublicKey, nameClassKey?: PublicKey, nameParent?: PublicKey, parentOwner?: PublicKey): TransactionInstruction;
|
|
7
8
|
export declare function deleteInstruction(nameProgramId: PublicKey, nameAccountKey: PublicKey, refundTargetKey: PublicKey, nameOwnerKey: PublicKey): TransactionInstruction;
|
|
9
|
+
export declare class createV2Instruction {
|
|
10
|
+
tag: number;
|
|
11
|
+
name: string;
|
|
12
|
+
space: number;
|
|
13
|
+
static schema: Schema;
|
|
14
|
+
constructor(obj: {
|
|
15
|
+
name: string;
|
|
16
|
+
space: number;
|
|
17
|
+
});
|
|
18
|
+
serialize(): Uint8Array;
|
|
19
|
+
getInstruction(programId: PublicKey, rentSysvarAccount: PublicKey, nameProgramId: PublicKey, rootDomain: PublicKey, nameAccount: PublicKey, reverseLookupAccount: PublicKey, centralState: PublicKey, buyer: PublicKey, buyerTokenAccount: PublicKey, fidaVault: PublicKey, state: PublicKey): TransactionInstruction;
|
|
20
|
+
}
|
package/dist/instructions.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteInstruction = exports.transferInstruction = exports.updateInstruction = exports.createInstruction = void 0;
|
|
3
|
+
exports.createV2Instruction = exports.deleteInstruction = exports.transferInstruction = exports.updateInstruction = exports.createInstruction = void 0;
|
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
|
5
|
+
const spl_token_1 = require("@solana/spl-token");
|
|
5
6
|
const utils_1 = require("./utils");
|
|
7
|
+
const borsh_1 = require("borsh");
|
|
8
|
+
const bindings_1 = require("./bindings");
|
|
6
9
|
function createInstruction(nameProgramId, systemProgramId, nameKey, nameOwnerKey, payerKey, hashed_name, lamports, space, nameClassKey, nameParent, nameParentOwner) {
|
|
7
10
|
const buffers = [
|
|
8
11
|
Buffer.from(Int8Array.from([0])),
|
|
@@ -175,4 +178,103 @@ function deleteInstruction(nameProgramId, nameAccountKey, refundTargetKey, nameO
|
|
|
175
178
|
});
|
|
176
179
|
}
|
|
177
180
|
exports.deleteInstruction = deleteInstruction;
|
|
181
|
+
class createV2Instruction {
|
|
182
|
+
constructor(obj) {
|
|
183
|
+
this.tag = 9;
|
|
184
|
+
this.name = obj.name;
|
|
185
|
+
this.space = obj.space;
|
|
186
|
+
}
|
|
187
|
+
serialize() {
|
|
188
|
+
return borsh_1.serialize(createV2Instruction.schema, this);
|
|
189
|
+
}
|
|
190
|
+
getInstruction(programId, rentSysvarAccount, nameProgramId, rootDomain, nameAccount, reverseLookupAccount, centralState, buyer, buyerTokenAccount, fidaVault, state) {
|
|
191
|
+
const data = Buffer.from(this.serialize());
|
|
192
|
+
const keys = [
|
|
193
|
+
{
|
|
194
|
+
pubkey: rentSysvarAccount,
|
|
195
|
+
isSigner: false,
|
|
196
|
+
isWritable: false,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
pubkey: nameProgramId,
|
|
200
|
+
isSigner: false,
|
|
201
|
+
isWritable: false,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
pubkey: rootDomain,
|
|
205
|
+
isSigner: false,
|
|
206
|
+
isWritable: false,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
pubkey: nameAccount,
|
|
210
|
+
isSigner: false,
|
|
211
|
+
isWritable: true,
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
pubkey: reverseLookupAccount,
|
|
215
|
+
isSigner: false,
|
|
216
|
+
isWritable: true,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
pubkey: web3_js_1.SystemProgram.programId,
|
|
220
|
+
isSigner: false,
|
|
221
|
+
isWritable: false,
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
pubkey: centralState,
|
|
225
|
+
isSigner: false,
|
|
226
|
+
isWritable: false,
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
pubkey: buyer,
|
|
230
|
+
isSigner: true,
|
|
231
|
+
isWritable: true,
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
pubkey: buyerTokenAccount,
|
|
235
|
+
isSigner: false,
|
|
236
|
+
isWritable: true,
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
pubkey: bindings_1.PYTH_FIDDA_PRICE_ACC,
|
|
240
|
+
isSigner: false,
|
|
241
|
+
isWritable: false,
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
pubkey: fidaVault,
|
|
245
|
+
isSigner: false,
|
|
246
|
+
isWritable: true,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
pubkey: spl_token_1.TOKEN_PROGRAM_ID,
|
|
250
|
+
isSigner: false,
|
|
251
|
+
isWritable: false,
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
pubkey: state,
|
|
255
|
+
isSigner: false,
|
|
256
|
+
isWritable: false,
|
|
257
|
+
},
|
|
258
|
+
];
|
|
259
|
+
return new web3_js_1.TransactionInstruction({
|
|
260
|
+
keys,
|
|
261
|
+
programId,
|
|
262
|
+
data,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
exports.createV2Instruction = createV2Instruction;
|
|
267
|
+
createV2Instruction.schema = new Map([
|
|
268
|
+
[
|
|
269
|
+
createV2Instruction,
|
|
270
|
+
{
|
|
271
|
+
kind: "struct",
|
|
272
|
+
fields: [
|
|
273
|
+
["tag", "u8"],
|
|
274
|
+
["name", "string"],
|
|
275
|
+
["space", "u32"],
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
]);
|
|
178
280
|
//# sourceMappingURL=instructions.js.map
|
package/dist/instructions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":";;;AAAA,6CAIyB;AACzB,iDAAqD;AACrD,mCAA+C;AAC/C,iCAA0C;AAC1C,yCAAkD;AAElD,SAAgB,iBAAiB,CAC/B,aAAwB,EACxB,eAA0B,EAC1B,OAAkB,EAClB,YAAuB,EACvB,QAAmB,EACnB,WAAmB,EACnB,QAAmB,EACnB,KAAgB,EAChB,YAAwB,EACxB,UAAsB,EACtB,eAA2B;IAE3B,MAAM,OAAO,GAAG;QACd,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChC,YAAY;QACZ,IAAI,iBAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;QAC5C,WAAW;QACX,QAAQ,CAAC,QAAQ,EAAE;QACnB,KAAK,CAAC,QAAQ,EAAE;KACjB,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEpC,MAAM,IAAI,GAAG;QACX;YACE,MAAM,EAAE,eAAe;YACvB,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;QACD;YACE,MAAM,EAAE,QAAQ;YAChB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,YAAY;YACpB,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;KACF,CAAC;IAEF,IAAI,YAAY,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AAU,EAAE,KAAK;aAClB;YACD;gBACE,MAAM,EAAE,SAAS;gBACjB,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,IAAI;aACjB;YACD;gBACE,MAAM,EAAE,4BAAgB;gBACxB,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;aAClB;YACD;gBACE,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;aAClB;SACF,CAAC;QAEF,OAAO,IAAI,gCAAsB,CAAC;YAChC,IAAI;YACJ,SAAS;YACT,IAAI;SACL,CAAC,CAAC;IACL,CAAC;;AApHH,kDAqHC;AAhHQ,0BAAM,GAAW,IAAI,GAAG,CAAC;IAC9B;QACE,mBAAmB;QACnB;YACE,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE;gBACN,CAAC,KAAK,EAAE,IAAI,CAAC;gBACb,CAAC,MAAM,EAAE,QAAQ,CAAC;gBAClB,CAAC,OAAO,EAAE,KAAK,CAAC;aACjB;SACF;KACF;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/bindings.ts
CHANGED
|
@@ -3,13 +3,14 @@ import {
|
|
|
3
3
|
PublicKey,
|
|
4
4
|
SystemProgram,
|
|
5
5
|
TransactionInstruction,
|
|
6
|
+
SYSVAR_RENT_PUBKEY,
|
|
6
7
|
} from "@solana/web3.js";
|
|
7
|
-
|
|
8
8
|
import {
|
|
9
9
|
createInstruction,
|
|
10
10
|
deleteInstruction,
|
|
11
11
|
transferInstruction,
|
|
12
12
|
updateInstruction,
|
|
13
|
+
createV2Instruction,
|
|
13
14
|
} from "./instructions";
|
|
14
15
|
import { NameRegistryState } from "./state";
|
|
15
16
|
import { Numberu64 } from "./utils";
|
|
@@ -27,6 +28,19 @@ export const NAME_PROGRAM_ID = new PublicKey(
|
|
|
27
28
|
);
|
|
28
29
|
export const HASH_PREFIX = "SPL Name Service";
|
|
29
30
|
|
|
31
|
+
export const REGISTER_PROGRAM_ID = new PublicKey(
|
|
32
|
+
"jCebN34bUfdeUYJT13J1yG16XWQpt5PDx6Mse9GUqhR"
|
|
33
|
+
);
|
|
34
|
+
export const PYTH_FIDDA_PRICE_ACC = new PublicKey(
|
|
35
|
+
"ETp9eKXVv1dWwHSpsXRUuXHmw24PwRkttCGVgpZEY9zF"
|
|
36
|
+
);
|
|
37
|
+
export const BONFIDA_FIDA_BNB = new PublicKey(
|
|
38
|
+
"AUoZ3YAhV3b2rZeEH93UMZHXUZcTramBvb4d9YEVySkc"
|
|
39
|
+
);
|
|
40
|
+
export const ROOT_DOMAIN_ACCOUNT = new PublicKey(
|
|
41
|
+
"58PwtjSDuFHuUkYjH9BYnnQKHfwo9reZhC2zMJv9JPkx"
|
|
42
|
+
);
|
|
43
|
+
|
|
30
44
|
////////////////////////////////////////////////////////////
|
|
31
45
|
/**
|
|
32
46
|
* Creates a name account with the given rent budget, allocated space, owner and class.
|
|
@@ -225,3 +239,57 @@ export async function deleteNameRegistry(
|
|
|
225
239
|
|
|
226
240
|
return changeAuthoritiesInstr;
|
|
227
241
|
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* This function can be used to register a .sol domain
|
|
245
|
+
* @param name The domain name to register e.g bonfida if you want to register bonfida.sol
|
|
246
|
+
* @param space The domain name account size (max 10kB)
|
|
247
|
+
* @param buyer The public key of the buyer
|
|
248
|
+
* @param buyerTokenAccount The buyer FIDA token account
|
|
249
|
+
* @returns
|
|
250
|
+
*/
|
|
251
|
+
export const registerDomainName = async (
|
|
252
|
+
name: string,
|
|
253
|
+
space: number,
|
|
254
|
+
buyer: PublicKey,
|
|
255
|
+
buyerTokenAccount: PublicKey
|
|
256
|
+
) => {
|
|
257
|
+
const [centralState] = await PublicKey.findProgramAddress(
|
|
258
|
+
[REGISTER_PROGRAM_ID.toBuffer()],
|
|
259
|
+
REGISTER_PROGRAM_ID
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
const hashed = await getHashedName(name);
|
|
263
|
+
const nameAccount = await getNameAccountKey(
|
|
264
|
+
hashed,
|
|
265
|
+
undefined,
|
|
266
|
+
ROOT_DOMAIN_ACCOUNT
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
const hashedReverseLookup = await getHashedName(nameAccount.toBase58());
|
|
270
|
+
const reverseLookupAccount = await getNameAccountKey(
|
|
271
|
+
hashedReverseLookup,
|
|
272
|
+
centralState
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
const [derived_state] = await PublicKey.findProgramAddress(
|
|
276
|
+
[nameAccount.toBuffer()],
|
|
277
|
+
REGISTER_PROGRAM_ID
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
const ix = new createV2Instruction({ name, space }).getInstruction(
|
|
281
|
+
REGISTER_PROGRAM_ID,
|
|
282
|
+
SYSVAR_RENT_PUBKEY,
|
|
283
|
+
NAME_PROGRAM_ID,
|
|
284
|
+
ROOT_DOMAIN_ACCOUNT,
|
|
285
|
+
nameAccount,
|
|
286
|
+
reverseLookupAccount,
|
|
287
|
+
centralState,
|
|
288
|
+
buyer,
|
|
289
|
+
buyerTokenAccount,
|
|
290
|
+
BONFIDA_FIDA_BNB,
|
|
291
|
+
derived_state
|
|
292
|
+
);
|
|
293
|
+
|
|
294
|
+
return [[], [ix]];
|
|
295
|
+
};
|
package/src/instructions.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
PublicKey,
|
|
3
|
+
TransactionInstruction,
|
|
4
|
+
SystemProgram,
|
|
5
|
+
} from "@solana/web3.js";
|
|
6
|
+
import { TOKEN_PROGRAM_ID } from "@solana/spl-token";
|
|
3
7
|
import { Numberu32, Numberu64 } from "./utils";
|
|
8
|
+
import { Schema, serialize } from "borsh";
|
|
9
|
+
import { PYTH_FIDDA_PRICE_ACC } from "./bindings";
|
|
4
10
|
|
|
5
11
|
export function createInstruction(
|
|
6
12
|
nameProgramId: PublicKey,
|
|
@@ -215,3 +221,122 @@ export function deleteInstruction(
|
|
|
215
221
|
data,
|
|
216
222
|
});
|
|
217
223
|
}
|
|
224
|
+
|
|
225
|
+
export class createV2Instruction {
|
|
226
|
+
tag: number;
|
|
227
|
+
name: string;
|
|
228
|
+
space: number;
|
|
229
|
+
|
|
230
|
+
static schema: Schema = new Map([
|
|
231
|
+
[
|
|
232
|
+
createV2Instruction,
|
|
233
|
+
{
|
|
234
|
+
kind: "struct",
|
|
235
|
+
fields: [
|
|
236
|
+
["tag", "u8"],
|
|
237
|
+
["name", "string"],
|
|
238
|
+
["space", "u32"],
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
]);
|
|
243
|
+
|
|
244
|
+
constructor(obj: { name: string; space: number }) {
|
|
245
|
+
this.tag = 9;
|
|
246
|
+
this.name = obj.name;
|
|
247
|
+
this.space = obj.space;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
serialize(): Uint8Array {
|
|
251
|
+
return serialize(createV2Instruction.schema, this);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
getInstruction(
|
|
255
|
+
programId: PublicKey,
|
|
256
|
+
rentSysvarAccount: PublicKey,
|
|
257
|
+
nameProgramId: PublicKey,
|
|
258
|
+
rootDomain: PublicKey,
|
|
259
|
+
nameAccount: PublicKey,
|
|
260
|
+
reverseLookupAccount: PublicKey,
|
|
261
|
+
centralState: PublicKey,
|
|
262
|
+
buyer: PublicKey,
|
|
263
|
+
buyerTokenAccount: PublicKey,
|
|
264
|
+
fidaVault: PublicKey,
|
|
265
|
+
state: PublicKey
|
|
266
|
+
): TransactionInstruction {
|
|
267
|
+
const data = Buffer.from(this.serialize());
|
|
268
|
+
const keys = [
|
|
269
|
+
{
|
|
270
|
+
pubkey: rentSysvarAccount,
|
|
271
|
+
isSigner: false,
|
|
272
|
+
isWritable: false,
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
pubkey: nameProgramId,
|
|
276
|
+
isSigner: false,
|
|
277
|
+
isWritable: false,
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
pubkey: rootDomain,
|
|
281
|
+
isSigner: false,
|
|
282
|
+
isWritable: false,
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
pubkey: nameAccount,
|
|
286
|
+
isSigner: false,
|
|
287
|
+
isWritable: true,
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
pubkey: reverseLookupAccount,
|
|
291
|
+
isSigner: false,
|
|
292
|
+
isWritable: true,
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
pubkey: SystemProgram.programId,
|
|
296
|
+
isSigner: false,
|
|
297
|
+
isWritable: false,
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
pubkey: centralState,
|
|
301
|
+
isSigner: false,
|
|
302
|
+
isWritable: false,
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
pubkey: buyer,
|
|
306
|
+
isSigner: true,
|
|
307
|
+
isWritable: true,
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
pubkey: buyerTokenAccount,
|
|
311
|
+
isSigner: false,
|
|
312
|
+
isWritable: true,
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
pubkey: PYTH_FIDDA_PRICE_ACC,
|
|
316
|
+
isSigner: false,
|
|
317
|
+
isWritable: false,
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
pubkey: fidaVault,
|
|
321
|
+
isSigner: false,
|
|
322
|
+
isWritable: true,
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
pubkey: TOKEN_PROGRAM_ID,
|
|
326
|
+
isSigner: false,
|
|
327
|
+
isWritable: false,
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
pubkey: state,
|
|
331
|
+
isSigner: false,
|
|
332
|
+
isWritable: false,
|
|
333
|
+
},
|
|
334
|
+
];
|
|
335
|
+
|
|
336
|
+
return new TransactionInstruction({
|
|
337
|
+
keys,
|
|
338
|
+
programId,
|
|
339
|
+
data,
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}
|