feat: add name and description fields to ListingAccount; update form, table, detail, dashboard
This commit is contained in:
@@ -26,6 +26,8 @@ interface FormState {
|
||||
price: string
|
||||
quantity: string
|
||||
oracle: string
|
||||
name: string
|
||||
description: string
|
||||
metadataUri: string
|
||||
alts: AltEntry[]
|
||||
resolvers: string[]
|
||||
@@ -39,6 +41,8 @@ function blank(): FormState {
|
||||
price: '',
|
||||
quantity: '',
|
||||
oracle: '',
|
||||
name: '',
|
||||
description: '',
|
||||
metadataUri: '',
|
||||
alts: [],
|
||||
resolvers: [],
|
||||
@@ -148,6 +152,8 @@ export function CreateListingForm({ editPk }: Props) {
|
||||
: (Number(d.price) / 1e9).toString(),
|
||||
quantity: String(d.quantity),
|
||||
oracle: isSome(d.canonicalOracle) ? d.canonicalOracle.value : '',
|
||||
name: d.name ?? '',
|
||||
description: d.description ?? '',
|
||||
metadataUri: d.metadataUri ?? '',
|
||||
alts: d.altCurrencies.map((a) => ({
|
||||
currency:
|
||||
@@ -265,6 +271,8 @@ export function CreateListingForm({ editPk }: Props) {
|
||||
altCurrencies,
|
||||
acceptedResolvers,
|
||||
quantity: quantityN,
|
||||
name: form.name,
|
||||
description: form.description,
|
||||
metadataUri: form.metadataUri,
|
||||
})
|
||||
await sendTx([ix as never], [['listings'], ['listing', editPk]], 'update_listing')
|
||||
@@ -278,6 +286,8 @@ export function CreateListingForm({ editPk }: Props) {
|
||||
altCurrencies,
|
||||
acceptedResolvers,
|
||||
quantity: quantityN,
|
||||
name: form.name,
|
||||
description: form.description,
|
||||
metadataUri: form.metadataUri,
|
||||
})
|
||||
await sendTx([ix as never], [['listings']], 'create_listing')
|
||||
@@ -337,6 +347,16 @@ export function CreateListingForm({ editPk }: Props) {
|
||||
gap: 22,
|
||||
}}
|
||||
>
|
||||
{/* NAME + DESCRIPTION */}
|
||||
<div>
|
||||
<label style={LABEL}>NAME <span style={{ fontWeight: 400, textTransform: 'none' }}>(max 64 chars)</span></label>
|
||||
<input value={form.name} onChange={set('name')} placeholder="e.g. Mechanical Keyboard Kit" style={INPUT} maxLength={64} />
|
||||
</div>
|
||||
<div>
|
||||
<label style={LABEL}>DESCRIPTION <span style={{ fontWeight: 400, textTransform: 'none' }}>(max 256 chars)</span></label>
|
||||
<input value={form.description} onChange={set('description')} placeholder="Short description of what you're selling" style={INPUT} maxLength={256} />
|
||||
</div>
|
||||
|
||||
{/* CANONICAL CURRENCY */}
|
||||
<div>
|
||||
<label style={LABEL}>CANONICAL CURRENCY</label>
|
||||
|
||||
@@ -168,7 +168,7 @@ export function Dashboard() {
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
||||
<span style={{ fontWeight: 600, fontSize: 15 }}>
|
||||
Listing #{String(l.data.listingId)}
|
||||
{l.data.name || `Listing #${String(l.data.listingId)}`}
|
||||
</span>
|
||||
<Badge color={sc.color} bg={sc.bg}>
|
||||
{l.data.isActive ? 'Active' : 'Inactive'}
|
||||
|
||||
@@ -54,14 +54,16 @@ export function ListingDetail({ pk, walletAddress, onUpdate, onClose, onPlaceOrd
|
||||
LISTING ACCOUNT · #{String(d.listingId)}
|
||||
</div>
|
||||
<h1 style={{ margin: 0, fontSize: 26, fontWeight: 700, letterSpacing: '-.02em' }}>
|
||||
{abbrev(pk)}
|
||||
{d.name || abbrev(pk)}
|
||||
</h1>
|
||||
</div>
|
||||
<Badge color={sc.color} bg={sc.bg}>{d.isActive ? 'Active' : 'Inactive'}</Badge>
|
||||
</div>
|
||||
{d.metadataUri && (
|
||||
{(d.description || d.metadataUri) && (
|
||||
<p style={{ margin: '0 0 24px', fontSize: 14, color: 'var(--mut)', maxWidth: 620, lineHeight: 1.55 }}>
|
||||
{d.description || (
|
||||
<a href={d.metadataUri} target="_blank" rel="noreferrer" style={{ color: 'var(--acc2light)' }}>{d.metadataUri}</a>
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
|
||||
@@ -70,20 +72,22 @@ export function ListingDetail({ pk, walletAddress, onUpdate, onClose, onPlaceOrd
|
||||
<div style={{ background: 'var(--bg2)', border: '1px solid var(--bd)', borderRadius: 'var(--radius)', padding: '8px 22px 16px' }}>
|
||||
<div style={{ fontSize: 11, letterSpacing: '.13em', color: 'var(--mut)', fontWeight: 600, padding: '14px 0 4px' }}>ACCOUNT FIELDS</div>
|
||||
<FieldRow label="Address"><MonoChip value={abbrev(pk)} onCopy={() => navigator.clipboard.writeText(pk)} /></FieldRow>
|
||||
<FieldRow label="Listing ID"><span style={{ fontSize: 13.5, fontWeight: 600 }}>#{String(d.listingId)}</span></FieldRow>
|
||||
<FieldRow label="Seller"><MonoChip value={abbrev(d.seller)} onCopy={() => navigator.clipboard.writeText(d.seller)} onClick={() => router.push(`/search?q=${d.seller}`)} /></FieldRow>
|
||||
<FieldRow label="Price"><span style={{ fontSize: 13.5, fontWeight: 600 }}>{fmtListingPrice()}</span></FieldRow>
|
||||
<FieldRow label="Currency">
|
||||
<span style={{ fontFamily: 'var(--font-mono)', fontSize: 12.5 }}>
|
||||
{d.canonicalCurrency.__kind === 'Sol' ? 'SOL (native)' : `SPL · ${abbrev((d.canonicalCurrency as { mint: string }).mint)}`}
|
||||
<FieldRow label="Listing ID"><span style={{ fontFamily: 'var(--font-mono)', fontSize: 13 }}>#{String(d.listingId)}</span></FieldRow>
|
||||
<FieldRow label="Canonical Currency">
|
||||
<span style={{ fontWeight: 600, fontSize: 13 }}>
|
||||
{d.canonicalCurrency.__kind === 'Sol' ? 'SOL' : `SPL · ${abbrev((d.canonicalCurrency as { mint: string }).mint)}`}
|
||||
</span>
|
||||
</FieldRow>
|
||||
{canonicalOracleAddr && (
|
||||
<FieldRow label="Oracle">
|
||||
<MonoChip value={abbrev(canonicalOracleAddr)} onCopy={() => navigator.clipboard.writeText(canonicalOracleAddr)} />
|
||||
<FieldRow label="Price"><span style={{ fontWeight: 700, fontSize: 13.5 }}>{fmtListingPrice()}</span></FieldRow>
|
||||
<FieldRow label="Canonical Oracle">
|
||||
{canonicalOracleAddr
|
||||
? <MonoChip value={abbrev(canonicalOracleAddr)} onCopy={() => navigator.clipboard.writeText(canonicalOracleAddr)} />
|
||||
: <span style={{ fontSize: 13, color: 'var(--mut)' }}>None — priced directly</span>
|
||||
}
|
||||
</FieldRow>
|
||||
)}
|
||||
<FieldRow label="Status"><Badge color={sc.color} bg={sc.bg}>{d.isActive ? 'Active' : 'Inactive'}</Badge></FieldRow>
|
||||
<FieldRow label="Bump"><span style={{ fontFamily: 'var(--font-mono)', fontSize: 13, color: 'var(--mut)' }}>{d.bump}</span></FieldRow>
|
||||
|
||||
{d.metadataUri && (
|
||||
<>
|
||||
|
||||
@@ -108,7 +108,7 @@ export function ListingsTable() {
|
||||
>
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<div style={{ fontWeight: 600, fontSize: 14, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
|
||||
{l.data.metadataUri || abbrev(l.address)}
|
||||
{l.data.name || abbrev(l.address)}
|
||||
</div>
|
||||
<div style={{ fontFamily: 'var(--font-mono)', fontSize: 11, color: 'var(--mut)', marginTop: 3 }}>
|
||||
#{String(l.data.listingId)} · {abbrev(l.address)}
|
||||
|
||||
@@ -29,6 +29,8 @@ pub fn handler(
|
||||
alt_currencies: Vec<AltCurrencyConfig>,
|
||||
accepted_resolvers: Vec<Pubkey>,
|
||||
quantity: u32,
|
||||
name: String,
|
||||
description: String,
|
||||
metadata_uri: String,
|
||||
) -> Result<()> {
|
||||
let listing = &mut ctx.accounts.listing_account;
|
||||
@@ -40,6 +42,8 @@ pub fn handler(
|
||||
listing.accepted_resolvers = accepted_resolvers;
|
||||
listing.quantity = quantity;
|
||||
listing.quantity_reserved = 0;
|
||||
listing.name = name;
|
||||
listing.description = description;
|
||||
listing.metadata_uri = metadata_uri;
|
||||
listing.listing_id = listing_id;
|
||||
listing.is_active = true;
|
||||
|
||||
@@ -25,6 +25,8 @@ pub fn handler(
|
||||
alt_currencies: Vec<AltCurrencyConfig>,
|
||||
accepted_resolvers: Vec<Pubkey>,
|
||||
quantity: u32,
|
||||
name: String,
|
||||
description: String,
|
||||
metadata_uri: String,
|
||||
) -> Result<()> {
|
||||
let listing = &mut ctx.accounts.listing_account;
|
||||
@@ -34,6 +36,8 @@ pub fn handler(
|
||||
listing.alt_currencies = alt_currencies;
|
||||
listing.accepted_resolvers = accepted_resolvers;
|
||||
listing.quantity = quantity;
|
||||
listing.name = name;
|
||||
listing.description = description;
|
||||
listing.metadata_uri = metadata_uri;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -31,11 +31,14 @@ pub mod solisting {
|
||||
alt_currencies: Vec<state::AltCurrencyConfig>,
|
||||
accepted_resolvers: Vec<Pubkey>,
|
||||
quantity: u32,
|
||||
name: String,
|
||||
description: String,
|
||||
metadata_uri: String,
|
||||
) -> Result<()> {
|
||||
create_listing::handler(
|
||||
ctx, listing_id, canonical_currency, price,
|
||||
canonical_oracle, alt_currencies, accepted_resolvers, quantity, metadata_uri,
|
||||
canonical_oracle, alt_currencies, accepted_resolvers, quantity,
|
||||
name, description, metadata_uri,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -48,11 +51,14 @@ pub mod solisting {
|
||||
alt_currencies: Vec<state::AltCurrencyConfig>,
|
||||
accepted_resolvers: Vec<Pubkey>,
|
||||
quantity: u32,
|
||||
name: String,
|
||||
description: String,
|
||||
metadata_uri: String,
|
||||
) -> Result<()> {
|
||||
update_listing::handler(
|
||||
ctx, canonical_currency, price,
|
||||
canonical_oracle, alt_currencies, accepted_resolvers, quantity, metadata_uri,
|
||||
canonical_oracle, alt_currencies, accepted_resolvers, quantity,
|
||||
name, description, metadata_uri,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,10 @@ pub struct ListingAccount {
|
||||
pub quantity: u32,
|
||||
/// Units held by pending orders. available = quantity - quantity_reserved.
|
||||
pub quantity_reserved: u32,
|
||||
#[max_len(64)]
|
||||
pub name: String,
|
||||
#[max_len(256)]
|
||||
pub description: String,
|
||||
#[max_len(256)]
|
||||
pub metadata_uri: String,
|
||||
pub listing_id: u64,
|
||||
|
||||
@@ -101,6 +101,8 @@ pub fn ix_create_listing(
|
||||
alt_currencies: Vec<AltCurrencyConfig>,
|
||||
accepted_resolvers: Vec<Pubkey>,
|
||||
quantity: u32,
|
||||
name: String,
|
||||
description: String,
|
||||
metadata_uri: String,
|
||||
) -> Instruction {
|
||||
let listing_account = listing_pda(seller, listing_id);
|
||||
@@ -114,6 +116,8 @@ pub fn ix_create_listing(
|
||||
alt_currencies,
|
||||
accepted_resolvers,
|
||||
quantity,
|
||||
name,
|
||||
description,
|
||||
metadata_uri,
|
||||
}
|
||||
.data(),
|
||||
@@ -136,6 +140,8 @@ pub fn ix_update_listing(
|
||||
alt_currencies: Vec<AltCurrencyConfig>,
|
||||
accepted_resolvers: Vec<Pubkey>,
|
||||
quantity: u32,
|
||||
name: String,
|
||||
description: String,
|
||||
metadata_uri: String,
|
||||
) -> Instruction {
|
||||
let listing_account = listing_pda(seller, listing_id);
|
||||
@@ -148,6 +154,8 @@ pub fn ix_update_listing(
|
||||
alt_currencies,
|
||||
accepted_resolvers,
|
||||
quantity,
|
||||
name,
|
||||
description,
|
||||
metadata_uri,
|
||||
}
|
||||
.data(),
|
||||
|
||||
@@ -17,7 +17,7 @@ fn seller_can_create_sol_only_listing() {
|
||||
vec![],
|
||||
vec![],
|
||||
10,
|
||||
"ipfs://test".to_string(),
|
||||
"".to_string(), "".to_string(), "ipfs://test".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix], &[&seller]);
|
||||
|
||||
@@ -48,7 +48,7 @@ fn seller_can_create_listing_with_usdc_alt_stablecoin() {
|
||||
}],
|
||||
vec![],
|
||||
5,
|
||||
"ipfs://x".to_string(),
|
||||
"".to_string(), "".to_string(), "ipfs://x".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix], &[&seller]);
|
||||
|
||||
@@ -75,7 +75,7 @@ fn seller_can_create_listing_with_bonk_alt_oracle() {
|
||||
}],
|
||||
vec![],
|
||||
5,
|
||||
"".to_string(),
|
||||
"".to_string(), "".to_string(), "".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix], &[&seller]);
|
||||
|
||||
@@ -90,7 +90,7 @@ fn seller_can_update_listing() {
|
||||
let listing_id: u64 = 2;
|
||||
let ix = ix_create_listing(
|
||||
&seller.pubkey(), listing_id, Currency::Sol, 1_000_000_000,
|
||||
None, vec![], vec![], 10, "".to_string(),
|
||||
None, vec![], vec![], 10, "".to_string(), "".to_string(), "".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix], &[&seller]);
|
||||
|
||||
@@ -103,7 +103,7 @@ fn seller_can_update_listing() {
|
||||
vec![],
|
||||
vec![],
|
||||
20,
|
||||
"ipfs://new".to_string(),
|
||||
"".to_string(), "".to_string(), "ipfs://new".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix_update], &[&seller]);
|
||||
|
||||
@@ -118,7 +118,7 @@ fn seller_can_close_listing() {
|
||||
let listing_id: u64 = 3;
|
||||
let ix = ix_create_listing(
|
||||
&seller.pubkey(), listing_id, Currency::Sol, 1_000_000_000,
|
||||
None, vec![], vec![], 5, "".to_string(),
|
||||
None, vec![], vec![], 5, "".to_string(), "".to_string(), "".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix], &[&seller]);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ fn buyer_can_create_order_canonical_sol() {
|
||||
let price = 100_000_000u64;
|
||||
let ix = ix_create_listing(
|
||||
&seller.pubkey(), listing_id, Currency::Sol, price,
|
||||
None, vec![], vec![], 5, "".to_string(),
|
||||
None, vec![], vec![], 5, "".to_string(), "".to_string(), "".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix], &[&seller]);
|
||||
|
||||
@@ -42,7 +42,7 @@ fn create_order_fails_if_listing_inactive() {
|
||||
let listing_id = 2u64;
|
||||
let ix = ix_create_listing(
|
||||
&seller.pubkey(), listing_id, Currency::Sol, 1_000_000_000,
|
||||
None, vec![], vec![], 1, "".to_string(),
|
||||
None, vec![], vec![], 1, "".to_string(), "".to_string(), "".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix], &[&seller]);
|
||||
let ix_close = ix_close_listing(&seller.pubkey(), listing_id);
|
||||
@@ -62,7 +62,7 @@ fn create_order_fails_if_out_of_stock() {
|
||||
let listing_id = 3u64;
|
||||
let ix = ix_create_listing(
|
||||
&seller.pubkey(), listing_id, Currency::Sol, 100_000_000,
|
||||
None, vec![], vec![], 1, "".to_string(),
|
||||
None, vec![], vec![], 1, "".to_string(), "".to_string(), "".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix], &[&seller]);
|
||||
send(
|
||||
@@ -87,7 +87,7 @@ fn create_order_fails_if_currency_not_accepted() {
|
||||
let listing_id = 4u64;
|
||||
let ix = ix_create_listing(
|
||||
&seller.pubkey(), listing_id, Currency::Sol, 100_000_000,
|
||||
None, vec![], vec![], 5, "".to_string(),
|
||||
None, vec![], vec![], 5, "".to_string(), "".to_string(), "".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix], &[&seller]);
|
||||
|
||||
@@ -110,7 +110,7 @@ fn create_order_fails_if_resolver_not_accepted() {
|
||||
let allowed_resolver = Pubkey::new_unique();
|
||||
let ix = ix_create_listing(
|
||||
&seller.pubkey(), listing_id, Currency::Sol, 100_000_000,
|
||||
None, vec![], vec![allowed_resolver], 5, "".to_string(),
|
||||
None, vec![], vec![allowed_resolver], 5, "".to_string(), "".to_string(), "".to_string(),
|
||||
);
|
||||
send(&mut svm, &[ix], &[&seller]);
|
||||
|
||||
@@ -132,7 +132,7 @@ fn seller_accept_creates_active_descro_escrow() {
|
||||
let price = 100_000_000u64;
|
||||
send(
|
||||
&mut svm,
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, price, None, vec![], vec![], 5, "".to_string())],
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, price, None, vec![], vec![], 5, "".to_string(), "".to_string(), "".to_string())],
|
||||
&[&seller],
|
||||
);
|
||||
let order_id = 1u64;
|
||||
@@ -166,7 +166,7 @@ fn seller_can_reject_order() {
|
||||
let price = 100_000_000u64;
|
||||
send(
|
||||
&mut svm,
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, price, None, vec![], vec![], 5, "".to_string())],
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, price, None, vec![], vec![], 5, "".to_string(), "".to_string(), "".to_string())],
|
||||
&[&seller],
|
||||
);
|
||||
send(
|
||||
@@ -197,7 +197,7 @@ fn buyer_can_cancel_order() {
|
||||
let listing_id = 21u64;
|
||||
send(
|
||||
&mut svm,
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, 100_000_000, None, vec![], vec![], 5, "".to_string())],
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, 100_000_000, None, vec![], vec![], 5, "".to_string(), "".to_string(), "".to_string())],
|
||||
&[&seller],
|
||||
);
|
||||
send(
|
||||
@@ -223,7 +223,7 @@ fn reject_handles_already_cancelled_escrow() {
|
||||
let listing_id = 22u64;
|
||||
send(
|
||||
&mut svm,
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, 100_000_000, None, vec![], vec![], 5, "".to_string())],
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, 100_000_000, None, vec![], vec![], 5, "".to_string(), "".to_string(), "".to_string())],
|
||||
&[&seller],
|
||||
);
|
||||
send(
|
||||
@@ -250,7 +250,7 @@ fn anyone_can_close_stale_order_after_terminal_escrow() {
|
||||
let listing_id = 30u64;
|
||||
send(
|
||||
&mut svm,
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, 100_000_000, None, vec![], vec![], 5, "".to_string())],
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, 100_000_000, None, vec![], vec![], 5, "".to_string(), "".to_string(), "".to_string())],
|
||||
&[&seller],
|
||||
);
|
||||
send(
|
||||
@@ -284,7 +284,7 @@ fn close_stale_order_fails_if_escrow_still_active() {
|
||||
let listing_id = 31u64;
|
||||
send(
|
||||
&mut svm,
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, 100_000_000, None, vec![], vec![], 5, "".to_string())],
|
||||
&[ix_create_listing(&seller.pubkey(), listing_id, Currency::Sol, 100_000_000, None, vec![], vec![], 5, "".to_string(), "".to_string(), "".to_string())],
|
||||
&[&seller],
|
||||
);
|
||||
send(
|
||||
|
||||
@@ -96,6 +96,8 @@ export type SolistingStateListingAccount = {
|
||||
quantity: number;
|
||||
/** Units held by pending orders. available = quantity - quantity_reserved. */
|
||||
quantityReserved: number;
|
||||
name: string;
|
||||
description: string;
|
||||
metadataUri: string;
|
||||
listingId: bigint;
|
||||
isActive: boolean;
|
||||
@@ -125,6 +127,8 @@ export type SolistingStateListingAccountArgs = {
|
||||
quantity: number;
|
||||
/** Units held by pending orders. available = quantity - quantity_reserved. */
|
||||
quantityReserved: number;
|
||||
name: string;
|
||||
description: string;
|
||||
metadataUri: string;
|
||||
listingId: number | bigint;
|
||||
isActive: boolean;
|
||||
@@ -147,6 +151,8 @@ export function getSolistingStateListingAccountEncoder(): Encoder<SolistingState
|
||||
["acceptedResolvers", getArrayEncoder(getAddressEncoder())],
|
||||
["quantity", getU32Encoder()],
|
||||
["quantityReserved", getU32Encoder()],
|
||||
["name", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
||||
["description", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
||||
["metadataUri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
||||
["listingId", getU64Encoder()],
|
||||
["isActive", getBooleanEncoder()],
|
||||
@@ -174,6 +180,8 @@ export function getSolistingStateListingAccountDecoder(): Decoder<SolistingState
|
||||
["acceptedResolvers", getArrayDecoder(getAddressDecoder())],
|
||||
["quantity", getU32Decoder()],
|
||||
["quantityReserved", getU32Decoder()],
|
||||
["name", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
||||
["description", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
||||
["metadataUri", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
||||
["listingId", getU64Decoder()],
|
||||
["isActive", getBooleanDecoder()],
|
||||
|
||||
@@ -111,6 +111,8 @@ export type CreateListingInstructionData = {
|
||||
altCurrencies: Array<SolistingStateAltCurrencyConfig>;
|
||||
acceptedResolvers: Array<Address>;
|
||||
quantity: number;
|
||||
name: string;
|
||||
description: string;
|
||||
metadataUri: string;
|
||||
};
|
||||
|
||||
@@ -122,6 +124,8 @@ export type CreateListingInstructionDataArgs = {
|
||||
altCurrencies: Array<SolistingStateAltCurrencyConfigArgs>;
|
||||
acceptedResolvers: Array<Address>;
|
||||
quantity: number;
|
||||
name: string;
|
||||
description: string;
|
||||
metadataUri: string;
|
||||
};
|
||||
|
||||
@@ -139,6 +143,8 @@ export function getCreateListingInstructionDataEncoder(): Encoder<CreateListingI
|
||||
],
|
||||
["acceptedResolvers", getArrayEncoder(getAddressEncoder())],
|
||||
["quantity", getU32Encoder()],
|
||||
["name", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
||||
["description", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
||||
["metadataUri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
||||
]),
|
||||
(value) => ({ ...value, discriminator: CREATE_LISTING_DISCRIMINATOR }),
|
||||
@@ -158,6 +164,8 @@ export function getCreateListingInstructionDataDecoder(): Decoder<CreateListingI
|
||||
],
|
||||
["acceptedResolvers", getArrayDecoder(getAddressDecoder())],
|
||||
["quantity", getU32Decoder()],
|
||||
["name", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
||||
["description", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
||||
["metadataUri", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
||||
]);
|
||||
}
|
||||
@@ -187,6 +195,8 @@ export type CreateListingAsyncInput<
|
||||
altCurrencies: CreateListingInstructionDataArgs["altCurrencies"];
|
||||
acceptedResolvers: CreateListingInstructionDataArgs["acceptedResolvers"];
|
||||
quantity: CreateListingInstructionDataArgs["quantity"];
|
||||
name: CreateListingInstructionDataArgs["name"];
|
||||
description: CreateListingInstructionDataArgs["description"];
|
||||
metadataUri: CreateListingInstructionDataArgs["metadataUri"];
|
||||
};
|
||||
|
||||
@@ -279,6 +289,8 @@ export type CreateListingInput<
|
||||
altCurrencies: CreateListingInstructionDataArgs["altCurrencies"];
|
||||
acceptedResolvers: CreateListingInstructionDataArgs["acceptedResolvers"];
|
||||
quantity: CreateListingInstructionDataArgs["quantity"];
|
||||
name: CreateListingInstructionDataArgs["name"];
|
||||
description: CreateListingInstructionDataArgs["description"];
|
||||
metadataUri: CreateListingInstructionDataArgs["metadataUri"];
|
||||
};
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ export type UpdateListingInstructionData = {
|
||||
altCurrencies: Array<SolistingStateAltCurrencyConfig>;
|
||||
acceptedResolvers: Array<Address>;
|
||||
quantity: number;
|
||||
name: string;
|
||||
description: string;
|
||||
metadataUri: string;
|
||||
};
|
||||
|
||||
@@ -111,6 +113,8 @@ export type UpdateListingInstructionDataArgs = {
|
||||
altCurrencies: Array<SolistingStateAltCurrencyConfigArgs>;
|
||||
acceptedResolvers: Array<Address>;
|
||||
quantity: number;
|
||||
name: string;
|
||||
description: string;
|
||||
metadataUri: string;
|
||||
};
|
||||
|
||||
@@ -127,6 +131,8 @@ export function getUpdateListingInstructionDataEncoder(): Encoder<UpdateListingI
|
||||
],
|
||||
["acceptedResolvers", getArrayEncoder(getAddressEncoder())],
|
||||
["quantity", getU32Encoder()],
|
||||
["name", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
||||
["description", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
||||
["metadataUri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
||||
]),
|
||||
(value) => ({ ...value, discriminator: UPDATE_LISTING_DISCRIMINATOR }),
|
||||
@@ -145,6 +151,8 @@ export function getUpdateListingInstructionDataDecoder(): Decoder<UpdateListingI
|
||||
],
|
||||
["acceptedResolvers", getArrayDecoder(getAddressDecoder())],
|
||||
["quantity", getU32Decoder()],
|
||||
["name", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
||||
["description", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
||||
["metadataUri", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
||||
]);
|
||||
}
|
||||
@@ -171,6 +179,8 @@ export type UpdateListingInput<
|
||||
altCurrencies: UpdateListingInstructionDataArgs["altCurrencies"];
|
||||
acceptedResolvers: UpdateListingInstructionDataArgs["acceptedResolvers"];
|
||||
quantity: UpdateListingInstructionDataArgs["quantity"];
|
||||
name: UpdateListingInstructionDataArgs["name"];
|
||||
description: UpdateListingInstructionDataArgs["description"];
|
||||
metadataUri: UpdateListingInstructionDataArgs["metadataUri"];
|
||||
};
|
||||
|
||||
|
||||
@@ -115,6 +115,14 @@
|
||||
"name": "quantity",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "metadata_uri",
|
||||
"type": "string"
|
||||
@@ -208,6 +216,14 @@
|
||||
"name": "quantity",
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "metadata_uri",
|
||||
"type": "string"
|
||||
@@ -1337,6 +1353,14 @@
|
||||
],
|
||||
"type": "u32"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "metadata_uri",
|
||||
"type": "string"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user