{"_id":"@atlaschain/transactions","name":"@atlaschain/transactions","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"@atlaschain/transactions","version":"3.0.0","description":"Helpers for creating and serializing transactions","exports":{"edge-light":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"workerd":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"react-native":"./dist/index.native.mjs","types":"./dist/types/index.d.ts"},"browser":{"./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs"},"main":"./dist/index.node.cjs","module":"./dist/index.node.mjs","react-native":"./dist/index.native.mjs","types":"./dist/types/index.d.ts","type":"commonjs","sideEffects":false,"keywords":["blockchain","atlas","web3"],"author":{"name":"Atlas Chain Foundation"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anza-xyz/kit.git"},"bugs":{"url":"https://github.com/anza-xyz/kit/issues"},"browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@atlaschain/addresses":"3.0.0","@atlaschain/codecs-core":"3.0.0","@atlaschain/codecs-strings":"3.0.0","@atlaschain/codecs-numbers":"3.0.0","@atlaschain/codecs-data-structures":"3.0.0","@atlaschain/keys":"3.0.0","@atlaschain/instructions":"3.0.0","@atlaschain/errors":"3.0.0","@atlaschain/functional":"3.0.0","@atlaschain/rpc-types":"3.0.0","@atlaschain/nominal-types":"3.0.1","@atlaschain/transaction-messages":"3.0.0"},"peerDependencies":{"typescript":">=5.3.3"},"engines":{"node":">=20.18.0"},"scripts":{"compile:docs":"typedoc","compile:js":"tsup --config build-scripts/tsup.config.package.ts","compile:typedefs":"tsc -p ./tsconfig.declarations.json","dev":"jest -c ../../node_modules/@atlaschain/test-config/jest-dev.config.ts --rootDir . --watch","publish-impl":"npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ -n \"${GITHUB_OUTPUT:-}\" ] && echo 'published=true' >> \"$GITHUB_OUTPUT\") || true) && (([ \"$PUBLISH_TAG\" != \"canary\" ] && ../build-scripts/maybe-tag-latest.ts $npm_package_name@$npm_package_version) || true))","publish-packages":"pnpm prepublishOnly && pnpm publish-impl","style:fix":"pnpm eslint --fix src && pnpm prettier --log-level warn --ignore-unknown --write ./*","test:lint":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@atlaschain/test-config/jest-lint.config.ts --rootDir . --silent","test:prettier":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@atlaschain/test-config/jest-prettier.config.ts --rootDir . --silent","test:treeshakability:browser":"agadoo dist/index.browser.mjs","test:treeshakability:native":"agadoo dist/index.native.mjs","test:treeshakability:node":"agadoo dist/index.node.mjs","test:typecheck":"tsc --noEmit","test:unit:browser":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@atlaschain/test-config/jest-unit.config.browser.ts --rootDir . --silent","test:unit:node":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@atlaschain/test-config/jest-unit.config.node.ts --rootDir . --silent"},"_id":"@atlaschain/transactions@3.0.0","homepage":"https://github.com/anza-xyz/kit#readme","_integrity":"sha512-4W4morHF6cOCVk/gdwt/ycaxLQALKWBgW7BisFjJdeCQjDd+RneH5StA8BBL3TCF4i/UOv/ohtOcV7yVjt4vQQ==","_resolved":"/private/var/folders/q8/nr55p0wd491c6fjmbky17kd00000gn/T/933bebd8e64b706ce6cf42774a97271b/atlaschain-transactions-3.0.0.tgz","_from":"file:atlaschain-transactions-3.0.0.tgz","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-4W4morHF6cOCVk/gdwt/ycaxLQALKWBgW7BisFjJdeCQjDd+RneH5StA8BBL3TCF4i/UOv/ohtOcV7yVjt4vQQ==","shasum":"6a3b46a51cdfb6a44ed5800493eb25461d261a01","tarball":"https://registry.npmjs.org/@atlaschain/transactions/-/transactions-3.0.0.tgz","fileCount":5,"unpackedSize":15474,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH9z3i2WSG8wd7XYrLpwxzVjAfqKFjhBIqF01nFSTsiHAiANTPdl1GyiMM0/qZ9HoOfIJHvSRKgCLiZDSLBeCEevVg=="}]},"_npmUser":{"name":"atlaschain","email":"jq@atlaschain.org"},"directories":{},"maintainers":[{"name":"atlaschain","email":"jq@atlaschain.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/transactions_3.0.0_1764611555063_0.7442068440949645"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-01T17:52:34.992Z","3.0.0":"2025-12-01T17:52:35.258Z","modified":"2025-12-01T17:52:35.834Z"},"maintainers":[{"name":"atlaschain","email":"jq@atlaschain.org"}],"description":"Helpers for creating and serializing transactions","homepage":"https://github.com/anza-xyz/kit#readme","keywords":["blockchain","atlas","web3"],"repository":{"type":"git","url":"git+https://github.com/anza-xyz/kit.git"},"author":{"name":"Atlas Chain Foundation"},"bugs":{"url":"https://github.com/anza-xyz/kit/issues"},"license":"MIT","readme":"[![npm][npm-image]][npm-url]\n[![npm-downloads][npm-downloads-image]][npm-url]\n<br />\n[![code-style-prettier][code-style-prettier-image]][code-style-prettier-url]\n\n[code-style-prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\n[code-style-prettier-url]: https://github.com/prettier/prettier\n[npm-downloads-image]: https://img.shields.io/npm/dm/@atlas/transactions?style=flat\n[npm-image]: https://img.shields.io/npm/v/@atlas/transactions?style=flat\n[npm-url]: https://www.npmjs.com/package/@atlas/transactions\n\n# @atlas/transactions\n\nThis package contains types and functions for compiling, signing and sending transactions. It can be used standalone, but it is also exported as part of Kit [`@atlas/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).\n\nTransactions are created by compiling a transaction message. They must then be signed before being submitted to the network.\n\n## Compiling a transaction\n\n### Functions\n\n#### `compileTransaction()`\n\nGiven a `TransactionMessage`, this function returns a `Transaction` object. This includes the compiled bytes of the transaction message, and a map of signatures. This map will have a key for each address that is required to sign the transaction. The transaction will not yet have signatures for any of these addresses.\n\nWhether a transaction message is ready to be compiled or not is enforced for you at the type level. In order to be signable, a transaction message must:\n\n- have a version and a list of zero or more instructions (ie. conform to `BaseTransactionMessage`)\n- have a fee payer set (ie. conform to `TransactionMessageWithFeePayer`)\n- have a lifetime specified (ie. conform to `TransactionMessageWithBlockhashLifetime | TransactionMessageWithDurableNonceLifetime`)\n\n## Signing transactions\n\nIn order to be landed on the network, a transaction must be signed by all of the private keys belonging to accounts that are required signers of the transaction.\n\n### Types\n\n#### `FullySignedTransaction`\n\nThis type represents a transaction that is signed by all of its required signers.\n\n#### `TransactionWithSizeLimit`\n\nThis type represents a transaction that is under or equal to the maximum size limit for transactions on the Atlas network.\n\n#### `SendableTransaction`\n\nThis type represents a transaction that has all the required conditions to be sent to the network. Namely:\n\n- It must be fully signed (ie. conform to `FullySignedTransaction`)\n- It must be within size limit (ie. conform to `TransactionWithSizeLimit`)\n\nThe `SendableTransaction` type is a prerequisite of functions designed to land transactions on the network.\n\n### Functions\n\n#### `getSignatureFromTransaction()`\n\nGiven a transaction signed by its fee payer, this method will return the `Signature` that uniquely identifies it. This string can be used to look up transactions at a later date, for example on a Atlas block explorer.\n\n```ts\nimport { getSignatureFromTransaction } from '@atlas/transactions';\n\nconst signature = getSignatureFromTransaction(tx);\nconsole.debug(`Inspect this transaction at https://explorer.atlas.com/tx/${signature}`);\n```\n\n### `signTransaction()`\n\nGiven an array of `CryptoKey` objects which are private keys pertaining to addresses that are required to sign a transaction, this method will return a new signed transaction of type `FullySignedTransaction`. This function will throw unless the resulting transaction is fully signed.\n\n```ts\nimport { generateKeyPair } from '@atlas/keys';\nimport { signTransaction } from '@atlas/transactions';\n\nconst signedTransaction = await signTransaction([myPrivateKey], tx);\n```\n\n### `partiallySignTransaction()`\n\nThis function is the same as `signTransaction()` but does not require the transaction to be signed by all signers. A partially signed transaction cannot be landed on the network, but can be serialized and deserialized.\n\n## Serializing transactions\n\nBefore sending a transaction to be landed on the network, you must serialize it in a particular way. You can use these types and functions to serialize a signed transaction into a binary format suitable for transit over the wire.\n\n### Types\n\n#### `Base64EncodedWireTransaction`\n\nThis type represents the wire format of a transaction as a base64-encoded string.\n\n### Functions\n\n#### `getBase64EncodedWireTransaction()`\n\nGiven a signed transaction, this method returns the transaction as a string that conforms to the `Base64EncodedWireTransaction` type.\n\n```ts\nimport { getBase64EncodedWireTransaction, signTransaction } from '@atlas/transactions';\n\nconst serializedTransaction = getBase64EncodedWireTransaction(signedTransaction);\nconst signature = await rpc.sendTransaction(serializedTransaction, { encoding: 'base64' }).send();\n```\n","readmeFilename":"README.md","_rev":"1-5ef8a43f9eee0a94b381fb67038beb0b"}