@dzapio/sdk 2.0.4 → 2.0.6
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/api/index.d.ts +3 -2
- package/dist/chains/definitions/stable.d.ts +36 -0
- package/dist/chains/index.d.ts +36 -0
- package/dist/constants/address.d.ts +1 -0
- package/dist/constants/chains.d.ts +13 -0
- package/dist/dZapClient/index.d.ts +3 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -1
- package/dist/index.m.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/transactionHandlers/zap.d.ts +3 -3
- package/dist/types/chains.d.ts +2 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/types/zap/step.d.ts +11 -3
- package/dist/zap/constants/urls.d.ts +1 -0
- package/package.json +1 -1
|
@@ -3,16 +3,16 @@ import { WalletClient } from 'viem';
|
|
|
3
3
|
import { StatusCodes, TxnStatus } from '../enums';
|
|
4
4
|
import { DZapTransactionResponse, HexString } from '../types';
|
|
5
5
|
import { ZapBuildTxnRequest } from '../types/zap';
|
|
6
|
-
import { ZapStep,
|
|
6
|
+
import { ZapStep, ZapEvmTxnDetails } from '../types/zap/step';
|
|
7
7
|
declare class ZapTxnHandler {
|
|
8
8
|
static execute: ({ chainId, txnData, signer, }: {
|
|
9
9
|
chainId: number;
|
|
10
|
-
txnData:
|
|
10
|
+
txnData: ZapEvmTxnDetails;
|
|
11
11
|
signer: Signer | WalletClient;
|
|
12
12
|
}) => Promise<DZapTransactionResponse>;
|
|
13
13
|
static approve: ({ chainId, data, signer }: {
|
|
14
14
|
chainId: number;
|
|
15
|
-
data:
|
|
15
|
+
data: ZapEvmTxnDetails;
|
|
16
16
|
signer: Signer | WalletClient;
|
|
17
17
|
}) => Promise<{
|
|
18
18
|
status: TxnStatus;
|
package/dist/types/chains.d.ts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -479,4 +479,11 @@ export type BroadcastTxParams = {
|
|
|
479
479
|
chainId: number;
|
|
480
480
|
txData: BroadcastTxData;
|
|
481
481
|
};
|
|
482
|
+
export type BroadcastTxResponse = {
|
|
483
|
+
status: TxnStatus.success;
|
|
484
|
+
txnHash: string;
|
|
485
|
+
} | {
|
|
486
|
+
status: Exclude<TxnStatus, typeof TxnStatus.success>;
|
|
487
|
+
message: string;
|
|
488
|
+
};
|
|
482
489
|
export {};
|
package/dist/types/zap/step.d.ts
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { HexString } from '..';
|
|
2
|
+
import { chainTypes } from '../../constants/chains';
|
|
2
3
|
import { zapStepAction } from '../../zap/constants/step';
|
|
3
4
|
export type StepAction = keyof typeof zapStepAction;
|
|
4
|
-
export type
|
|
5
|
+
export type ZapEvmTxnDetails = {
|
|
6
|
+
type: typeof chainTypes.evm;
|
|
5
7
|
txnId: HexString;
|
|
6
8
|
callData: HexString;
|
|
7
9
|
callTo: HexString;
|
|
8
10
|
value: string;
|
|
9
11
|
estimatedGas: string;
|
|
10
12
|
};
|
|
11
|
-
export type
|
|
13
|
+
export type ZapBvmTxnDetails = {
|
|
14
|
+
type: typeof chainTypes.bvm;
|
|
15
|
+
txnId: HexString;
|
|
16
|
+
data: string;
|
|
17
|
+
};
|
|
18
|
+
export type ZapTxnDetails = ZapEvmTxnDetails | ZapBvmTxnDetails;
|
|
19
|
+
export type ZapTransactionStep<T extends ZapTxnDetails = ZapTxnDetails> = {
|
|
12
20
|
action: StepAction;
|
|
13
|
-
data:
|
|
21
|
+
data: T;
|
|
14
22
|
};
|
|
15
23
|
export type ZapStep = ZapTransactionStep;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dzapio/sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "A TypeScript/JavaScript SDK for interacting with the DZap protocol, providing utilities for DeFi operations including Swaps, Bridges, and Zaps.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"source": "src/index.ts",
|