@x1id/resolve 0.19.0 → 0.19.1
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/adminMarket.d.ts +13 -2
- package/dist/adminMarket.js +6 -1
- package/dist/base58.js +8 -0
- package/package.json +1 -1
package/dist/adminMarket.d.ts
CHANGED
|
@@ -44,9 +44,20 @@ export declare const NAMESPACE_MAX_LEN = 16;
|
|
|
44
44
|
export type NamespaceStatus = "Active" | "Paused" | "Retired";
|
|
45
45
|
export interface CreateNamespaceParams {
|
|
46
46
|
readonly programId: AddressLike;
|
|
47
|
-
/**
|
|
48
|
-
|
|
47
|
+
/** The creator — signs AND pays rent + the creation fee; writable.
|
|
48
|
+
* Permissionless: any wallet, not an admin. (Was mis-named `admin` and
|
|
49
|
+
* built with too few accounts, so the ix failed AccountNotEnoughKeys 3005 —
|
|
50
|
+
* W169.) */
|
|
51
|
+
readonly payer: AddressLike;
|
|
49
52
|
readonly config: AddressLike;
|
|
53
|
+
/** `Config.treasury` — receives the creation fee; writable. */
|
|
54
|
+
readonly treasury: AddressLike;
|
|
55
|
+
/** The creator's chosen payout wallet, recorded on the namespace for future
|
|
56
|
+
* 75% primary/secondary cuts. An arbitrary pubkey; never signs. */
|
|
57
|
+
readonly creatorPayout: AddressLike;
|
|
58
|
+
/** `["reserved_namespace", label]` PDA — the denylist shadow the handler
|
|
59
|
+
* refuses creation against if it exists; read-only, never written. */
|
|
60
|
+
readonly reserved: AddressLike;
|
|
50
61
|
/** `["namespace", label]` PDA — init, writable. */
|
|
51
62
|
readonly namespace: AddressLike;
|
|
52
63
|
/** Canonical ASCII label (a-z 0-9 -), 1..=16 bytes — an instruction ARG. */
|
package/dist/adminMarket.js
CHANGED
|
@@ -111,9 +111,14 @@ export function buildCreateNamespaceIx(p) {
|
|
|
111
111
|
throw new Error(`label must be 1..=${NAMESPACE_MAX_LEN} chars`);
|
|
112
112
|
}
|
|
113
113
|
const data = concat([CREATE_NAMESPACE_DISCRIMINATOR, borshString(p.label)]);
|
|
114
|
+
// Account order matches the program's `CreateNamespace` context exactly:
|
|
115
|
+
// payer, config, treasury, creator_payout, reserved, namespace, system.
|
|
114
116
|
const keys = [
|
|
115
|
-
{ pubkey: toBase58(p.
|
|
117
|
+
{ pubkey: toBase58(p.payer, "payer"), isSigner: true, isWritable: true },
|
|
116
118
|
{ pubkey: toBase58(p.config, "config"), isSigner: false, isWritable: false },
|
|
119
|
+
{ pubkey: toBase58(p.treasury, "treasury"), isSigner: false, isWritable: true },
|
|
120
|
+
{ pubkey: toBase58(p.creatorPayout, "creatorPayout"), isSigner: false, isWritable: false },
|
|
121
|
+
{ pubkey: toBase58(p.reserved, "reserved"), isSigner: false, isWritable: false },
|
|
117
122
|
{ pubkey: toBase58(p.namespace, "namespace"), isSigner: false, isWritable: true },
|
|
118
123
|
{ pubkey: toBase58(p.systemProgram ?? SYSTEM_PROGRAM_ID, "systemProgram"), isSigner: false, isWritable: false },
|
|
119
124
|
];
|
package/dist/base58.js
CHANGED
|
@@ -65,5 +65,13 @@ export function decodeBase58_32(s) {
|
|
|
65
65
|
out[i] = Number(n & 255n);
|
|
66
66
|
n >>= 8n;
|
|
67
67
|
}
|
|
68
|
+
// W167: reject anything that isn't the canonical base58 of EXACTLY these 32
|
|
69
|
+
// bytes. Without this, a short valid-base58 string ("notakey") decodes to a
|
|
70
|
+
// small number and is silently LEFT-PADDED into a bogus 32-byte "address",
|
|
71
|
+
// so builders / sign-in / resolve / MCP prepare_register accept garbage as a
|
|
72
|
+
// pubkey. The round-trip also correctly accepts a real key with leading zero
|
|
73
|
+
// bytes (encodeBase58 re-emits its leading '1's).
|
|
74
|
+
if (encodeBase58(out) !== s)
|
|
75
|
+
return null;
|
|
68
76
|
return out;
|
|
69
77
|
}
|