passkey-kit 0.12.1 → 0.14.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 (172) hide show
  1. package/README.md +408 -227
  2. package/{types → dist}/base.d.ts +1 -0
  3. package/dist/base.d.ts.map +1 -0
  4. package/{src/base.ts → dist/base.js} +8 -10
  5. package/dist/base.js.map +1 -0
  6. package/dist/base64url.d.ts +18 -0
  7. package/dist/base64url.d.ts.map +1 -0
  8. package/dist/base64url.js +18 -0
  9. package/dist/base64url.js.map +1 -0
  10. package/dist/constants.d.ts +91 -0
  11. package/dist/constants.d.ts.map +1 -0
  12. package/dist/constants.js +115 -0
  13. package/dist/constants.js.map +1 -0
  14. package/dist/contract-errors.d.ts +69 -0
  15. package/dist/contract-errors.d.ts.map +1 -0
  16. package/dist/contract-errors.js +132 -0
  17. package/dist/contract-errors.js.map +1 -0
  18. package/dist/errors.d.ts +163 -0
  19. package/dist/errors.d.ts.map +1 -0
  20. package/dist/errors.js +244 -0
  21. package/dist/errors.js.map +1 -0
  22. package/dist/events.d.ts +94 -0
  23. package/dist/events.d.ts.map +1 -0
  24. package/dist/events.js +92 -0
  25. package/dist/events.js.map +1 -0
  26. package/dist/index.d.ts +22 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +36 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/indexer/codec.d.ts +18 -0
  31. package/dist/indexer/codec.d.ts.map +1 -0
  32. package/dist/indexer/codec.js +32 -0
  33. package/dist/indexer/codec.js.map +1 -0
  34. package/dist/indexer/index.d.ts +25 -0
  35. package/dist/indexer/index.d.ts.map +1 -0
  36. package/dist/indexer/index.js +34 -0
  37. package/dist/indexer/index.js.map +1 -0
  38. package/dist/indexer/mercury.d.ts +94 -0
  39. package/dist/indexer/mercury.d.ts.map +1 -0
  40. package/dist/indexer/mercury.js +245 -0
  41. package/dist/indexer/mercury.js.map +1 -0
  42. package/dist/indexer/stellar-indexer.d.ts +115 -0
  43. package/dist/indexer/stellar-indexer.d.ts.map +1 -0
  44. package/dist/indexer/stellar-indexer.js +279 -0
  45. package/dist/indexer/stellar-indexer.js.map +1 -0
  46. package/dist/indexer/types.d.ts +73 -0
  47. package/dist/indexer/types.d.ts.map +1 -0
  48. package/dist/indexer/types.js +9 -0
  49. package/dist/indexer/types.js.map +1 -0
  50. package/dist/kit/auth-payload.d.ts +106 -0
  51. package/dist/kit/auth-payload.d.ts.map +1 -0
  52. package/dist/kit/auth-payload.js +227 -0
  53. package/dist/kit/auth-payload.js.map +1 -0
  54. package/dist/kit/deploy-ops.d.ts +45 -0
  55. package/dist/kit/deploy-ops.d.ts.map +1 -0
  56. package/dist/kit/deploy-ops.js +69 -0
  57. package/dist/kit/deploy-ops.js.map +1 -0
  58. package/dist/kit/tx-ops.d.ts +95 -0
  59. package/dist/kit/tx-ops.d.ts.map +1 -0
  60. package/dist/kit/tx-ops.js +125 -0
  61. package/dist/kit/tx-ops.js.map +1 -0
  62. package/dist/kit/wallet-ops.d.ts +59 -0
  63. package/dist/kit/wallet-ops.d.ts.map +1 -0
  64. package/dist/kit/wallet-ops.js +122 -0
  65. package/dist/kit/wallet-ops.js.map +1 -0
  66. package/dist/kit/webauthn-ops.d.ts +55 -0
  67. package/dist/kit/webauthn-ops.d.ts.map +1 -0
  68. package/dist/kit/webauthn-ops.js +79 -0
  69. package/dist/kit/webauthn-ops.js.map +1 -0
  70. package/dist/kit.d.ts +132 -0
  71. package/dist/kit.d.ts.map +1 -0
  72. package/dist/kit.js +290 -0
  73. package/dist/kit.js.map +1 -0
  74. package/dist/managers/credential-manager.d.ts +39 -0
  75. package/dist/managers/credential-manager.d.ts.map +1 -0
  76. package/dist/managers/credential-manager.js +47 -0
  77. package/dist/managers/credential-manager.js.map +1 -0
  78. package/dist/managers/index.d.ts +7 -0
  79. package/dist/managers/index.d.ts.map +1 -0
  80. package/dist/managers/index.js +7 -0
  81. package/dist/managers/index.js.map +1 -0
  82. package/dist/managers/signer-manager.d.ts +62 -0
  83. package/dist/managers/signer-manager.d.ts.map +1 -0
  84. package/dist/managers/signer-manager.js +111 -0
  85. package/dist/managers/signer-manager.js.map +1 -0
  86. package/dist/managers/submission-manager.d.ts +52 -0
  87. package/dist/managers/submission-manager.d.ts.map +1 -0
  88. package/dist/managers/submission-manager.js +77 -0
  89. package/dist/managers/submission-manager.js.map +1 -0
  90. package/dist/relayer.d.ts +61 -0
  91. package/dist/relayer.d.ts.map +1 -0
  92. package/dist/relayer.js +122 -0
  93. package/dist/relayer.js.map +1 -0
  94. package/dist/rpc-data.d.ts +45 -0
  95. package/dist/rpc-data.d.ts.map +1 -0
  96. package/dist/rpc-data.js +61 -0
  97. package/dist/rpc-data.js.map +1 -0
  98. package/dist/sac.d.ts +31 -0
  99. package/dist/sac.d.ts.map +1 -0
  100. package/dist/sac.js +47 -0
  101. package/dist/sac.js.map +1 -0
  102. package/dist/server.d.ts +79 -0
  103. package/dist/server.d.ts.map +1 -0
  104. package/dist/server.js +152 -0
  105. package/dist/server.js.map +1 -0
  106. package/dist/signers.d.ts +83 -0
  107. package/dist/signers.d.ts.map +1 -0
  108. package/dist/signers.js +124 -0
  109. package/dist/signers.js.map +1 -0
  110. package/dist/storage/index.d.ts +13 -0
  111. package/dist/storage/index.d.ts.map +1 -0
  112. package/dist/storage/index.js +12 -0
  113. package/dist/storage/index.js.map +1 -0
  114. package/dist/storage/indexeddb.d.ts +26 -0
  115. package/dist/storage/indexeddb.d.ts.map +1 -0
  116. package/dist/storage/indexeddb.js +100 -0
  117. package/dist/storage/indexeddb.js.map +1 -0
  118. package/dist/storage/localStorage.d.ts +22 -0
  119. package/dist/storage/localStorage.d.ts.map +1 -0
  120. package/dist/storage/localStorage.js +86 -0
  121. package/dist/storage/localStorage.js.map +1 -0
  122. package/dist/storage/memory.d.ts +18 -0
  123. package/dist/storage/memory.d.ts.map +1 -0
  124. package/dist/storage/memory.js +41 -0
  125. package/dist/storage/memory.js.map +1 -0
  126. package/dist/types.d.ts +136 -0
  127. package/dist/types.d.ts.map +1 -0
  128. package/dist/types.js +39 -0
  129. package/dist/types.js.map +1 -0
  130. package/dist/utils.d.ts +72 -0
  131. package/dist/utils.d.ts.map +1 -0
  132. package/dist/utils.js +253 -0
  133. package/dist/utils.js.map +1 -0
  134. package/dist/validation.d.ts +42 -0
  135. package/dist/validation.d.ts.map +1 -0
  136. package/dist/validation.js +75 -0
  137. package/dist/validation.js.map +1 -0
  138. package/dist/version.d.ts +7 -0
  139. package/dist/version.d.ts.map +1 -0
  140. package/dist/version.js +9 -0
  141. package/dist/version.js.map +1 -0
  142. package/package.json +47 -20
  143. package/.claude/settings.local.json +0 -20
  144. package/.cursorrules +0 -170
  145. package/.gitattributes +0 -2
  146. package/.github/workflows/release.yml +0 -21
  147. package/.vscode/settings.json +0 -6
  148. package/PROPOSAL.md +0 -397
  149. package/cheatsheet.txt +0 -18
  150. package/clone-js-sdk.sh +0 -21
  151. package/packages/passkey-kit-sdk/README.md +0 -54
  152. package/packages/passkey-kit-sdk/package.json +0 -21
  153. package/packages/passkey-kit-sdk/src/index.ts +0 -171
  154. package/packages/passkey-kit-sdk/tsconfig.json +0 -98
  155. package/packages/passkey-kit-sdk/types/index.d.ts +0 -190
  156. package/packages/sac-sdk/README.md +0 -54
  157. package/packages/sac-sdk/package.json +0 -21
  158. package/packages/sac-sdk/src/index.ts +0 -586
  159. package/packages/sac-sdk/tsconfig.json +0 -98
  160. package/packages/sac-sdk/types/index.d.ts +0 -532
  161. package/pnpm-workspace.yaml +0 -2
  162. package/src/index.ts +0 -5
  163. package/src/kit.ts +0 -823
  164. package/src/sac.ts +0 -29
  165. package/src/server.ts +0 -179
  166. package/src/types.ts +0 -32
  167. package/tsconfig.json +0 -28
  168. package/types/index.d.ts +0 -5
  169. package/types/kit.d.ts +0 -95
  170. package/types/sac.d.ts +0 -13
  171. package/types/server.d.ts +0 -29
  172. package/types/types.d.ts +0 -22
@@ -1,98 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
- /* Projects */
5
- // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
6
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
7
- // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
8
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
9
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
10
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
11
- /* Language and Environment */
12
- "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
13
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
14
- // "jsx": "preserve", /* Specify what JSX code is generated. */
15
- // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
16
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
17
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
18
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
19
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
20
- // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
21
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
22
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
23
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
24
- /* Modules */
25
- "module": "NodeNext", /* Specify what module code is generated. */
26
- // "rootDir": "./", /* Specify the root folder within your source files. */
27
- "moduleResolution": "nodenext", /* Specify how TypeScript looks up a file from a given module specifier. */
28
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
29
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
30
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
31
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
32
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
33
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
34
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
35
- // "resolveJsonModule": true, /* Enable importing .json files. */
36
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
37
- /* JavaScript Support */
38
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
39
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
40
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
41
- /* Emit */
42
- "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
43
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
44
- "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
45
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
46
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
47
- "outDir": "./types", /* Specify an output folder for all emitted files. */
48
- // "removeComments": true, /* Disable emitting comments. */
49
- // "noEmit": true, /* Disable emitting files from a compilation. */
50
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
51
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
52
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
53
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
54
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
55
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
56
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
57
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
58
- // "newLine": "crlf", /* Set the newline character for emitting files. */
59
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
60
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
61
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
62
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
63
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
64
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
65
- /* Interop Constraints */
66
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
67
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
68
- // "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
69
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
70
- // "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
71
- /* Type Checking */
72
- // "strict": true, /* Enable all strict type-checking options. */
73
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
74
- "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
75
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
76
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
77
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
78
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
79
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
80
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
81
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
82
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
83
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
84
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
85
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
86
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
87
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
88
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
89
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
90
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
91
- /* Completeness */
92
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
93
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
94
- },
95
- "include": [
96
- "src/*"
97
- ]
98
- }
@@ -1,532 +0,0 @@
1
- import { Buffer } from "buffer";
2
- import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from '@stellar/stellar-sdk/contract';
3
- import type { u32, i128 } from '@stellar/stellar-sdk/contract';
4
- export interface Client {
5
- /**
6
- * Construct and simulate a allowance transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
7
- * Returns the allowance for `spender` to transfer from `from`.
8
- *
9
- * The amount returned is the amount that spender is allowed to transfer
10
- * out of from's balance. When the spender transfers amounts, the allowance
11
- * will be reduced by the amount transferred.
12
- *
13
- * # Arguments
14
- *
15
- * * `from` - The address holding the balance of tokens to be drawn from.
16
- * * `spender` - The address spending the tokens held by `from`.
17
- */
18
- allowance: ({ from, spender }: {
19
- from: string;
20
- spender: string;
21
- }, options?: {
22
- /**
23
- * The fee to pay for the transaction. Default: BASE_FEE
24
- */
25
- fee?: number;
26
- /**
27
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
28
- */
29
- timeoutInSeconds?: number;
30
- /**
31
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
32
- */
33
- simulate?: boolean;
34
- }) => Promise<AssembledTransaction<i128>>;
35
- /**
36
- * Construct and simulate a authorized transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
37
- * Returns true if `id` is authorized to use its balance.
38
- *
39
- * # Arguments
40
- *
41
- * * `id` - The address for which token authorization is being checked.
42
- */
43
- authorized: ({ id }: {
44
- id: string;
45
- }, options?: {
46
- /**
47
- * The fee to pay for the transaction. Default: BASE_FEE
48
- */
49
- fee?: number;
50
- /**
51
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
52
- */
53
- timeoutInSeconds?: number;
54
- /**
55
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
56
- */
57
- simulate?: boolean;
58
- }) => Promise<AssembledTransaction<boolean>>;
59
- /**
60
- * Construct and simulate a approve transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
61
- * Set the allowance by `amount` for `spender` to transfer/burn from
62
- * `from`.
63
- *
64
- * The amount set is the amount that spender is approved to transfer out of
65
- * from's balance. The spender will be allowed to transfer amounts, and
66
- * when an amount is transferred the allowance will be reduced by the
67
- * amount transferred.
68
- *
69
- * # Arguments
70
- *
71
- * * `from` - The address holding the balance of tokens to be drawn from.
72
- * * `spender` - The address being authorized to spend the tokens held by
73
- * `from`.
74
- * * `amount` - The tokens to be made available to `spender`.
75
- * * `expiration_ledger` - The ledger number where this allowance expires. Cannot
76
- * be less than the current ledger number unless the amount is being set to 0.
77
- * An expired entry (where expiration_ledger < the current ledger number)
78
- * should be treated as a 0 amount allowance.
79
- *
80
- * # Events
81
- *
82
- * Emits an event with topics `["approve", from: Address,
83
- * spender: Address], data = [amount: i128, expiration_ledger: u32]`
84
- */
85
- approve: ({ from, spender, amount, expiration_ledger }: {
86
- from: string;
87
- spender: string;
88
- amount: i128;
89
- expiration_ledger: u32;
90
- }, options?: {
91
- /**
92
- * The fee to pay for the transaction. Default: BASE_FEE
93
- */
94
- fee?: number;
95
- /**
96
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
97
- */
98
- timeoutInSeconds?: number;
99
- /**
100
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
101
- */
102
- simulate?: boolean;
103
- }) => Promise<AssembledTransaction<null>>;
104
- /**
105
- * Construct and simulate a balance transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
106
- * Returns the balance of `id`.
107
- *
108
- * # Arguments
109
- *
110
- * * `id` - The address for which a balance is being queried. If the
111
- * address has no existing balance, returns 0.
112
- */
113
- balance: ({ id }: {
114
- id: string;
115
- }, options?: {
116
- /**
117
- * The fee to pay for the transaction. Default: BASE_FEE
118
- */
119
- fee?: number;
120
- /**
121
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
122
- */
123
- timeoutInSeconds?: number;
124
- /**
125
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
126
- */
127
- simulate?: boolean;
128
- }) => Promise<AssembledTransaction<i128>>;
129
- /**
130
- * Construct and simulate a burn transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
131
- * Burn `amount` from `from`.
132
- *
133
- * Reduces from's balance by the amount, without transferring the balance
134
- * to another holder's balance.
135
- *
136
- * # Arguments
137
- *
138
- * * `from` - The address holding the balance of tokens which will be
139
- * burned from.
140
- * * `amount` - The amount of tokens to be burned.
141
- *
142
- * # Events
143
- *
144
- * Emits an event with topics `["burn", from: Address], data = amount:
145
- * i128`
146
- */
147
- burn: ({ from, amount }: {
148
- from: string;
149
- amount: i128;
150
- }, options?: {
151
- /**
152
- * The fee to pay for the transaction. Default: BASE_FEE
153
- */
154
- fee?: number;
155
- /**
156
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
157
- */
158
- timeoutInSeconds?: number;
159
- /**
160
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
161
- */
162
- simulate?: boolean;
163
- }) => Promise<AssembledTransaction<null>>;
164
- /**
165
- * Construct and simulate a burn_from transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
166
- * Burn `amount` from `from`, consuming the allowance of `spender`.
167
- *
168
- * Reduces from's balance by the amount, without transferring the balance
169
- * to another holder's balance.
170
- *
171
- * The spender will be allowed to burn the amount from from's balance, if
172
- * the amount is less than or equal to the allowance that the spender has
173
- * on the from's balance. The spender's allowance on from's balance will be
174
- * reduced by the amount.
175
- *
176
- * # Arguments
177
- *
178
- * * `spender` - The address authorizing the burn, and having its allowance
179
- * consumed during the burn.
180
- * * `from` - The address holding the balance of tokens which will be
181
- * burned from.
182
- * * `amount` - The amount of tokens to be burned.
183
- *
184
- * # Events
185
- *
186
- * Emits an event with topics `["burn", from: Address], data = amount:
187
- * i128`
188
- */
189
- burn_from: ({ spender, from, amount }: {
190
- spender: string;
191
- from: string;
192
- amount: i128;
193
- }, options?: {
194
- /**
195
- * The fee to pay for the transaction. Default: BASE_FEE
196
- */
197
- fee?: number;
198
- /**
199
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
200
- */
201
- timeoutInSeconds?: number;
202
- /**
203
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
204
- */
205
- simulate?: boolean;
206
- }) => Promise<AssembledTransaction<null>>;
207
- /**
208
- * Construct and simulate a clawback transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
209
- * Clawback `amount` from `from` account. `amount` is burned in the
210
- * clawback process.
211
- *
212
- * # Arguments
213
- *
214
- * * `from` - The address holding the balance from which the clawback will
215
- * take tokens.
216
- * * `amount` - The amount of tokens to be clawed back.
217
- *
218
- * # Events
219
- *
220
- * Emits an event with topics `["clawback", admin: Address, to: Address],
221
- * data = amount: i128`
222
- */
223
- clawback: ({ from, amount }: {
224
- from: string;
225
- amount: i128;
226
- }, options?: {
227
- /**
228
- * The fee to pay for the transaction. Default: BASE_FEE
229
- */
230
- fee?: number;
231
- /**
232
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
233
- */
234
- timeoutInSeconds?: number;
235
- /**
236
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
237
- */
238
- simulate?: boolean;
239
- }) => Promise<AssembledTransaction<null>>;
240
- /**
241
- * Construct and simulate a decimals transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
242
- * Returns the number of decimals used to represent amounts of this token.
243
- *
244
- * # Panics
245
- *
246
- * If the contract has not yet been initialized.
247
- */
248
- decimals: (options?: {
249
- /**
250
- * The fee to pay for the transaction. Default: BASE_FEE
251
- */
252
- fee?: number;
253
- /**
254
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
255
- */
256
- timeoutInSeconds?: number;
257
- /**
258
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
259
- */
260
- simulate?: boolean;
261
- }) => Promise<AssembledTransaction<u32>>;
262
- /**
263
- * Construct and simulate a mint transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
264
- * Mints `amount` to `to`.
265
- *
266
- * # Arguments
267
- *
268
- * * `to` - The address which will receive the minted tokens.
269
- * * `amount` - The amount of tokens to be minted.
270
- *
271
- * # Events
272
- *
273
- * Emits an event with topics `["mint", admin: Address, to: Address], data
274
- * = amount: i128`
275
- */
276
- mint: ({ to, amount }: {
277
- to: string;
278
- amount: i128;
279
- }, options?: {
280
- /**
281
- * The fee to pay for the transaction. Default: BASE_FEE
282
- */
283
- fee?: number;
284
- /**
285
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
286
- */
287
- timeoutInSeconds?: number;
288
- /**
289
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
290
- */
291
- simulate?: boolean;
292
- }) => Promise<AssembledTransaction<null>>;
293
- /**
294
- * Construct and simulate a name transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
295
- * Returns the name for this token.
296
- *
297
- * # Panics
298
- *
299
- * If the contract has not yet been initialized.
300
- */
301
- name: (options?: {
302
- /**
303
- * The fee to pay for the transaction. Default: BASE_FEE
304
- */
305
- fee?: number;
306
- /**
307
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
308
- */
309
- timeoutInSeconds?: number;
310
- /**
311
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
312
- */
313
- simulate?: boolean;
314
- }) => Promise<AssembledTransaction<string>>;
315
- /**
316
- * Construct and simulate a set_admin transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
317
- * Sets the administrator to the specified address `new_admin`.
318
- *
319
- * # Arguments
320
- *
321
- * * `new_admin` - The address which will henceforth be the administrator
322
- * of this token contract.
323
- *
324
- * # Events
325
- *
326
- * Emits an event with topics `["set_admin", admin: Address], data =
327
- * [new_admin: Address]`
328
- */
329
- set_admin: ({ new_admin }: {
330
- new_admin: string;
331
- }, options?: {
332
- /**
333
- * The fee to pay for the transaction. Default: BASE_FEE
334
- */
335
- fee?: number;
336
- /**
337
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
338
- */
339
- timeoutInSeconds?: number;
340
- /**
341
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
342
- */
343
- simulate?: boolean;
344
- }) => Promise<AssembledTransaction<null>>;
345
- /**
346
- * Construct and simulate a admin transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
347
- * Returns the admin of the contract.
348
- *
349
- * # Panics
350
- *
351
- * If the admin is not set.
352
- */
353
- admin: (options?: {
354
- /**
355
- * The fee to pay for the transaction. Default: BASE_FEE
356
- */
357
- fee?: number;
358
- /**
359
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
360
- */
361
- timeoutInSeconds?: number;
362
- /**
363
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
364
- */
365
- simulate?: boolean;
366
- }) => Promise<AssembledTransaction<string>>;
367
- /**
368
- * Construct and simulate a set_authorized transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
369
- * Sets whether the account is authorized to use its balance. If
370
- * `authorized` is true, `id` should be able to use its balance.
371
- *
372
- * # Arguments
373
- *
374
- * * `id` - The address being (de-)authorized.
375
- * * `authorize` - Whether or not `id` can use its balance.
376
- *
377
- * # Events
378
- *
379
- * Emits an event with topics `["set_authorized", id: Address], data =
380
- * [authorize: bool]`
381
- */
382
- set_authorized: ({ id, authorize }: {
383
- id: string;
384
- authorize: boolean;
385
- }, options?: {
386
- /**
387
- * The fee to pay for the transaction. Default: BASE_FEE
388
- */
389
- fee?: number;
390
- /**
391
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
392
- */
393
- timeoutInSeconds?: number;
394
- /**
395
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
396
- */
397
- simulate?: boolean;
398
- }) => Promise<AssembledTransaction<null>>;
399
- /**
400
- * Construct and simulate a symbol transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
401
- * Returns the symbol for this token.
402
- *
403
- * # Panics
404
- *
405
- * If the contract has not yet been initialized.
406
- */
407
- symbol: (options?: {
408
- /**
409
- * The fee to pay for the transaction. Default: BASE_FEE
410
- */
411
- fee?: number;
412
- /**
413
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
414
- */
415
- timeoutInSeconds?: number;
416
- /**
417
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
418
- */
419
- simulate?: boolean;
420
- }) => Promise<AssembledTransaction<string>>;
421
- /**
422
- * Construct and simulate a transfer transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
423
- * Transfer `amount` from `from` to `to`.
424
- *
425
- * # Arguments
426
- *
427
- * * `from` - The address holding the balance of tokens which will be
428
- * withdrawn from.
429
- * * `to` - The address which will receive the transferred tokens.
430
- * * `amount` - The amount of tokens to be transferred.
431
- *
432
- * # Events
433
- *
434
- * Emits an event with topics `["transfer", from: Address, to: Address],
435
- * data = amount: i128`
436
- */
437
- transfer: ({ from, to, amount }: {
438
- from: string;
439
- to: string;
440
- amount: i128;
441
- }, options?: {
442
- /**
443
- * The fee to pay for the transaction. Default: BASE_FEE
444
- */
445
- fee?: number;
446
- /**
447
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
448
- */
449
- timeoutInSeconds?: number;
450
- /**
451
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
452
- */
453
- simulate?: boolean;
454
- }) => Promise<AssembledTransaction<null>>;
455
- /**
456
- * Construct and simulate a transfer_from transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
457
- * Transfer `amount` from `from` to `to`, consuming the allowance that
458
- * `spender` has on `from`'s balance. Authorized by spender
459
- * (`spender.require_auth()`).
460
- *
461
- * The spender will be allowed to transfer the amount from from's balance
462
- * if the amount is less than or equal to the allowance that the spender
463
- * has on the from's balance. The spender's allowance on from's balance
464
- * will be reduced by the amount.
465
- *
466
- * # Arguments
467
- *
468
- * * `spender` - The address authorizing the transfer, and having its
469
- * allowance consumed during the transfer.
470
- * * `from` - The address holding the balance of tokens which will be
471
- * withdrawn from.
472
- * * `to` - The address which will receive the transferred tokens.
473
- * * `amount` - The amount of tokens to be transferred.
474
- *
475
- * # Events
476
- *
477
- * Emits an event with topics `["transfer", from: Address, to: Address],
478
- * data = amount: i128`
479
- */
480
- transfer_from: ({ spender, from, to, amount }: {
481
- spender: string;
482
- from: string;
483
- to: string;
484
- amount: i128;
485
- }, options?: {
486
- /**
487
- * The fee to pay for the transaction. Default: BASE_FEE
488
- */
489
- fee?: number;
490
- /**
491
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
492
- */
493
- timeoutInSeconds?: number;
494
- /**
495
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
496
- */
497
- simulate?: boolean;
498
- }) => Promise<AssembledTransaction<null>>;
499
- }
500
- export declare class Client extends ContractClient {
501
- readonly options: ContractClientOptions;
502
- static deploy<T = Client>(
503
- /** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
504
- options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
505
- /** The hash of the Wasm blob, which must already be installed on-chain. */
506
- wasmHash: Buffer | string;
507
- /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
508
- salt?: Buffer | Uint8Array;
509
- /** The format used to decode `wasmHash`, if it's provided as a string. */
510
- format?: "hex" | "base64";
511
- address?: string;
512
- }): Promise<AssembledTransaction<T>>;
513
- constructor(options: ContractClientOptions);
514
- readonly fromJSON: {
515
- allowance: (json: string) => AssembledTransaction<bigint>;
516
- authorized: (json: string) => AssembledTransaction<boolean>;
517
- approve: (json: string) => AssembledTransaction<null>;
518
- balance: (json: string) => AssembledTransaction<bigint>;
519
- burn: (json: string) => AssembledTransaction<null>;
520
- burn_from: (json: string) => AssembledTransaction<null>;
521
- clawback: (json: string) => AssembledTransaction<null>;
522
- decimals: (json: string) => AssembledTransaction<number>;
523
- mint: (json: string) => AssembledTransaction<null>;
524
- name: (json: string) => AssembledTransaction<string>;
525
- set_admin: (json: string) => AssembledTransaction<null>;
526
- admin: (json: string) => AssembledTransaction<string>;
527
- set_authorized: (json: string) => AssembledTransaction<null>;
528
- symbol: (json: string) => AssembledTransaction<string>;
529
- transfer: (json: string) => AssembledTransaction<null>;
530
- transfer_from: (json: string) => AssembledTransaction<null>;
531
- };
532
- }
@@ -1,2 +0,0 @@
1
- packages:
2
- - 'packages/**'
package/src/index.ts DELETED
@@ -1,5 +0,0 @@
1
- export { SignerStore, SignerKey, type Signer, type SignerLimits } from './types'
2
- export { PasskeyKit } from "./kit"
3
- export { PasskeyServer } from "./server"
4
- export { SACClient } from "./sac"
5
- export { Client as PasskeyClient } from 'passkey-kit-sdk'