@rougechain/sdk 0.5.0 → 0.6.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/dist/client.d.ts DELETED
@@ -1,199 +0,0 @@
1
- import type { WalletKeys, ApiResponse, SignedTransaction, NodeStats, Block, TokenMetadata, BalanceResponse, LiquidityPool, SwapQuote, PoolEvent, PoolStats, NftCollection, NftToken, Validator, BridgeConfig, BridgeWithdrawal, XrgeBridgeConfig, TransferParams, CreateTokenParams, SwapParams, CreatePoolParams, AddLiquidityParams, RemoveLiquidityParams, StakeParams, CreateNftCollectionParams, MintNftParams, BatchMintNftParams, TransferNftParams, BurnNftParams, LockNftParams, FreezeCollectionParams, BridgeWithdrawParams, BridgeClaimParams, XrgeBridgeClaimParams, XrgeBridgeWithdrawParams, SwapQuoteParams, TokenMetadataUpdateParams, TokenHolder, MailMessage, SendMailParams, MessengerWallet, MessengerConversation, MessengerMessage, PriceSnapshot, ShieldParams, ShieldedTransferParams, UnshieldParams, ShieldedStats, RollupStatus, RollupBatchResult, RollupSubmitParams, RollupSubmitResult } from "./types.js";
2
- import { type ShieldedNote } from "./shielded.js";
3
- type FetchFn = typeof globalThis.fetch;
4
- export interface RougeChainOptions {
5
- /** Custom fetch implementation (defaults to globalThis.fetch) */
6
- fetch?: FetchFn;
7
- /** Optional API key for authenticated endpoints */
8
- apiKey?: string;
9
- }
10
- export declare class RougeChain {
11
- /** @internal */ readonly baseUrl: string;
12
- /** @internal */ readonly fetchFn: FetchFn;
13
- /** @internal */ readonly headers: Record<string, string>;
14
- readonly nft: NftClient;
15
- readonly dex: DexClient;
16
- readonly bridge: BridgeClient;
17
- readonly mail: MailClient;
18
- readonly messenger: MessengerClient;
19
- readonly shielded: ShieldedClient;
20
- constructor(baseUrl: string, options?: RougeChainOptions);
21
- /** @internal */
22
- get<T = unknown>(path: string): Promise<T>;
23
- /** @internal */
24
- post<T = unknown>(path: string, body: unknown): Promise<T>;
25
- /** @internal */
26
- submitTx(endpoint: string, signedTx: SignedTransaction): Promise<ApiResponse>;
27
- getStats(): Promise<NodeStats>;
28
- getHealth(): Promise<{
29
- status: string;
30
- chain_id: string;
31
- height: number;
32
- }>;
33
- getBlocks(opts?: {
34
- limit?: number;
35
- }): Promise<Block[]>;
36
- getBlocksSummary(range?: "1h" | "24h" | "7d"): Promise<unknown>;
37
- getBalance(publicKey: string): Promise<BalanceResponse>;
38
- getTokenBalance(publicKey: string, token: string): Promise<number>;
39
- getTransactions(opts?: {
40
- limit?: number;
41
- offset?: number;
42
- }): Promise<unknown>;
43
- getTokens(): Promise<TokenMetadata[]>;
44
- getTokenMetadata(symbol: string): Promise<TokenMetadata>;
45
- getTokenHolders(symbol: string): Promise<TokenHolder[]>;
46
- getTokenTransactions(symbol: string): Promise<unknown>;
47
- getValidators(): Promise<Validator[]>;
48
- getValidatorStats(): Promise<unknown>;
49
- getFinality(): Promise<{
50
- finalized_height: number;
51
- tip_height: number;
52
- total_stake: number;
53
- finalized_stake: number;
54
- }>;
55
- getPeers(): Promise<string[]>;
56
- getBurnedTokens(): Promise<{
57
- burned: Record<string, number>;
58
- total_xrge_burned: number;
59
- }>;
60
- transfer(wallet: WalletKeys, params: TransferParams): Promise<ApiResponse>;
61
- createToken(wallet: WalletKeys, params: CreateTokenParams): Promise<ApiResponse>;
62
- stake(wallet: WalletKeys, params: StakeParams): Promise<ApiResponse>;
63
- unstake(wallet: WalletKeys, params: StakeParams): Promise<ApiResponse>;
64
- faucet(wallet: WalletKeys): Promise<ApiResponse>;
65
- burn(wallet: WalletKeys, amount: number, fee?: number, token?: string): Promise<ApiResponse>;
66
- updateTokenMetadata(wallet: WalletKeys, params: TokenMetadataUpdateParams): Promise<ApiResponse>;
67
- claimTokenMetadata(wallet: WalletKeys, tokenSymbol: string): Promise<ApiResponse>;
68
- /** Get the current rollup accumulator status. */
69
- getRollupStatus(): Promise<RollupStatus>;
70
- /** Submit a transfer into the rollup batch accumulator. */
71
- submitRollupTransfer(params: RollupSubmitParams): Promise<RollupSubmitResult>;
72
- /** Get the result of a completed rollup batch by ID. */
73
- getRollupBatch(batchId: number): Promise<RollupBatchResult>;
74
- }
75
- declare class NftClient {
76
- private readonly rc;
77
- constructor(rc: RougeChain);
78
- getCollections(): Promise<NftCollection[]>;
79
- getCollection(collectionId: string): Promise<NftCollection>;
80
- /**
81
- * Poll until a collection exists on-chain (i.e. the create tx has been mined).
82
- * Useful after `createCollection` since the tx goes to the mempool first.
83
- * @returns the collection once found, or throws after the timeout.
84
- */
85
- waitForCollection(collectionId: string, opts?: {
86
- timeoutMs?: number;
87
- pollMs?: number;
88
- }): Promise<NftCollection>;
89
- getTokens(collectionId: string, opts?: {
90
- limit?: number;
91
- offset?: number;
92
- }): Promise<{
93
- tokens: NftToken[];
94
- total: number;
95
- }>;
96
- getToken(collectionId: string, tokenId: number): Promise<NftToken>;
97
- getByOwner(pubkey: string): Promise<NftToken[]>;
98
- createCollection(wallet: WalletKeys, params: CreateNftCollectionParams): Promise<ApiResponse>;
99
- mint(wallet: WalletKeys, params: MintNftParams): Promise<ApiResponse>;
100
- batchMint(wallet: WalletKeys, params: BatchMintNftParams): Promise<ApiResponse>;
101
- transfer(wallet: WalletKeys, params: TransferNftParams): Promise<ApiResponse>;
102
- burn(wallet: WalletKeys, params: BurnNftParams): Promise<ApiResponse>;
103
- lock(wallet: WalletKeys, params: LockNftParams): Promise<ApiResponse>;
104
- freezeCollection(wallet: WalletKeys, params: FreezeCollectionParams): Promise<ApiResponse>;
105
- }
106
- declare class DexClient {
107
- private readonly rc;
108
- constructor(rc: RougeChain);
109
- getPools(): Promise<LiquidityPool[]>;
110
- getPool(poolId: string): Promise<LiquidityPool>;
111
- getPoolEvents(poolId: string): Promise<PoolEvent[]>;
112
- getPriceHistory(poolId: string): Promise<PriceSnapshot[]>;
113
- getPoolStats(poolId: string): Promise<PoolStats>;
114
- quote(params: SwapQuoteParams): Promise<SwapQuote>;
115
- swap(wallet: WalletKeys, params: SwapParams): Promise<ApiResponse>;
116
- createPool(wallet: WalletKeys, params: CreatePoolParams): Promise<ApiResponse>;
117
- addLiquidity(wallet: WalletKeys, params: AddLiquidityParams): Promise<ApiResponse>;
118
- removeLiquidity(wallet: WalletKeys, params: RemoveLiquidityParams): Promise<ApiResponse>;
119
- }
120
- declare class BridgeClient {
121
- private readonly rc;
122
- constructor(rc: RougeChain);
123
- getConfig(): Promise<BridgeConfig>;
124
- getWithdrawals(): Promise<BridgeWithdrawal[]>;
125
- /** Withdraw qETH/qUSDC — signed client-side, private key never sent to server */
126
- withdraw(wallet: WalletKeys, params: BridgeWithdrawParams): Promise<ApiResponse>;
127
- /** Claim qETH or qUSDC after depositing on Base Sepolia */
128
- claim(params: BridgeClaimParams): Promise<ApiResponse>;
129
- getXrgeConfig(): Promise<XrgeBridgeConfig>;
130
- claimXrge(params: XrgeBridgeClaimParams): Promise<ApiResponse>;
131
- withdrawXrge(wallet: WalletKeys, params: XrgeBridgeWithdrawParams): Promise<ApiResponse>;
132
- getXrgeWithdrawals(): Promise<BridgeWithdrawal[]>;
133
- }
134
- declare class MailClient {
135
- private readonly rc;
136
- constructor(rc: RougeChain);
137
- send(params: SendMailParams): Promise<ApiResponse>;
138
- getInbox(walletId: string): Promise<MailMessage[]>;
139
- getSent(walletId: string): Promise<MailMessage[]>;
140
- getTrash(walletId: string): Promise<MailMessage[]>;
141
- getMessage(id: string): Promise<MailMessage>;
142
- move(messageId: string, folder: string): Promise<ApiResponse>;
143
- markRead(messageId: string): Promise<ApiResponse>;
144
- delete(id: string): Promise<ApiResponse>;
145
- }
146
- declare class MessengerClient {
147
- private readonly rc;
148
- constructor(rc: RougeChain);
149
- getWallets(): Promise<MessengerWallet[]>;
150
- registerWallet(opts: {
151
- id: string;
152
- displayName: string;
153
- signingPublicKey: string;
154
- encryptionPublicKey: string;
155
- }): Promise<ApiResponse>;
156
- getConversations(walletId: string, opts?: {
157
- signingPublicKey?: string;
158
- encryptionPublicKey?: string;
159
- }): Promise<MessengerConversation[]>;
160
- createConversation(participants: string[]): Promise<ApiResponse>;
161
- getMessages(conversationId: string): Promise<MessengerMessage[]>;
162
- sendMessage(conversationId: string, sender: string, encryptedContent: string, opts?: {
163
- mediaType?: string;
164
- mediaData?: string;
165
- selfDestruct?: boolean;
166
- destructAfterSeconds?: number;
167
- }): Promise<ApiResponse>;
168
- deleteMessage(messageId: string): Promise<ApiResponse>;
169
- markRead(messageId: string): Promise<ApiResponse>;
170
- }
171
- declare class ShieldedClient {
172
- private readonly rc;
173
- constructor(rc: RougeChain);
174
- getStats(): Promise<ShieldedStats>;
175
- isNullifierSpent(nullifierHex: string): Promise<{
176
- spent: boolean;
177
- }>;
178
- /**
179
- * Shield public XRGE into a private note.
180
- * Creates the commitment client-side, submits to the chain.
181
- *
182
- * @returns The ShieldedNote (keep this locally — it's the only way to spend the note)
183
- */
184
- shield(wallet: WalletKeys, params: ShieldParams): Promise<ApiResponse & {
185
- note?: ShieldedNote;
186
- }>;
187
- /**
188
- * Transfer between shielded notes (private → private).
189
- * Requires a pre-generated STARK proof.
190
- */
191
- transfer(wallet: WalletKeys, params: ShieldedTransferParams): Promise<ApiResponse>;
192
- /**
193
- * Unshield a private note back to public XRGE.
194
- * Requires a STARK proof of note ownership.
195
- */
196
- unshield(wallet: WalletKeys, params: UnshieldParams): Promise<ApiResponse>;
197
- }
198
- export {};
199
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,KAAK,EACL,aAAa,EACb,eAAe,EACf,aAAa,EACb,SAAS,EACT,SAAS,EACT,SAAS,EACT,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EA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B,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,KAAK,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,eAAe,EACf,aAAa,EACb,SAAS,EACT,SAAS,EACT,SAAS,EACT,aAAa,EACb,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,yBAAyB,EACzB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EACf,yBAAyB,EACzB,WAAW,EACX,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
@@ -1,43 +0,0 @@
1
- /**
2
- * Client-side shielded transaction crypto primitives.
3
- *
4
- * Mirrors the Rust commitment.rs exactly:
5
- * commitment = SHA-256("ROUGECHAIN_COMMITMENT_V1" || value || pubkey || randomness)
6
- * nullifier = SHA-256("ROUGECHAIN_NULLIFIER_V1" || randomness || commitment)
7
- */
8
- /** Generate 32 bytes of cryptographically secure randomness (hex-encoded). */
9
- export declare function generateRandomness(): string;
10
- /**
11
- * Compute a shielded note commitment.
12
- *
13
- * @param value - Note value in XRGE (integer)
14
- * @param ownerPubKey - Owner's ML-DSA-65 public key (hex)
15
- * @param randomness - 32-byte blinding factor (hex)
16
- * @returns 32-byte commitment hash (hex)
17
- */
18
- export declare function computeCommitment(value: number, ownerPubKey: string, randomness: string): string;
19
- /**
20
- * Compute a nullifier for a shielded note.
21
- *
22
- * @param randomness - The note's blinding factor (hex)
23
- * @param commitment - The note's commitment hash (hex)
24
- * @returns 32-byte nullifier hash (hex)
25
- */
26
- export declare function computeNullifier(randomness: string, commitment: string): string;
27
- /** A shielded note — kept locally by the owner (never sent to chain). */
28
- export interface ShieldedNote {
29
- commitment: string;
30
- nullifier: string;
31
- value: number;
32
- randomness: string;
33
- ownerPubKey: string;
34
- }
35
- /**
36
- * Create a new shielded note for a given value.
37
- *
38
- * @param value - XRGE amount (integer)
39
- * @param ownerPubKey - Owner's public key (hex)
40
- * @returns A ShieldedNote with all derived fields
41
- */
42
- export declare function createShieldedNote(value: number, ownerPubKey: string): ShieldedNote;
43
- //# sourceMappingURL=shielded.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shielded.d.ts","sourceRoot":"","sources":["../src/shielded.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,8EAA8E;AAC9E,wBAAgB,kBAAkB,IAAI,MAAM,CAI3C;AAqBD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,MAAM,CAgBR;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,MAAM,CAaR;AAED,yEAAyE;AACzE,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,YAAY,CAKd"}
package/dist/signer.d.ts DELETED
@@ -1,47 +0,0 @@
1
- import type { TransactionPayload, SignedTransaction, WalletKeys } from "./types.js";
2
- export declare const BURN_ADDRESS = "XRGE_BURN_0x000000000000000000000000000000000000000000000000000000000000DEAD";
3
- export declare function serializePayload(payload: TransactionPayload): Uint8Array;
4
- export declare function signTransaction(payload: TransactionPayload, privateKey: string, publicKey: string): SignedTransaction;
5
- export declare function verifyTransaction(signedTx: SignedTransaction): boolean;
6
- export declare function isBurnAddress(address: string): boolean;
7
- export declare function createSignedTransfer(wallet: WalletKeys, to: string, amount: number, fee?: number, token?: string): SignedTransaction;
8
- export declare function createSignedTokenCreation(wallet: WalletKeys, tokenName: string, tokenSymbol: string, initialSupply: number, fee?: number, image?: string): SignedTransaction;
9
- export declare function createSignedTokenMetadataUpdate(wallet: WalletKeys, tokenSymbol: string, metadata: {
10
- image?: string;
11
- description?: string;
12
- website?: string;
13
- twitter?: string;
14
- discord?: string;
15
- }): SignedTransaction;
16
- export declare function createSignedTokenMetadataClaim(wallet: WalletKeys, tokenSymbol: string): SignedTransaction;
17
- export declare function createSignedSwap(wallet: WalletKeys, tokenIn: string, tokenOut: string, amountIn: number, minAmountOut: number): SignedTransaction;
18
- export declare function createSignedPoolCreation(wallet: WalletKeys, tokenA: string, tokenB: string, amountA: number, amountB: number): SignedTransaction;
19
- export declare function createSignedAddLiquidity(wallet: WalletKeys, poolId: string, amountA: number, amountB: number): SignedTransaction;
20
- export declare function createSignedRemoveLiquidity(wallet: WalletKeys, poolId: string, lpAmount: number): SignedTransaction;
21
- export declare function createSignedStake(wallet: WalletKeys, amount: number, fee?: number): SignedTransaction;
22
- export declare function createSignedUnstake(wallet: WalletKeys, amount: number, fee?: number): SignedTransaction;
23
- export declare function createSignedFaucetRequest(wallet: WalletKeys): SignedTransaction;
24
- export declare function createSignedBurn(wallet: WalletKeys, amount: number, fee?: number, token?: string): SignedTransaction;
25
- export declare function createSignedBridgeWithdraw(wallet: WalletKeys, amount: number, evmAddress: string, tokenSymbol?: string, fee?: number): SignedTransaction;
26
- export declare function createSignedNftCreateCollection(wallet: WalletKeys, symbol: string, name: string, opts?: {
27
- maxSupply?: number;
28
- royaltyBps?: number;
29
- image?: string;
30
- description?: string;
31
- }): SignedTransaction;
32
- export declare function createSignedNftMint(wallet: WalletKeys, collectionId: string, name: string, opts?: {
33
- metadataUri?: string;
34
- attributes?: unknown;
35
- }): SignedTransaction;
36
- export declare function createSignedNftBatchMint(wallet: WalletKeys, collectionId: string, names: string[], opts?: {
37
- uris?: string[];
38
- batchAttributes?: unknown[];
39
- }): SignedTransaction;
40
- export declare function createSignedNftTransfer(wallet: WalletKeys, collectionId: string, tokenId: number, to: string, salePrice?: number): SignedTransaction;
41
- export declare function createSignedNftBurn(wallet: WalletKeys, collectionId: string, tokenId: number): SignedTransaction;
42
- export declare function createSignedNftLock(wallet: WalletKeys, collectionId: string, tokenId: number, locked: boolean): SignedTransaction;
43
- export declare function createSignedNftFreezeCollection(wallet: WalletKeys, collectionId: string, frozen: boolean): SignedTransaction;
44
- export declare function createSignedShield(wallet: WalletKeys, amount: number, commitment: string): SignedTransaction;
45
- export declare function createSignedShieldedTransfer(wallet: WalletKeys, nullifiers: string[], outputCommitments: string[], proof: string, shieldedFee?: number): SignedTransaction;
46
- export declare function createSignedUnshield(wallet: WalletKeys, nullifiers: string[], amount: number, proof: string): SignedTransaction;
47
- //# sourceMappingURL=signer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,YAAY,iFACuD,CAAC;AAcjF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG,UAAU,CAGxE;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,kBAAkB,EAC3B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,iBAAiB,CAQnB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAWtE;AAED,wBAAgB,aAAa,CAAC,O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