@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.
Files changed (31) hide show
  1. package/dist/cjs/calls/batch/index.js +2 -1
  2. package/dist/cjs/calls/batch/index.js.map +1 -1
  3. package/dist/cjs/calls/batch/prepare-claim-real-tokens.js +95 -1
  4. package/dist/cjs/calls/batch/prepare-claim-real-tokens.js.map +1 -1
  5. package/dist/cjs/calls/index.js +2 -1
  6. package/dist/cjs/calls/index.js.map +1 -1
  7. package/dist/cjs/constants/chain-configs/chain.js +1 -0
  8. package/dist/cjs/constants/chain-configs/chain.js.map +1 -1
  9. package/dist/cjs/constants/chain-configs/eids.js +1 -0
  10. package/dist/cjs/constants/chain-configs/eids.js.map +1 -1
  11. package/dist/esm/calls/batch/index.js +1 -1
  12. package/dist/esm/calls/batch/index.js.map +1 -1
  13. package/dist/esm/calls/batch/prepare-claim-real-tokens.js +134 -1
  14. package/dist/esm/calls/batch/prepare-claim-real-tokens.js.map +1 -1
  15. package/dist/esm/calls/index.js +1 -1
  16. package/dist/esm/calls/index.js.map +1 -1
  17. package/dist/esm/constants/chain-configs/chain.js +2 -1
  18. package/dist/esm/constants/chain-configs/chain.js.map +1 -1
  19. package/dist/esm/constants/chain-configs/eids.js +1 -0
  20. package/dist/esm/constants/chain-configs/eids.js.map +1 -1
  21. package/dist/tsconfig.build.tsbuildinfo +1 -1
  22. package/dist/types/calls/batch/index.d.ts +1 -1
  23. package/dist/types/calls/batch/index.d.ts.map +1 -1
  24. package/dist/types/calls/batch/prepare-claim-real-tokens.d.ts +37 -0
  25. package/dist/types/calls/batch/prepare-claim-real-tokens.d.ts.map +1 -1
  26. package/dist/types/calls/index.d.ts +1 -1
  27. package/dist/types/calls/index.d.ts.map +1 -1
  28. package/dist/types/constants/chain-configs/chain.d.ts +1 -0
  29. package/dist/types/constants/chain-configs/chain.d.ts.map +1 -1
  30. package/dist/types/constants/chain-configs/eids.d.ts.map +1 -1
  31. 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":"AAEA,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"}
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,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,cAAc,EACd,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,eAAe,EACf,mBAAmB,EACnB,wCAAwC,EACxC,uBAAuB,GACxB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
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,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,cAAc,EACd,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,wCAAwC,EACxC,uBAAuB,GACxB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
@@ -5,6 +5,7 @@ export declare enum CHAIN_IDS {
5
5
  BASE_SEPOLIA,
6
6
  BASE,
7
7
  ARBITRUM_SEPOLIA,
8
+ PEAQ,
8
9
  ANVIL
9
10
  }
10
11
  export declare const CHAIN_MAP: {
@@ -1 +1 @@
1
- {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../../src/constants/chain-configs/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,KAAK,EAGX,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAGF,oBAAY,SAAS;IACnB,QAAqB;IACrB,YAA6B;IAC7B,IAAc;IACd,gBAAqC;IACrC,KAAgB;CACjB;AAED,eAAO,MAAM,SAAS,EAAE;KACrB,KAAK,IAAI,SAAS,GAAG,KAAK;CAO5B,CAAC"}
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;CAO7B,CAAC"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1stdex/first-sdk",
3
- "version": "1.0.99",
3
+ "version": "1.0.101",
4
4
  "description": "🛠 An SDK for building applications on top of 1st V2",
5
5
  "files": [
6
6
  "dist"