@tetsuo-ai/marketplace-react 0.4.0 → 0.5.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.
- package/CHANGELOG.md +78 -0
- package/README.md +93 -47
- package/dist/chunk-7NKRSPPN.js +227 -0
- package/dist/chunk-7NKRSPPN.js.map +1 -0
- package/dist/{chunk-BNILOX3O.js → chunk-CDDHUFMG.js} +38 -6
- package/dist/chunk-CDDHUFMG.js.map +1 -0
- package/dist/chunk-FIDFPM5A.cjs +40 -0
- package/dist/chunk-FIDFPM5A.cjs.map +1 -0
- package/dist/chunk-IJKWKY4H.cjs +1370 -0
- package/dist/chunk-IJKWKY4H.cjs.map +1 -0
- package/dist/chunk-JTSG5FGC.cjs +397 -0
- package/dist/chunk-JTSG5FGC.cjs.map +1 -0
- package/dist/chunk-ONC6L3IX.cjs +97 -0
- package/dist/chunk-ONC6L3IX.cjs.map +1 -0
- package/dist/chunk-R76EUYDI.cjs +233 -0
- package/dist/chunk-R76EUYDI.cjs.map +1 -0
- package/dist/chunk-RG5JZ6JL.js +378 -0
- package/dist/chunk-RG5JZ6JL.js.map +1 -0
- package/dist/components/index.cjs +158 -1513
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/hooks/index.cjs +693 -457
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +109 -28
- package/dist/hooks/index.d.ts +109 -28
- package/dist/hooks/index.js +659 -178
- package/dist/hooks/index.js.map +1 -1
- package/dist/{index-DQ3Xovkq.d.ts → index-BAyr1ODZ.d.ts} +76 -6
- package/dist/{index-UxuvIlmD.d.cts → index-C20NVU7_.d.cts} +76 -6
- package/dist/index.cjs +284 -1752
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.js +64 -4
- package/dist/index.js.map +1 -1
- package/dist/signers/index.cjs +22 -161
- package/dist/signers/index.cjs.map +1 -1
- package/dist/signers/index.d.cts +16 -11
- package/dist/signers/index.d.ts +16 -11
- package/dist/signers/index.js +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/theme/agenc-tailwind-preset.cjs +134 -108
- package/dist/{types-jvISR6bc.d.cts → types-B10rndEI.d.cts} +16 -7
- package/dist/{types-jvISR6bc.d.ts → types-B10rndEI.d.ts} +16 -7
- package/dist/{useAgentTrackRecord-BCvRHYM2.d.cts → useAgentTrackRecord-Ch7gHTFj.d.cts} +40 -3
- package/dist/{useAgentTrackRecord-BCvRHYM2.d.ts → useAgentTrackRecord-Ch7gHTFj.d.ts} +40 -3
- package/package.json +6 -3
- package/src/components/GuaranteedBadge.tsx +73 -0
- package/src/components/HireCheckoutModal.tsx +5 -2
- package/src/components/index.ts +4 -0
- package/src/components/strings.ts +8 -0
- package/src/hooks/index.ts +14 -0
- package/src/hooks/internal.ts +179 -22
- package/src/hooks/useAgentTrackRecord.ts +5 -2
- package/src/hooks/useCompletionBond.ts +191 -0
- package/src/hooks/useDispute.ts +46 -9
- package/src/hooks/useHire.ts +113 -23
- package/src/hooks/useHumanlessHireFlow.ts +335 -115
- package/src/hooks/useListing.ts +2 -2
- package/src/hooks/useListings.ts +2 -2
- package/src/hooks/useRateHire.ts +32 -5
- package/src/hooks/useReferrerEarnings.ts +4 -1
- package/src/hooks/useSubmissionReview.ts +95 -32
- package/src/hooks/useTaskActivation.ts +51 -9
- package/src/hooks/useTaskGuarantee.ts +123 -0
- package/src/hooks/useTaskLifecycle.ts +104 -24
- package/src/hooks/useTaskStatus.ts +121 -26
- package/src/hooks/useTaskWork.ts +76 -12
- package/src/hooks/useWalletSigner.ts +11 -16
- package/src/index.ts +5 -0
- package/src/provider/AgencProvider.tsx +95 -3
- package/src/provider/referrer.ts +1 -1
- package/src/signers/README.md +13 -7
- package/src/signers/index.ts +6 -1
- package/src/signers/strings.ts +13 -1
- package/src/signers/types.ts +16 -5
- package/src/signers/wallet-account.ts +115 -29
- package/src/signers/wallet-adapter.ts +38 -4
- package/src/theme/agenc-tailwind-preset.cjs +134 -108
- package/src/types.ts +32 -3
- package/dist/chunk-BNILOX3O.js.map +0 -1
- package/dist/chunk-BTAVED7S.js +0 -226
- package/dist/chunk-BTAVED7S.js.map +0 -1
- package/dist/chunk-ON6XR4XO.js +0 -128
- package/dist/chunk-ON6XR4XO.js.map +0 -1
package/src/signers/strings.ts
CHANGED
|
@@ -15,7 +15,19 @@ export const EN_SIGNER_STRINGS = {
|
|
|
15
15
|
"signer.walletNoSignFeature":
|
|
16
16
|
"Wallet account {address} does not expose a solana:signTransaction feature. Pass options.signTransaction explicitly, or use a Wallet Standard account that supports transaction signing.",
|
|
17
17
|
"signer.walletNoSignature":
|
|
18
|
-
"The wallet returned no signature for account {address}. The wallet may have rejected
|
|
18
|
+
"The wallet returned no signature for account {address}. The wallet may have rejected the signing request.",
|
|
19
|
+
"signer.walletResponseCount":
|
|
20
|
+
"Wallet returned {got} signed transactions; expected {expected} ordered outputs, one per input.",
|
|
21
|
+
"signer.walletModifiedTransaction":
|
|
22
|
+
"Wallet modified the transaction message for account {address}. AgenC cannot attach a signature over different bytes to the original transaction.",
|
|
23
|
+
"signer.walletInvalidSignature":
|
|
24
|
+
"Wallet returned an invalid signature for account {address} over the requested transaction message.",
|
|
25
|
+
"signer.walletChainRequired":
|
|
26
|
+
"Wallet account {address} exposes {count} Solana chains. Select exactly one with options.chain or options.network.",
|
|
27
|
+
"signer.walletChainUnsupported":
|
|
28
|
+
"Wallet account {address} does not support requested chain {chain}.",
|
|
29
|
+
"signer.walletChainNetworkMismatch":
|
|
30
|
+
"Requested chain {chain} does not match options.network {network} ({expected}).",
|
|
19
31
|
"signer.embeddedSignatureCount":
|
|
20
32
|
"Embedded wallet returned {got} signatures for {expected} transactions; expected one per transaction.",
|
|
21
33
|
"signer.walletAdapterDisconnected":
|
package/src/signers/types.ts
CHANGED
|
@@ -45,8 +45,8 @@ export type { Address, SignatureBytes, Transaction, TransactionSigner };
|
|
|
45
45
|
*
|
|
46
46
|
* Given one or more `{ transaction }` wire-format inputs, it returns one
|
|
47
47
|
* `{ signedTransaction }` output per input (a fully serialized, signed
|
|
48
|
-
* transaction
|
|
49
|
-
*
|
|
48
|
+
* transaction. The bridge rejects a returned message that differs from the
|
|
49
|
+
* requested message because the SDK submits the original transaction bytes.
|
|
50
50
|
*/
|
|
51
51
|
export type WalletStandardSignTransaction = (
|
|
52
52
|
...inputs: ReadonlyArray<{
|
|
@@ -78,7 +78,7 @@ export type WalletStandardSignTransaction = (
|
|
|
78
78
|
export interface WalletStandardAccountLike {
|
|
79
79
|
/** Base58 account address (becomes the signer's `address`). */
|
|
80
80
|
readonly address: string;
|
|
81
|
-
/** CAIP-2 chains this account supports (used to
|
|
81
|
+
/** CAIP-2 chains this account supports (used to validate chain selection). */
|
|
82
82
|
readonly chains?: readonly string[];
|
|
83
83
|
/** Raw Wallet Standard feature bag, when resolvable off the account. */
|
|
84
84
|
readonly features?: Readonly<
|
|
@@ -89,14 +89,25 @@ export interface WalletStandardAccountLike {
|
|
|
89
89
|
>;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/** Provider networks that map to Wallet Standard Solana chain identifiers. */
|
|
93
|
+
export type SolanaWalletNetwork = "localnet" | "devnet" | "mainnet";
|
|
94
|
+
|
|
95
|
+
/** A kit signer whose Wallet Standard chain can be validated by a provider. */
|
|
96
|
+
export type ChainBoundTransactionSigner = TransactionSigner & {
|
|
97
|
+
readonly chain: string;
|
|
98
|
+
};
|
|
99
|
+
|
|
92
100
|
/** Options for {@link signerFromWalletAccount}. */
|
|
93
101
|
export interface SignerFromWalletAccountOptions {
|
|
94
102
|
/**
|
|
95
103
|
* CAIP-2 chain id forwarded to the wallet on each sign (e.g.
|
|
96
|
-
* `"solana:devnet"`, `"solana:mainnet"`).
|
|
97
|
-
* `solana:*` chain
|
|
104
|
+
* `"solana:devnet"`, `"solana:mainnet"`). When omitted, `network` maps to a
|
|
105
|
+
* chain; otherwise the account must expose exactly one `solana:*` chain.
|
|
106
|
+
* Ambiguous or unsupported selections fail closed.
|
|
98
107
|
*/
|
|
99
108
|
chain?: string;
|
|
109
|
+
/** Provider network to bind to a Wallet Standard chain. */
|
|
110
|
+
network?: SolanaWalletNetwork;
|
|
100
111
|
/**
|
|
101
112
|
* Explicit `solana:signTransaction` feature method. Overrides any feature
|
|
102
113
|
* resolved off `account.features`. This is the seam tests and non-Wallet-
|
|
@@ -7,25 +7,28 @@
|
|
|
7
7
|
* — so it needs a PARTIAL signer (one that returns signatures without sending),
|
|
8
8
|
* NOT a `TransactionSendingSigner` (which `signTransactionMessageWithSigners`
|
|
9
9
|
* deliberately ignores). This bridge therefore produces a
|
|
10
|
-
* {@link TransactionPartialSigner}: it
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* {@link TransactionPartialSigner}: it batches transactions through the
|
|
11
|
+
* wallet's variadic `solana:signTransaction` feature, requires byte-identical
|
|
12
|
+
* returned messages, and recovers THIS account's verified signatures.
|
|
13
13
|
*
|
|
14
14
|
* @see {@link signerFromWalletAccount}
|
|
15
15
|
* @module signers/wallet-account
|
|
16
16
|
*/
|
|
17
17
|
import {
|
|
18
18
|
address,
|
|
19
|
+
getPublicKeyFromAddress,
|
|
19
20
|
getTransactionDecoder,
|
|
20
21
|
getTransactionEncoder,
|
|
22
|
+
verifySignature,
|
|
21
23
|
type Address,
|
|
22
24
|
type SignatureBytes,
|
|
23
25
|
type Transaction,
|
|
24
26
|
} from "@solana/kit";
|
|
25
27
|
import { ts } from "./strings.js";
|
|
26
28
|
import type {
|
|
29
|
+
ChainBoundTransactionSigner,
|
|
27
30
|
SignerFromWalletAccountOptions,
|
|
28
|
-
|
|
31
|
+
SolanaWalletNetwork,
|
|
29
32
|
WalletStandardAccountLike,
|
|
30
33
|
WalletStandardSignTransaction,
|
|
31
34
|
} from "./types.js";
|
|
@@ -45,13 +48,67 @@ function resolveSignTransaction(
|
|
|
45
48
|
throw new Error(ts("signer.walletNoSignFeature", { address: account.address }));
|
|
46
49
|
}
|
|
47
50
|
|
|
48
|
-
/**
|
|
51
|
+
/** Map an AgenC provider network to the Wallet Standard chain identifier. */
|
|
52
|
+
export function walletStandardChainForNetwork(
|
|
53
|
+
network: SolanaWalletNetwork,
|
|
54
|
+
): string {
|
|
55
|
+
return `solana:${network}`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Resolve and validate the CAIP-2 chain forwarded to the wallet. */
|
|
49
59
|
function resolveChain(
|
|
50
60
|
account: WalletStandardAccountLike,
|
|
51
61
|
options: SignerFromWalletAccountOptions,
|
|
52
|
-
): string
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
): string {
|
|
63
|
+
const networkChain = options.network
|
|
64
|
+
? walletStandardChainForNetwork(options.network)
|
|
65
|
+
: undefined;
|
|
66
|
+
if (options.chain && networkChain && options.chain !== networkChain) {
|
|
67
|
+
throw new Error(
|
|
68
|
+
ts("signer.walletChainNetworkMismatch", {
|
|
69
|
+
chain: options.chain,
|
|
70
|
+
network: options.network!,
|
|
71
|
+
expected: networkChain,
|
|
72
|
+
}),
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const solanaChains =
|
|
77
|
+
account.chains?.filter((chain) => chain.startsWith("solana:")) ?? [];
|
|
78
|
+
const requested = options.chain ?? networkChain;
|
|
79
|
+
const chain =
|
|
80
|
+
requested ?? (solanaChains.length === 1 ? solanaChains[0] : undefined);
|
|
81
|
+
if (!chain) {
|
|
82
|
+
throw new Error(
|
|
83
|
+
ts("signer.walletChainRequired", {
|
|
84
|
+
address: account.address,
|
|
85
|
+
count: solanaChains.length,
|
|
86
|
+
}),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
if (
|
|
90
|
+
!chain.startsWith("solana:") ||
|
|
91
|
+
(account.chains !== undefined && !account.chains.includes(chain))
|
|
92
|
+
) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
ts("signer.walletChainUnsupported", {
|
|
95
|
+
address: account.address,
|
|
96
|
+
chain,
|
|
97
|
+
}),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return chain;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function bytesEqual(
|
|
104
|
+
left: ArrayLike<number>,
|
|
105
|
+
right: ArrayLike<number>,
|
|
106
|
+
): boolean {
|
|
107
|
+
if (left.length !== right.length) return false;
|
|
108
|
+
for (let index = 0; index < left.length; index += 1) {
|
|
109
|
+
if (left[index] !== right[index]) return false;
|
|
110
|
+
}
|
|
111
|
+
return true;
|
|
55
112
|
}
|
|
56
113
|
|
|
57
114
|
/**
|
|
@@ -63,12 +120,9 @@ function resolveChain(
|
|
|
63
120
|
* the `solana:signTransaction` feature. The returned signer is a
|
|
64
121
|
* {@link TransactionPartialSigner}, the exact shape the SDK client expects.
|
|
65
122
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* re-assembles and submits. (If a wallet rewrites the message such that the
|
|
70
|
-
* fee-payer's own prior signing is invalidated, that is a wallet contract the
|
|
71
|
-
* SDK's single-fee-payer flow already assumes won't happen for the payer.)
|
|
123
|
+
* The SDK client re-assembles and submits the ORIGINAL transaction. This bridge
|
|
124
|
+
* therefore accepts only byte-identical returned message bytes and verifies the
|
|
125
|
+
* extracted signature over them.
|
|
72
126
|
*
|
|
73
127
|
* SSR-safe: constructs no browser globals; the wallet round-trip only runs when
|
|
74
128
|
* a transaction is actually signed.
|
|
@@ -89,40 +143,72 @@ function resolveChain(
|
|
|
89
143
|
export function signerFromWalletAccount(
|
|
90
144
|
account: WalletStandardAccountLike,
|
|
91
145
|
options: SignerFromWalletAccountOptions = {},
|
|
92
|
-
):
|
|
146
|
+
): ChainBoundTransactionSigner {
|
|
93
147
|
const signerAddress: Address = address(account.address);
|
|
94
148
|
const signTransaction = resolveSignTransaction(account, options);
|
|
95
149
|
const chain = resolveChain(account, options);
|
|
96
150
|
const encoder = getTransactionEncoder();
|
|
97
151
|
const decoder = getTransactionDecoder();
|
|
152
|
+
let publicKeyPromise: ReturnType<typeof getPublicKeyFromAddress> | undefined;
|
|
98
153
|
|
|
99
|
-
async function
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
154
|
+
async function extractSignature(
|
|
155
|
+
transaction: Transaction,
|
|
156
|
+
signedTransaction: Uint8Array,
|
|
157
|
+
): Promise<SignatureBytes> {
|
|
158
|
+
const signed = decoder.decode(signedTransaction);
|
|
159
|
+
if (!bytesEqual(transaction.messageBytes, signed.messageBytes)) {
|
|
160
|
+
throw new Error(
|
|
161
|
+
ts("signer.walletModifiedTransaction", { address: account.address }),
|
|
162
|
+
);
|
|
107
163
|
}
|
|
108
|
-
const signed = decoder.decode(output.signedTransaction);
|
|
109
164
|
const signature = signed.signatures[signerAddress];
|
|
110
165
|
if (!signature) {
|
|
111
166
|
throw new Error(ts("signer.walletNoSignature", { address: account.address }));
|
|
112
167
|
}
|
|
168
|
+
publicKeyPromise ??= getPublicKeyFromAddress(signerAddress);
|
|
169
|
+
const valid = await verifySignature(
|
|
170
|
+
await publicKeyPromise,
|
|
171
|
+
signature,
|
|
172
|
+
transaction.messageBytes,
|
|
173
|
+
);
|
|
174
|
+
if (!valid) {
|
|
175
|
+
throw new Error(
|
|
176
|
+
ts("signer.walletInvalidSignature", { address: account.address }),
|
|
177
|
+
);
|
|
178
|
+
}
|
|
113
179
|
return signature as SignatureBytes;
|
|
114
180
|
}
|
|
115
181
|
|
|
116
182
|
return {
|
|
117
183
|
address: signerAddress,
|
|
184
|
+
chain,
|
|
118
185
|
async signTransactions(transactions) {
|
|
119
|
-
|
|
120
|
-
//
|
|
186
|
+
if (transactions.length === 0) return [];
|
|
187
|
+
// Wallet Standard is variadic: one call preserves single-flight approval
|
|
188
|
+
// behavior and output ordering.
|
|
189
|
+
const outputs = await signTransaction(
|
|
190
|
+
...transactions.map((transaction) => ({
|
|
191
|
+
account,
|
|
192
|
+
chain,
|
|
193
|
+
transaction: new Uint8Array(encoder.encode(transaction)),
|
|
194
|
+
})),
|
|
195
|
+
);
|
|
196
|
+
if (outputs.length !== transactions.length) {
|
|
197
|
+
throw new Error(
|
|
198
|
+
ts("signer.walletResponseCount", {
|
|
199
|
+
got: outputs.length,
|
|
200
|
+
expected: transactions.length,
|
|
201
|
+
}),
|
|
202
|
+
);
|
|
203
|
+
}
|
|
121
204
|
return Promise.all(
|
|
122
|
-
|
|
123
|
-
[signerAddress]: await
|
|
205
|
+
outputs.map(async (output, index) => ({
|
|
206
|
+
[signerAddress]: await extractSignature(
|
|
207
|
+
transactions[index]!,
|
|
208
|
+
output.signedTransaction,
|
|
209
|
+
),
|
|
124
210
|
})),
|
|
125
211
|
);
|
|
126
212
|
},
|
|
127
|
-
} satisfies
|
|
213
|
+
} satisfies ChainBoundTransactionSigner;
|
|
128
214
|
}
|
|
@@ -21,8 +21,10 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import {
|
|
23
23
|
address,
|
|
24
|
+
getPublicKeyFromAddress,
|
|
24
25
|
getTransactionDecoder,
|
|
25
26
|
getTransactionEncoder,
|
|
27
|
+
verifySignature,
|
|
26
28
|
type SignatureBytes,
|
|
27
29
|
type Transaction,
|
|
28
30
|
} from "@solana/kit";
|
|
@@ -83,6 +85,17 @@ function resolveAdapterAddress(adapter: WalletAdapterLike): string {
|
|
|
83
85
|
return String(publicKey);
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
function bytesEqual(
|
|
89
|
+
left: ArrayLike<number>,
|
|
90
|
+
right: ArrayLike<number>,
|
|
91
|
+
): boolean {
|
|
92
|
+
if (left.length !== right.length) return false;
|
|
93
|
+
for (let index = 0; index < left.length; index += 1) {
|
|
94
|
+
if (left[index] !== right[index]) return false;
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
|
|
86
99
|
/**
|
|
87
100
|
* Bridge a LEGACY `@solana/wallet-adapter` `WalletContextState` into a kit
|
|
88
101
|
* {@link TransactionSigner}.
|
|
@@ -121,29 +134,50 @@ export function signerFromWalletAdapter(
|
|
|
121
134
|
const { VersionedTransaction } = options;
|
|
122
135
|
const encoder = getTransactionEncoder();
|
|
123
136
|
const decoder = getTransactionDecoder();
|
|
137
|
+
let publicKeyPromise: ReturnType<typeof getPublicKeyFromAddress> | undefined;
|
|
124
138
|
|
|
125
139
|
async function signOne(transaction: Transaction): Promise<SignatureBytes> {
|
|
126
140
|
const wireBytes = new Uint8Array(encoder.encode(transaction));
|
|
127
141
|
const legacyTx = VersionedTransaction.deserialize(wireBytes);
|
|
128
142
|
const signed = await signTransaction!(legacyTx);
|
|
129
143
|
const signedTx = decoder.decode(new Uint8Array(signed.serialize()));
|
|
144
|
+
if (!bytesEqual(transaction.messageBytes, signedTx.messageBytes)) {
|
|
145
|
+
throw new Error(
|
|
146
|
+
ts("signer.walletModifiedTransaction", { address: signerAddress }),
|
|
147
|
+
);
|
|
148
|
+
}
|
|
130
149
|
const signature = signedTx.signatures[signerAddress];
|
|
131
150
|
if (!signature) {
|
|
132
151
|
throw new Error(
|
|
133
152
|
ts("signer.walletNoSignature", { address: signerAddress }),
|
|
134
153
|
);
|
|
135
154
|
}
|
|
155
|
+
publicKeyPromise ??= getPublicKeyFromAddress(signerAddress);
|
|
156
|
+
const valid = await verifySignature(
|
|
157
|
+
await publicKeyPromise,
|
|
158
|
+
signature,
|
|
159
|
+
transaction.messageBytes,
|
|
160
|
+
);
|
|
161
|
+
if (!valid) {
|
|
162
|
+
throw new Error(
|
|
163
|
+
ts("signer.walletInvalidSignature", { address: signerAddress }),
|
|
164
|
+
);
|
|
165
|
+
}
|
|
136
166
|
return signature as SignatureBytes;
|
|
137
167
|
}
|
|
138
168
|
|
|
139
169
|
return {
|
|
140
170
|
address: signerAddress,
|
|
141
171
|
async signTransactions(transactions) {
|
|
142
|
-
|
|
143
|
-
|
|
172
|
+
const signatures = [];
|
|
173
|
+
// Legacy wallet-adapter is unary and many implementations are
|
|
174
|
+
// single-flight. Serialize prompts in input order.
|
|
175
|
+
for (const transaction of transactions) {
|
|
176
|
+
signatures.push({
|
|
144
177
|
[signerAddress]: await signOne(transaction),
|
|
145
|
-
})
|
|
146
|
-
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return signatures;
|
|
147
181
|
},
|
|
148
182
|
} satisfies TransactionSigner;
|
|
149
183
|
}
|
|
@@ -8,15 +8,19 @@
|
|
|
8
8
|
* Reason: cross-repo imports are impossible in CI; consumers read the
|
|
9
9
|
* AgenC Tailwind preset FROM this package via
|
|
10
10
|
* "@tetsuo-ai/marketplace-react/tailwind-preset".
|
|
11
|
+
* Local adaptation: export Tailwind's dependency-free plugin descriptor shape
|
|
12
|
+
* directly so importing this optional preset never requires
|
|
13
|
+
* Tailwind from the React package itself.
|
|
11
14
|
* Resync: copy tokens/tailwind.config.cjs from agenc-ui-design-skill
|
|
12
|
-
* HEAD
|
|
15
|
+
* HEAD, preserve the local plugin-descriptor adaptation, and
|
|
16
|
+
* update the commit line above.
|
|
13
17
|
* ============================================================================
|
|
14
18
|
*/
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* Tetsuo.ai / AgenC Tailwind config fragment.
|
|
18
22
|
*
|
|
19
|
-
* Drop-in extension for an existing Tailwind v3
|
|
23
|
+
* Drop-in extension for an existing Tailwind v3 project (works alongside
|
|
20
24
|
* shadcn/ui's default config). Colors are sRGB hex.
|
|
21
25
|
*
|
|
22
26
|
* Usage in your tailwind.config.{js,cjs,ts}:
|
|
@@ -33,142 +37,164 @@
|
|
|
33
37
|
* };
|
|
34
38
|
*/
|
|
35
39
|
|
|
36
|
-
const plugin = require('tailwindcss/plugin');
|
|
37
|
-
|
|
38
40
|
const colors = {
|
|
39
41
|
// AgenC neon (canonical product palette)
|
|
40
42
|
agenc: {
|
|
41
|
-
void:
|
|
42
|
-
surface:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
violet:
|
|
46
|
-
magenta:
|
|
47
|
-
orange:
|
|
48
|
-
cyan:
|
|
49
|
-
grid:
|
|
50
|
-
text:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
success:
|
|
54
|
-
warning:
|
|
55
|
-
danger:
|
|
56
|
-
border:
|
|
57
|
-
|
|
43
|
+
void: "#0A0612",
|
|
44
|
+
surface: "#16102A",
|
|
45
|
+
"surface-2": "#221638",
|
|
46
|
+
"surface-3": "#2E1A4A",
|
|
47
|
+
violet: "#7B3FFF",
|
|
48
|
+
magenta: "#FF2E93",
|
|
49
|
+
orange: "#FF6B1A",
|
|
50
|
+
cyan: "#48C8EF",
|
|
51
|
+
grid: "#3A1F66",
|
|
52
|
+
text: "#F5F0FF",
|
|
53
|
+
"text-muted": "#B8A8D9",
|
|
54
|
+
"text-dim": "#6E5C8F",
|
|
55
|
+
success: "#3FFFA0",
|
|
56
|
+
warning: "#FFC53F",
|
|
57
|
+
danger: "#FF3D3D",
|
|
58
|
+
border: "#2E1A4A",
|
|
59
|
+
"border-strong": "#4A2E7A",
|
|
58
60
|
},
|
|
59
61
|
// Tetsuo.ai noir (marketing / community)
|
|
60
62
|
tetsuo: {
|
|
61
|
-
noir:
|
|
62
|
-
|
|
63
|
-
paper:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
blood:
|
|
67
|
-
cyan:
|
|
68
|
-
magenta:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
noir: "#0A0A0A",
|
|
64
|
+
"noir-2": "#141414",
|
|
65
|
+
paper: "#F8F5E9",
|
|
66
|
+
"akira-red": "#E30426",
|
|
67
|
+
"akira-red-bright": "#FA1232",
|
|
68
|
+
blood: "#7A0000",
|
|
69
|
+
cyan: "#48C8EF",
|
|
70
|
+
magenta: "#D01D7D",
|
|
71
|
+
"synth-pink": "#EF5EC2",
|
|
72
|
+
"synth-pink-soft": "#F3A8CE",
|
|
73
|
+
"synth-purple": "#7B3FFF",
|
|
74
|
+
"synth-eggplant": "#441535",
|
|
73
75
|
},
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
const backgroundImage = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
"agenc-gradient":
|
|
80
|
+
"linear-gradient(135deg, #7B3FFF 0%, #FF2E93 60%, #FF6B1A 100%)",
|
|
81
|
+
"agenc-gradient-cool": "linear-gradient(135deg, #48C8EF 0%, #7B3FFF 100%)",
|
|
82
|
+
"agenc-gradient-text":
|
|
83
|
+
"linear-gradient(90deg, #7B3FFF 0%, #FF2E93 50%, #FF6B1A 100%)",
|
|
84
|
+
"tetsuo-gradient-glitch": "linear-gradient(90deg, #48C8EF 0%, #D01D7D 100%)",
|
|
85
|
+
"tetsuo-gradient-synth":
|
|
86
|
+
"linear-gradient(135deg, #441535 0%, #D01D7D 50%, #EF5EC2 100%)",
|
|
83
87
|
// Synthwave grid floor — pair with a perspective transform on a child
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
"agenc-grid-floor":
|
|
89
|
+
"linear-gradient(transparent 95%, #3A1F66 95%), linear-gradient(90deg, transparent 95%, #3A1F66 95%)",
|
|
86
90
|
};
|
|
87
91
|
|
|
88
92
|
const boxShadow = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
"glow-violet":
|
|
94
|
+
"0 0 24px rgba(123, 63, 255, 0.4), 0 0 48px rgba(123, 63, 255, 0.2)",
|
|
95
|
+
"glow-magenta":
|
|
96
|
+
"0 0 24px rgba(255, 46, 147, 0.4), 0 0 48px rgba(255, 46, 147, 0.2)",
|
|
97
|
+
"glow-cyan":
|
|
98
|
+
"0 0 24px rgba(72, 200, 239, 0.4), 0 0 48px rgba(72, 200, 239, 0.2)",
|
|
99
|
+
"glow-orange":
|
|
100
|
+
"0 0 24px rgba(255, 107, 26, 0.4), 0 0 48px rgba(255, 107, 26, 0.2)",
|
|
101
|
+
"glow-akira":
|
|
102
|
+
"0 0 24px rgba(227, 4, 38, 0.5), 0 0 64px rgba(227, 4, 38, 0.25)",
|
|
94
103
|
};
|
|
95
104
|
|
|
96
105
|
const fontFamily = {
|
|
97
106
|
// Display: jagged / glitch / cyberpunk. Pick one and load via @font-face.
|
|
98
|
-
|
|
107
|
+
"agenc-display": [
|
|
108
|
+
'"Audiowide"',
|
|
109
|
+
'"Major Mono Display"',
|
|
110
|
+
"system-ui",
|
|
111
|
+
"sans-serif",
|
|
112
|
+
],
|
|
99
113
|
// Body: clean geometric sans
|
|
100
|
-
|
|
114
|
+
"agenc-body": ['"Geist"', '"Inter"', "system-ui", "sans-serif"],
|
|
101
115
|
// Mono: for HUD / status / readouts
|
|
102
|
-
|
|
116
|
+
"agenc-mono": [
|
|
117
|
+
'"JetBrains Mono"',
|
|
118
|
+
'"IBM Plex Mono"',
|
|
119
|
+
"ui-monospace",
|
|
120
|
+
"monospace",
|
|
121
|
+
],
|
|
103
122
|
};
|
|
104
123
|
|
|
105
124
|
const fontSize = {
|
|
106
125
|
// Display scale skews dramatic — these are AgenC-specific overrides.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
126
|
+
"display-xs": ["2rem", { lineHeight: "1.05", letterSpacing: "-0.02em" }],
|
|
127
|
+
"display-sm": ["2.5rem", { lineHeight: "1.05", letterSpacing: "-0.02em" }],
|
|
128
|
+
"display-md": ["3.5rem", { lineHeight: "1.0", letterSpacing: "-0.03em" }],
|
|
129
|
+
"display-lg": ["5rem", { lineHeight: "0.95", letterSpacing: "-0.04em" }],
|
|
130
|
+
"display-xl": ["7rem", { lineHeight: "0.9", letterSpacing: "-0.04em" }],
|
|
112
131
|
};
|
|
113
132
|
|
|
114
133
|
// Plugin: utilities that aren't trivially expressible as theme extensions.
|
|
115
|
-
const tetsuoPlugin =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
textShadow: '3px 0 0 #48C8EF, -3px 0 0 #D01D7D, 0 0 8px rgba(255,255,255,0.15)',
|
|
127
|
-
},
|
|
128
|
-
// Neon-stroked outline text
|
|
129
|
-
'.text-neon-stroke': {
|
|
130
|
-
color: 'transparent',
|
|
131
|
-
WebkitTextStroke: '1.5px #FF2E93',
|
|
132
|
-
textShadow: '0 0 12px rgba(255, 46, 147, 0.6)',
|
|
133
|
-
},
|
|
134
|
-
// Scanline overlay — apply to a positioned container.
|
|
135
|
-
'.bg-scanlines': {
|
|
136
|
-
backgroundImage:
|
|
137
|
-
'repeating-linear-gradient(0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.18) 2px, rgba(0,0,0,0.18) 3px)',
|
|
138
|
-
},
|
|
139
|
-
// CRT vignette
|
|
140
|
-
'.bg-vignette': {
|
|
141
|
-
backgroundImage:
|
|
142
|
-
'radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.55) 100%)',
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
addComponents({
|
|
147
|
-
// HUD frame: corner brackets only, transparent middle.
|
|
148
|
-
'.hud-frame': {
|
|
149
|
-
position: 'relative',
|
|
150
|
-
padding: '24px',
|
|
151
|
-
'&::before, &::after': {
|
|
152
|
-
content: '""',
|
|
153
|
-
position: 'absolute',
|
|
154
|
-
width: '24px',
|
|
155
|
-
height: '24px',
|
|
156
|
-
borderColor: '#7B3FFF',
|
|
157
|
-
borderStyle: 'solid',
|
|
134
|
+
const tetsuoPlugin = {
|
|
135
|
+
// Tailwind v3's `plugin(handler)` helper returns exactly this
|
|
136
|
+
// `{ handler, config }` descriptor. Keeping the descriptor local prevents an
|
|
137
|
+
// optional preset export from creating a runtime dependency on Tailwind.
|
|
138
|
+
handler({ addUtilities, addComponents }) {
|
|
139
|
+
addUtilities({
|
|
140
|
+
// Chromatic aberration glitch text — drop on any text element.
|
|
141
|
+
".text-glitch": {
|
|
142
|
+
position: "relative",
|
|
143
|
+
color: "#F8F5E9",
|
|
144
|
+
textShadow: "2px 0 0 #48C8EF, -2px 0 0 #D01D7D",
|
|
158
145
|
},
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
146
|
+
".text-glitch-strong": {
|
|
147
|
+
position: "relative",
|
|
148
|
+
color: "#F8F5E9",
|
|
149
|
+
textShadow:
|
|
150
|
+
"3px 0 0 #48C8EF, -3px 0 0 #D01D7D, 0 0 8px rgba(255,255,255,0.15)",
|
|
163
151
|
},
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
152
|
+
// Neon-stroked outline text
|
|
153
|
+
".text-neon-stroke": {
|
|
154
|
+
color: "transparent",
|
|
155
|
+
WebkitTextStroke: "1.5px #FF2E93",
|
|
156
|
+
textShadow: "0 0 12px rgba(255, 46, 147, 0.6)",
|
|
168
157
|
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
158
|
+
// Scanline overlay — apply to a positioned container.
|
|
159
|
+
".bg-scanlines": {
|
|
160
|
+
backgroundImage:
|
|
161
|
+
"repeating-linear-gradient(0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.18) 2px, rgba(0,0,0,0.18) 3px)",
|
|
162
|
+
},
|
|
163
|
+
// CRT vignette
|
|
164
|
+
".bg-vignette": {
|
|
165
|
+
backgroundImage:
|
|
166
|
+
"radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.55) 100%)",
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
addComponents({
|
|
171
|
+
// HUD frame: corner brackets only, transparent middle.
|
|
172
|
+
".hud-frame": {
|
|
173
|
+
position: "relative",
|
|
174
|
+
padding: "24px",
|
|
175
|
+
"&::before, &::after": {
|
|
176
|
+
content: '""',
|
|
177
|
+
position: "absolute",
|
|
178
|
+
width: "24px",
|
|
179
|
+
height: "24px",
|
|
180
|
+
borderColor: "#7B3FFF",
|
|
181
|
+
borderStyle: "solid",
|
|
182
|
+
},
|
|
183
|
+
"&::before": {
|
|
184
|
+
top: "0",
|
|
185
|
+
left: "0",
|
|
186
|
+
borderWidth: "2px 0 0 2px",
|
|
187
|
+
},
|
|
188
|
+
"&::after": {
|
|
189
|
+
bottom: "0",
|
|
190
|
+
right: "0",
|
|
191
|
+
borderWidth: "0 2px 2px 0",
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
config: undefined,
|
|
197
|
+
};
|
|
172
198
|
|
|
173
199
|
module.exports = {
|
|
174
200
|
theme: {
|