@amadeus-protocol/sdk 1.0.7 → 1.1.0

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 (199) hide show
  1. package/dist/api/chain.d.ts +144 -117
  2. package/dist/api/chain.d.ts.map +1 -1
  3. package/dist/api/chain.js +175 -146
  4. package/dist/api/chain.js.map +1 -1
  5. package/dist/api/contract.d.ts +78 -60
  6. package/dist/api/contract.d.ts.map +1 -1
  7. package/dist/api/contract.js +102 -75
  8. package/dist/api/contract.js.map +1 -1
  9. package/dist/api/epoch.d.ts +65 -66
  10. package/dist/api/epoch.d.ts.map +1 -1
  11. package/dist/api/epoch.js +90 -98
  12. package/dist/api/epoch.js.map +1 -1
  13. package/dist/api/peer.d.ts +77 -78
  14. package/dist/api/peer.d.ts.map +1 -1
  15. package/dist/api/peer.js +93 -94
  16. package/dist/api/peer.js.map +1 -1
  17. package/dist/api/proof.d.ts +44 -23
  18. package/dist/api/proof.d.ts.map +1 -1
  19. package/dist/api/proof.js +56 -29
  20. package/dist/api/proof.js.map +1 -1
  21. package/dist/api/transaction.d.ts +68 -69
  22. package/dist/api/transaction.d.ts.map +1 -1
  23. package/dist/api/transaction.js +84 -84
  24. package/dist/api/transaction.js.map +1 -1
  25. package/dist/api/wallet.d.ts +36 -37
  26. package/dist/api/wallet.d.ts.map +1 -1
  27. package/dist/api/wallet.js +47 -50
  28. package/dist/api/wallet.js.map +1 -1
  29. package/dist/client.d.ts +66 -68
  30. package/dist/client.d.ts.map +1 -1
  31. package/dist/client.js +231 -276
  32. package/dist/client.js.map +1 -1
  33. package/dist/constants.d.ts +13 -10
  34. package/dist/constants.d.ts.map +1 -1
  35. package/dist/constants.js +49 -45
  36. package/dist/constants.js.map +1 -1
  37. package/dist/contract-state.d.ts +6 -3
  38. package/dist/contract-state.d.ts.map +1 -1
  39. package/dist/contract-state.js +88 -106
  40. package/dist/contract-state.js.map +1 -1
  41. package/dist/contracts/abi-types.d.ts +32 -32
  42. package/dist/contracts/abi-types.d.ts.map +1 -1
  43. package/dist/contracts/coin.d.ts +13 -20
  44. package/dist/contracts/coin.d.ts.map +1 -1
  45. package/dist/contracts/coin.js +42 -38
  46. package/dist/contracts/coin.js.map +1 -1
  47. package/dist/contracts/contract-call.d.ts +14 -16
  48. package/dist/contracts/contract-call.d.ts.map +1 -1
  49. package/dist/contracts/contract-call.js +45 -54
  50. package/dist/contracts/contract-call.js.map +1 -1
  51. package/dist/contracts/contract.d.ts +24 -55
  52. package/dist/contracts/contract.d.ts.map +1 -1
  53. package/dist/contracts/contract.js +63 -101
  54. package/dist/contracts/contract.js.map +1 -1
  55. package/dist/contracts/lockup/abi.d.ts +54 -51
  56. package/dist/contracts/lockup/abi.d.ts.map +1 -1
  57. package/dist/contracts/lockup/abi.js +65 -74
  58. package/dist/contracts/lockup/abi.js.map +1 -1
  59. package/dist/contracts/lockup/helpers.d.ts +22 -18
  60. package/dist/contracts/lockup/helpers.d.ts.map +1 -1
  61. package/dist/contracts/lockup/helpers.js +44 -47
  62. package/dist/contracts/lockup/helpers.js.map +1 -1
  63. package/dist/contracts/lockup/parsers.d.ts +7 -3
  64. package/dist/contracts/lockup/parsers.d.ts.map +1 -1
  65. package/dist/contracts/lockup/parsers.js +51 -55
  66. package/dist/contracts/lockup/parsers.js.map +1 -1
  67. package/dist/contracts/lockup/storage-keys.d.ts +5 -2
  68. package/dist/contracts/lockup/storage-keys.d.ts.map +1 -1
  69. package/dist/contracts/lockup/storage-keys.js +54 -70
  70. package/dist/contracts/lockup/storage-keys.js.map +1 -1
  71. package/dist/contracts/lockup/types.d.ts +73 -70
  72. package/dist/contracts/lockup/types.d.ts.map +1 -1
  73. package/dist/contracts/lockup-prime/abi.d.ts +328 -325
  74. package/dist/contracts/lockup-prime/abi.d.ts.map +1 -1
  75. package/dist/contracts/lockup-prime/abi.js +397 -417
  76. package/dist/contracts/lockup-prime/abi.js.map +1 -1
  77. package/dist/contracts/lockup-prime/helpers.d.ts +35 -31
  78. package/dist/contracts/lockup-prime/helpers.d.ts.map +1 -1
  79. package/dist/contracts/lockup-prime/helpers.js +131 -137
  80. package/dist/contracts/lockup-prime/helpers.js.map +1 -1
  81. package/dist/contracts/lockup-prime/parsers.d.ts +9 -5
  82. package/dist/contracts/lockup-prime/parsers.d.ts.map +1 -1
  83. package/dist/contracts/lockup-prime/parsers.js +61 -61
  84. package/dist/contracts/lockup-prime/parsers.js.map +1 -1
  85. package/dist/contracts/lockup-prime/storage-keys.d.ts +7 -4
  86. package/dist/contracts/lockup-prime/storage-keys.d.ts.map +1 -1
  87. package/dist/contracts/lockup-prime/storage-keys.js +64 -80
  88. package/dist/contracts/lockup-prime/storage-keys.js.map +1 -1
  89. package/dist/contracts/lockup-prime/types.d.ts +92 -89
  90. package/dist/contracts/lockup-prime/types.d.ts.map +1 -1
  91. package/dist/contracts/lockup-prime/types.js +12 -13
  92. package/dist/contracts/lockup-prime/types.js.map +1 -1
  93. package/dist/contracts/nft/abi.d.ts +104 -0
  94. package/dist/contracts/nft/abi.d.ts.map +1 -0
  95. package/dist/contracts/nft/abi.js +135 -0
  96. package/dist/contracts/nft/abi.js.map +1 -0
  97. package/dist/contracts/nft/helpers.d.ts +21 -0
  98. package/dist/contracts/nft/helpers.d.ts.map +1 -0
  99. package/dist/contracts/nft/helpers.js +61 -0
  100. package/dist/contracts/nft/helpers.js.map +1 -0
  101. package/dist/contracts/nft/types.d.ts +47 -0
  102. package/dist/contracts/nft/types.d.ts.map +1 -0
  103. package/dist/conversion.d.ts +5 -2
  104. package/dist/conversion.d.ts.map +1 -1
  105. package/dist/conversion.js +45 -50
  106. package/dist/conversion.js.map +1 -1
  107. package/dist/crypto.d.ts +14 -16
  108. package/dist/crypto.d.ts.map +1 -1
  109. package/dist/crypto.js +121 -140
  110. package/dist/crypto.js.map +1 -1
  111. package/dist/encoding.d.ts +11 -8
  112. package/dist/encoding.d.ts.map +1 -1
  113. package/dist/encoding.js +123 -144
  114. package/dist/encoding.js.map +1 -1
  115. package/dist/encryption.d.ts +15 -12
  116. package/dist/encryption.d.ts.map +1 -1
  117. package/dist/encryption.js +119 -117
  118. package/dist/encryption.js.map +1 -1
  119. package/dist/explorer.d.ts +10 -7
  120. package/dist/explorer.d.ts.map +1 -1
  121. package/dist/explorer.js +51 -48
  122. package/dist/explorer.js.map +1 -1
  123. package/dist/formatters.d.ts +8 -5
  124. package/dist/formatters.d.ts.map +1 -1
  125. package/dist/formatters.js +67 -68
  126. package/dist/formatters.js.map +1 -1
  127. package/dist/index.d.ts +42 -54
  128. package/dist/index.js +39 -54
  129. package/dist/mnemonic.d.ts +99 -0
  130. package/dist/mnemonic.d.ts.map +1 -0
  131. package/dist/mnemonic.js +119 -0
  132. package/dist/mnemonic.js.map +1 -0
  133. package/dist/networks.d.ts +14 -17
  134. package/dist/networks.d.ts.map +1 -1
  135. package/dist/networks.js +40 -36
  136. package/dist/networks.js.map +1 -1
  137. package/dist/schemas.js +75 -79
  138. package/dist/schemas.js.map +1 -1
  139. package/dist/sdk.d.ts +69 -65
  140. package/dist/sdk.d.ts.map +1 -1
  141. package/dist/sdk.js +126 -117
  142. package/dist/sdk.js.map +1 -1
  143. package/dist/serialization.d.ts +8 -18
  144. package/dist/serialization.d.ts.map +1 -1
  145. package/dist/serialization.js +207 -260
  146. package/dist/serialization.js.map +1 -1
  147. package/dist/signing.js +67 -67
  148. package/dist/signing.js.map +1 -1
  149. package/dist/transaction-builder.d.ts +175 -184
  150. package/dist/transaction-builder.d.ts.map +1 -1
  151. package/dist/transaction-builder.js +295 -344
  152. package/dist/transaction-builder.js.map +1 -1
  153. package/dist/transaction-errors.d.ts +10 -12
  154. package/dist/transaction-errors.d.ts.map +1 -1
  155. package/dist/transaction-errors.js +145 -166
  156. package/dist/transaction-errors.js.map +1 -1
  157. package/dist/types.d.ts +530 -450
  158. package/dist/types.d.ts.map +1 -1
  159. package/dist/types.js +169 -183
  160. package/dist/types.js.map +1 -1
  161. package/dist/validation.d.ts +24 -26
  162. package/dist/validation.d.ts.map +1 -1
  163. package/dist/validation.js +194 -192
  164. package/dist/validation.js.map +1 -1
  165. package/package.json +5 -3
  166. package/dist/api/index.d.ts +0 -8
  167. package/dist/api/index.d.ts.map +0 -1
  168. package/dist/api/index.js +0 -8
  169. package/dist/api/index.js.map +0 -1
  170. package/dist/contracts/abi-types.js +0 -8
  171. package/dist/contracts/abi-types.js.map +0 -1
  172. package/dist/contracts/index.d.ts +0 -7
  173. package/dist/contracts/index.d.ts.map +0 -1
  174. package/dist/contracts/index.js +0 -7
  175. package/dist/contracts/index.js.map +0 -1
  176. package/dist/contracts/lockup/calls.d.ts +0 -23
  177. package/dist/contracts/lockup/calls.d.ts.map +0 -1
  178. package/dist/contracts/lockup/calls.js +0 -25
  179. package/dist/contracts/lockup/calls.js.map +0 -1
  180. package/dist/contracts/lockup/index.d.ts +0 -6
  181. package/dist/contracts/lockup/index.d.ts.map +0 -1
  182. package/dist/contracts/lockup/index.js +0 -6
  183. package/dist/contracts/lockup/index.js.map +0 -1
  184. package/dist/contracts/lockup/types.js +0 -7
  185. package/dist/contracts/lockup/types.js.map +0 -1
  186. package/dist/contracts/lockup-prime/calls.d.ts +0 -53
  187. package/dist/contracts/lockup-prime/calls.d.ts.map +0 -1
  188. package/dist/contracts/lockup-prime/calls.js +0 -60
  189. package/dist/contracts/lockup-prime/calls.js.map +0 -1
  190. package/dist/contracts/lockup-prime/index.d.ts +0 -6
  191. package/dist/contracts/lockup-prime/index.d.ts.map +0 -1
  192. package/dist/contracts/lockup-prime/index.js +0 -6
  193. package/dist/contracts/lockup-prime/index.js.map +0 -1
  194. package/dist/index.d.ts.map +0 -1
  195. package/dist/index.js.map +0 -1
  196. package/dist/schemas.d.ts +0 -67
  197. package/dist/schemas.d.ts.map +0 -1
  198. package/dist/signing.d.ts +0 -39
  199. package/dist/signing.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"encryption.js","sourceRoot":"","sources":["../src/encryption.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"encryption.js","names":[],"sources":["../src/encryption.ts"],"sourcesContent":["/**\n * Password-Based Encryption Utilities\n *\n * Provides secure password-based encryption using PBKDF2 key derivation\n * and AES-GCM encryption. Suitable for encrypting sensitive wallet data.\n */\n\nimport { uint8ArrayToBase64, base64ToUint8Array } from './encoding'\nimport { uint8ArrayToArrayBuffer } from './encoding'\n\n// ============================================================================\n// Constants\n// ============================================================================\n\n/**\n * PBKDF2 iterations for key derivation (100,000 iterations for security)\n * Matches web wallet implementation for consistency\n */\nconst PBKDF2_ITERATIONS = 100_000\n\n/**\n * Salt length in bytes (128 bits)\n */\nconst SALT_LENGTH = 16\n\n/**\n * IV length in bytes for AES-GCM (96 bits)\n */\nconst IV_LENGTH = 12\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Import password as a PBKDF2 key\n */\nasync function importPbkdf2Key(password: string): Promise<CryptoKey> {\n\tconst enc = new TextEncoder()\n\treturn crypto.subtle.importKey('raw', enc.encode(password), 'PBKDF2', false, ['deriveKey'])\n}\n\n/**\n * Derive a cryptographic key from a password using PBKDF2\n *\n * @param password - Password string\n * @param salt - Salt as Uint8Array or ArrayBuffer\n * @param iterations - Number of PBKDF2 iterations (default: 100,000)\n * @returns Derived AES-GCM key\n */\nexport async function deriveKey(\n\tpassword: string,\n\tsalt: Uint8Array | ArrayBuffer,\n\titerations: number = PBKDF2_ITERATIONS\n): Promise<CryptoKey> {\n\tconst baseKey = await importPbkdf2Key(password)\n\tconst saltBuffer = salt instanceof Uint8Array ? uint8ArrayToArrayBuffer(salt) : salt\n\n\treturn crypto.subtle.deriveKey(\n\t\t{\n\t\t\tname: 'PBKDF2',\n\t\t\tsalt: saltBuffer,\n\t\t\titerations,\n\t\t\thash: 'SHA-256'\n\t\t},\n\t\tbaseKey,\n\t\t{ name: 'AES-GCM', length: 256 },\n\t\tfalse,\n\t\t['encrypt', 'decrypt']\n\t)\n}\n\n// ============================================================================\n// Random Generation\n// ============================================================================\n\n/**\n * Generate a cryptographically secure random salt\n *\n * @returns Random salt (16 bytes)\n */\nexport function generateSalt(): Uint8Array {\n\tconst salt = new Uint8Array(SALT_LENGTH)\n\tcrypto.getRandomValues(salt)\n\treturn salt\n}\n\n/**\n * Generate a cryptographically secure random initialization vector\n *\n * @returns Random IV (12 bytes)\n */\nexport function generateIV(): Uint8Array {\n\tconst iv = new Uint8Array(IV_LENGTH)\n\tcrypto.getRandomValues(iv)\n\treturn iv\n}\n\n// ============================================================================\n// Encryption/Decryption (Base64 encoding for payloads)\n// ============================================================================\n\n/**\n * Encrypted data payload (Base64 encoded)\n *\n * Uses Base64 encoding for binary payloads like vaults (more efficient than Base58).\n * Base58 is reserved for addresses, keys, and hashes.\n */\nexport interface EncryptedPayload {\n\t/** Encrypted data (Base64 encoded) */\n\tencryptedData: string\n\t/** Initialization vector (Base64 encoded) */\n\tiv: string\n\t/** Salt used for key derivation (Base64 encoded) */\n\tsalt: string\n}\n\n/**\n * Encrypt plaintext with a password using AES-GCM\n *\n * Uses PBKDF2 for key derivation and Base64 encoding for output.\n * Suitable for encrypting sensitive wallet data like private keys.\n *\n * **Encoding Standard**: Uses Base64 encoding for binary payloads (RFC 4648).\n * Base58 is used for addresses, keys, and hashes elsewhere in the SDK.\n *\n * @param plaintext - Plaintext string to encrypt\n * @param password - Password for encryption\n * @returns Encrypted payload with encryptedData, IV, and salt (all Base64 encoded)\n *\n * @example\n * ```ts\n * const encrypted = await encryptWithPassword('sensitive data', 'my-password')\n * // Store encrypted.encryptedData, encrypted.iv, encrypted.salt\n * ```\n */\nexport async function encryptWithPassword(\n\tplaintext: string,\n\tpassword: string\n): Promise<EncryptedPayload> {\n\tconst enc = new TextEncoder()\n\tconst iv = generateIV()\n\tconst salt = generateSalt()\n\tconst key = await deriveKey(password, salt)\n\n\tconst ivBuffer = uint8ArrayToArrayBuffer(iv)\n\tconst encryptedBuf = await crypto.subtle.encrypt(\n\t\t{ name: 'AES-GCM', iv: ivBuffer },\n\t\tkey,\n\t\tenc.encode(plaintext)\n\t)\n\n\treturn {\n\t\tencryptedData: uint8ArrayToBase64(new Uint8Array(encryptedBuf)),\n\t\tiv: uint8ArrayToBase64(iv),\n\t\tsalt: uint8ArrayToBase64(salt)\n\t}\n}\n\n/**\n * Decrypt encrypted data with a password\n *\n * @param payload - Encrypted payload (Base64 encoded)\n * @param password - Password used for encryption\n * @returns Decrypted plaintext string\n * @throws {Error} If decryption fails (wrong password or corrupted data)\n *\n * @example\n * ```ts\n * const decrypted = await decryptWithPassword(encrypted, 'my-password')\n * ```\n */\nexport async function decryptWithPassword(\n\tpayload: EncryptedPayload,\n\tpassword: string\n): Promise<string> {\n\tconst dec = new TextDecoder()\n\tconst ivBytes = base64ToUint8Array(payload.iv)\n\tconst saltBytes = base64ToUint8Array(payload.salt)\n\tconst encryptedBytes = base64ToUint8Array(payload.encryptedData)\n\n\tconst key = await deriveKey(password, saltBytes)\n\tconst iv = uint8ArrayToArrayBuffer(ivBytes)\n\tconst encrypted = uint8ArrayToArrayBuffer(encryptedBytes)\n\n\ttry {\n\t\tconst plaintextBuf = await crypto.subtle.decrypt({ name: 'AES-GCM', iv }, key, encrypted)\n\t\treturn dec.decode(plaintextBuf)\n\t} catch {\n\t\tthrow new Error('Decryption failed. Incorrect password or corrupted data.')\n\t}\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,MAAM,oBAAoB;;;;AAK1B,MAAM,cAAc;;;;AAKpB,MAAM,YAAY;;;;AASlB,eAAe,gBAAgB,UAAsC;CACpE,MAAM,MAAM,IAAI,aAAa;CAC7B,OAAO,OAAO,OAAO,UAAU,OAAO,IAAI,OAAO,SAAS,EAAE,UAAU,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;AAW5F,eAAsB,UACrB,UACA,MACA,aAAqB,mBACA;CACrB,MAAM,UAAU,MAAM,gBAAgB,SAAS;CAC/C,MAAM,aAAa,gBAAgB,aAAa,wBAAwB,KAAK,GAAG;CAEhF,OAAO,OAAO,OAAO,UACpB;EACC,MAAM;EACN,MAAM;EACN;EACA,MAAM;EACN,EACD,SACA;EAAE,MAAM;EAAW,QAAQ;EAAK,EAChC,OACA,CAAC,WAAW,UAAU,CACtB;;;;;;;AAYF,SAAgB,eAA2B;CAC1C,MAAM,OAAO,IAAI,WAAW,YAAY;CACxC,OAAO,gBAAgB,KAAK;CAC5B,OAAO;;;;;;;AAQR,SAAgB,aAAyB;CACxC,MAAM,KAAK,IAAI,WAAW,UAAU;CACpC,OAAO,gBAAgB,GAAG;CAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;AAyCR,eAAsB,oBACrB,WACA,UAC4B;CAC5B,MAAM,MAAM,IAAI,aAAa;CAC7B,MAAM,KAAK,YAAY;CACvB,MAAM,OAAO,cAAc;CAC3B,MAAM,MAAM,MAAM,UAAU,UAAU,KAAK;CAE3C,MAAM,WAAW,wBAAwB,GAAG;CAC5C,MAAM,eAAe,MAAM,OAAO,OAAO,QACxC;EAAE,MAAM;EAAW,IAAI;EAAU,EACjC,KACA,IAAI,OAAO,UAAU,CACrB;CAED,OAAO;EACN,eAAe,mBAAmB,IAAI,WAAW,aAAa,CAAC;EAC/D,IAAI,mBAAmB,GAAG;EAC1B,MAAM,mBAAmB,KAAK;EAC9B;;;;;;;;;;;;;;;AAgBF,eAAsB,oBACrB,SACA,UACkB;CAClB,MAAM,MAAM,IAAI,aAAa;CAC7B,MAAM,UAAU,mBAAmB,QAAQ,GAAG;CAC9C,MAAM,YAAY,mBAAmB,QAAQ,KAAK;CAClD,MAAM,iBAAiB,mBAAmB,QAAQ,cAAc;CAEhE,MAAM,MAAM,MAAM,UAAU,UAAU,UAAU;CAChD,MAAM,KAAK,wBAAwB,QAAQ;CAC3C,MAAM,YAAY,wBAAwB,eAAe;CAEzD,IAAI;EACH,MAAM,eAAe,MAAM,OAAO,OAAO,QAAQ;GAAE,MAAM;GAAW;GAAI,EAAE,KAAK,UAAU;EACzF,OAAO,IAAI,OAAO,aAAa;SACxB;EACP,MAAM,IAAI,MAAM,2DAA2D"}
@@ -1,3 +1,4 @@
1
+ //#region src/explorer.d.ts
1
2
  /**
2
3
  * Explorer URL Utilities
3
4
  *
@@ -6,10 +7,10 @@
6
7
  /**
7
8
  * Types of explorer links
8
9
  */
9
- export declare enum ExplorerType {
10
- TRANSACTION = "tx",
11
- ADDRESS = "address",
12
- TIP = "tip"
10
+ declare enum ExplorerType {
11
+ TRANSACTION = "tx",
12
+ ADDRESS = "address",
13
+ TIP = "tip"
13
14
  }
14
15
  /**
15
16
  * Constructs an explorer URL for a given type and ID
@@ -28,7 +29,7 @@ export declare enum ExplorerType {
28
29
  * // Returns: "https://testnet.explorer.ama.one/network/address/xyz789"
29
30
  * ```
30
31
  */
31
- export declare function makeExplorerUrl(type: ExplorerType, id: string, baseUrl?: string): string;
32
+ declare function makeExplorerUrl(type: ExplorerType, id: string, baseUrl?: string): string;
32
33
  /**
33
34
  * Create a transaction explorer URL
34
35
  *
@@ -36,7 +37,7 @@ export declare function makeExplorerUrl(type: ExplorerType, id: string, baseUrl?
36
37
  * @param baseUrl - Optional base explorer URL
37
38
  * @returns Transaction explorer URL
38
39
  */
39
- export declare function makeTransactionUrl(txHash: string, baseUrl?: string): string;
40
+ declare function makeTransactionUrl(txHash: string, baseUrl?: string): string;
40
41
  /**
41
42
  * Create an address explorer URL
42
43
  *
@@ -44,5 +45,7 @@ export declare function makeTransactionUrl(txHash: string, baseUrl?: string): st
44
45
  * @param baseUrl - Optional base explorer URL
45
46
  * @returns Address explorer URL
46
47
  */
47
- export declare function makeAddressUrl(address: string, baseUrl?: string): string;
48
+ declare function makeAddressUrl(address: string, baseUrl?: string): string;
49
+ //#endregion
50
+ export { ExplorerType, makeAddressUrl, makeExplorerUrl, makeTransactionUrl };
48
51
  //# sourceMappingURL=explorer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"explorer.d.ts","sourceRoot":"","sources":["../src/explorer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,oBAAY,YAAY;IACvB,WAAW,OAAO;IAClB,OAAO,YAAY;IACnB,GAAG,QAAQ;CACX;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAGxF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAExE"}
1
+ {"version":3,"file":"explorer.d.ts","names":[],"sources":["../src/explorer.ts"],"mappings":";;AAWA;;;;;;;aAAY,YAAA;EACX,WAAA;EACA,OAAA;EACA,GAAA;AAAA;;;;;;;;AAgCD;;;;;AAWA;;;;;iBAvBgB,eAAA,CAAgB,IAAA,EAAM,YAAA,EAAc,EAAA,UAAY,OAAA;;;;;;;;iBAYhD,kBAAA,CAAmB,MAAA,UAAgB,OAAA;;;;;;;;iBAWnC,cAAA,CAAe,OAAA,UAAiB,OAAA"}
package/dist/explorer.js CHANGED
@@ -1,57 +1,60 @@
1
+ import { NETWORK_EXPLORER_URLS } from "./networks.js";
2
+ //#region src/explorer.ts
1
3
  /**
2
- * Explorer URL Utilities
3
- *
4
- * This module provides utilities for generating Amadeus explorer URLs.
5
- */
6
- import { NETWORK_EXPLORER_URLS, NetworkType } from './networks';
4
+ * Explorer URL Utilities
5
+ *
6
+ * This module provides utilities for generating Amadeus explorer URLs.
7
+ */
7
8
  /**
8
- * Types of explorer links
9
- */
10
- export var ExplorerType;
11
- (function (ExplorerType) {
12
- ExplorerType["TRANSACTION"] = "tx";
13
- ExplorerType["ADDRESS"] = "address";
14
- ExplorerType["TIP"] = "tip";
15
- })(ExplorerType || (ExplorerType = {}));
9
+ * Types of explorer links
10
+ */
11
+ let ExplorerType = /* @__PURE__ */ function(ExplorerType) {
12
+ ExplorerType["TRANSACTION"] = "tx";
13
+ ExplorerType["ADDRESS"] = "address";
14
+ ExplorerType["TIP"] = "tip";
15
+ return ExplorerType;
16
+ }({});
16
17
  /**
17
- * Constructs an explorer URL for a given type and ID
18
- *
19
- * @param type - The type of entity (transaction, address, tip)
20
- * @param id - The ID/hash/address of the entity
21
- * @param baseUrl - Optional base explorer URL (defaults to mainnet explorer URL)
22
- * @returns The full explorer URL
23
- *
24
- * @example
25
- * ```ts
26
- * makeExplorerUrl(ExplorerType.TRANSACTION, 'abc123')
27
- * // Returns: "https://explorer.ama.one/network/tx/abc123"
28
- *
29
- * makeExplorerUrl(ExplorerType.ADDRESS, 'xyz789', 'https://testnet.explorer.ama.one')
30
- * // Returns: "https://testnet.explorer.ama.one/network/address/xyz789"
31
- * ```
32
- */
33
- export function makeExplorerUrl(type, id, baseUrl) {
34
- const explorerBase = baseUrl || NETWORK_EXPLORER_URLS[NetworkType.MAINNET];
35
- return `${explorerBase}/network/${type}/${id}`;
18
+ * Constructs an explorer URL for a given type and ID
19
+ *
20
+ * @param type - The type of entity (transaction, address, tip)
21
+ * @param id - The ID/hash/address of the entity
22
+ * @param baseUrl - Optional base explorer URL (defaults to mainnet explorer URL)
23
+ * @returns The full explorer URL
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * makeExplorerUrl(ExplorerType.TRANSACTION, 'abc123')
28
+ * // Returns: "https://explorer.ama.one/network/tx/abc123"
29
+ *
30
+ * makeExplorerUrl(ExplorerType.ADDRESS, 'xyz789', 'https://testnet.explorer.ama.one')
31
+ * // Returns: "https://testnet.explorer.ama.one/network/address/xyz789"
32
+ * ```
33
+ */
34
+ function makeExplorerUrl(type, id, baseUrl) {
35
+ return `${baseUrl || NETWORK_EXPLORER_URLS["mainnet"]}/network/${type}/${id}`;
36
36
  }
37
37
  /**
38
- * Create a transaction explorer URL
39
- *
40
- * @param txHash - Transaction hash
41
- * @param baseUrl - Optional base explorer URL
42
- * @returns Transaction explorer URL
43
- */
44
- export function makeTransactionUrl(txHash, baseUrl) {
45
- return makeExplorerUrl(ExplorerType.TRANSACTION, txHash, baseUrl);
38
+ * Create a transaction explorer URL
39
+ *
40
+ * @param txHash - Transaction hash
41
+ * @param baseUrl - Optional base explorer URL
42
+ * @returns Transaction explorer URL
43
+ */
44
+ function makeTransactionUrl(txHash, baseUrl) {
45
+ return makeExplorerUrl("tx", txHash, baseUrl);
46
46
  }
47
47
  /**
48
- * Create an address explorer URL
49
- *
50
- * @param address - Wallet address
51
- * @param baseUrl - Optional base explorer URL
52
- * @returns Address explorer URL
53
- */
54
- export function makeAddressUrl(address, baseUrl) {
55
- return makeExplorerUrl(ExplorerType.ADDRESS, address, baseUrl);
48
+ * Create an address explorer URL
49
+ *
50
+ * @param address - Wallet address
51
+ * @param baseUrl - Optional base explorer URL
52
+ * @returns Address explorer URL
53
+ */
54
+ function makeAddressUrl(address, baseUrl) {
55
+ return makeExplorerUrl("address", address, baseUrl);
56
56
  }
57
+ //#endregion
58
+ export { ExplorerType, makeAddressUrl, makeExplorerUrl, makeTransactionUrl };
59
+
57
60
  //# sourceMappingURL=explorer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"explorer.js","sourceRoot":"","sources":["../src/explorer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE/D;;GAEG;AACH,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,kCAAkB,CAAA;IAClB,mCAAmB,CAAA;IACnB,2BAAW,CAAA;AACZ,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,eAAe,CAAC,IAAkB,EAAE,EAAU,EAAE,OAAgB;IAC/E,MAAM,YAAY,GAAG,OAAO,IAAI,qBAAqB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IAC1E,OAAO,GAAG,YAAY,YAAY,IAAI,IAAI,EAAE,EAAE,CAAA;AAC/C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,OAAgB;IAClE,OAAO,eAAe,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;AAClE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,OAAgB;IAC/D,OAAO,eAAe,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAC/D,CAAC"}
1
+ {"version":3,"file":"explorer.js","names":[],"sources":["../src/explorer.ts"],"sourcesContent":["/**\n * Explorer URL Utilities\n *\n * This module provides utilities for generating Amadeus explorer URLs.\n */\n\nimport { NETWORK_EXPLORER_URLS, NetworkType } from './networks'\n\n/**\n * Types of explorer links\n */\nexport enum ExplorerType {\n\tTRANSACTION = 'tx',\n\tADDRESS = 'address',\n\tTIP = 'tip'\n}\n\n/**\n * Constructs an explorer URL for a given type and ID\n *\n * @param type - The type of entity (transaction, address, tip)\n * @param id - The ID/hash/address of the entity\n * @param baseUrl - Optional base explorer URL (defaults to mainnet explorer URL)\n * @returns The full explorer URL\n *\n * @example\n * ```ts\n * makeExplorerUrl(ExplorerType.TRANSACTION, 'abc123')\n * // Returns: \"https://explorer.ama.one/network/tx/abc123\"\n *\n * makeExplorerUrl(ExplorerType.ADDRESS, 'xyz789', 'https://testnet.explorer.ama.one')\n * // Returns: \"https://testnet.explorer.ama.one/network/address/xyz789\"\n * ```\n */\nexport function makeExplorerUrl(type: ExplorerType, id: string, baseUrl?: string): string {\n\tconst explorerBase = baseUrl || NETWORK_EXPLORER_URLS[NetworkType.MAINNET]\n\treturn `${explorerBase}/network/${type}/${id}`\n}\n\n/**\n * Create a transaction explorer URL\n *\n * @param txHash - Transaction hash\n * @param baseUrl - Optional base explorer URL\n * @returns Transaction explorer URL\n */\nexport function makeTransactionUrl(txHash: string, baseUrl?: string): string {\n\treturn makeExplorerUrl(ExplorerType.TRANSACTION, txHash, baseUrl)\n}\n\n/**\n * Create an address explorer URL\n *\n * @param address - Wallet address\n * @param baseUrl - Optional base explorer URL\n * @returns Address explorer URL\n */\nexport function makeAddressUrl(address: string, baseUrl?: string): string {\n\treturn makeExplorerUrl(ExplorerType.ADDRESS, address, baseUrl)\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAY,eAAL,yBAAA,cAAA;CACN,aAAA,iBAAA;CACA,aAAA,aAAA;CACA,aAAA,SAAA;;KACA;;;;;;;;;;;;;;;;;;AAmBD,SAAgB,gBAAgB,MAAoB,IAAY,SAA0B;CAEzF,OAAO,GADc,WAAW,sBAAA,WACT,WAAW,KAAK,GAAG;;;;;;;;;AAU3C,SAAgB,mBAAmB,QAAgB,SAA0B;CAC5E,OAAO,gBAAA,MAA0C,QAAQ,QAAQ;;;;;;;;;AAUlE,SAAgB,eAAe,SAAiB,SAA0B;CACzE,OAAO,gBAAA,WAAsC,SAAS,QAAQ"}
@@ -1,3 +1,4 @@
1
+ //#region src/formatters.d.ts
1
2
  /**
2
3
  * Formatting Utilities
3
4
  *
@@ -16,21 +17,21 @@
16
17
  * formatNumber(1.123456789, 4) // "1.1235"
17
18
  * ```
18
19
  */
19
- export declare function formatNumber(num: number, digits?: number): string;
20
+ declare function formatNumber(num: number, digits?: number): string;
20
21
  /**
21
22
  * Format an amount with the AMA suffix
22
23
  *
23
24
  * @param amount - The amount to format
24
25
  * @returns Formatted string like "1,234.56 AMA"
25
26
  */
26
- export declare function formatAMAAmount(amount: number): string;
27
+ declare function formatAMAAmount(amount: number): string;
27
28
  /**
28
29
  * Format a balance value with proper AMA token decimals
29
30
  *
30
31
  * @param amount - The balance amount (string, number, or undefined)
31
32
  * @returns Formatted balance string
32
33
  */
33
- export declare function formatBalance(amount: string | number | undefined): string;
34
+ declare function formatBalance(amount: string | number | undefined): string;
34
35
  /**
35
36
  * Format balance with privacy mode support
36
37
  *
@@ -38,7 +39,7 @@ export declare function formatBalance(amount: string | number | undefined): stri
38
39
  * @param hideBalances - Whether to hide the balance
39
40
  * @returns Formatted balance or masked string
40
41
  */
41
- export declare function formatBalanceWithPrivacy(amount: string | number | undefined, hideBalances: boolean): string;
42
+ declare function formatBalanceWithPrivacy(amount: string | number | undefined, hideBalances: boolean): string;
42
43
  /**
43
44
  * Truncate an address for display (e.g., "abc123...xyz789")
44
45
  *
@@ -52,5 +53,7 @@ export declare function formatBalanceWithPrivacy(amount: string | number | undef
52
53
  * formatShortAddress("abcdefghijklmnopqrstuvwxyz", 4) // "abcd...wxyz"
53
54
  * ```
54
55
  */
55
- export declare function formatShortAddress(address: string, chars?: number): string;
56
+ declare function formatShortAddress(address: string, chars?: number): string;
57
+ //#endregion
58
+ export { formatAMAAmount, formatBalance, formatBalanceWithPrivacy, formatNumber, formatShortAddress };
56
59
  //# sourceMappingURL=formatters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../src/formatters.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,SAAqB,GAAG,MAAM,CAE7E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAYzE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACnC,YAAY,EAAE,OAAO,GACnB,MAAM,CAGR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,MAAM,CAGrE"}
1
+ {"version":3,"file":"formatters.d.ts","names":[],"sources":["../src/formatters.ts"],"mappings":";;AAqBA;;;;;AAUA;;;;;AAUA;;;;;AAqBA;;iBAzCgB,YAAA,CAAa,GAAA,UAAa,MAAA;;;AA8D1C;;;;iBApDgB,eAAA,CAAgB,MAAA;;;;;;;iBAUhB,aAAA,CAAc,MAAA;;;;;;;;iBAqBd,wBAAA,CACf,MAAA,+BACA,YAAA;;;;;;;;;;;;;;iBAmBe,kBAAA,CAAmB,OAAA,UAAiB,KAAA"}
@@ -1,80 +1,79 @@
1
+ import "./constants.js";
2
+ //#region src/formatters.ts
1
3
  /**
2
- * Formatting Utilities
3
- *
4
- * This module provides common formatting functions for amounts, addresses, and dates.
5
- */
6
- import { AMA_TOKEN_DECIMALS } from './constants';
4
+ * Formatting Utilities
5
+ *
6
+ * This module provides common formatting functions for amounts, addresses, and dates.
7
+ */
7
8
  /**
8
- * Format a number with locale-aware commas and specified decimal places
9
- *
10
- * @param num - The number to format
11
- * @param digits - Maximum fraction digits (default: AMA_TOKEN_DECIMALS)
12
- * @returns Formatted number string
13
- *
14
- * @example
15
- * ```ts
16
- * formatNumber(1234567.89) // "1,234,567.89"
17
- * formatNumber(1.123456789, 4) // "1.1235"
18
- * ```
19
- */
20
- export function formatNumber(num, digits = AMA_TOKEN_DECIMALS) {
21
- return num.toLocaleString(undefined, { maximumFractionDigits: digits });
9
+ * Format a number with locale-aware commas and specified decimal places
10
+ *
11
+ * @param num - The number to format
12
+ * @param digits - Maximum fraction digits (default: AMA_TOKEN_DECIMALS)
13
+ * @returns Formatted number string
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * formatNumber(1234567.89) // "1,234,567.89"
18
+ * formatNumber(1.123456789, 4) // "1.1235"
19
+ * ```
20
+ */
21
+ function formatNumber(num, digits = 9) {
22
+ return num.toLocaleString(void 0, { maximumFractionDigits: digits });
22
23
  }
23
24
  /**
24
- * Format an amount with the AMA suffix
25
- *
26
- * @param amount - The amount to format
27
- * @returns Formatted string like "1,234.56 AMA"
28
- */
29
- export function formatAMAAmount(amount) {
30
- return `${formatNumber(amount)} AMA`;
25
+ * Format an amount with the AMA suffix
26
+ *
27
+ * @param amount - The amount to format
28
+ * @returns Formatted string like "1,234.56 AMA"
29
+ */
30
+ function formatAMAAmount(amount) {
31
+ return `${formatNumber(amount)} AMA`;
31
32
  }
32
33
  /**
33
- * Format a balance value with proper AMA token decimals
34
- *
35
- * @param amount - The balance amount (string, number, or undefined)
36
- * @returns Formatted balance string
37
- */
38
- export function formatBalance(amount) {
39
- if (amount === undefined)
40
- return '0';
41
- const num = Number(amount);
42
- if (!Number.isNaN(num)) {
43
- return num.toLocaleString(undefined, {
44
- minimumFractionDigits: 0,
45
- maximumFractionDigits: AMA_TOKEN_DECIMALS
46
- });
47
- }
48
- return String(amount);
34
+ * Format a balance value with proper AMA token decimals
35
+ *
36
+ * @param amount - The balance amount (string, number, or undefined)
37
+ * @returns Formatted balance string
38
+ */
39
+ function formatBalance(amount) {
40
+ if (amount === void 0) return "0";
41
+ const num = Number(amount);
42
+ if (!Number.isNaN(num)) return num.toLocaleString(void 0, {
43
+ minimumFractionDigits: 0,
44
+ maximumFractionDigits: 9
45
+ });
46
+ return String(amount);
49
47
  }
50
48
  /**
51
- * Format balance with privacy mode support
52
- *
53
- * @param amount - The balance amount
54
- * @param hideBalances - Whether to hide the balance
55
- * @returns Formatted balance or masked string
56
- */
57
- export function formatBalanceWithPrivacy(amount, hideBalances) {
58
- if (hideBalances)
59
- return '******';
60
- return formatBalance(amount);
49
+ * Format balance with privacy mode support
50
+ *
51
+ * @param amount - The balance amount
52
+ * @param hideBalances - Whether to hide the balance
53
+ * @returns Formatted balance or masked string
54
+ */
55
+ function formatBalanceWithPrivacy(amount, hideBalances) {
56
+ if (hideBalances) return "******";
57
+ return formatBalance(amount);
61
58
  }
62
59
  /**
63
- * Truncate an address for display (e.g., "abc123...xyz789")
64
- *
65
- * @param address - The full address
66
- * @param chars - Number of characters to show on each side (default: 6)
67
- * @returns Truncated address string
68
- *
69
- * @example
70
- * ```ts
71
- * formatShortAddress("abcdefghijklmnopqrstuvwxyz") // "abcdef...uvwxyz"
72
- * formatShortAddress("abcdefghijklmnopqrstuvwxyz", 4) // "abcd...wxyz"
73
- * ```
74
- */
75
- export function formatShortAddress(address, chars = 6) {
76
- if (!address || address.length <= chars * 2)
77
- return address || '';
78
- return `${address.substring(0, chars)}...${address.substring(address.length - chars)}`;
60
+ * Truncate an address for display (e.g., "abc123...xyz789")
61
+ *
62
+ * @param address - The full address
63
+ * @param chars - Number of characters to show on each side (default: 6)
64
+ * @returns Truncated address string
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * formatShortAddress("abcdefghijklmnopqrstuvwxyz") // "abcdef...uvwxyz"
69
+ * formatShortAddress("abcdefghijklmnopqrstuvwxyz", 4) // "abcd...wxyz"
70
+ * ```
71
+ */
72
+ function formatShortAddress(address, chars = 6) {
73
+ if (!address || address.length <= chars * 2) return address || "";
74
+ return `${address.substring(0, chars)}...${address.substring(address.length - chars)}`;
79
75
  }
76
+ //#endregion
77
+ export { formatAMAAmount, formatBalance, formatBalanceWithPrivacy, formatNumber, formatShortAddress };
78
+
80
79
  //# sourceMappingURL=formatters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../src/formatters.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,MAAM,GAAG,kBAAkB;IACpE,OAAO,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,CAAC,CAAA;AACxE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc;IAC7C,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAA;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,MAAmC;IAChE,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,GAAG,CAAA;IAEpC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;IAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE;YACpC,qBAAqB,EAAE,CAAC;YACxB,qBAAqB,EAAE,kBAAkB;SACzC,CAAC,CAAA;IACH,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,CAAA;AACtB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACvC,MAAmC,EACnC,YAAqB;IAErB,IAAI,YAAY;QAAE,OAAO,QAAQ,CAAA;IACjC,OAAO,aAAa,CAAC,MAAM,CAAC,CAAA;AAC7B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,KAAK,GAAG,CAAC;IAC5D,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,OAAO,IAAI,EAAE,CAAA;IACjE,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,CAAA;AACvF,CAAC"}
1
+ {"version":3,"file":"formatters.js","names":[],"sources":["../src/formatters.ts"],"sourcesContent":["/**\n * Formatting Utilities\n *\n * This module provides common formatting functions for amounts, addresses, and dates.\n */\n\nimport { AMA_TOKEN_DECIMALS } from './constants'\n\n/**\n * Format a number with locale-aware commas and specified decimal places\n *\n * @param num - The number to format\n * @param digits - Maximum fraction digits (default: AMA_TOKEN_DECIMALS)\n * @returns Formatted number string\n *\n * @example\n * ```ts\n * formatNumber(1234567.89) // \"1,234,567.89\"\n * formatNumber(1.123456789, 4) // \"1.1235\"\n * ```\n */\nexport function formatNumber(num: number, digits = AMA_TOKEN_DECIMALS): string {\n\treturn num.toLocaleString(undefined, { maximumFractionDigits: digits })\n}\n\n/**\n * Format an amount with the AMA suffix\n *\n * @param amount - The amount to format\n * @returns Formatted string like \"1,234.56 AMA\"\n */\nexport function formatAMAAmount(amount: number): string {\n\treturn `${formatNumber(amount)} AMA`\n}\n\n/**\n * Format a balance value with proper AMA token decimals\n *\n * @param amount - The balance amount (string, number, or undefined)\n * @returns Formatted balance string\n */\nexport function formatBalance(amount: string | number | undefined): string {\n\tif (amount === undefined) return '0'\n\n\tconst num = Number(amount)\n\tif (!Number.isNaN(num)) {\n\t\treturn num.toLocaleString(undefined, {\n\t\t\tminimumFractionDigits: 0,\n\t\t\tmaximumFractionDigits: AMA_TOKEN_DECIMALS\n\t\t})\n\t}\n\n\treturn String(amount)\n}\n\n/**\n * Format balance with privacy mode support\n *\n * @param amount - The balance amount\n * @param hideBalances - Whether to hide the balance\n * @returns Formatted balance or masked string\n */\nexport function formatBalanceWithPrivacy(\n\tamount: string | number | undefined,\n\thideBalances: boolean\n): string {\n\tif (hideBalances) return '******'\n\treturn formatBalance(amount)\n}\n\n/**\n * Truncate an address for display (e.g., \"abc123...xyz789\")\n *\n * @param address - The full address\n * @param chars - Number of characters to show on each side (default: 6)\n * @returns Truncated address string\n *\n * @example\n * ```ts\n * formatShortAddress(\"abcdefghijklmnopqrstuvwxyz\") // \"abcdef...uvwxyz\"\n * formatShortAddress(\"abcdefghijklmnopqrstuvwxyz\", 4) // \"abcd...wxyz\"\n * ```\n */\nexport function formatShortAddress(address: string, chars = 6): string {\n\tif (!address || address.length <= chars * 2) return address || ''\n\treturn `${address.substring(0, chars)}...${address.substring(address.length - chars)}`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,aAAa,KAAa,SAAA,GAAqC;CAC9E,OAAO,IAAI,eAAe,KAAA,GAAW,EAAE,uBAAuB,QAAQ,CAAC;;;;;;;;AASxE,SAAgB,gBAAgB,QAAwB;CACvD,OAAO,GAAG,aAAa,OAAO,CAAC;;;;;;;;AAShC,SAAgB,cAAc,QAA6C;CAC1E,IAAI,WAAW,KAAA,GAAW,OAAO;CAEjC,MAAM,MAAM,OAAO,OAAO;CAC1B,IAAI,CAAC,OAAO,MAAM,IAAI,EACrB,OAAO,IAAI,eAAe,KAAA,GAAW;EACpC,uBAAuB;EACvB,uBAAA;EACA,CAAC;CAGH,OAAO,OAAO,OAAO;;;;;;;;;AAUtB,SAAgB,yBACf,QACA,cACS;CACT,IAAI,cAAc,OAAO;CACzB,OAAO,cAAc,OAAO;;;;;;;;;;;;;;;AAgB7B,SAAgB,mBAAmB,SAAiB,QAAQ,GAAW;CACtE,IAAI,CAAC,WAAW,QAAQ,UAAU,QAAQ,GAAG,OAAO,WAAW;CAC/D,OAAO,GAAG,QAAQ,UAAU,GAAG,MAAM,CAAC,KAAK,QAAQ,UAAU,QAAQ,SAAS,MAAM"}
package/dist/index.d.ts CHANGED
@@ -1,54 +1,42 @@
1
- /**
2
- * @amadeus-protocol/sdk
3
- *
4
- * Official TypeScript/JavaScript SDK for Amadeus Protocol
5
- *
6
- * This SDK provides:
7
- * - Canonical serialization (VecPack)
8
- * - Cryptographic operations (BLS12-381, Base58)
9
- * - Transaction building and signing
10
- * - Token amount conversions
11
- * - Full-featured API client for Amadeus nodes
12
- *
13
- * @example
14
- * ```ts
15
- * import { AmadeusSDK, TransactionBuilder, generateKeypair } from '@amadeus-protocol/sdk'
16
- *
17
- * // Initialize SDK
18
- * const sdk = new AmadeusSDK()
19
- *
20
- * // Generate keypair
21
- * const keypair = generateKeypair()
22
- *
23
- * // Build and submit transaction
24
- * const builder = new TransactionBuilder(keypair.privateKey)
25
- * const { txHash, txPacked } = builder.transfer({
26
- * recipient: '5Kd3N...',
27
- * amount: 10.5,
28
- * symbol: 'AMA'
29
- * })
30
- *
31
- * const result = await sdk.transaction.submit(txPacked)
32
- * ```
33
- *
34
- * @packageDocumentation
35
- */
36
- export * from './types';
37
- export * from './constants';
38
- export * from './networks';
39
- export * from './serialization';
40
- export * from './contract-state';
41
- export * from './crypto';
42
- export * from './conversion';
43
- export * from './encoding';
44
- export * from './encryption';
45
- export * from './validation';
46
- export * from './formatters';
47
- export * from './explorer';
48
- export * from './transaction-errors';
49
- export * from './transaction-builder';
50
- export * from './client';
51
- export * from './api';
52
- export * from './sdk';
53
- export * from './contracts';
54
- //# sourceMappingURL=index.d.ts.map
1
+ import { ANRInfo, AmadeusSDKConfig, AmadeusSDKError, ApiResponse, BuildTransactionResult, ChainEntry, ChainEntryHeader, ChainKpi, ChainStats, Contract, ContractData, ContractDataValue, ContractFunction, ContractStateProof, ContractViewParams, ContractViewResponse, DecodedValue, EmissionAddress, EpochScore, EpochScoreAll, EpochScoreSingle, GetANRByPkResponse, GetANRsResponse, GetAllBalancesResponse, GetByHashResponse, GetByHeightResponse, GetEmissionAddressResponse, GetKpiResponse, GetNodesResponse, GetRemovedTrainersResponse, GetRichlistResponse, GetSolInEpochResponse, GetStatsResponse, GetTipResponse, GetTokenBalanceQuery, GetTokenBalanceResponse, GetTrainersResponse, GetTransactionEventsByAccountResponse, GetTransactionsInEntryResponse, GetWalletTransactionsQuery, GetWalletTransactionsResponse, KeyPair, LockupPrimeDailyCheckinInput, LockupPrimeLockInput, LockupPrimeUnlockInput, LockupUnlockInput, PeerInfo, ProofValidators, RichlistEntry, SerializableValue, SubmitAndWaitOptions, SubmitAndWaitTransactionResponse, SubmitTransactionRequestQuery, SubmitTransactionResponse, TokenBalance, Transaction, TransactionAction, TransactionActionBody, TransactionActionResponse, TransactionBody, TransactionEvent, TransactionEventType, TransactionExecutionError, TransactionFilters, TransactionMetadata, TransactionPacked, TransactionReceipt, TransactionResult, TransactionUnpacked, TransactionValidationError, TransactionValidationResult, TransferTransactionInput, TxByFilterParams, TxByFilterResponse, UnsignedTransaction, UnsignedTransactionWithHash, ValidateBytecodeResponse, ValidatorProofData, ValidatorProofNode, WalletBalance, WalletBalances } from "./types.js";
2
+ import { AMADEUS_PUBLIC_KEY_BYTE_LENGTH, AMADEUS_SEED_BYTE_LENGTH, AMA_TOKEN_DECIMALS, AMA_TOKEN_DECIMALS_MULTIPLIER, AMA_TRANSFER_FEE, DEFAULT_TIMEOUT, EXPLORER_URL, MIN_TRANSFERABLE_AMOUNT, NODE_API_URL, SDK_VERSION } from "./constants.js";
3
+ import { NETWORK_CONFIGS, NETWORK_EXPLORER_URLS, NETWORK_URLS, NetworkConfig, NetworkType, TESTNET_FAUCET_URL } from "./networks.js";
4
+ import { decode, decodeContractState, encode } from "./serialization.js";
5
+ import { decodeContractStateToBase64, parseStateNumber, parseStateString } from "./contract-state.js";
6
+ import { derivePublicKeyFromSeedBase58, deriveSkAndSeed64FromBase58Seed, generateKeypair, generatePrivateKey, getPublicKey, reduce512To256LE, seed64ToKeypair } from "./crypto.js";
7
+ import { fromAtomicAma, toAtomicAma } from "./conversion.js";
8
+ import { arrayBufferToBase64, arrayBufferToUint8Array, base64ToArrayBuffer, base64ToUint8Array, fromBase58, toBase58, uint8ArrayToArrayBuffer, uint8ArrayToBase64 } from "./encoding.js";
9
+ import { EncryptedPayload, decryptWithPassword, deriveKey, encryptWithPassword, generateIV, generateSalt } from "./encryption.js";
10
+ import { VaultSecretData, decodeVaultSecret, detectInputType, encodeVaultSecret, generateMnemonic, mnemonicToSeedBase58, validateMnemonic } from "./mnemonic.js";
11
+ import { ValidationResult, isValidAddress, isValidAmount, isValidSeed, validate, validateAddress, validateAmount, validatePassword, validateSeed, validateTokenSymbol } from "./validation.js";
12
+ import { formatAMAAmount, formatBalance, formatBalanceWithPrivacy, formatNumber, formatShortAddress } from "./formatters.js";
13
+ import { ExplorerType, makeAddressUrl, makeExplorerUrl, makeTransactionUrl } from "./explorer.js";
14
+ import { TRANSACTION_EXECUTION_ERROR_MESSAGES, TRANSACTION_VALIDATION_ERROR_MESSAGES, getExecutionErrorMessage, getTransactionErrorMessage, getValidationErrorMessage } from "./transaction-errors.js";
15
+ import { AbiDefinition, AbiFunction, AbiInput, ExtractContractName, ExtractFunctionNames, FunctionParams } from "./contracts/abi-types.js";
16
+ import { ContractCall, buildContractCall } from "./contracts/contract-call.js";
17
+ import { SignedContract, TypedContract, createContract } from "./contracts/contract.js";
18
+ import { NftCreateCollectionInput, NftCreateCollectionParams, NftMintInput, NftMintParams, NftTransferInput, NftTransferParams } from "./contracts/nft/types.js";
19
+ import { TransactionBuilder } from "./transaction-builder.js";
20
+ import { AmadeusClient } from "./client.js";
21
+ import { ChainAPI } from "./api/chain.js";
22
+ import { ContractAPI } from "./api/contract.js";
23
+ import { EpochAPI } from "./api/epoch.js";
24
+ import { PeerAPI } from "./api/peer.js";
25
+ import { ProofAPI } from "./api/proof.js";
26
+ import { TransactionAPI } from "./api/transaction.js";
27
+ import { WalletAPI } from "./api/wallet.js";
28
+ import { AmadeusSDK } from "./sdk.js";
29
+ import { CoinTransferParams, buildCoinTransfer } from "./contracts/coin.js";
30
+ import { LOCKUP_PRIME_ABI } from "./contracts/lockup-prime/abi.js";
31
+ import { LOCKUP_PRIME_TIER_KEYS, LockupPrimeAbiConstant, LockupPrimeAbiError, LockupPrimeAbiFunction, LockupPrimeAbiInput, LockupPrimeAbiOutput, LockupPrimeAbiStorage, LockupPrimeAbiStorageKey, LockupPrimeAbiStorageRead, LockupPrimeAbiStorageWrite, LockupPrimeTierKey, LockupPrimeVault, LockupPrimeVaultSchema, LockupTier, LockupTiersSchema, RawLockupPrimeVaultData, isValidLockupPrimeTierKey } from "./contracts/lockup-prime/types.js";
32
+ import { LockupPrime, RATE_MAP } from "./contracts/lockup-prime/helpers.js";
33
+ import { parseContractStateNumber, parseRawVaultData, parseVaultData } from "./contracts/lockup-prime/parsers.js";
34
+ import { buildDailyStreakKey, buildLockupPrimeVaultKeyPrefix, buildNextCheckinEpochKey, extractLockupPrimeVaultIndexFromKey } from "./contracts/lockup-prime/storage-keys.js";
35
+ import { LOCKUP_ABI } from "./contracts/lockup/abi.js";
36
+ import { LockupAbiError, LockupAbiFunction, LockupAbiInput, LockupAbiOutput, LockupAbiStorage, LockupAbiStorageKey, LockupAbiStorageRead, LockupAbiStorageWrite, LockupVault, LockupVaultSchema, RawLockupVaultData } from "./contracts/lockup/types.js";
37
+ import { Lockup } from "./contracts/lockup/helpers.js";
38
+ import { parseLockupVaultData, parseRawLockupVaultData } from "./contracts/lockup/parsers.js";
39
+ import { buildLockupVaultKeyPrefix, extractLockupVaultIndexFromKey } from "./contracts/lockup/storage-keys.js";
40
+ import { NFT_ABI } from "./contracts/nft/abi.js";
41
+ import { buildNftCreateCollection, buildNftMint, buildNftTransfer } from "./contracts/nft/helpers.js";
42
+ export { AMADEUS_PUBLIC_KEY_BYTE_LENGTH, AMADEUS_SEED_BYTE_LENGTH, AMA_TOKEN_DECIMALS, AMA_TOKEN_DECIMALS_MULTIPLIER, AMA_TRANSFER_FEE, ANRInfo, AbiDefinition, AbiFunction, AbiInput, AmadeusClient, AmadeusSDK, AmadeusSDKConfig, AmadeusSDKError, ApiResponse, BuildTransactionResult, ChainAPI, ChainEntry, ChainEntryHeader, ChainKpi, ChainStats, CoinTransferParams, Contract, ContractAPI, ContractCall, ContractData, ContractDataValue, ContractFunction, ContractStateProof, ContractViewParams, ContractViewResponse, DEFAULT_TIMEOUT, DecodedValue, EXPLORER_URL, EmissionAddress, EncryptedPayload, EpochAPI, EpochScore, EpochScoreAll, EpochScoreSingle, ExplorerType, ExtractContractName, ExtractFunctionNames, FunctionParams, GetANRByPkResponse, GetANRsResponse, GetAllBalancesResponse, GetByHashResponse, GetByHeightResponse, GetEmissionAddressResponse, GetKpiResponse, GetNodesResponse, GetRemovedTrainersResponse, GetRichlistResponse, GetSolInEpochResponse, GetStatsResponse, GetTipResponse, GetTokenBalanceQuery, GetTokenBalanceResponse, GetTrainersResponse, GetTransactionEventsByAccountResponse, GetTransactionsInEntryResponse, GetWalletTransactionsQuery, GetWalletTransactionsResponse, KeyPair, LOCKUP_ABI, LOCKUP_PRIME_ABI, LOCKUP_PRIME_TIER_KEYS, Lockup, LockupAbiError, LockupAbiFunction, LockupAbiInput, LockupAbiOutput, LockupAbiStorage, LockupAbiStorageKey, LockupAbiStorageRead, LockupAbiStorageWrite, LockupPrime, LockupPrimeAbiConstant, LockupPrimeAbiError, LockupPrimeAbiFunction, LockupPrimeAbiInput, LockupPrimeAbiOutput, LockupPrimeAbiStorage, LockupPrimeAbiStorageKey, LockupPrimeAbiStorageRead, LockupPrimeAbiStorageWrite, LockupPrimeDailyCheckinInput, LockupPrimeLockInput, LockupPrimeTierKey, LockupPrimeUnlockInput, LockupPrimeVault, LockupPrimeVaultSchema, LockupTier, LockupTiersSchema, LockupUnlockInput, LockupVault, LockupVaultSchema, MIN_TRANSFERABLE_AMOUNT, NETWORK_CONFIGS, NETWORK_EXPLORER_URLS, NETWORK_URLS, NFT_ABI, NODE_API_URL, NetworkConfig, NetworkType, NftCreateCollectionInput, NftCreateCollectionParams, NftMintInput, NftMintParams, NftTransferInput, NftTransferParams, PeerAPI, PeerInfo, ProofAPI, ProofValidators, RATE_MAP, RawLockupPrimeVaultData, RawLockupVaultData, RichlistEntry, SDK_VERSION, SerializableValue, SignedContract, SubmitAndWaitOptions, SubmitAndWaitTransactionResponse, SubmitTransactionRequestQuery, SubmitTransactionResponse, TESTNET_FAUCET_URL, TRANSACTION_EXECUTION_ERROR_MESSAGES, TRANSACTION_VALIDATION_ERROR_MESSAGES, TokenBalance, Transaction, TransactionAPI, TransactionAction, TransactionActionBody, TransactionActionResponse, TransactionBody, TransactionBuilder, TransactionEvent, TransactionEventType, TransactionExecutionError, TransactionFilters, TransactionMetadata, TransactionPacked, TransactionReceipt, TransactionResult, TransactionUnpacked, TransactionValidationError, TransactionValidationResult, TransferTransactionInput, TxByFilterParams, TxByFilterResponse, TypedContract, UnsignedTransaction, UnsignedTransactionWithHash, ValidateBytecodeResponse, ValidationResult, ValidatorProofData, ValidatorProofNode, VaultSecretData, WalletAPI, WalletBalance, WalletBalances, arrayBufferToBase64, arrayBufferToUint8Array, base64ToArrayBuffer, base64ToUint8Array, buildCoinTransfer, buildContractCall, buildDailyStreakKey, buildLockupPrimeVaultKeyPrefix, buildLockupVaultKeyPrefix, buildNextCheckinEpochKey, buildNftCreateCollection, buildNftMint, buildNftTransfer, createContract, decode, decodeContractState, decodeContractStateToBase64, decodeVaultSecret, decryptWithPassword, deriveKey, derivePublicKeyFromSeedBase58, deriveSkAndSeed64FromBase58Seed, detectInputType, encode, encodeVaultSecret, encryptWithPassword, extractLockupPrimeVaultIndexFromKey, extractLockupVaultIndexFromKey, formatAMAAmount, formatBalance, formatBalanceWithPrivacy, formatNumber, formatShortAddress, fromAtomicAma, fromBase58, generateIV, generateKeypair, generateMnemonic, generatePrivateKey, generateSalt, getExecutionErrorMessage, getPublicKey, getTransactionErrorMessage, getValidationErrorMessage, isValidAddress, isValidAmount, isValidLockupPrimeTierKey, isValidSeed, makeAddressUrl, makeExplorerUrl, makeTransactionUrl, mnemonicToSeedBase58, parseContractStateNumber, parseLockupVaultData, parseRawLockupVaultData, parseRawVaultData, parseStateNumber, parseStateString, parseVaultData, reduce512To256LE, seed64ToKeypair, toAtomicAma, toBase58, uint8ArrayToArrayBuffer, uint8ArrayToBase64, validate, validateAddress, validateAmount, validateMnemonic, validatePassword, validateSeed, validateTokenSymbol };