open-index/open-npm huggingface dataset:
npm package: @galliun/galliun-payment-sdk
Description: Galliun Payment SDK
Author: @galliun
Latest version: 0.1.1

# @galliun/galliun-payment-sdk

TypeScript SDK for interacting with the Galliun Payment Protocol on Sui Network. Enables easy integration of Galliun Payment contracts

## Installation

```bash
npm install @galliun/galliun-payment-sdk
# or
yarn add @galliun/galliun-payment-sdk
```

## Quick Start

```typescript
import { PaymentClient } from '@galliun/galliun-payment-sdk';

const client = new PaymentClient({
	network: 'mainnet', // or 'testnet', 'devnet'
	packageId: '0x...', // Protocol package ID
	configId: '0x...', // Protocol config ID
	signTransaction: async (tx) => {
		// Your transaction signing logic
		return signedTx;
	},
});

// Access different managers
const { billManager, paymentRequestManager, productManager } = client;

// Example: Create a bill
try {
	const bill = await billManager.createBill({
		amount: '1000000',
		coinType: '0x2::sui::SUI',
		description: 'Test Bill',
		participants: ['0x...'],
	});
	console.log('Bill created:', bill);
} catch (error) {
	console.error('Failed to create bill:', error);
}
```

## Documentation

For detailed documentation, visit our [GitBook Documentation](https://galliun-1.gitbook.io/gallypay/sdk-reference/getting-started).

- [Getting Started Guide](https://galliun-1.gitbook.io/gallypay/sdk-reference/getting-started/sdk/getting-started)
- [Bill Management](https://galliun-1.gitbook.io/gallypay/sdk-reference/getting-started/sdk/bill-management)
- [Payment Requests](https://galliun-1.gitbook.io/gallypay/sdk-reference/getting-started/sdk/payment-requests)
- [Product Management](https://galliun-1.gitbook.io/gallypay/sdk-reference/getting-started/sdk/product-management)
- [API Reference](https://galliun-1.gitbook.io/gallypay/sdk-reference/getting-started/sdk/reference/globals)

## Error Handling

The SDK provides typed errors for better error handling:

```typescript
try {
	await client.billManager.createBill(/* ... */);
} catch (error) {
	if (error.code === 'UNSUPPORTED_COIN') {
		// Handle unsupported coin error
	}
	// Handle other errors
}
```

## License

MIT License