@1stdex/first-sdk 1.0.81 → 1.0.83
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/cjs/calls/batch/index.js +4 -1
- package/dist/cjs/calls/batch/index.js.map +1 -1
- package/dist/cjs/calls/batch/prepare-claim-real-tokens.js +153 -0
- package/dist/cjs/calls/batch/prepare-claim-real-tokens.js.map +1 -0
- package/dist/cjs/constants/abis/core/first_oft.js +1680 -0
- package/dist/cjs/constants/abis/core/first_oft.js.map +1 -0
- package/dist/cjs/constants/chain-configs/eids.js +11 -0
- package/dist/cjs/constants/chain-configs/eids.js.map +1 -0
- package/dist/cjs/constants/chain-configs/subgraph.js +1 -1
- package/dist/cjs/constants/chain-configs/subgraph.js.map +1 -1
- package/dist/cjs/views/balance.js +2 -2
- package/dist/esm/calls/batch/index.js +1 -0
- package/dist/esm/calls/batch/index.js.map +1 -1
- package/dist/esm/calls/batch/prepare-claim-real-tokens.js +211 -0
- package/dist/esm/calls/batch/prepare-claim-real-tokens.js.map +1 -0
- package/dist/esm/constants/abis/core/first_oft.js +1677 -0
- package/dist/esm/constants/abis/core/first_oft.js.map +1 -0
- package/dist/esm/constants/chain-configs/eids.js +11 -0
- package/dist/esm/constants/chain-configs/eids.js.map +1 -0
- package/dist/esm/constants/chain-configs/subgraph.js +1 -1
- package/dist/esm/constants/chain-configs/subgraph.js.map +1 -1
- package/dist/esm/views/balance.js +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/calls/batch/index.d.ts +1 -0
- package/dist/types/calls/batch/index.d.ts.map +1 -1
- package/dist/types/calls/batch/prepare-claim-real-tokens.d.ts +73 -0
- package/dist/types/calls/batch/prepare-claim-real-tokens.d.ts.map +1 -0
- package/dist/types/constants/abis/core/first_oft.d.ts +1286 -0
- package/dist/types/constants/abis/core/first_oft.d.ts.map +1 -0
- package/dist/types/constants/chain-configs/eids.d.ts +8 -0
- package/dist/types/constants/chain-configs/eids.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { prepareLimitOrderWithSetup } from './prepare-limit-order-with-setup';
|
|
2
2
|
export { prepareMarketOrderWithSetup } from './prepare-market-order-with-setup';
|
|
3
3
|
export { prepareWithdraw, NotEnoughFundsError } from './prepare-withdraw';
|
|
4
|
+
export { prepareClaimRealTokensSameChain, prepareClaimRealTokensCrossChainLZ, } from './prepare-claim-real-tokens';
|
|
4
5
|
export type { BatchCall } from './prepare-limit-order-with-setup';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/calls/batch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,YAAY,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/calls/batch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,GACnC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CHAIN_IDS } from '../../constants/chain-configs/chain';
|
|
2
|
+
import { DefaultWriteContractOptions } from '../../types';
|
|
3
|
+
import { BatchCall } from './prepare-limit-order-with-setup';
|
|
4
|
+
/**
|
|
5
|
+
* Prepares transactions to claim real tokens from a mirror token system.
|
|
6
|
+
* Checks vault claimable assets and mirror token claimable assets, then creates
|
|
7
|
+
* claim calls to transfer all available real tokens to the receiving address.
|
|
8
|
+
*
|
|
9
|
+
* @param chainId The chain ID.
|
|
10
|
+
* @param userAddress The user address.
|
|
11
|
+
* @param mirrorTokenAddress The mirror token address.
|
|
12
|
+
* @param receivingAddress The address to receive the claimed real tokens.
|
|
13
|
+
* @param options Optional parameters.
|
|
14
|
+
* @returns Promise resolving to array of batch calls.
|
|
15
|
+
* @example
|
|
16
|
+
* import { prepareClaimRealTokensSameChain } from '@1stdex/first-sdk'
|
|
17
|
+
* import { useSmartWallets } from '@privy-io/react-auth/smart-wallets'
|
|
18
|
+
*
|
|
19
|
+
* const calls = await prepareClaimRealTokensSameChain({
|
|
20
|
+
* chainId: 421614,
|
|
21
|
+
* userAddress: '0xF8c1869Ecd4df136693C45EcE1b67f85B6bDaE69',
|
|
22
|
+
* mirrorTokenAddress: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
|
|
23
|
+
* receivingAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* // Send all calls in one batched transaction
|
|
27
|
+
* const { client } = useSmartWallets()
|
|
28
|
+
* const txHash = await client.sendUserOperation({ calls })
|
|
29
|
+
*/
|
|
30
|
+
export declare const prepareClaimRealTokensSameChain: ({ chainId, userAddress, mirrorTokenAddress, receivingAddress, options, }: {
|
|
31
|
+
chainId: CHAIN_IDS;
|
|
32
|
+
userAddress: `0x${string}`;
|
|
33
|
+
mirrorTokenAddress: `0x${string}`;
|
|
34
|
+
receivingAddress: `0x${string}`;
|
|
35
|
+
options?: DefaultWriteContractOptions;
|
|
36
|
+
}) => Promise<BatchCall[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Prepares transactions to claim real tokens and bridge them cross-chain via LayerZero.
|
|
39
|
+
* Claims all available assets to the user address, then bridges them to a receiving
|
|
40
|
+
* address on the destination chain using LayerZero's OFT protocol.
|
|
41
|
+
*
|
|
42
|
+
* @param chainId The source chain ID.
|
|
43
|
+
* @param destinationChainId The destination chain ID.
|
|
44
|
+
* @param userAddress The user address.
|
|
45
|
+
* @param mirrorTokenAddress The mirror token address (OFT contract).
|
|
46
|
+
* @param receivingAddress The address to receive the tokens on destination chain.
|
|
47
|
+
* @param options Optional parameters.
|
|
48
|
+
* @returns Promise resolving to array of batch calls.
|
|
49
|
+
* @example
|
|
50
|
+
* import { prepareClaimRealTokensCrossChainLZ } from '@1stdex/first-sdk'
|
|
51
|
+
* import { useSmartWallets } from '@privy-io/react-auth/smart-wallets'
|
|
52
|
+
*
|
|
53
|
+
* const calls = await prepareClaimRealTokensCrossChainLZ({
|
|
54
|
+
* chainId: 84532,
|
|
55
|
+
* destinationChainId: 8453,
|
|
56
|
+
* userAddress: '0xF8c1869Ecd4df136693C45EcE1b67f85B6bDaE69',
|
|
57
|
+
* mirrorTokenAddress: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
|
|
58
|
+
* receivingAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
|
|
59
|
+
* })
|
|
60
|
+
*
|
|
61
|
+
* // Send all calls in one batched transaction
|
|
62
|
+
* const { client } = useSmartWallets()
|
|
63
|
+
* const txHash = await client.sendUserOperation({ calls })
|
|
64
|
+
*/
|
|
65
|
+
export declare const prepareClaimRealTokensCrossChainLZ: ({ chainId, destinationChainId, userAddress, mirrorTokenAddress, receivingAddress, options, }: {
|
|
66
|
+
chainId: CHAIN_IDS;
|
|
67
|
+
destinationChainId: CHAIN_IDS;
|
|
68
|
+
userAddress: `0x${string}`;
|
|
69
|
+
mirrorTokenAddress: `0x${string}`;
|
|
70
|
+
receivingAddress: `0x${string}`;
|
|
71
|
+
options?: DefaultWriteContractOptions;
|
|
72
|
+
}) => Promise<BatchCall[]>;
|
|
73
|
+
//# sourceMappingURL=prepare-claim-real-tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-claim-real-tokens.d.ts","sourceRoot":"","sources":["../../../../src/calls/batch/prepare-claim-real-tokens.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAa,MAAM,qCAAqC,CAAC;AAM3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,+BAA+B,6EAMzC;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;IAC3B,kBAAkB,EAAE,KAAK,MAAM,EAAE,CAAC;IAClC,gBAAgB,EAAE,KAAK,MAAM,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,2BAA2B,CAAC;CACvC,KAAG,QAAQ,SAAS,EAAE,CAkEtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,kCAAkC,iGAO5C;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,kBAAkB,EAAE,SAAS,CAAC;IAC9B,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;IAC3B,kBAAkB,EAAE,KAAK,MAAM,EAAE,CAAC;IAClC,gBAAgB,EAAE,KAAK,MAAM,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,2BAA2B,CAAC;CACvC,KAAG,QAAQ,SAAS,EAAE,CA2GtB,CAAC"}
|