@heyanon/sdk 1.0.2 → 1.0.3
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.
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { TransactionParams
|
|
3
|
-
import { FunctionOptions } from '../../adapter';
|
|
1
|
+
import { Address, PublicClient } from 'viem';
|
|
2
|
+
import { TransactionParams } from '../../blockchain';
|
|
4
3
|
interface Props {
|
|
5
4
|
readonly args: {
|
|
6
|
-
readonly chainId: ChainId;
|
|
7
5
|
readonly account: Address;
|
|
8
6
|
readonly target: Address;
|
|
9
7
|
readonly spender: Address;
|
|
10
8
|
readonly amount: bigint;
|
|
11
9
|
};
|
|
12
|
-
readonly
|
|
10
|
+
readonly provider: PublicClient;
|
|
13
11
|
readonly transactions: TransactionParams[];
|
|
14
12
|
}
|
|
15
|
-
export declare function checkToApprove({ args,
|
|
13
|
+
export declare function checkToApprove({ args, transactions, provider }: Props): Promise<void>;
|
|
16
14
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -105,10 +105,9 @@ function getWrappedNative(chainId) {
|
|
|
105
105
|
}
|
|
106
106
|
return token;
|
|
107
107
|
}
|
|
108
|
-
async function checkToApprove({ args,
|
|
109
|
-
const {
|
|
110
|
-
const
|
|
111
|
-
const allowance = await publicClient.readContract({
|
|
108
|
+
async function checkToApprove({ args, transactions, provider }) {
|
|
109
|
+
const { account, target, spender, amount } = args;
|
|
110
|
+
const allowance = await provider.readContract({
|
|
112
111
|
address: target,
|
|
113
112
|
abi: viem.erc20Abi,
|
|
114
113
|
functionName: "allowance",
|
package/dist/index.mjs
CHANGED
|
@@ -103,10 +103,9 @@ function getWrappedNative(chainId) {
|
|
|
103
103
|
}
|
|
104
104
|
return token;
|
|
105
105
|
}
|
|
106
|
-
async function checkToApprove({ args,
|
|
107
|
-
const {
|
|
108
|
-
const
|
|
109
|
-
const allowance = await publicClient.readContract({
|
|
106
|
+
async function checkToApprove({ args, transactions, provider }) {
|
|
107
|
+
const { account, target, spender, amount } = args;
|
|
108
|
+
const allowance = await provider.readContract({
|
|
110
109
|
address: target,
|
|
111
110
|
abi: erc20Abi,
|
|
112
111
|
functionName: "allowance",
|