@xgamesfun/solana 0.26.3 → 0.26.4
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/README.md +9 -9
- package/js/approve/live-check.mjs +106 -1
- package/js/approve/page.html +1 -1
- package/js/approve/page.js +19 -5
- package/js/approve/server.mjs +192 -33
- package/js/chain/metadata.js +92 -0
- package/js/economy/check.mjs +10 -2
- package/js/economy/cost.mjs +6 -5
- package/js/economy/explain.mjs +3 -2
- package/js/economy/guide.mjs +1 -1
- package/js/economy/live.mjs +27 -7
- package/js/economy/model.mjs +13 -2
- package/js/economy/plan.mjs +84 -27
- package/js/economy/schema.json +7 -1
- package/js/mcp/tools.mjs +30 -11
- package/package.json +1 -1
- package/release.json +1 -1
- package/skills/xsolana-economy/SKILL.md +4 -4
- package/skills/xsolana-economy/references/telling-the-person.md +4 -2
- package/types/chain/metadata.d.ts +45 -0
- package/types/economy/cost.d.mts +11 -3
- package/types/economy/live.d.mts +29 -5
- package/types/economy/model.d.mts +6 -0
- package/types/economy/plan.d.mts +22 -5
|
@@ -122,8 +122,10 @@ Don'ts:
|
|
|
122
122
|
- **A token the setup makes is named on chain as it goes live**: its `name`, its `symbol` and its `uri` (a link to a
|
|
123
123
|
JSON file the project hosts, `{ "name", "symbol", "image": "https://…" }`), which is what wallets and explorers show.
|
|
124
124
|
Ask for the name, the ticker and a picture before going live: with no `uri` it shows by name and ticker with no
|
|
125
|
-
picture. Only the owner's wallet can change the three later (Token Metadata's rule, not loot's)
|
|
126
|
-
|
|
125
|
+
picture. Only the owner's wallet can change the three later (Token Metadata's rule, not loot's): change them in the
|
|
126
|
+
spec and approve again, and the record is written again for the price of a transaction (approving reads the record
|
|
127
|
+
first: one its owner handed to another wallet, made unchangeable or gave a royalty or creators outside these tools
|
|
128
|
+
is left as it is, and the page says so at each approve until the spec gives the old name back). The record costs about 0.014 SOL (`xsolana_cost` says it:
|
|
127
129
|
rent, and 0.01 SOL Token Metadata keeps). A token that went live before the tools wrote one has none and
|
|
128
130
|
can't be given one: only a mint's own authority can name it, and its minting was handed on or turned off.
|
|
129
131
|
- **NFTs the project has no authority over** (any collection but its own): they count as they are. Say that
|
|
@@ -36,5 +36,50 @@ export declare function createFungibleMetadataIx({ mint, authority, payer, name,
|
|
|
36
36
|
}[];
|
|
37
37
|
data: Uint8Array<any>;
|
|
38
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Token Metadata's UpdateMetadataAccountV2 for a fungible token's record: a new name, ticker and link ('' for none),
|
|
41
|
+
* all three written as given. `authority` is the record's update authority (for a token a setup made: the project's
|
|
42
|
+
* owner) and signs; it stays the update authority, and the record stays changeable. The record's words are written
|
|
43
|
+
* whole, with no royalty, creators, collection or uses: as a record a setup made has them. One that was given any of
|
|
44
|
+
* those outside these tools would lose them (or refuse the write), so the approval sends this only to a record that
|
|
45
|
+
* has none (`parseRecord`'s `plain`; approve/live-check.mjs readRenames). The mint is untouched, and it costs only the
|
|
46
|
+
* transaction: the record keeps its size.
|
|
47
|
+
*/
|
|
48
|
+
export declare function updateFungibleMetadataIx({ mint, authority, name, symbol, uri }: {
|
|
49
|
+
authority: any;
|
|
50
|
+
mint: any;
|
|
51
|
+
name: any;
|
|
52
|
+
symbol: any;
|
|
53
|
+
uri?: string | undefined;
|
|
54
|
+
}): {
|
|
55
|
+
programId: string;
|
|
56
|
+
keys: {
|
|
57
|
+
pubkey: any;
|
|
58
|
+
isSigner: any;
|
|
59
|
+
isWritable: any;
|
|
60
|
+
}[];
|
|
61
|
+
data: Uint8Array<any>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* A Token Metadata record as the chain holds it, or null when the data is not one (its first byte says a metadata
|
|
65
|
+
* record; the strings are padded with NULs to their full length):
|
|
66
|
+
* { updateAuthority, mint, name, symbol, uri, royalty, creators, mutable, collection, uses, plain }.
|
|
67
|
+
* `royalty`: its resale royalty, in hundredths of a percent. `creators`: how many it lists. `mutable`: its update
|
|
68
|
+
* authority can still change it. `collection`, `uses`: whether it names one. `plain`: none of royalty, creators,
|
|
69
|
+
* collection or uses, as a setup's own record is: writing its words again changes nothing else of it.
|
|
70
|
+
*/
|
|
71
|
+
export declare function parseRecord(data: any): {
|
|
72
|
+
updateAuthority: string;
|
|
73
|
+
mint: string;
|
|
74
|
+
name: string;
|
|
75
|
+
symbol: string;
|
|
76
|
+
uri: string;
|
|
77
|
+
royalty: number;
|
|
78
|
+
creators: number;
|
|
79
|
+
mutable: boolean;
|
|
80
|
+
collection: boolean;
|
|
81
|
+
uses: boolean;
|
|
82
|
+
plain: boolean;
|
|
83
|
+
} | null;
|
|
39
84
|
/** The update authority a Token Metadata record names (who can change its name, ticker and link). */
|
|
40
85
|
export declare const metadataUpdateAuthority: (data: any) => string | null;
|
package/types/economy/cost.d.mts
CHANGED
|
@@ -19,10 +19,11 @@ export declare function setupCost(plan: any, economy: any): {
|
|
|
19
19
|
export declare function actionCosts(economy: any, { now }?: Readonly<Record<string, any>>): any[];
|
|
20
20
|
/** Setup and play costs for a spec, or its refusals. */
|
|
21
21
|
/** `only` and `live`: a change to a live economy, priced as only what it publishes (live.mjs `changedParts`). */
|
|
22
|
-
export declare function cost(economy: any, { now, only, live }?: {
|
|
22
|
+
export declare function cost(economy: any, { now, only, live, renames }?: {
|
|
23
23
|
live?: null | undefined;
|
|
24
24
|
now?: number | undefined;
|
|
25
25
|
only?: null | undefined;
|
|
26
|
+
renames?: null | undefined;
|
|
26
27
|
}): {
|
|
27
28
|
ok: boolean;
|
|
28
29
|
refusals: any[];
|
|
@@ -35,7 +36,14 @@ export declare function cost(economy: any, { now, only, live }?: {
|
|
|
35
36
|
refusals?: undefined;
|
|
36
37
|
ok: boolean;
|
|
37
38
|
warnings: any[];
|
|
38
|
-
steps:
|
|
39
|
+
steps: {
|
|
40
|
+
creates: never[];
|
|
41
|
+
signers: string[];
|
|
42
|
+
id: string;
|
|
43
|
+
part: string;
|
|
44
|
+
says: string;
|
|
45
|
+
build: {};
|
|
46
|
+
}[];
|
|
39
47
|
transactions: {
|
|
40
48
|
signer: string;
|
|
41
49
|
steps: any[];
|
|
@@ -46,7 +54,7 @@ export declare function cost(economy: any, { now, only, live }?: {
|
|
|
46
54
|
alone: boolean;
|
|
47
55
|
}[];
|
|
48
56
|
approvals: number;
|
|
49
|
-
freshKeys:
|
|
57
|
+
freshKeys: string[];
|
|
50
58
|
} | {
|
|
51
59
|
ok: boolean;
|
|
52
60
|
setup: {
|
package/types/economy/live.d.mts
CHANGED
|
@@ -7,12 +7,13 @@ export declare function freshAddresses(names: any, random?: typeof randomBytes):
|
|
|
7
7
|
* The transactions that put `economy` live for `owner`, with `keys` the addresses of the fresh accounts (each signs
|
|
8
8
|
* the transaction that creates it). `live`: what is already live (a change publishes only what differs).
|
|
9
9
|
*/
|
|
10
|
-
export declare function prepare(economy: any, { owner, keys, live, now, rent, only, slot }: {
|
|
10
|
+
export declare function prepare(economy: any, { owner, keys, live, now, rent, only, slot, renames }: {
|
|
11
11
|
keys: any;
|
|
12
12
|
live?: null | undefined;
|
|
13
13
|
now?: number | undefined;
|
|
14
14
|
only?: null | undefined;
|
|
15
15
|
owner: any;
|
|
16
|
+
renames?: null | undefined;
|
|
16
17
|
rent: any;
|
|
17
18
|
slot?: null | undefined;
|
|
18
19
|
}): {
|
|
@@ -27,7 +28,14 @@ export declare function prepare(economy: any, { owner, keys, live, now, rent, on
|
|
|
27
28
|
refusals?: undefined;
|
|
28
29
|
ok: boolean;
|
|
29
30
|
warnings: any[];
|
|
30
|
-
steps:
|
|
31
|
+
steps: {
|
|
32
|
+
creates: never[];
|
|
33
|
+
signers: string[];
|
|
34
|
+
id: string;
|
|
35
|
+
part: string;
|
|
36
|
+
says: string;
|
|
37
|
+
build: {};
|
|
38
|
+
}[];
|
|
31
39
|
transactions: {
|
|
32
40
|
signer: string;
|
|
33
41
|
steps: any[];
|
|
@@ -38,7 +46,7 @@ export declare function prepare(economy: any, { owner, keys, live, now, rent, on
|
|
|
38
46
|
alone: boolean;
|
|
39
47
|
}[];
|
|
40
48
|
approvals: number;
|
|
41
|
-
freshKeys:
|
|
49
|
+
freshKeys: string[];
|
|
42
50
|
} | {
|
|
43
51
|
ok: boolean;
|
|
44
52
|
refusals: any[];
|
|
@@ -55,6 +63,7 @@ export declare function prepare(economy: any, { owner, keys, live, now, rent, on
|
|
|
55
63
|
project: any;
|
|
56
64
|
treasury: any;
|
|
57
65
|
mints: {};
|
|
66
|
+
tables: any;
|
|
58
67
|
keys: any;
|
|
59
68
|
rent: any;
|
|
60
69
|
slot: null;
|
|
@@ -63,7 +72,14 @@ export declare function prepare(economy: any, { owner, keys, live, now, rent, on
|
|
|
63
72
|
refusals?: undefined;
|
|
64
73
|
ok: boolean;
|
|
65
74
|
warnings: any[];
|
|
66
|
-
steps:
|
|
75
|
+
steps: {
|
|
76
|
+
creates: never[];
|
|
77
|
+
signers: string[];
|
|
78
|
+
id: string;
|
|
79
|
+
part: string;
|
|
80
|
+
says: string;
|
|
81
|
+
build: {};
|
|
82
|
+
}[];
|
|
67
83
|
transactions: {
|
|
68
84
|
signer: string;
|
|
69
85
|
steps: any[];
|
|
@@ -74,7 +90,7 @@ export declare function prepare(economy: any, { owner, keys, live, now, rent, on
|
|
|
74
90
|
alone: boolean;
|
|
75
91
|
}[];
|
|
76
92
|
approvals: number;
|
|
77
|
-
freshKeys:
|
|
93
|
+
freshKeys: string[];
|
|
78
94
|
ctx: {
|
|
79
95
|
owner: any;
|
|
80
96
|
authority: any;
|
|
@@ -83,6 +99,7 @@ export declare function prepare(economy: any, { owner, keys, live, now, rent, on
|
|
|
83
99
|
project: any;
|
|
84
100
|
treasury: any;
|
|
85
101
|
mints: {};
|
|
102
|
+
tables: any;
|
|
86
103
|
keys: any;
|
|
87
104
|
rent: any;
|
|
88
105
|
slot: null;
|
|
@@ -118,9 +135,16 @@ export declare function changedParts(economy: any): {
|
|
|
118
135
|
fixed: never[];
|
|
119
136
|
removed: never[];
|
|
120
137
|
settings: never[];
|
|
138
|
+
renames: never[];
|
|
121
139
|
} | {
|
|
122
140
|
only: Set<any>;
|
|
123
141
|
fixed: string[];
|
|
124
142
|
removed: string[];
|
|
125
143
|
settings: string[];
|
|
144
|
+
renames: any[];
|
|
126
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* In words, for a tool that does not read the chain: the spec changes what these tokens are called, and what becomes
|
|
148
|
+
* of that is decided when the change is approved.
|
|
149
|
+
*/
|
|
150
|
+
export declare const renamesNote: (renames: any) => string;
|
|
@@ -196,6 +196,12 @@ export declare const spendOf: (then: any, m: any) => "Burn" | {
|
|
|
196
196
|
Stash?: undefined;
|
|
197
197
|
Give: any[];
|
|
198
198
|
};
|
|
199
|
+
/**
|
|
200
|
+
* What a token the setup makes is called on chain, from its entry in a spec as written: [name, ticker, link], with
|
|
201
|
+
* the names it gets when the spec gives none (`tokenOf`: its key in capitals for a ticker, its ticker or key for a
|
|
202
|
+
* name). Two entries with the same labels write the same record, however they are spelled.
|
|
203
|
+
*/
|
|
204
|
+
export declare function tokenLabels(t: any): any[];
|
|
199
205
|
/**
|
|
200
206
|
* The spec with references resolved and ids given. Unknown references stay as they are (the checker reports
|
|
201
207
|
* them); call `check` first when it matters.
|
package/types/economy/plan.d.mts
CHANGED
|
@@ -929,12 +929,20 @@ export declare function grantArgs(g: any, m: any): {
|
|
|
929
929
|
* seats there as it is released, its clock stopped while nobody is in. A seed that lands
|
|
930
930
|
* before the first stake or after it is released the same way from that stake on, so seeding first would change nothing.
|
|
931
931
|
*/
|
|
932
|
-
export declare function setupSteps(economy: any, { now, only, live: given }?: {
|
|
932
|
+
export declare function setupSteps(economy: any, { now, only, live: given, renames }?: {
|
|
933
933
|
live?: null | undefined;
|
|
934
934
|
now?: number | undefined;
|
|
935
935
|
only?: null | undefined;
|
|
936
|
+
renames?: null | undefined;
|
|
936
937
|
}): {
|
|
937
|
-
steps:
|
|
938
|
+
steps: {
|
|
939
|
+
creates: never[];
|
|
940
|
+
signers: string[];
|
|
941
|
+
id: string;
|
|
942
|
+
part: string;
|
|
943
|
+
says: string;
|
|
944
|
+
build: {};
|
|
945
|
+
}[];
|
|
938
946
|
model: {
|
|
939
947
|
now: number;
|
|
940
948
|
name: any;
|
|
@@ -1026,6 +1034,7 @@ export declare function setupContext(m: any, { owner: ownerKey, keys, live: give
|
|
|
1026
1034
|
project: any;
|
|
1027
1035
|
treasury: any;
|
|
1028
1036
|
mints: {};
|
|
1037
|
+
tables: any;
|
|
1029
1038
|
keys: any;
|
|
1030
1039
|
rent: any;
|
|
1031
1040
|
};
|
|
@@ -1051,11 +1060,12 @@ export declare function pack(steps: any, ctx: any): {
|
|
|
1051
1060
|
* The plan for a spec: refusals, or every step packed into transactions. With `ctx` the transactions carry the
|
|
1052
1061
|
* real instructions; without it they are built on stand-in addresses (for sizing, cost and showing).
|
|
1053
1062
|
*/
|
|
1054
|
-
export declare function plan(economy: any, { now, ctx, only, live }?: {
|
|
1063
|
+
export declare function plan(economy: any, { now, ctx, only, live, renames }?: {
|
|
1055
1064
|
ctx?: null | undefined;
|
|
1056
1065
|
live?: null | undefined;
|
|
1057
1066
|
now?: number | undefined;
|
|
1058
1067
|
only?: null | undefined;
|
|
1068
|
+
renames?: null | undefined;
|
|
1059
1069
|
}): {
|
|
1060
1070
|
ok: boolean;
|
|
1061
1071
|
refusals: any[];
|
|
@@ -1068,7 +1078,14 @@ export declare function plan(economy: any, { now, ctx, only, live }?: {
|
|
|
1068
1078
|
refusals?: undefined;
|
|
1069
1079
|
ok: boolean;
|
|
1070
1080
|
warnings: any[];
|
|
1071
|
-
steps:
|
|
1081
|
+
steps: {
|
|
1082
|
+
creates: never[];
|
|
1083
|
+
signers: string[];
|
|
1084
|
+
id: string;
|
|
1085
|
+
part: string;
|
|
1086
|
+
says: string;
|
|
1087
|
+
build: {};
|
|
1088
|
+
}[];
|
|
1072
1089
|
transactions: {
|
|
1073
1090
|
signer: string;
|
|
1074
1091
|
steps: any[];
|
|
@@ -1079,7 +1096,7 @@ export declare function plan(economy: any, { now, ctx, only, live }?: {
|
|
|
1079
1096
|
alone: boolean;
|
|
1080
1097
|
}[];
|
|
1081
1098
|
approvals: number;
|
|
1082
|
-
freshKeys:
|
|
1099
|
+
freshKeys: string[];
|
|
1083
1100
|
};
|
|
1084
1101
|
/** What each part needs while the economy runs: the instruction, and who signs it. */
|
|
1085
1102
|
export declare function playSteps(economy: any): any[];
|