Product Management

The productManager provides methods to create and manage products in the Galliun Payment Protocol.

Creating Products

const { resp, productObjChange } = await client.productManager.createProduct(
	coinType, // e.g., "0x2::sui::SUI"
	name, // Product name
	description, // Product description
	price, // Price in smallest unit
	quantity, // Initial quantity
	{
		dryRun, // Optional: Simulate transaction
		sender, // Optional: Override default sender
	},
);

Response

interface ProductResponse {
	resp: SuiTransactionBlockResponse;
	productObjChange: {
		id: string;
		type: string;
		// ... other product properties
	};
}

Managing Products

Buy Product

Update Product Info

Manage Quantity

Increase Quantity

Decrease Quantity

Fetching Products

Fetch Single Product

Fetch Multiple Products

Product Object

The SDK returns products in this format:

Error Handling

Handle specific product management errors:

Common Use Cases

  1. Create and Track Product:

  1. Update Product with Price Change:

Last updated