@chipi-stack/backend 0.1.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-3HAMR0rB.d.mts +24 -0
- package/dist/client-3HAMR0rB.d.ts +24 -0
- package/dist/index.d.mts +52 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +722 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +710 -0
- package/dist/index.mjs.map +1 -0
- package/dist/skus.d.mts +52 -0
- package/dist/skus.d.ts +52 -0
- package/dist/skus.js +87 -0
- package/dist/skus.js.map +1 -0
- package/dist/skus.mjs +85 -0
- package/dist/skus.mjs.map +1 -0
- package/dist/transactions.d.mts +50 -0
- package/dist/transactions.d.ts +50 -0
- package/dist/transactions.js +174 -0
- package/dist/transactions.js.map +1 -0
- package/dist/transactions.mjs +168 -0
- package/dist/transactions.mjs.map +1 -0
- package/dist/wallets.d.mts +38 -0
- package/dist/wallets.d.ts +38 -0
- package/dist/wallets.js +190 -0
- package/dist/wallets.js.map +1 -0
- package/dist/wallets.mjs +184 -0
- package/dist/wallets.mjs.map +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChipiSDKConfig } from '@chipi-stack/types';
|
|
2
|
+
import { ApiResponse } from '@chipi-stack/shared';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* HTTP client for Chipi API interactions
|
|
6
|
+
*/
|
|
7
|
+
declare class ChipiClient {
|
|
8
|
+
private apiPublicKey;
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
private environment;
|
|
11
|
+
constructor(config: ChipiSDKConfig);
|
|
12
|
+
/**
|
|
13
|
+
* Get the API public key (for internal SDK use)
|
|
14
|
+
*/
|
|
15
|
+
getApiPublicKey(): string;
|
|
16
|
+
private getBaseUrl;
|
|
17
|
+
private getHeaders;
|
|
18
|
+
get<T>(endpoint: string, params?: Record<string, any>, bearerToken?: string): Promise<ApiResponse<T>>;
|
|
19
|
+
post<T>(endpoint: string, body?: any, bearerToken?: string): Promise<ApiResponse<T>>;
|
|
20
|
+
put<T>(endpoint: string, body?: any, bearerToken?: string): Promise<ApiResponse<T>>;
|
|
21
|
+
delete<T>(endpoint: string, bearerToken?: string): Promise<ApiResponse<T>>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { ChipiClient as C };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChipiSDKConfig } from '@chipi-stack/types';
|
|
2
|
+
import { ApiResponse } from '@chipi-stack/shared';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* HTTP client for Chipi API interactions
|
|
6
|
+
*/
|
|
7
|
+
declare class ChipiClient {
|
|
8
|
+
private apiPublicKey;
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
private environment;
|
|
11
|
+
constructor(config: ChipiSDKConfig);
|
|
12
|
+
/**
|
|
13
|
+
* Get the API public key (for internal SDK use)
|
|
14
|
+
*/
|
|
15
|
+
getApiPublicKey(): string;
|
|
16
|
+
private getBaseUrl;
|
|
17
|
+
private getHeaders;
|
|
18
|
+
get<T>(endpoint: string, params?: Record<string, any>, bearerToken?: string): Promise<ApiResponse<T>>;
|
|
19
|
+
post<T>(endpoint: string, body?: any, bearerToken?: string): Promise<ApiResponse<T>>;
|
|
20
|
+
put<T>(endpoint: string, body?: any, bearerToken?: string): Promise<ApiResponse<T>>;
|
|
21
|
+
delete<T>(endpoint: string, bearerToken?: string): Promise<ApiResponse<T>>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { ChipiClient as C };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ChipiSDKConfig, ExecuteTransactionParams, TransferParams, ApproveParams, StakeVesuUsdcParams, WithdrawVesuUsdcParams, CallAnyContractParams, CreateWalletParams, CreateWalletResponse } from '@chipi-stack/types';
|
|
2
|
+
export * from '@chipi-stack/types';
|
|
3
|
+
import { ChipiWallets } from './wallets.mjs';
|
|
4
|
+
import { ChipiTransactions } from './transactions.mjs';
|
|
5
|
+
import { ChipiSkus } from './skus.mjs';
|
|
6
|
+
export { C as ChipiClient } from './client-3HAMR0rB.mjs';
|
|
7
|
+
import '@chipi-stack/shared';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Main Chipi SDK class
|
|
11
|
+
*/
|
|
12
|
+
declare class ChipiSDK {
|
|
13
|
+
private client;
|
|
14
|
+
private nodeUrl;
|
|
15
|
+
readonly wallets: ChipiWallets;
|
|
16
|
+
readonly transactions: ChipiTransactions;
|
|
17
|
+
readonly skus: ChipiSkus;
|
|
18
|
+
constructor(config: ChipiSDKConfig);
|
|
19
|
+
/**
|
|
20
|
+
* Execute a gasless transaction
|
|
21
|
+
*/
|
|
22
|
+
executeTransaction(input: Omit<ExecuteTransactionParams, 'apiPublicKey'>): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Transfer tokens
|
|
25
|
+
*/
|
|
26
|
+
transfer(params: Omit<TransferParams, 'apiPublicKey'>): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Approve token spending
|
|
29
|
+
*/
|
|
30
|
+
approve(params: Omit<ApproveParams, 'apiPublicKey'>): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Stake USDC in Vesu protocol
|
|
33
|
+
*/
|
|
34
|
+
stakeVesuUsdc(params: Omit<StakeVesuUsdcParams, 'apiPublicKey'>): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Withdraw USDC from Vesu protocol
|
|
37
|
+
*/
|
|
38
|
+
withdrawVesuUsdc(params: Omit<WithdrawVesuUsdcParams, 'apiPublicKey'>): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Call any contract method
|
|
41
|
+
*/
|
|
42
|
+
callAnyContract(params: Omit<CallAnyContractParams, 'apiPublicKey'>): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Create a new wallet
|
|
45
|
+
*/
|
|
46
|
+
createWallet(params: Omit<CreateWalletParams, 'apiPublicKey' | 'nodeUrl'>): Promise<CreateWalletResponse>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare const encryptPrivateKey: (privateKey: string, password: string) => string;
|
|
50
|
+
declare const decryptPrivateKey: (encryptedPrivateKey: string, password: string) => string | null;
|
|
51
|
+
|
|
52
|
+
export { ChipiSDK, ChipiSkus, ChipiTransactions, ChipiWallets, decryptPrivateKey, encryptPrivateKey };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ChipiSDKConfig, ExecuteTransactionParams, TransferParams, ApproveParams, StakeVesuUsdcParams, WithdrawVesuUsdcParams, CallAnyContractParams, CreateWalletParams, CreateWalletResponse } from '@chipi-stack/types';
|
|
2
|
+
export * from '@chipi-stack/types';
|
|
3
|
+
import { ChipiWallets } from './wallets.js';
|
|
4
|
+
import { ChipiTransactions } from './transactions.js';
|
|
5
|
+
import { ChipiSkus } from './skus.js';
|
|
6
|
+
export { C as ChipiClient } from './client-3HAMR0rB.js';
|
|
7
|
+
import '@chipi-stack/shared';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Main Chipi SDK class
|
|
11
|
+
*/
|
|
12
|
+
declare class ChipiSDK {
|
|
13
|
+
private client;
|
|
14
|
+
private nodeUrl;
|
|
15
|
+
readonly wallets: ChipiWallets;
|
|
16
|
+
readonly transactions: ChipiTransactions;
|
|
17
|
+
readonly skus: ChipiSkus;
|
|
18
|
+
constructor(config: ChipiSDKConfig);
|
|
19
|
+
/**
|
|
20
|
+
* Execute a gasless transaction
|
|
21
|
+
*/
|
|
22
|
+
executeTransaction(input: Omit<ExecuteTransactionParams, 'apiPublicKey'>): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Transfer tokens
|
|
25
|
+
*/
|
|
26
|
+
transfer(params: Omit<TransferParams, 'apiPublicKey'>): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Approve token spending
|
|
29
|
+
*/
|
|
30
|
+
approve(params: Omit<ApproveParams, 'apiPublicKey'>): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Stake USDC in Vesu protocol
|
|
33
|
+
*/
|
|
34
|
+
stakeVesuUsdc(params: Omit<StakeVesuUsdcParams, 'apiPublicKey'>): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Withdraw USDC from Vesu protocol
|
|
37
|
+
*/
|
|
38
|
+
withdrawVesuUsdc(params: Omit<WithdrawVesuUsdcParams, 'apiPublicKey'>): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Call any contract method
|
|
41
|
+
*/
|
|
42
|
+
callAnyContract(params: Omit<CallAnyContractParams, 'apiPublicKey'>): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Create a new wallet
|
|
45
|
+
*/
|
|
46
|
+
createWallet(params: Omit<CreateWalletParams, 'apiPublicKey' | 'nodeUrl'>): Promise<CreateWalletResponse>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare const encryptPrivateKey: (privateKey: string, password: string) => string;
|
|
50
|
+
declare const decryptPrivateKey: (encryptedPrivateKey: string, password: string) => string | null;
|
|
51
|
+
|
|
52
|
+
export { ChipiSDK, ChipiSkus, ChipiTransactions, ChipiWallets, decryptPrivateKey, encryptPrivateKey };
|