@dzapio/sdk 1.0.1
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/CHANGELOG.md +33 -0
- package/LICENSE +21 -0
- package/README.md +355 -0
- package/dist/api/index.d.ts +19 -0
- package/dist/artifacts/ERC20Permit.d.ts +336 -0
- package/dist/artifacts/Permit2.d.ts +700 -0
- package/dist/artifacts/default/DZapCoreAbi.d.ts +2 -0
- package/dist/artifacts/default/DZapDcaAbi.d.ts +2 -0
- package/dist/artifacts/default/Permit2Abi.d.ts +70 -0
- package/dist/artifacts/default/erc20Abi.d.ts +165 -0
- package/dist/artifacts/default/index.d.ts +5 -0
- package/dist/artifacts/index.d.ts +2 -0
- package/dist/artifacts/staging/DZapCoreSwapAbi.d.ts +2 -0
- package/dist/artifacts/staging/index.d.ts +2 -0
- package/dist/axios/baseClient.d.ts +2 -0
- package/dist/axios/index.d.ts +8 -0
- package/dist/config.d.ts +16 -0
- package/dist/constants/address.d.ts +13 -0
- package/dist/constants/approval.d.ts +5 -0
- package/dist/constants/axios.d.ts +2 -0
- package/dist/constants/chains.d.ts +16 -0
- package/dist/constants/contract.d.ts +6 -0
- package/dist/constants/erc20.d.ts +22 -0
- package/dist/constants/httpMethods.d.ts +2 -0
- package/dist/constants/index.d.ts +43 -0
- package/dist/constants/permit.d.ts +5 -0
- package/dist/constants/permit2.d.ts +2 -0
- package/dist/constants/rpc.d.ts +2 -0
- package/dist/constants/urlConstants.d.ts +13 -0
- package/dist/dZapClient/index.d.ts +383 -0
- package/dist/enums/index.d.ts +36 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.m.js +2 -0
- package/dist/index.m.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/service/cache/cacheProvider.d.ts +10 -0
- package/dist/service/cache/constant.d.ts +2 -0
- package/dist/service/price/index.d.ts +16 -0
- package/dist/service/price/provider/coingecko/config.d.ts +6 -0
- package/dist/service/price/provider/coingecko/index.d.ts +9 -0
- package/dist/service/price/provider/defiLlama/config.d.ts +3 -0
- package/dist/service/price/provider/defiLlama/index.d.ts +9 -0
- package/dist/service/price/provider/defiLlama/types.d.ts +11 -0
- package/dist/service/price/provider/dzap/index.d.ts +6 -0
- package/dist/service/price/types/IPriceProvider.d.ts +14 -0
- package/dist/transactionHandlers/generic.d.ts +24 -0
- package/dist/transactionHandlers/permit.d.ts +58 -0
- package/dist/transactionHandlers/trade.d.ts +11 -0
- package/dist/transactionHandlers/zap.d.ts +37 -0
- package/dist/types/axiosClient.d.ts +6 -0
- package/dist/types/btc.d.ts +45 -0
- package/dist/types/chains.d.ts +2 -0
- package/dist/types/contract.d.ts +14 -0
- package/dist/types/eip-2612.d.ts +6 -0
- package/dist/types/index.d.ts +317 -0
- package/dist/types/zap/index.d.ts +65 -0
- package/dist/types/zap/path.d.ts +36 -0
- package/dist/types/zap/step.d.ts +15 -0
- package/dist/utils/amount.d.ts +82 -0
- package/dist/utils/axios.d.ts +13 -0
- package/dist/utils/chains.d.ts +2 -0
- package/dist/utils/date.d.ts +1 -0
- package/dist/utils/erc20.d.ts +61 -0
- package/dist/utils/errors.d.ts +16 -0
- package/dist/utils/index.d.ts +3940 -0
- package/dist/utils/multicall.d.ts +12 -0
- package/dist/utils/permit/permit2Methods.d.ts +32 -0
- package/dist/utils/permit/permitMethods.d.ts +29 -0
- package/dist/utils/signTypedData.d.ts +11 -0
- package/dist/utils/tokens.d.ts +7 -0
- package/dist/utils/updateQuotes.d.ts +3 -0
- package/dist/zap/constants/index.d.ts +2 -0
- package/dist/zap/constants/path.d.ts +8 -0
- package/dist/zap/constants/step.d.ts +3 -0
- package/dist/zap/constants/urls.d.ts +3 -0
- package/package.json +115 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const abi: ({
|
|
2
|
+
inputs: {
|
|
3
|
+
internalType: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
}[];
|
|
7
|
+
name: string;
|
|
8
|
+
type: string;
|
|
9
|
+
anonymous?: undefined;
|
|
10
|
+
outputs?: undefined;
|
|
11
|
+
stateMutability?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
anonymous: boolean;
|
|
14
|
+
inputs: {
|
|
15
|
+
indexed: boolean;
|
|
16
|
+
internalType: string;
|
|
17
|
+
name: string;
|
|
18
|
+
type: string;
|
|
19
|
+
}[];
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
outputs?: undefined;
|
|
23
|
+
stateMutability?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
inputs: {
|
|
26
|
+
internalType: string;
|
|
27
|
+
name: string;
|
|
28
|
+
type: string;
|
|
29
|
+
}[];
|
|
30
|
+
name: string;
|
|
31
|
+
outputs: {
|
|
32
|
+
internalType: string;
|
|
33
|
+
name: string;
|
|
34
|
+
type: string;
|
|
35
|
+
}[];
|
|
36
|
+
stateMutability: string;
|
|
37
|
+
type: string;
|
|
38
|
+
anonymous?: undefined;
|
|
39
|
+
} | {
|
|
40
|
+
inputs: ({
|
|
41
|
+
internalType: string;
|
|
42
|
+
name: string;
|
|
43
|
+
type: string;
|
|
44
|
+
components?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
components: ({
|
|
47
|
+
components: {
|
|
48
|
+
internalType: string;
|
|
49
|
+
name: string;
|
|
50
|
+
type: string;
|
|
51
|
+
}[];
|
|
52
|
+
internalType: string;
|
|
53
|
+
name: string;
|
|
54
|
+
type: string;
|
|
55
|
+
} | {
|
|
56
|
+
internalType: string;
|
|
57
|
+
name: string;
|
|
58
|
+
type: string;
|
|
59
|
+
components?: undefined;
|
|
60
|
+
})[];
|
|
61
|
+
internalType: string;
|
|
62
|
+
name: string;
|
|
63
|
+
type: string;
|
|
64
|
+
})[];
|
|
65
|
+
name: string;
|
|
66
|
+
outputs: never[];
|
|
67
|
+
stateMutability: string;
|
|
68
|
+
type: string;
|
|
69
|
+
anonymous?: undefined;
|
|
70
|
+
})[];
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export declare const abi: readonly [{
|
|
2
|
+
readonly constant: true;
|
|
3
|
+
readonly inputs: readonly [];
|
|
4
|
+
readonly name: "name";
|
|
5
|
+
readonly outputs: readonly [{
|
|
6
|
+
readonly name: "";
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
}];
|
|
9
|
+
readonly payable: false;
|
|
10
|
+
readonly stateMutability: "view";
|
|
11
|
+
readonly type: "function";
|
|
12
|
+
}, {
|
|
13
|
+
readonly constant: false;
|
|
14
|
+
readonly inputs: readonly [{
|
|
15
|
+
readonly name: "_spender";
|
|
16
|
+
readonly type: "address";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "_value";
|
|
19
|
+
readonly type: "uint256";
|
|
20
|
+
}];
|
|
21
|
+
readonly name: "approve";
|
|
22
|
+
readonly outputs: readonly [];
|
|
23
|
+
readonly payable: false;
|
|
24
|
+
readonly stateMutability: "nonpayable";
|
|
25
|
+
readonly type: "function";
|
|
26
|
+
}, {
|
|
27
|
+
readonly constant: true;
|
|
28
|
+
readonly inputs: readonly [];
|
|
29
|
+
readonly name: "totalSupply";
|
|
30
|
+
readonly outputs: readonly [{
|
|
31
|
+
readonly name: "";
|
|
32
|
+
readonly type: "uint256";
|
|
33
|
+
}];
|
|
34
|
+
readonly payable: false;
|
|
35
|
+
readonly stateMutability: "view";
|
|
36
|
+
readonly type: "function";
|
|
37
|
+
}, {
|
|
38
|
+
readonly constant: false;
|
|
39
|
+
readonly inputs: readonly [{
|
|
40
|
+
readonly name: "_from";
|
|
41
|
+
readonly type: "address";
|
|
42
|
+
}, {
|
|
43
|
+
readonly name: "_to";
|
|
44
|
+
readonly type: "address";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "_value";
|
|
47
|
+
readonly type: "uint256";
|
|
48
|
+
}];
|
|
49
|
+
readonly name: "transferFrom";
|
|
50
|
+
readonly outputs: readonly [{
|
|
51
|
+
readonly name: "";
|
|
52
|
+
readonly type: "bool";
|
|
53
|
+
}];
|
|
54
|
+
readonly payable: false;
|
|
55
|
+
readonly stateMutability: "nonpayable";
|
|
56
|
+
readonly type: "function";
|
|
57
|
+
}, {
|
|
58
|
+
readonly constant: true;
|
|
59
|
+
readonly inputs: readonly [];
|
|
60
|
+
readonly name: "decimals";
|
|
61
|
+
readonly outputs: readonly [{
|
|
62
|
+
readonly name: "";
|
|
63
|
+
readonly type: "uint8";
|
|
64
|
+
}];
|
|
65
|
+
readonly payable: false;
|
|
66
|
+
readonly stateMutability: "view";
|
|
67
|
+
readonly type: "function";
|
|
68
|
+
}, {
|
|
69
|
+
readonly constant: true;
|
|
70
|
+
readonly inputs: readonly [{
|
|
71
|
+
readonly name: "_owner";
|
|
72
|
+
readonly type: "address";
|
|
73
|
+
}];
|
|
74
|
+
readonly name: "balanceOf";
|
|
75
|
+
readonly outputs: readonly [{
|
|
76
|
+
readonly name: "balance";
|
|
77
|
+
readonly type: "uint256";
|
|
78
|
+
}];
|
|
79
|
+
readonly payable: false;
|
|
80
|
+
readonly stateMutability: "view";
|
|
81
|
+
readonly type: "function";
|
|
82
|
+
}, {
|
|
83
|
+
readonly constant: true;
|
|
84
|
+
readonly inputs: readonly [];
|
|
85
|
+
readonly name: "symbol";
|
|
86
|
+
readonly outputs: readonly [{
|
|
87
|
+
readonly name: "";
|
|
88
|
+
readonly type: "string";
|
|
89
|
+
}];
|
|
90
|
+
readonly payable: false;
|
|
91
|
+
readonly stateMutability: "view";
|
|
92
|
+
readonly type: "function";
|
|
93
|
+
}, {
|
|
94
|
+
readonly constant: false;
|
|
95
|
+
readonly inputs: readonly [{
|
|
96
|
+
readonly name: "_to";
|
|
97
|
+
readonly type: "address";
|
|
98
|
+
}, {
|
|
99
|
+
readonly name: "_value";
|
|
100
|
+
readonly type: "uint256";
|
|
101
|
+
}];
|
|
102
|
+
readonly name: "transfer";
|
|
103
|
+
readonly outputs: readonly [{
|
|
104
|
+
readonly name: "";
|
|
105
|
+
readonly type: "bool";
|
|
106
|
+
}];
|
|
107
|
+
readonly payable: false;
|
|
108
|
+
readonly stateMutability: "nonpayable";
|
|
109
|
+
readonly type: "function";
|
|
110
|
+
}, {
|
|
111
|
+
readonly constant: true;
|
|
112
|
+
readonly inputs: readonly [{
|
|
113
|
+
readonly name: "_owner";
|
|
114
|
+
readonly type: "address";
|
|
115
|
+
}, {
|
|
116
|
+
readonly name: "_spender";
|
|
117
|
+
readonly type: "address";
|
|
118
|
+
}];
|
|
119
|
+
readonly name: "allowance";
|
|
120
|
+
readonly outputs: readonly [{
|
|
121
|
+
readonly name: "";
|
|
122
|
+
readonly type: "uint256";
|
|
123
|
+
}];
|
|
124
|
+
readonly payable: false;
|
|
125
|
+
readonly stateMutability: "view";
|
|
126
|
+
readonly type: "function";
|
|
127
|
+
}, {
|
|
128
|
+
readonly payable: true;
|
|
129
|
+
readonly stateMutability: "payable";
|
|
130
|
+
readonly type: "fallback";
|
|
131
|
+
}, {
|
|
132
|
+
readonly anonymous: false;
|
|
133
|
+
readonly inputs: readonly [{
|
|
134
|
+
readonly indexed: true;
|
|
135
|
+
readonly name: "owner";
|
|
136
|
+
readonly type: "address";
|
|
137
|
+
}, {
|
|
138
|
+
readonly indexed: true;
|
|
139
|
+
readonly name: "spender";
|
|
140
|
+
readonly type: "address";
|
|
141
|
+
}, {
|
|
142
|
+
readonly indexed: false;
|
|
143
|
+
readonly name: "value";
|
|
144
|
+
readonly type: "uint256";
|
|
145
|
+
}];
|
|
146
|
+
readonly name: "Approval";
|
|
147
|
+
readonly type: "event";
|
|
148
|
+
}, {
|
|
149
|
+
readonly anonymous: false;
|
|
150
|
+
readonly inputs: readonly [{
|
|
151
|
+
readonly indexed: true;
|
|
152
|
+
readonly name: "from";
|
|
153
|
+
readonly type: "address";
|
|
154
|
+
}, {
|
|
155
|
+
readonly indexed: true;
|
|
156
|
+
readonly name: "to";
|
|
157
|
+
readonly type: "address";
|
|
158
|
+
}, {
|
|
159
|
+
readonly indexed: false;
|
|
160
|
+
readonly name: "value";
|
|
161
|
+
readonly type: "uint256";
|
|
162
|
+
}];
|
|
163
|
+
readonly name: "Transfer";
|
|
164
|
+
readonly type: "event";
|
|
165
|
+
}];
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Abi } from 'viem';
|
|
2
|
+
export declare const appEnv: string;
|
|
3
|
+
export declare const versionPostfix = "v1/";
|
|
4
|
+
export declare const getBaseUrl: () => string;
|
|
5
|
+
export declare const getBaseZapUrl: () => string;
|
|
6
|
+
export type DeFiContract = {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
abi: Abi;
|
|
9
|
+
[key: number]: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const batchSwapIntegrators: {
|
|
13
|
+
[key: string]: {
|
|
14
|
+
contract: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const zeroAddress = "0x0000000000000000000000000000000000000000";
|
|
2
|
+
export declare const eFormatNativeTokenLowerCase = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
3
|
+
export declare const eFormatNativeToken = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
4
|
+
export declare const zkNativeToken = "0x000000000000000000000000000000000000800A";
|
|
5
|
+
export declare const solanaNativeToken = "11111111111111111111111111111111";
|
|
6
|
+
export declare const solanaWNativeToken = "So11111111111111111111111111111111111111112";
|
|
7
|
+
export declare const unmarshalDeadAddress = "0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000";
|
|
8
|
+
export declare const tonNativeToken = "EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c";
|
|
9
|
+
export declare const artheraNativeToken = "0x000000000000000000000000000000000000aA09";
|
|
10
|
+
export declare const suiNativeToken = "0x2::sui::SUI";
|
|
11
|
+
export declare const aptosNativeToken = "0x1::aptos_coin::AptosCoin";
|
|
12
|
+
export declare const celoNativeToken = "0x471EcE3750Da237f93B8E339c536989b8978a438";
|
|
13
|
+
export declare const nativeTokens: string[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const exclusiveChainIds: {
|
|
2
|
+
zkSync: number;
|
|
3
|
+
arthera: number;
|
|
4
|
+
gnosis: number;
|
|
5
|
+
kaia: number;
|
|
6
|
+
bounceBit: number;
|
|
7
|
+
biFrost: number;
|
|
8
|
+
flare: number;
|
|
9
|
+
iotaEvm: number;
|
|
10
|
+
opbnb: number;
|
|
11
|
+
zkFair: number;
|
|
12
|
+
bahamut: number;
|
|
13
|
+
immutableZkevm: number;
|
|
14
|
+
abstract: number;
|
|
15
|
+
lens: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HexString } from 'src/types';
|
|
2
|
+
import { ExclusiveChainIds } from 'src/types/chains';
|
|
3
|
+
export declare const exclusivePermit2Addresses: {
|
|
4
|
+
[key: ExclusiveChainIds]: HexString;
|
|
5
|
+
};
|
|
6
|
+
export declare const DEFAULT_PERMIT2_ADDRESS = "0x000000000022D473030F116dDEE9F6B43aC78BA3";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const erc20PermitFunctions: {
|
|
2
|
+
readonly nonces: "nonces";
|
|
3
|
+
readonly version: "version";
|
|
4
|
+
readonly PERMIT_TYPEHASH: "PERMIT_TYPEHASH";
|
|
5
|
+
readonly allowance: "allowance";
|
|
6
|
+
};
|
|
7
|
+
export declare const erc20Functions: {
|
|
8
|
+
readonly name: "name";
|
|
9
|
+
readonly allowance: "allowance";
|
|
10
|
+
readonly approve: "approve";
|
|
11
|
+
readonly transfer: "transfer";
|
|
12
|
+
readonly transferFrom: "transferFrom";
|
|
13
|
+
readonly balanceOf: "balanceOf";
|
|
14
|
+
readonly decimals: "decimals";
|
|
15
|
+
readonly symbol: "symbol";
|
|
16
|
+
};
|
|
17
|
+
export declare const eip2612PermitFunctions: {
|
|
18
|
+
readonly permit: "permit";
|
|
19
|
+
readonly nonces: "nonces";
|
|
20
|
+
readonly DOMAIN_SEPARATOR: "DOMAIN_SEPARATOR";
|
|
21
|
+
readonly version: "version";
|
|
22
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const STATUS: {
|
|
2
|
+
pending: string;
|
|
3
|
+
inProgress: string;
|
|
4
|
+
success: string;
|
|
5
|
+
rejected: string;
|
|
6
|
+
error: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const ERRORS: {
|
|
9
|
+
NOT_FOUND: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const DZapAbis: {
|
|
12
|
+
readonly dZapCoreAbi: "dZapCoreAbi";
|
|
13
|
+
readonly dZapDcaAbi: "dZapDcaAbi";
|
|
14
|
+
};
|
|
15
|
+
export declare const OtherAbis: {
|
|
16
|
+
readonly permit2: "permit2";
|
|
17
|
+
readonly erc20: "erc20";
|
|
18
|
+
};
|
|
19
|
+
export declare const Services: {
|
|
20
|
+
readonly trade: "trade";
|
|
21
|
+
readonly dca: "dca";
|
|
22
|
+
readonly zap: "zap";
|
|
23
|
+
};
|
|
24
|
+
export declare const QuoteFilters: {
|
|
25
|
+
readonly fastest: "fastest";
|
|
26
|
+
readonly best: "best";
|
|
27
|
+
readonly all: "all";
|
|
28
|
+
};
|
|
29
|
+
export declare const HISTORICAL_BLOCK = 10;
|
|
30
|
+
export declare const NATIVE_TOKEN_DECIMAL = 18;
|
|
31
|
+
export declare const NATIVE_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
32
|
+
export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
33
|
+
export declare const dZapNativeTokenFormat = "0x0000000000000000000000000000000000000000";
|
|
34
|
+
export declare const PERMIT_TYPEHASH_CONST = "0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9";
|
|
35
|
+
export declare const DEFAULT_PERMIT_DATA: `0x${string}`;
|
|
36
|
+
export declare const DEFAULT_PERMIT2_DATA: `0x${string}`;
|
|
37
|
+
export declare const STATUS_RESPONSE: {
|
|
38
|
+
readonly COMPLETED: "COMPLETED";
|
|
39
|
+
readonly FAILED: "FAILED";
|
|
40
|
+
readonly PENDING: "PENDING";
|
|
41
|
+
readonly PARTIAL_SUCCESS: "PARTIAL_SUCCESS";
|
|
42
|
+
readonly REFUNDED: "REFUNDED";
|
|
43
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const BATCH_SWAP_QUOTE_URL = "swap/quote";
|
|
2
|
+
export declare const BATCH_SWAP_BUILD_TX_URL = "swap/buildTx";
|
|
3
|
+
export declare const BRIDGE_QUOTE_URL = "bridge/quote";
|
|
4
|
+
export declare const BRIDGE_BUILD_TX_URL = "bridge/buildTx";
|
|
5
|
+
export declare const QUOTES_URL = "/quotes";
|
|
6
|
+
export declare const BUILD_TX_URL = "/buildTx";
|
|
7
|
+
export declare const GET_ALL_CHAINS_URL = "chains";
|
|
8
|
+
export declare const GET_ALL_TOKENS_URL = "token/tokens";
|
|
9
|
+
export declare const GET_TOKEN_DETAILS_URL = "token/details";
|
|
10
|
+
export declare const GET_TOKEN_PRICE = "token/price";
|
|
11
|
+
export declare const GET_STATUS = "/status";
|
|
12
|
+
export declare const GET_BALANCES = "token/balance-of";
|
|
13
|
+
export declare const CALCULATE_POINTS_URL = "user/calculatePoints";
|