prividium 1.3.0 → 1.3.2
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/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Prividium™ SDK & CLI
|
|
2
2
|
|
|
3
|
-
A TypeScript SDK and CLI for integrating with the Prividium™ authorization system. The SDK
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
A TypeScript SDK and CLI for integrating with the Prividium™ authorization system. The SDK handles **authentication** —
|
|
4
|
+
signing in with OIDC or SIWE and attaching your identity to each request — while Prividium™ enforces **authorization**
|
|
5
|
+
server-side from your assigned roles, controlling which contract functions, events, and data you can access; the SDK
|
|
6
|
+
does not grant permissions. It provides popup OAuth, token management, and a viem transport for secure RPC; the CLI runs
|
|
7
|
+
a local authenticated JSON-RPC proxy to your Prividium™ RPC and manages basic configuration.
|
|
6
8
|
|
|
7
9
|
## Features
|
|
8
10
|
|
|
@@ -417,6 +419,22 @@ interface PrividiumSiweConfig {
|
|
|
417
419
|
browser-only), plus `address` (the wallet address derived from the account) and an `admin` namespace for permissions-API
|
|
418
420
|
administration operations.
|
|
419
421
|
|
|
422
|
+
### Fetching contract ABI: `prividium.fetchContractAbi(address)`
|
|
423
|
+
|
|
424
|
+
Fetches the ABI and function metadata for a registered contract.
|
|
425
|
+
|
|
426
|
+
```typescript
|
|
427
|
+
const result = await prividium.fetchContractAbi('0xCONTRACT_ADDRESS');
|
|
428
|
+
// result.abi — the contract ABI array
|
|
429
|
+
// result.functions — list of { selector, signature, name, accessType }
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
**Parameters:**
|
|
433
|
+
|
|
434
|
+
- `contractAddress: Address` — address of the contract to look up
|
|
435
|
+
|
|
436
|
+
**Returns:** `Promise<ContractAbiResponse>` — includes `contractAddress`, `name`, `abi`, and `functions`.
|
|
437
|
+
|
|
420
438
|
### Admin API: `prividium.admin.*`
|
|
421
439
|
|
|
422
440
|
The `admin` namespace on a `PrividiumSiweChain` instance wraps permissions-API endpoints that require admin
|
package/dist/sdk/siwe-chain.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Address, type Chain, type LocalAccount, type Transport } from 'viem';
|
|
2
2
|
import { type AdminMethods } from './admin-api/index.js';
|
|
3
|
-
import type { AuthorizeTransactionParams, AuthorizeTransactionResponse, Storage, TokenData, UserProfile } from './types.js';
|
|
3
|
+
import type { AuthorizeTransactionParams, AuthorizeTransactionResponse, ContractAbiResponse, Storage, TokenData, UserProfile } from './types.js';
|
|
4
4
|
export interface PrividiumSiweConfig {
|
|
5
5
|
chain: Omit<Chain, 'rpcUrls'>;
|
|
6
6
|
prividiumApiBaseUrl: string;
|
|
@@ -25,6 +25,7 @@ export interface PrividiumSiweChain {
|
|
|
25
25
|
getWalletRpcUrl(): Promise<string>;
|
|
26
26
|
invalidateWalletToken(): Promise<string>;
|
|
27
27
|
authorizeTransaction(params: AuthorizeTransactionParams): Promise<AuthorizeTransactionResponse>;
|
|
28
|
+
fetchContractAbi(contractAddress: Address): Promise<ContractAbiResponse>;
|
|
28
29
|
admin: AdminMethods;
|
|
29
30
|
}
|
|
30
31
|
export declare function createPrividiumSiweChain(config: PrividiumSiweConfig): PrividiumSiweChain;
|
package/dist/sdk/siwe-chain.js
CHANGED
|
@@ -173,6 +173,7 @@ export function createPrividiumSiweChain(config) {
|
|
|
173
173
|
getWalletRpcUrl: apiMethods.getWalletRpcUrl,
|
|
174
174
|
invalidateWalletToken: apiMethods.invalidateWalletToken,
|
|
175
175
|
authorizeTransaction: apiMethods.authorizeTransaction,
|
|
176
|
+
fetchContractAbi: apiMethods.fetchContractAbi,
|
|
176
177
|
admin
|
|
177
178
|
};
|
|
178
179
|
}
|