@1money/protocol-ts-sdk 1.0.14
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/.claude/settings.local.json +14 -0
- package/CLAUDE.md +77 -0
- package/README.md +600 -0
- package/es/api/accounts/index.d.ts +20 -0
- package/es/api/accounts/types.d.ts +9 -0
- package/es/api/chain/index.d.ts +12 -0
- package/es/api/chain/types.d.ts +3 -0
- package/es/api/checkpoints/index.d.ts +26 -0
- package/es/api/checkpoints/types.d.ts +33 -0
- package/es/api/constants.d.ts +9 -0
- package/es/api/index.d.ts +31 -0
- package/es/api/index.js +593 -0
- package/es/api/state/index.d.ts +12 -0
- package/es/api/state/types.d.ts +7 -0
- package/es/api/tokens/index.d.ts +62 -0
- package/es/api/tokens/types.d.ts +130 -0
- package/es/api/transactions/index.d.ts +35 -0
- package/es/api/transactions/types.d.ts +25 -0
- package/es/api/types.d.ts +18 -0
- package/es/client/core.d.ts +109 -0
- package/es/client/index.d.ts +21 -0
- package/es/client/index.js +373 -0
- package/es/index.d.ts +20 -0
- package/es/index.js +1490 -0
- package/es/utils/address.d.ts +15 -0
- package/es/utils/index.d.ts +6 -0
- package/es/utils/index.js +841 -0
- package/es/utils/interface.d.ts +7 -0
- package/es/utils/safePromise.d.ts +4 -0
- package/es/utils/sign.d.ts +15 -0
- package/es/utils/txHash.d.ts +2 -0
- package/es/utils/typeof.d.ts +2 -0
- package/lib/api/accounts/index.d.ts +20 -0
- package/lib/api/accounts/types.d.ts +9 -0
- package/lib/api/chain/index.d.ts +12 -0
- package/lib/api/chain/types.d.ts +3 -0
- package/lib/api/checkpoints/index.d.ts +26 -0
- package/lib/api/checkpoints/types.d.ts +33 -0
- package/lib/api/constants.d.ts +9 -0
- package/lib/api/index.d.ts +31 -0
- package/lib/api/index.js +692 -0
- package/lib/api/state/index.d.ts +12 -0
- package/lib/api/state/types.d.ts +7 -0
- package/lib/api/tokens/index.d.ts +62 -0
- package/lib/api/tokens/types.d.ts +130 -0
- package/lib/api/transactions/index.d.ts +35 -0
- package/lib/api/transactions/types.d.ts +25 -0
- package/lib/api/types.d.ts +18 -0
- package/lib/client/core.d.ts +109 -0
- package/lib/client/index.d.ts +21 -0
- package/lib/client/index.js +434 -0
- package/lib/index.d.ts +20 -0
- package/lib/index.js +1591 -0
- package/lib/utils/address.d.ts +15 -0
- package/lib/utils/index.d.ts +6 -0
- package/lib/utils/index.js +937 -0
- package/lib/utils/interface.d.ts +7 -0
- package/lib/utils/safePromise.d.ts +4 -0
- package/lib/utils/sign.d.ts +15 -0
- package/lib/utils/txHash.d.ts +2 -0
- package/lib/utils/typeof.d.ts +2 -0
- package/package.json +111 -0
- package/public/favicon.ico +0 -0
- package/public/logo.png +0 -0
- package/umd/1money-protocol-ts-sdk.min.js +2 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ZeroXString } from './interface';
|
|
2
|
+
/**
|
|
3
|
+
* Derives the token account address given the wallet address and mint address.
|
|
4
|
+
*
|
|
5
|
+
* Address is 20 byte, 160 bits. Let's say if we want to support 50 billion
|
|
6
|
+
* accounts on 1money. That's about 36 bits. There are 124 bits remaining. In
|
|
7
|
+
* other words, the collision probability is 1/2^124, which is very very low.
|
|
8
|
+
* So, we will be fine to just use the hash of the wallet address and mint
|
|
9
|
+
* address to derive the token account address.
|
|
10
|
+
*
|
|
11
|
+
* @param walletAddress - The wallet address (20 bytes)
|
|
12
|
+
* @param mintAddress - The mint address (20 bytes)
|
|
13
|
+
* @returns The derived token account address
|
|
14
|
+
*/
|
|
15
|
+
export declare function deriveTokenAddress(walletAddress: string, mintAddress: string): ZeroXString;
|