@1stdex/first-sdk 1.0.99 → 1.0.101
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 +2 -1
- package/dist/cjs/calls/batch/index.js.map +1 -1
- package/dist/cjs/calls/batch/prepare-claim-real-tokens.js +95 -1
- package/dist/cjs/calls/batch/prepare-claim-real-tokens.js.map +1 -1
- package/dist/cjs/calls/index.js +2 -1
- package/dist/cjs/calls/index.js.map +1 -1
- package/dist/cjs/constants/chain-configs/chain.js +1 -0
- package/dist/cjs/constants/chain-configs/chain.js.map +1 -1
- package/dist/cjs/constants/chain-configs/eids.js +1 -0
- package/dist/cjs/constants/chain-configs/eids.js.map +1 -1
- package/dist/esm/calls/batch/index.js +1 -1
- package/dist/esm/calls/batch/index.js.map +1 -1
- package/dist/esm/calls/batch/prepare-claim-real-tokens.js +134 -1
- package/dist/esm/calls/batch/prepare-claim-real-tokens.js.map +1 -1
- package/dist/esm/calls/index.js +1 -1
- package/dist/esm/calls/index.js.map +1 -1
- package/dist/esm/constants/chain-configs/chain.js +2 -1
- package/dist/esm/constants/chain-configs/chain.js.map +1 -1
- package/dist/esm/constants/chain-configs/eids.js +1 -0
- package/dist/esm/constants/chain-configs/eids.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/calls/batch/index.d.ts +1 -1
- package/dist/types/calls/batch/index.d.ts.map +1 -1
- package/dist/types/calls/batch/prepare-claim-real-tokens.d.ts +37 -0
- package/dist/types/calls/batch/prepare-claim-real-tokens.d.ts.map +1 -1
- package/dist/types/calls/index.d.ts +1 -1
- package/dist/types/calls/index.d.ts.map +1 -1
- package/dist/types/constants/chain-configs/chain.d.ts +1 -0
- package/dist/types/constants/chain-configs/chain.d.ts.map +1 -1
- package/dist/types/constants/chain-configs/eids.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +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 { prepareClaimRealTokensCrossChainBridgeLZ, NotEnoughClaimableError, } from './prepare-claim-real-tokens';
|
|
4
|
+
export { prepareClaimRealTokens, prepareClaimRealTokensCrossChainBridgeLZ, NotEnoughClaimableError, } from './prepare-claim-real-tokens';
|
|
5
5
|
export type { BatchCall } from './prepare-limit-order-with-setup';
|
|
6
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,OAAO,EACL,wCAAwC,EACxC,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AACrC,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,sBAAsB,EACtB,wCAAwC,EACxC,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -50,4 +50,41 @@ export declare const prepareClaimRealTokensCrossChainBridgeLZ: ({ chainId, desti
|
|
|
50
50
|
amount: bigint;
|
|
51
51
|
options?: DefaultWriteContractOptions;
|
|
52
52
|
}) => Promise<BatchCall[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Prepares transactions to claim real tokens and transfer them to a receiving address on the same chain.
|
|
55
|
+
* Claims the specified amount optimally (from mirror token and/or vault) to the user address,
|
|
56
|
+
* then transfers them to the receiving address via a standard ERC20 transfer.
|
|
57
|
+
* Throws NotEnoughClaimableError if combined claimable amount is insufficient.
|
|
58
|
+
*
|
|
59
|
+
* @param chainId The chain ID.
|
|
60
|
+
* @param userAddress The user address.
|
|
61
|
+
* @param mirrorTokenAddress The mirror token address.
|
|
62
|
+
* @param receivingAddress The address to receive the tokens.
|
|
63
|
+
* @param amount The amount to claim and send (in token base units, e.g., wei).
|
|
64
|
+
* @param options Optional parameters.
|
|
65
|
+
* @returns Promise resolving to array of batch calls.
|
|
66
|
+
* @example
|
|
67
|
+
* import { prepareClaimRealTokens } from '@1stdex/first-sdk'
|
|
68
|
+
* import { useSmartWallets } from '@privy-io/react-auth/smart-wallets'
|
|
69
|
+
*
|
|
70
|
+
* const calls = await prepareClaimRealTokens({
|
|
71
|
+
* chainId: 84532,
|
|
72
|
+
* userAddress: '0xF8c1869Ecd4df136693C45EcE1b67f85B6bDaE69',
|
|
73
|
+
* mirrorTokenAddress: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
|
|
74
|
+
* receivingAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
|
|
75
|
+
* amount: 1000000000000000000n // 1 token (18 decimals)
|
|
76
|
+
* })
|
|
77
|
+
*
|
|
78
|
+
* // Send all calls in one batched transaction
|
|
79
|
+
* const { client } = useSmartWallets()
|
|
80
|
+
* const txHash = await client.sendUserOperation({ calls })
|
|
81
|
+
*/
|
|
82
|
+
export declare const prepareClaimRealTokens: ({ chainId, userAddress, mirrorTokenAddress, receivingAddress, amount, options, }: {
|
|
83
|
+
chainId: CHAIN_IDS;
|
|
84
|
+
userAddress: `0x${string}`;
|
|
85
|
+
mirrorTokenAddress: `0x${string}`;
|
|
86
|
+
receivingAddress: `0x${string}`;
|
|
87
|
+
amount: bigint;
|
|
88
|
+
options?: DefaultWriteContractOptions;
|
|
89
|
+
}) => Promise<BatchCall[]>;
|
|
53
90
|
//# sourceMappingURL=prepare-claim-real-tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare-claim-real-tokens.d.ts","sourceRoot":"","sources":["../../../../src/calls/batch/prepare-claim-real-tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepare-claim-real-tokens.d.ts","sourceRoot":"","sources":["../../../../src/calls/batch/prepare-claim-real-tokens.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAa,MAAM,qCAAqC,CAAC;AAQ3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;aAG9B,QAAQ,EAAE,MAAM;aAChB,SAAS,EAAE,MAAM;gBAFjC,OAAO,EAAE,MAAM,EACC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM;CAMpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,wCAAwC,yGAQlD;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,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,2BAA2B,CAAC;CACvC,KAAG,QAAQ,SAAS,EAAE,CAsKtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,sBAAsB,qFAOhC;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,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,2BAA2B,CAAC;CACvC,KAAG,QAAQ,SAAS,EAAE,CAwHtB,CAAC"}
|
|
@@ -8,6 +8,6 @@ export { setApprovalOfOpenOrdersForAll } from './approval/open-order';
|
|
|
8
8
|
export { setTokenAllowances } from './approval/token';
|
|
9
9
|
export { approveAllForMarket } from './approval/market';
|
|
10
10
|
export { setVault, removeVault, depositToVault, withdrawFromVault, } from './vault';
|
|
11
|
-
export { prepareLimitOrderWithSetup, prepareMarketOrderWithSetup, prepareWithdraw, NotEnoughFundsError, prepareClaimRealTokensCrossChainBridgeLZ, NotEnoughClaimableError, } from './batch';
|
|
11
|
+
export { prepareLimitOrderWithSetup, prepareMarketOrderWithSetup, prepareWithdraw, NotEnoughFundsError, prepareClaimRealTokens, prepareClaimRealTokensCrossChainBridgeLZ, NotEnoughClaimableError, } from './batch';
|
|
12
12
|
export type { BatchCall } from './batch';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/calls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACzD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EACtB,wCAAwC,EACxC,uBAAuB,GACxB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../../src/constants/chain-configs/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../../src/constants/chain-configs/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,KAAK,EAIX,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAGF,oBAAY,SAAS;IACnB,QAAqB;IACrB,YAA6B;IAC7B,IAAc;IACd,gBAAqC;IACrC,IAAc;IACd,KAAgB;CACjB;AAED,eAAO,MAAM,SAAS,EAAE;KACrB,KAAK,IAAI,SAAS,GAAG,KAAK;CAO5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eids.d.ts","sourceRoot":"","sources":["../../../../src/constants/chain-configs/eids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE;KACtB,KAAK,IAAI,SAAS,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"eids.d.ts","sourceRoot":"","sources":["../../../../src/constants/chain-configs/eids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE;KACtB,KAAK,IAAI,SAAS,GAAG,MAAM;CAQ7B,CAAC"}
|