@solana/signers 2.0.0-experimental.feaeef2 → 2.0.0-preview.1

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 (34) hide show
  1. package/dist/index.browser.cjs.map +1 -1
  2. package/dist/index.browser.js.map +1 -1
  3. package/dist/index.native.js.map +1 -1
  4. package/dist/index.node.cjs.map +1 -1
  5. package/dist/index.node.js.map +1 -1
  6. package/dist/types/account-signer-meta.d.ts +1 -1
  7. package/dist/types/account-signer-meta.d.ts.map +1 -1
  8. package/dist/types/add-signers.d.ts +2 -2
  9. package/dist/types/add-signers.d.ts.map +1 -1
  10. package/dist/types/fee-payer-signer.d.ts +2 -2
  11. package/dist/types/fee-payer-signer.d.ts.map +1 -1
  12. package/dist/types/keypair-signer.d.ts +2 -2
  13. package/dist/types/keypair-signer.d.ts.map +1 -1
  14. package/dist/types/message-modifying-signer.d.ts +2 -2
  15. package/dist/types/message-modifying-signer.d.ts.map +1 -1
  16. package/dist/types/message-partial-signer.d.ts +2 -2
  17. package/dist/types/message-partial-signer.d.ts.map +1 -1
  18. package/dist/types/message-signer.d.ts +3 -3
  19. package/dist/types/message-signer.d.ts.map +1 -1
  20. package/dist/types/sign-transaction.d.ts +2 -2
  21. package/dist/types/sign-transaction.d.ts.map +1 -1
  22. package/dist/types/signable-message.d.ts +1 -1
  23. package/dist/types/signable-message.d.ts.map +1 -1
  24. package/dist/types/transaction-modifying-signer.d.ts +2 -2
  25. package/dist/types/transaction-modifying-signer.d.ts.map +1 -1
  26. package/dist/types/transaction-partial-signer.d.ts +2 -2
  27. package/dist/types/transaction-partial-signer.d.ts.map +1 -1
  28. package/dist/types/transaction-sending-signer.d.ts +2 -2
  29. package/dist/types/transaction-sending-signer.d.ts.map +1 -1
  30. package/dist/types/transaction-signer.d.ts +3 -3
  31. package/dist/types/transaction-signer.d.ts.map +1 -1
  32. package/dist/types/transaction-with-single-sending-signer.d.ts +2 -2
  33. package/dist/types/transaction-with-single-sending-signer.d.ts.map +1 -1
  34. package/package.json +13 -13
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/deduplicate-signers.ts","../src/account-signer-meta.ts","../src/add-signers.ts","../src/fee-payer-signer.ts","../src/keypair-signer.ts","../src/message-partial-signer.ts","../src/transaction-partial-signer.ts","../src/message-modifying-signer.ts","../src/message-signer.ts","../src/noop-signer.ts","../src/sign-transaction.ts","../src/transaction-modifying-signer.ts","../src/transaction-sending-signer.ts","../src/transaction-signer.ts","../../text-encoding-impl/src/index.node.ts","../src/signable-message.ts","../src/transaction-with-single-sending-signer.ts"],"names":["out","SolanaError","transaction","TextDecoder","TextEncoder","SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING"],"mappings":";AACA,SAAS,4DAA4D,mBAAmB;AAMjF,SAAS,mBACZ,SACkB;AAClB,QAAM,eAAyC,CAAC;AAChD,UAAQ,QAAQ,YAAU;AACtB,QAAI,CAAC,aAAa,OAAO,OAAO,GAAG;AAC/B,mBAAa,OAAO,OAAO,IAAI;AAAA,IACnC,WAAW,aAAa,OAAO,OAAO,MAAM,QAAQ;AAChD,YAAM,IAAI,YAAY,4DAA4D;AAAA,QAC9E,SAAS,OAAO;AAAA,MACpB,CAAC;AAAA,IACL;AAAA,EACJ,CAAC;AACD,SAAO,OAAO,OAAO,YAAY;AACrC;;;ACeO,SAAS,0BACZ,aACkB;AAClB,SAAO;AAAA,KACF,YAAY,YAAY,CAAC,GAAG,QAAQ,aAAY,YAAY,UAAU,QAAQ,SAAS,CAAC,CAAE;AAAA,EAC/F;AACJ;AAGO,SAAS,0BAGd,aAA+C;AAC7C,SAAO,mBAAmB;AAAA,IACtB,GAAI,YAAY,iBAAiB,CAAC,YAAY,cAAc,IAAI,CAAC;AAAA,IACjE,GAAG,YAAY,aAAa,QAAQ,yBAAyB;AAAA,EACjE,CAAC;AACL;;;ACrDA,SAAuB,oBAAoB;AAQpC,SAAS,wBACZ,SACA,aACsC;AACtC,MAAI,CAAC,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AAW;AAA/B,IACMC,IAAc,WAAW;;;ACa/B,SAAS,sBACZ,SACA,aAAkC,CAAC,GACpB;AACf,SAAO,OAAO,OAAO;AAAA,IACjB,SAAS,OAAO,YAAY,WAAW,IAAI,EAAY,EAAE,OAAO,OAAO,IAAI;AAAA,IAC3E,YAAY,OAAO,OAAO,EAAE,GAAG,WAAW,CAAC;AAAA,EAC/C,CAAC;AACL;;;ACtBA;AAAA,EACI;AAAA,EACA,4DAAAC;AAAA,EACA,eAAAJ;AAAA,OACG;AAcA,SAAS,qCACZ,aACiE;AACjE,MAAI;AACA,+CAA2C,WAAW;AACtD,WAAO;AAAA,EACX,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;AAGO,SAAS,2CACZ,aACyE;AACzE,QAAM,UAAU,0BAA0B,WAAW;AACrD,QAAM,iBAAiB,QAAQ,OAAO,0BAA0B;AAEhE,MAAI,eAAe,WAAW,GAAG;AAC7B,UAAM,IAAIA,cAAYI,yDAAwD;AAAA,EAClF;AAKA,QAAM,qBAAqB,eAAe;AAAA,IACtC,YAAU,CAAC,2BAA2B,MAAM,KAAK,CAAC,6BAA6B,MAAM;AAAA,EACzF;AAEA,MAAI,mBAAmB,SAAS,GAAG;AAC/B,UAAM,IAAIJ,cAAY,sEAAsE;AAAA,EAChG;AACJ","sourcesContent":["import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS, SolanaError } from '@solana/errors';\n\nimport { MessageSigner } from './message-signer';\nimport { TransactionSigner } from './transaction-signer';\n\n/** Removes all duplicated signers from a provided array by comparing their addresses. */\nexport function deduplicateSigners<TSigner extends MessageSigner | TransactionSigner>(\n signers: readonly TSigner[],\n): readonly TSigner[] {\n const deduplicated: Record<Address, TSigner> = {};\n signers.forEach(signer => {\n if (!deduplicated[signer.address]) {\n deduplicated[signer.address] = signer;\n } else if (deduplicated[signer.address] !== signer) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS, {\n address: signer.address,\n });\n }\n });\n return Object.values(deduplicated);\n}\n","import { AccountRole, IAccountLookupMeta, IAccountMeta, IInstruction } from '@solana/instructions';\nimport { BaseTransaction, TransactionVersion } from '@solana/transactions';\n\nimport { deduplicateSigners } from './deduplicate-signers';\nimport { TransactionSigner } from './transaction-signer';\n\n/** An extension of the IAccountMeta type that keeps track of its transaction signer. */\nexport interface IAccountSignerMeta<\n TAddress extends string = string,\n TSigner extends TransactionSigner<TAddress> = TransactionSigner<TAddress>,\n> extends IAccountMeta<TAddress> {\n readonly role: AccountRole.READONLY_SIGNER | AccountRole.WRITABLE_SIGNER;\n readonly signer: TSigner;\n}\n\ntype IAccountMetaWithSigner<TSigner extends TransactionSigner = TransactionSigner> =\n | IAccountMeta\n | IAccountLookupMeta\n | IAccountSignerMeta<string, TSigner>;\n\n/** A variation of the instruction type that allows IAccountSignerMeta in its account metas. */\nexport type IInstructionWithSigners<\n TSigner extends TransactionSigner = TransactionSigner,\n TAccounts extends readonly IAccountMetaWithSigner<TSigner>[] = readonly IAccountMetaWithSigner<TSigner>[],\n> = Pick<IInstruction<string, TAccounts>, 'accounts'>;\n\n/** A variation of the transaction type that allows IAccountSignerMeta in its account metas. */\nexport type ITransactionWithSigners<\n TSigner extends TransactionSigner = TransactionSigner,\n TAccounts extends readonly IAccountMetaWithSigner<TSigner>[] = readonly IAccountMetaWithSigner<TSigner>[],\n> = Pick<\n BaseTransaction<TransactionVersion, IInstruction & IInstructionWithSigners<TSigner, TAccounts>>,\n 'instructions'\n> & { feePayerSigner?: TSigner };\n\n/** Extract all signers from an instruction that may contain IAccountSignerMeta accounts. */\nexport function getSignersFromInstruction<TSigner extends TransactionSigner = TransactionSigner>(\n instruction: IInstructionWithSigners<TSigner>,\n): readonly TSigner[] {\n return deduplicateSigners(\n (instruction.accounts ?? []).flatMap(account => ('signer' in account ? account.signer : [])),\n );\n}\n\n/** Extract all signers from a transaction that may contain IAccountSignerMeta accounts. */\nexport function getSignersFromTransaction<\n TSigner extends TransactionSigner = TransactionSigner,\n TTransaction extends ITransactionWithSigners<TSigner> = ITransactionWithSigners<TSigner>,\n>(transaction: TTransaction): readonly TSigner[] {\n return deduplicateSigners([\n ...(transaction.feePayerSigner ? [transaction.feePayerSigner] : []),\n ...transaction.instructions.flatMap(getSignersFromInstruction),\n ]);\n}\n","import { IInstruction, isSignerRole } from '@solana/instructions';\nimport { BaseTransaction } from '@solana/transactions';\n\nimport { IAccountSignerMeta, IInstructionWithSigners, ITransactionWithSigners } from './account-signer-meta';\nimport { deduplicateSigners } from './deduplicate-signers';\nimport { TransactionSigner } from './transaction-signer';\n\n/** Attaches the provided signers to the account metas of an instruction when applicable. */\nexport function addSignersToInstruction<TInstruction extends IInstruction>(\n signers: TransactionSigner[],\n instruction: TInstruction | (TInstruction & IInstructionWithSigners),\n): TInstruction & IInstructionWithSigners {\n if (!instruction.accounts || instruction.accounts.length === 0) {\n return instruction as TInstruction & IInstructionWithSigners;\n }\n\n const signerByAddress = new Map(deduplicateSigners(signers).map(signer => [signer.address, signer]));\n return Object.freeze({\n ...instruction,\n accounts: instruction.accounts.map(account => {\n const signer = signerByAddress.get(account.address);\n if (!isSignerRole(account.role) || 'signer' in account || !signer) {\n return account;\n }\n return Object.freeze({ ...account, signer } as IAccountSignerMeta);\n }),\n });\n}\n\n/** Attaches the provided signers to the account metas of a transaction when applicable. */\nexport function addSignersToTransaction<TTransaction extends BaseTransaction>(\n signers: TransactionSigner[],\n transaction: TTransaction | (TTransaction & ITransactionWithSigners),\n): TTransaction & ITransactionWithSigners {\n if (transaction.instructions.length === 0) {\n return transaction as TTransaction & ITransactionWithSigners;\n }\n\n return Object.freeze({\n ...transaction,\n instructions: transaction.instructions.map(instruction => addSignersToInstruction(signers, instruction)),\n });\n}\n","import { Address } from '@solana/addresses';\nimport {\n BaseTransaction,\n getUnsignedTransaction,\n ITransactionWithFeePayer,\n ITransactionWithSignatures,\n} from '@solana/transactions';\n\nimport { TransactionSigner } from './transaction-signer';\n\nexport interface ITransactionWithFeePayerSigner<\n TAddress extends string = string,\n TSigner extends TransactionSigner<TAddress> = TransactionSigner<TAddress>,\n> {\n readonly feePayer: Address<TAddress>;\n readonly feePayerSigner: TSigner;\n}\n\nexport function setTransactionFeePayerSigner<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(\n feePayerSigner: TransactionSigner<TFeePayerAddress>,\n transaction:\n | (TTransaction & ITransactionWithSignatures)\n | (TTransaction & ITransactionWithFeePayer<string> & ITransactionWithSignatures),\n): Omit<TTransaction, keyof ITransactionWithSignatures> & ITransactionWithFeePayerSigner<TFeePayerAddress>;\n\nexport function setTransactionFeePayerSigner<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(\n feePayerSigner: TransactionSigner<TFeePayerAddress>,\n transaction: TTransaction | (TTransaction & ITransactionWithFeePayer<string>),\n): TTransaction & ITransactionWithFeePayerSigner<TFeePayerAddress>;\n\nexport function setTransactionFeePayerSigner<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(\n feePayerSigner: TransactionSigner<TFeePayerAddress>,\n transaction:\n | TTransaction\n | (TTransaction & ITransactionWithFeePayer<string>)\n | (TTransaction & ITransactionWithSignatures)\n | (TTransaction & ITransactionWithFeePayer<string> & ITransactionWithSignatures),\n) {\n if ('feePayer' in transaction && feePayerSigner.address === transaction.feePayer) {\n if ('feePayerSigner' in transaction) return transaction;\n const out = { ...transaction, feePayerSigner };\n Object.freeze(out);\n return out;\n }\n const out = {\n ...getUnsignedTransaction(transaction),\n feePayer: feePayerSigner.address,\n feePayerSigner,\n };\n Object.freeze(out);\n return out;\n}\n","import { Address, getAddressFromPublicKey } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER, SolanaError } from '@solana/errors';\nimport { createKeyPairFromBytes, generateKeyPair, signBytes } from '@solana/keys';\nimport { partiallySignTransaction } from '@solana/transactions';\n\nimport { isMessagePartialSigner, MessagePartialSigner } from './message-partial-signer';\nimport { isTransactionPartialSigner, TransactionPartialSigner } from './transaction-partial-signer';\n\n/** Defines a signer capable of signing messages and transactions using a CryptoKeyPair. */\nexport type KeyPairSigner<TAddress extends string = string> = MessagePartialSigner<TAddress> &\n TransactionPartialSigner<TAddress> & { keyPair: CryptoKeyPair };\n\n/** Checks whether the provided value implements the {@link KeyPairSigner} interface. */\nexport function isKeyPairSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): value is KeyPairSigner<TAddress> {\n return (\n 'keyPair' in value &&\n typeof value.keyPair === 'object' &&\n isMessagePartialSigner(value) &&\n isTransactionPartialSigner(value)\n );\n}\n\n/** Asserts that the provided value implements the {@link KeyPairSigner} interface. */\nexport function assertIsKeyPairSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): asserts value is KeyPairSigner<TAddress> {\n if (!isKeyPairSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER, {\n address: value.address,\n });\n }\n}\n\n/** Creates a KeyPairSigner from the provided Crypto KeyPair. */\nexport async function createSignerFromKeyPair(keyPair: CryptoKeyPair): Promise<KeyPairSigner> {\n const address = await getAddressFromPublicKey(keyPair.publicKey);\n const out: KeyPairSigner = {\n address,\n keyPair,\n signMessages: messages =>\n Promise.all(\n messages.map(async message =>\n Object.freeze({ [address]: await signBytes(keyPair.privateKey, message.content) }),\n ),\n ),\n signTransactions: transactions =>\n Promise.all(\n transactions.map(async transaction => {\n const signedTransaction = await partiallySignTransaction([keyPair], transaction);\n return Object.freeze({ [address]: signedTransaction.signatures[address] });\n }),\n ),\n };\n\n return Object.freeze(out);\n}\n\n/** Securely generates a signer capable of signing messages and transactions using a Crypto KeyPair. */\nexport async function generateKeyPairSigner(): Promise<KeyPairSigner> {\n return createSignerFromKeyPair(await generateKeyPair());\n}\n\n/** Creates a signer capable of signing messages and transactions using the 64 bytes of a KeyPair. */\nexport async function createKeyPairSignerFromBytes(bytes: Uint8Array, extractable?: boolean): Promise<KeyPairSigner> {\n return createSignerFromKeyPair(await createKeyPairFromBytes(bytes, extractable));\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER, SolanaError } from '@solana/errors';\n\nimport { SignableMessage } from './signable-message';\nimport { BaseSignerConfig, SignatureDictionary } from './types';\n\nexport type MessagePartialSignerConfig = BaseSignerConfig;\n\n/** Defines a signer capable of signing messages. */\nexport type MessagePartialSigner<TAddress extends string = string> = Readonly<{\n address: Address<TAddress>;\n signMessages(\n messages: readonly SignableMessage[],\n config?: MessagePartialSignerConfig,\n ): Promise<readonly SignatureDictionary[]>;\n}>;\n\n/** Checks whether the provided value implements the {@link MessagePartialSigner} interface. */\nexport function isMessagePartialSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): value is MessagePartialSigner<TAddress> {\n return 'signMessages' in value && typeof value.signMessages === 'function';\n}\n\n/** Asserts that the provided value implements the {@link MessagePartialSigner} interface. */\nexport function assertIsMessagePartialSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): asserts value is MessagePartialSigner<TAddress> {\n if (!isMessagePartialSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER, SolanaError } from '@solana/errors';\nimport { CompilableTransaction } from '@solana/transactions';\n\nimport { BaseSignerConfig, SignatureDictionary } from './types';\n\nexport type TransactionPartialSignerConfig = BaseSignerConfig;\n\n/** Defines a signer capable of signing transactions. */\nexport type TransactionPartialSigner<TAddress extends string = string> = Readonly<{\n address: Address<TAddress>;\n signTransactions(\n transactions: readonly CompilableTransaction[],\n config?: TransactionPartialSignerConfig,\n ): Promise<readonly SignatureDictionary[]>;\n}>;\n\n/** Checks whether the provided value implements the {@link TransactionPartialSigner} interface. */\nexport function isTransactionPartialSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): value is TransactionPartialSigner<TAddress> {\n return 'signTransactions' in value && typeof value.signTransactions === 'function';\n}\n\n/** Asserts that the provided value implements the {@link TransactionPartialSigner} interface. */\nexport function assertIsTransactionPartialSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): asserts value is TransactionPartialSigner<TAddress> {\n if (!isTransactionPartialSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address, isAddress } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER, SolanaError } from '@solana/errors';\n\nimport { SignableMessage } from './signable-message';\nimport { BaseSignerConfig } from './types';\n\nexport type MessageModifyingSignerConfig = BaseSignerConfig;\n\n/** Defines a signer capable of signing messages. */\nexport type MessageModifyingSigner<TAddress extends string = string> = Readonly<{\n address: Address<TAddress>;\n modifyAndSignMessages(\n messages: readonly SignableMessage[],\n config?: MessageModifyingSignerConfig,\n ): Promise<readonly SignableMessage[]>;\n}>;\n\n/** Checks whether the provided value implements the {@link MessageModifyingSigner} interface. */\nexport function isMessageModifyingSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): value is MessageModifyingSigner<TAddress> {\n return (\n isAddress(value.address) &&\n 'modifyAndSignMessages' in value &&\n typeof value.modifyAndSignMessages === 'function'\n );\n}\n\n/** Asserts that the provided value implements the {@link MessageModifyingSigner} interface. */\nexport function assertIsMessageModifyingSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): asserts value is MessageModifyingSigner<TAddress> {\n if (!isMessageModifyingSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER, SolanaError } from '@solana/errors';\n\nimport { isMessageModifyingSigner, MessageModifyingSigner } from './message-modifying-signer';\nimport { isMessagePartialSigner, MessagePartialSigner } from './message-partial-signer';\n\n/** Defines a signer capable of signing messages. */\nexport type MessageSigner<TAddress extends string = string> =\n | MessagePartialSigner<TAddress>\n | MessageModifyingSigner<TAddress>;\n\n/** Checks whether the provided value implements the {@link MessageSigner} interface. */\nexport function isMessageSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): value is MessageSigner<TAddress> {\n return isMessagePartialSigner(value) || isMessageModifyingSigner(value);\n}\n\n/** Asserts that the provided value implements the {@link MessageSigner} interface. */\nexport function assertIsMessageSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): asserts value is MessageSigner<TAddress> {\n if (!isMessageSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address } from '@solana/addresses';\n\nimport { MessagePartialSigner } from './message-partial-signer';\nimport { TransactionPartialSigner } from './transaction-partial-signer';\n\n/** Defines a no-operation signer that pretends to partially sign messages and transactions. */\nexport type NoopSigner<TAddress extends string = string> = MessagePartialSigner<TAddress> &\n TransactionPartialSigner<TAddress>;\n\n/** Creates a NoopSigner from the provided Address. */\nexport function createNoopSigner(address: Address): NoopSigner {\n const out: NoopSigner = {\n address,\n signMessages: async messages => messages.map(() => Object.freeze({})),\n signTransactions: async transactions => transactions.map(() => Object.freeze({})),\n };\n\n return Object.freeze(out);\n}\n","import { SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING, SolanaError } from '@solana/errors';\nimport { SignatureBytes } from '@solana/keys';\nimport {\n assertTransactionIsFullySigned,\n CompilableTransaction,\n IFullySignedTransaction,\n ITransactionWithSignatures,\n} from '@solana/transactions';\n\nimport { getSignersFromTransaction, ITransactionWithSigners } from './account-signer-meta';\nimport { deduplicateSigners } from './deduplicate-signers';\nimport { isTransactionModifyingSigner, TransactionModifyingSigner } from './transaction-modifying-signer';\nimport { isTransactionPartialSigner, TransactionPartialSigner } from './transaction-partial-signer';\nimport { isTransactionSendingSigner, TransactionSendingSigner } from './transaction-sending-signer';\nimport { isTransactionSigner, TransactionSigner } from './transaction-signer';\nimport { ITransactionWithSingleSendingSigner } from './transaction-with-single-sending-signer';\n\ntype CompilableTransactionWithSigners = CompilableTransaction &\n ITransactionWithSigners &\n Partial<ITransactionWithSignatures>;\n\n/**\n * Signs a transaction using any signers that may be stored in IAccountSignerMeta instruction accounts\n * as well as any signers provided explicitly to this function.\n * It will ignore TransactionSendingSigners since this function does not send the transaction.\n */\nexport async function partiallySignTransactionWithSigners<\n TTransaction extends CompilableTransactionWithSigners = CompilableTransactionWithSigners,\n>(\n transaction: TTransaction,\n config: { abortSignal?: AbortSignal } = {},\n): Promise<TTransaction & ITransactionWithSignatures> {\n const { partialSigners, modifyingSigners } = categorizeTransactionSigners(\n deduplicateSigners(getSignersFromTransaction(transaction).filter(isTransactionSigner)),\n { identifySendingSigner: false },\n );\n\n return signModifyingAndPartialTransactionSigners(transaction, modifyingSigners, partialSigners, config.abortSignal);\n}\n\n/**\n * Signs a transaction using any signers that may be stored in IAccountSignerMeta instruction accounts\n * as well as any signers provided explicitly to this function.\n * It will assert that the transaction is fully signed before returning.\n * It will ignore TransactionSendingSigners since this function does not send the transaction.\n */\nexport async function signTransactionWithSigners<\n TTransaction extends CompilableTransactionWithSigners = CompilableTransactionWithSigners,\n>(\n transaction: TTransaction,\n config: { abortSignal?: AbortSignal } = {},\n): Promise<TTransaction & IFullySignedTransaction> {\n const signedTransaction = await partiallySignTransactionWithSigners(transaction, config);\n assertTransactionIsFullySigned(signedTransaction);\n return signedTransaction;\n}\n\n/**\n * Signs and sends a transaction using any signers that may be stored in IAccountSignerMeta\n * instruction accounts as well as any signers provided explicitly to this function.\n * It will identify a single TransactionSendingSigners to use for sending the transaction, if any.\n * Otherwise, it will send the transaction using the provided fallbackSender.\n */\nexport async function signAndSendTransactionWithSigners<\n TTransaction extends CompilableTransactionWithSigners &\n ITransactionWithSingleSendingSigner = CompilableTransactionWithSigners & ITransactionWithSingleSendingSigner,\n>(transaction: TTransaction, config: { abortSignal?: AbortSignal } = {}): Promise<SignatureBytes> {\n const abortSignal = config.abortSignal;\n const { partialSigners, modifyingSigners, sendingSigner } = categorizeTransactionSigners(\n deduplicateSigners(getSignersFromTransaction(transaction).filter(isTransactionSigner)),\n );\n\n abortSignal?.throwIfAborted();\n const signedTransaction = await signModifyingAndPartialTransactionSigners(\n transaction,\n modifyingSigners,\n partialSigners,\n abortSignal,\n );\n\n if (!sendingSigner) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING);\n }\n\n abortSignal?.throwIfAborted();\n const [signature] = await sendingSigner.signAndSendTransactions([signedTransaction], { abortSignal });\n abortSignal?.throwIfAborted();\n\n return signature;\n}\n\n/**\n * Identifies each provided TransactionSigner and categorizes them into their respective types.\n * When a signer implements multiple interface, it will try to used to most powerful interface\n * but fallback to the least powerful interface when necessary.\n * For instance, if a signer implements TransactionSendingSigner and TransactionModifyingSigner,\n * it will be categorized as a TransactionSendingSigner if and only if no other signers implement\n * the TransactionSendingSigner interface.\n */\nfunction categorizeTransactionSigners(\n signers: readonly TransactionSigner[],\n config: { identifySendingSigner?: boolean } = {},\n): Readonly<{\n modifyingSigners: readonly TransactionModifyingSigner[];\n partialSigners: readonly TransactionPartialSigner[];\n sendingSigner: TransactionSendingSigner | null;\n}> {\n // Identify the unique sending signer that should be used.\n const identifySendingSigner = config.identifySendingSigner ?? true;\n const sendingSigner = identifySendingSigner ? identifyTransactionSendingSigner(signers) : null;\n\n // Now, focus on the other signers.\n // I.e. the modifying or partial signers that are not the identified sending signer.\n // Note that any other sending only signers will be discarded.\n const otherSigners = signers.filter(\n (signer): signer is TransactionModifyingSigner | TransactionPartialSigner =>\n signer !== sendingSigner && (isTransactionModifyingSigner(signer) || isTransactionPartialSigner(signer)),\n );\n\n // Identify the modifying signers from the other signers.\n const modifyingSigners = identifyTransactionModifyingSigners(otherSigners);\n\n // Use any remaining signers as partial signers.\n const partialSigners = otherSigners\n .filter(isTransactionPartialSigner)\n .filter(signer => !(modifyingSigners as typeof otherSigners).includes(signer));\n\n return Object.freeze({ modifyingSigners, partialSigners, sendingSigner });\n}\n\n/** Identifies the best signer to use as a TransactionSendingSigner, if any */\nfunction identifyTransactionSendingSigner(signers: readonly TransactionSigner[]): TransactionSendingSigner | null {\n // Ensure there are any TransactionSendingSigners in the first place.\n const sendingSigners = signers.filter(isTransactionSendingSigner);\n if (sendingSigners.length === 0) return null;\n\n // Prefer sending signers that do not offer other interfaces.\n const sendingOnlySigners = sendingSigners.filter(\n signer => !isTransactionModifyingSigner(signer) && !isTransactionPartialSigner(signer),\n );\n if (sendingOnlySigners.length > 0) {\n return sendingOnlySigners[0];\n }\n\n // Otherwise, choose any sending signer.\n return sendingSigners[0];\n}\n\n/** Identifies the best signers to use as TransactionModifyingSigners, if any */\nfunction identifyTransactionModifyingSigners(\n signers: readonly (TransactionModifyingSigner | TransactionPartialSigner)[],\n): readonly TransactionModifyingSigner[] {\n // Ensure there are any TransactionModifyingSigner in the first place.\n const modifyingSigners = signers.filter(isTransactionModifyingSigner);\n if (modifyingSigners.length === 0) return [];\n\n // Prefer modifying signers that do not offer partial signing.\n const nonPartialSigners = modifyingSigners.filter(signer => !isTransactionPartialSigner(signer));\n if (nonPartialSigners.length > 0) return nonPartialSigners;\n\n // Otherwise, choose only one modifying signer (whichever).\n return [modifyingSigners[0]];\n}\n\n/**\n * Signs a transaction using the provided TransactionModifyingSigners\n * sequentially followed by the TransactionPartialSigners in parallel.\n */\nasync function signModifyingAndPartialTransactionSigners<\n TTransaction extends CompilableTransactionWithSigners = CompilableTransactionWithSigners,\n>(\n transaction: TTransaction,\n modifyingSigners: readonly TransactionModifyingSigner[] = [],\n partialSigners: readonly TransactionPartialSigner[] = [],\n abortSignal?: AbortSignal,\n): Promise<TTransaction & ITransactionWithSignatures> {\n // Handle modifying signers sequentially.\n const modifiedTransaction = await modifyingSigners.reduce(\n async (transaction, modifyingSigner) => {\n abortSignal?.throwIfAborted();\n const [tx] = await modifyingSigner.modifyAndSignTransactions([await transaction], { abortSignal });\n return Object.freeze(tx);\n },\n Promise.resolve(transaction) as Promise<TTransaction>,\n );\n\n // Handle partial signers in parallel.\n abortSignal?.throwIfAborted();\n const signatureDictionaries = await Promise.all(\n partialSigners.map(async partialSigner => {\n const [signatures] = await partialSigner.signTransactions([modifiedTransaction], { abortSignal });\n return signatures;\n }),\n );\n const signedTransaction: TTransaction & ITransactionWithSignatures = {\n ...modifiedTransaction,\n signatures: Object.freeze(\n signatureDictionaries.reduce((signatures, signatureDictionary) => {\n return { ...signatures, ...signatureDictionary };\n }, modifiedTransaction.signatures ?? {}),\n ),\n };\n\n return Object.freeze(signedTransaction);\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER, SolanaError } from '@solana/errors';\nimport { CompilableTransaction } from '@solana/transactions';\n\nimport { BaseSignerConfig } from './types';\n\nexport type TransactionModifyingSignerConfig = BaseSignerConfig;\n\n/** Defines a signer capable of signing transactions. */\nexport type TransactionModifyingSigner<TAddress extends string = string> = Readonly<{\n address: Address<TAddress>;\n modifyAndSignTransactions<TTransaction extends CompilableTransaction>(\n transactions: readonly TTransaction[],\n config?: TransactionModifyingSignerConfig,\n ): Promise<readonly TTransaction[]>;\n}>;\n\n/** Checks whether the provided value implements the {@link TransactionModifyingSigner} interface. */\nexport function isTransactionModifyingSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): value is TransactionModifyingSigner<TAddress> {\n return 'modifyAndSignTransactions' in value && typeof value.modifyAndSignTransactions === 'function';\n}\n\n/** Asserts that the provided value implements the {@link TransactionModifyingSigner} interface. */\nexport function assertIsTransactionModifyingSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): asserts value is TransactionModifyingSigner<TAddress> {\n if (!isTransactionModifyingSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER, SolanaError } from '@solana/errors';\nimport { SignatureBytes } from '@solana/keys';\nimport { CompilableTransaction } from '@solana/transactions';\n\nimport { BaseSignerConfig } from './types';\n\nexport type TransactionSendingSignerConfig = BaseSignerConfig;\n\n/** Defines a signer capable of signing and sending transactions simultaneously. */\nexport type TransactionSendingSigner<TAddress extends string = string> = Readonly<{\n address: Address<TAddress>;\n signAndSendTransactions(\n transactions: readonly CompilableTransaction[],\n config?: TransactionSendingSignerConfig,\n ): Promise<readonly SignatureBytes[]>;\n}>;\n\n/** Checks whether the provided value implements the {@link TransactionSendingSigner} interface. */\nexport function isTransactionSendingSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): value is TransactionSendingSigner<TAddress> {\n return 'signAndSendTransactions' in value && typeof value.signAndSendTransactions === 'function';\n}\n\n/** Asserts that the provided value implements the {@link TransactionSendingSigner} interface. */\nexport function assertIsTransactionSendingSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): asserts value is TransactionSendingSigner<TAddress> {\n if (!isTransactionSendingSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER, SolanaError } from '@solana/errors';\n\nimport { isTransactionModifyingSigner, TransactionModifyingSigner } from './transaction-modifying-signer';\nimport { isTransactionPartialSigner, TransactionPartialSigner } from './transaction-partial-signer';\nimport { isTransactionSendingSigner, TransactionSendingSigner } from './transaction-sending-signer';\n\n/** Defines a signer capable of signing transactions. */\nexport type TransactionSigner<TAddress extends string = string> =\n | TransactionPartialSigner<TAddress>\n | TransactionModifyingSigner<TAddress>\n | TransactionSendingSigner<TAddress>;\n\n/** Checks whether the provided value implements the {@link TransactionSigner} interface. */\nexport function isTransactionSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): value is TransactionSigner<TAddress> {\n return (\n isTransactionPartialSigner(value) || isTransactionModifyingSigner(value) || isTransactionSendingSigner(value)\n );\n}\n\n/** Asserts that the provided value implements the {@link TransactionSigner} interface. */\nexport function assertIsTransactionSigner<TAddress extends string>(value: {\n address: Address<TAddress>;\n [key: string]: unknown;\n}): asserts value is TransactionSigner<TAddress> {\n if (!isTransactionSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER, {\n address: value.address,\n });\n }\n}\n","export const TextDecoder = globalThis.TextDecoder;\nexport const TextEncoder = globalThis.TextEncoder;\n","import { TextEncoder } from '@solana/text-encoding-impl';\n\nimport { SignatureDictionary } from './types';\n\n/** Defines a message that needs signing and its current set of signatures if any. */\nexport type SignableMessage = Readonly<{\n content: Uint8Array;\n signatures: SignatureDictionary;\n}>;\n\n/**\n * Creates a signable message from a provided content.\n * If a string is provided, it will be UTF-8 encoded.\n */\nexport function createSignableMessage(\n content: string | Uint8Array,\n signatures: SignatureDictionary = {},\n): SignableMessage {\n return Object.freeze({\n content: typeof content === 'string' ? new TextEncoder().encode(content) : content,\n signatures: Object.freeze({ ...signatures }),\n });\n}\n","import {\n SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS,\n SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING,\n SolanaError,\n} from '@solana/errors';\nimport { CompilableTransaction } from '@solana/transactions';\n\nimport { getSignersFromTransaction, ITransactionWithSigners } from './account-signer-meta';\nimport { isTransactionModifyingSigner } from './transaction-modifying-signer';\nimport { isTransactionPartialSigner } from './transaction-partial-signer';\nimport { isTransactionSendingSigner } from './transaction-sending-signer';\n\n/** Defines a transaction with exactly one {@link TransactionSendingSigner}. */\nexport type ITransactionWithSingleSendingSigner = ITransactionWithSigners & {\n readonly __transactionWithSingleSendingSigner: unique symbol;\n};\n\n/** Checks whether the provided transaction has exactly one {@link TransactionSendingSigner}. */\nexport function isTransactionWithSingleSendingSigner<TTransaction extends CompilableTransaction>(\n transaction: TTransaction,\n): transaction is TTransaction & ITransactionWithSingleSendingSigner {\n try {\n assertIsTransactionWithSingleSendingSigner(transaction);\n return true;\n } catch {\n return false;\n }\n}\n\n/** Asserts that the provided transaction has exactly one {@link TransactionSendingSigner}. */\nexport function assertIsTransactionWithSingleSendingSigner<TTransaction extends CompilableTransaction>(\n transaction: TTransaction,\n): asserts transaction is TTransaction & ITransactionWithSingleSendingSigner {\n const signers = getSignersFromTransaction(transaction);\n const sendingSigners = signers.filter(isTransactionSendingSigner);\n\n if (sendingSigners.length === 0) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING);\n }\n\n // When identifying if there are multiple sending signers, we only need to check for\n // sending signers that do not implement other transaction signer interfaces as\n // they will be used as these other signer interfaces in case of a conflict.\n const sendingOnlySigners = sendingSigners.filter(\n signer => !isTransactionPartialSigner(signer) && !isTransactionModifyingSigner(signer),\n );\n\n if (sendingOnlySigners.length > 1) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/deduplicate-signers.ts","../src/account-signer-meta.ts","../src/add-signers.ts","../src/fee-payer-signer.ts","../src/keypair-signer.ts","../src/message-partial-signer.ts","../src/transaction-partial-signer.ts","../src/message-modifying-signer.ts","../src/message-signer.ts","../src/noop-signer.ts","../src/sign-transaction.ts","../src/transaction-modifying-signer.ts","../src/transaction-sending-signer.ts","../src/transaction-signer.ts","../../text-encoding-impl/src/index.node.ts","../src/signable-message.ts","../src/transaction-with-single-sending-signer.ts"],"names":["out","SolanaError","transaction","TextDecoder","TextEncoder","SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING"],"mappings":";AACA,SAAS,4DAA4D,mBAAmB;AAMjF,SAAS,mBACZ,SACkB;AAClB,QAAM,eAAyC,CAAC;AAChD,UAAQ,QAAQ,YAAU;AACtB,QAAI,CAAC,aAAa,OAAO,OAAO,GAAG;AAC/B,mBAAa,OAAO,OAAO,IAAI;AAAA,IACnC,WAAW,aAAa,OAAO,OAAO,MAAM,QAAQ;AAChD,YAAM,IAAI,YAAY,4DAA4D;AAAA,QAC9E,SAAS,OAAO;AAAA,MACpB,CAAC;AAAA,IACL;AAAA,EACJ,CAAC;AACD,SAAO,OAAO,OAAO,YAAY;AACrC;;;ACeO,SAAS,0BACZ,aACkB;AAClB,SAAO;AAAA,KACF,YAAY,YAAY,CAAC,GAAG,QAAQ,aAAY,YAAY,UAAU,QAAQ,SAAS,CAAC,CAAE;AAAA,EAC/F;AACJ;AAGO,SAAS,0BAGd,aAA+C;AAC7C,SAAO,mBAAmB;AAAA,IACtB,GAAI,YAAY,iBAAiB,CAAC,YAAY,cAAc,IAAI,CAAC;AAAA,IACjE,GAAG,YAAY,aAAa,QAAQ,yBAAyB;AAAA,EACjE,CAAC;AACL;;;ACrDA,SAAuB,oBAAoB;AAQpC,SAAS,wBACZ,SACA,aACsC;AACtC,MAAI,CAAC,YAAY,YAAY,YAAY,SAAS,WAAW,GAAG;AAC5D,WAAO;AAAA,EACX;AAEA,QAAM,kBAAkB,IAAI,IAAI,mBAAmB,OAAO,EAAE,IAAI,YAAU,CAAC,OAAO,SAAS,MAAM,CAAC,CAAC;A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AO,IAAI;AAAA,IAC3E,YAAY,OAAO,OAAO,EAAE,GAAG,WAAW,CAAC;AAAA,EAC/C,CAAC;AACL;;;ACtBA;AAAA,EACI;AAAA,EACA,4DAAAC;AAAA,EACA,eAAAJ;AAAA,OACG;AAcA,SAAS,qCACZ,aACiE;AACjE,MAAI;AACA,+CAA2C,WAAW;AACtD,WAAO;AAAA,EACX,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;AAGO,SAAS,2CACZ,aACyE;AACzE,QAAM,UAAU,0BAA0B,WAAW;AACrD,QAAM,iBAAiB,QAAQ,OAAO,0BAA0B;AAEhE,MAAI,eAAe,WAAW,GAAG;AAC7B,UAAM,IAAIA,cAAYI,yDAAwD;AAAA,EAClF;AAKA,QAAM,qBAAqB,eAAe;AAAA,IACtC,YAAU,CAAC,2BAA2B,MAAM,KAAK,CAAC,6BAA6B,MAAM;AAAA,EACzF;AAEA,MAAI,mBAAmB,SAAS,GAAG;AAC/B,UAAM,IAAIJ,cAAY,sEAAsE;AAAA,EAChG;AACJ","sourcesContent":["import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS, SolanaError } from '@solana/errors';\n\nimport { MessageSigner } from './message-signer';\nimport { TransactionSigner } from './transaction-signer';\n\n/** Removes all duplicated signers from a provided array by comparing their addresses. */\nexport function deduplicateSigners<TSigner extends MessageSigner | TransactionSigner>(\n signers: readonly TSigner[],\n): readonly TSigner[] {\n const deduplicated: Record<Address, TSigner> = {};\n signers.forEach(signer => {\n if (!deduplicated[signer.address]) {\n deduplicated[signer.address] = signer;\n } else if (deduplicated[signer.address] !== signer) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS, {\n address: signer.address,\n });\n }\n });\n return Object.values(deduplicated);\n}\n","import { AccountRole, IAccountLookupMeta, IAccountMeta, IInstruction } from '@solana/instructions';\nimport { BaseTransaction, TransactionVersion } from '@solana/transactions';\n\nimport { deduplicateSigners } from './deduplicate-signers';\nimport { TransactionSigner } from './transaction-signer';\n\n/** An extension of the IAccountMeta type that keeps track of its transaction signer. */\nexport interface IAccountSignerMeta<\n TAddress extends string = string,\n TSigner extends TransactionSigner<TAddress> = TransactionSigner<TAddress>,\n> extends IAccountMeta<TAddress> {\n readonly role: AccountRole.READONLY_SIGNER | AccountRole.WRITABLE_SIGNER;\n readonly signer: TSigner;\n}\n\ntype IAccountMetaWithSigner<TSigner extends TransactionSigner = TransactionSigner> =\n | IAccountLookupMeta\n | IAccountMeta\n | IAccountSignerMeta<string, TSigner>;\n\n/** A variation of the instruction type that allows IAccountSignerMeta in its account metas. */\nexport type IInstructionWithSigners<\n TSigner extends TransactionSigner = TransactionSigner,\n TAccounts extends readonly IAccountMetaWithSigner<TSigner>[] = readonly IAccountMetaWithSigner<TSigner>[],\n> = Pick<IInstruction<string, TAccounts>, 'accounts'>;\n\n/** A variation of the transaction type that allows IAccountSignerMeta in its account metas. */\nexport type ITransactionWithSigners<\n TSigner extends TransactionSigner = TransactionSigner,\n TAccounts extends readonly IAccountMetaWithSigner<TSigner>[] = readonly IAccountMetaWithSigner<TSigner>[],\n> = Pick<\n BaseTransaction<TransactionVersion, IInstruction & IInstructionWithSigners<TSigner, TAccounts>>,\n 'instructions'\n> & { feePayerSigner?: TSigner };\n\n/** Extract all signers from an instruction that may contain IAccountSignerMeta accounts. */\nexport function getSignersFromInstruction<TSigner extends TransactionSigner = TransactionSigner>(\n instruction: IInstructionWithSigners<TSigner>,\n): readonly TSigner[] {\n return deduplicateSigners(\n (instruction.accounts ?? []).flatMap(account => ('signer' in account ? account.signer : [])),\n );\n}\n\n/** Extract all signers from a transaction that may contain IAccountSignerMeta accounts. */\nexport function getSignersFromTransaction<\n TSigner extends TransactionSigner = TransactionSigner,\n TTransaction extends ITransactionWithSigners<TSigner> = ITransactionWithSigners<TSigner>,\n>(transaction: TTransaction): readonly TSigner[] {\n return deduplicateSigners([\n ...(transaction.feePayerSigner ? [transaction.feePayerSigner] : []),\n ...transaction.instructions.flatMap(getSignersFromInstruction),\n ]);\n}\n","import { IInstruction, isSignerRole } from '@solana/instructions';\nimport { BaseTransaction } from '@solana/transactions';\n\nimport { IAccountSignerMeta, IInstructionWithSigners, ITransactionWithSigners } from './account-signer-meta';\nimport { deduplicateSigners } from './deduplicate-signers';\nimport { TransactionSigner } from './transaction-signer';\n\n/** Attaches the provided signers to the account metas of an instruction when applicable. */\nexport function addSignersToInstruction<TInstruction extends IInstruction>(\n signers: TransactionSigner[],\n instruction: TInstruction | (IInstructionWithSigners & TInstruction),\n): IInstructionWithSigners & TInstruction {\n if (!instruction.accounts || instruction.accounts.length === 0) {\n return instruction as IInstructionWithSigners & TInstruction;\n }\n\n const signerByAddress = new Map(deduplicateSigners(signers).map(signer => [signer.address, signer]));\n return Object.freeze({\n ...instruction,\n accounts: instruction.accounts.map(account => {\n const signer = signerByAddress.get(account.address);\n if (!isSignerRole(account.role) || 'signer' in account || !signer) {\n return account;\n }\n return Object.freeze({ ...account, signer } as IAccountSignerMeta);\n }),\n });\n}\n\n/** Attaches the provided signers to the account metas of a transaction when applicable. */\nexport function addSignersToTransaction<TTransaction extends BaseTransaction>(\n signers: TransactionSigner[],\n transaction: TTransaction | (ITransactionWithSigners & TTransaction),\n): ITransactionWithSigners & TTransaction {\n if (transaction.instructions.length === 0) {\n return transaction as ITransactionWithSigners & TTransaction;\n }\n\n return Object.freeze({\n ...transaction,\n instructions: transaction.instructions.map(instruction => addSignersToInstruction(signers, instruction)),\n });\n}\n","import { Address } from '@solana/addresses';\nimport {\n BaseTransaction,\n getUnsignedTransaction,\n ITransactionWithFeePayer,\n ITransactionWithSignatures,\n} from '@solana/transactions';\n\nimport { TransactionSigner } from './transaction-signer';\n\nexport interface ITransactionWithFeePayerSigner<\n TAddress extends string = string,\n TSigner extends TransactionSigner<TAddress> = TransactionSigner<TAddress>,\n> {\n readonly feePayer: Address<TAddress>;\n readonly feePayerSigner: TSigner;\n}\n\nexport function setTransactionFeePayerSigner<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(\n feePayerSigner: TransactionSigner<TFeePayerAddress>,\n transaction:\n | (ITransactionWithFeePayer<string> & ITransactionWithSignatures & TTransaction)\n | (ITransactionWithSignatures & TTransaction),\n): ITransactionWithFeePayerSigner<TFeePayerAddress> & Omit<TTransaction, keyof ITransactionWithSignatures>;\n\nexport function setTransactionFeePayerSigner<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(\n feePayerSigner: TransactionSigner<TFeePayerAddress>,\n transaction: TTransaction | (ITransactionWithFeePayer<string> & TTransaction),\n): ITransactionWithFeePayerSigner<TFeePayerAddress> & TTransaction;\n\nexport function setTransactionFeePayerSigner<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(\n feePayerSigner: TransactionSigner<TFeePayerAddress>,\n transaction:\n | TTransaction\n | (ITransactionWithFeePayer<string> & ITransactionWithSignatures & TTransaction)\n | (ITransactionWithFeePayer<string> & TTransaction)\n | (ITransactionWithSignatures & TTransaction),\n) {\n if ('feePayer' in transaction && feePayerSigner.address === transaction.feePayer) {\n if ('feePayerSigner' in transaction) return transaction;\n const out = { ...transaction, feePayerSigner };\n Object.freeze(out);\n return out;\n }\n const out = {\n ...getUnsignedTransaction(transaction),\n feePayer: feePayerSigner.address,\n feePayerSigner,\n };\n Object.freeze(out);\n return out;\n}\n","import { Address, getAddressFromPublicKey } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER, SolanaError } from '@solana/errors';\nimport { createKeyPairFromBytes, generateKeyPair, signBytes } from '@solana/keys';\nimport { partiallySignTransaction } from '@solana/transactions';\n\nimport { isMessagePartialSigner, MessagePartialSigner } from './message-partial-signer';\nimport { isTransactionPartialSigner, TransactionPartialSigner } from './transaction-partial-signer';\n\n/** Defines a signer capable of signing messages and transactions using a CryptoKeyPair. */\nexport type KeyPairSigner<TAddress extends string = string> = MessagePartialSigner<TAddress> &\n TransactionPartialSigner<TAddress> & { keyPair: CryptoKeyPair };\n\n/** Checks whether the provided value implements the {@link KeyPairSigner} interface. */\nexport function isKeyPairSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): value is KeyPairSigner<TAddress> {\n return (\n 'keyPair' in value &&\n typeof value.keyPair === 'object' &&\n isMessagePartialSigner(value) &&\n isTransactionPartialSigner(value)\n );\n}\n\n/** Asserts that the provided value implements the {@link KeyPairSigner} interface. */\nexport function assertIsKeyPairSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): asserts value is KeyPairSigner<TAddress> {\n if (!isKeyPairSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER, {\n address: value.address,\n });\n }\n}\n\n/** Creates a KeyPairSigner from the provided Crypto KeyPair. */\nexport async function createSignerFromKeyPair(keyPair: CryptoKeyPair): Promise<KeyPairSigner> {\n const address = await getAddressFromPublicKey(keyPair.publicKey);\n const out: KeyPairSigner = {\n address,\n keyPair,\n signMessages: messages =>\n Promise.all(\n messages.map(async message =>\n Object.freeze({ [address]: await signBytes(keyPair.privateKey, message.content) }),\n ),\n ),\n signTransactions: transactions =>\n Promise.all(\n transactions.map(async transaction => {\n const signedTransaction = await partiallySignTransaction([keyPair], transaction);\n return Object.freeze({ [address]: signedTransaction.signatures[address] });\n }),\n ),\n };\n\n return Object.freeze(out);\n}\n\n/** Securely generates a signer capable of signing messages and transactions using a Crypto KeyPair. */\nexport async function generateKeyPairSigner(): Promise<KeyPairSigner> {\n return createSignerFromKeyPair(await generateKeyPair());\n}\n\n/** Creates a signer capable of signing messages and transactions using the 64 bytes of a KeyPair. */\nexport async function createKeyPairSignerFromBytes(bytes: Uint8Array, extractable?: boolean): Promise<KeyPairSigner> {\n return createSignerFromKeyPair(await createKeyPairFromBytes(bytes, extractable));\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER, SolanaError } from '@solana/errors';\n\nimport { SignableMessage } from './signable-message';\nimport { BaseSignerConfig, SignatureDictionary } from './types';\n\nexport type MessagePartialSignerConfig = BaseSignerConfig;\n\n/** Defines a signer capable of signing messages. */\nexport type MessagePartialSigner<TAddress extends string = string> = Readonly<{\n address: Address<TAddress>;\n signMessages(\n messages: readonly SignableMessage[],\n config?: MessagePartialSignerConfig,\n ): Promise<readonly SignatureDictionary[]>;\n}>;\n\n/** Checks whether the provided value implements the {@link MessagePartialSigner} interface. */\nexport function isMessagePartialSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): value is MessagePartialSigner<TAddress> {\n return 'signMessages' in value && typeof value.signMessages === 'function';\n}\n\n/** Asserts that the provided value implements the {@link MessagePartialSigner} interface. */\nexport function assertIsMessagePartialSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): asserts value is MessagePartialSigner<TAddress> {\n if (!isMessagePartialSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER, SolanaError } from '@solana/errors';\nimport { CompilableTransaction } from '@solana/transactions';\n\nimport { BaseSignerConfig, SignatureDictionary } from './types';\n\nexport type TransactionPartialSignerConfig = BaseSignerConfig;\n\n/** Defines a signer capable of signing transactions. */\nexport type TransactionPartialSigner<TAddress extends string = string> = Readonly<{\n address: Address<TAddress>;\n signTransactions(\n transactions: readonly CompilableTransaction[],\n config?: TransactionPartialSignerConfig,\n ): Promise<readonly SignatureDictionary[]>;\n}>;\n\n/** Checks whether the provided value implements the {@link TransactionPartialSigner} interface. */\nexport function isTransactionPartialSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): value is TransactionPartialSigner<TAddress> {\n return 'signTransactions' in value && typeof value.signTransactions === 'function';\n}\n\n/** Asserts that the provided value implements the {@link TransactionPartialSigner} interface. */\nexport function assertIsTransactionPartialSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): asserts value is TransactionPartialSigner<TAddress> {\n if (!isTransactionPartialSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address, isAddress } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER, SolanaError } from '@solana/errors';\n\nimport { SignableMessage } from './signable-message';\nimport { BaseSignerConfig } from './types';\n\nexport type MessageModifyingSignerConfig = BaseSignerConfig;\n\n/** Defines a signer capable of signing messages. */\nexport type MessageModifyingSigner<TAddress extends string = string> = Readonly<{\n address: Address<TAddress>;\n modifyAndSignMessages(\n messages: readonly SignableMessage[],\n config?: MessageModifyingSignerConfig,\n ): Promise<readonly SignableMessage[]>;\n}>;\n\n/** Checks whether the provided value implements the {@link MessageModifyingSigner} interface. */\nexport function isMessageModifyingSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): value is MessageModifyingSigner<TAddress> {\n return (\n isAddress(value.address) &&\n 'modifyAndSignMessages' in value &&\n typeof value.modifyAndSignMessages === 'function'\n );\n}\n\n/** Asserts that the provided value implements the {@link MessageModifyingSigner} interface. */\nexport function assertIsMessageModifyingSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): asserts value is MessageModifyingSigner<TAddress> {\n if (!isMessageModifyingSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER, SolanaError } from '@solana/errors';\n\nimport { isMessageModifyingSigner, MessageModifyingSigner } from './message-modifying-signer';\nimport { isMessagePartialSigner, MessagePartialSigner } from './message-partial-signer';\n\n/** Defines a signer capable of signing messages. */\nexport type MessageSigner<TAddress extends string = string> =\n | MessageModifyingSigner<TAddress>\n | MessagePartialSigner<TAddress>;\n\n/** Checks whether the provided value implements the {@link MessageSigner} interface. */\nexport function isMessageSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): value is MessageSigner<TAddress> {\n return isMessagePartialSigner(value) || isMessageModifyingSigner(value);\n}\n\n/** Asserts that the provided value implements the {@link MessageSigner} interface. */\nexport function assertIsMessageSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): asserts value is MessageSigner<TAddress> {\n if (!isMessageSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address } from '@solana/addresses';\n\nimport { MessagePartialSigner } from './message-partial-signer';\nimport { TransactionPartialSigner } from './transaction-partial-signer';\n\n/** Defines a no-operation signer that pretends to partially sign messages and transactions. */\nexport type NoopSigner<TAddress extends string = string> = MessagePartialSigner<TAddress> &\n TransactionPartialSigner<TAddress>;\n\n/** Creates a NoopSigner from the provided Address. */\nexport function createNoopSigner(address: Address): NoopSigner {\n const out: NoopSigner = {\n address,\n signMessages: async messages => messages.map(() => Object.freeze({})),\n signTransactions: async transactions => transactions.map(() => Object.freeze({})),\n };\n\n return Object.freeze(out);\n}\n","import { SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING, SolanaError } from '@solana/errors';\nimport { SignatureBytes } from '@solana/keys';\nimport {\n assertTransactionIsFullySigned,\n CompilableTransaction,\n IFullySignedTransaction,\n ITransactionWithSignatures,\n} from '@solana/transactions';\n\nimport { getSignersFromTransaction, ITransactionWithSigners } from './account-signer-meta';\nimport { deduplicateSigners } from './deduplicate-signers';\nimport { isTransactionModifyingSigner, TransactionModifyingSigner } from './transaction-modifying-signer';\nimport { isTransactionPartialSigner, TransactionPartialSigner } from './transaction-partial-signer';\nimport { isTransactionSendingSigner, TransactionSendingSigner } from './transaction-sending-signer';\nimport { isTransactionSigner, TransactionSigner } from './transaction-signer';\nimport { ITransactionWithSingleSendingSigner } from './transaction-with-single-sending-signer';\n\ntype CompilableTransactionWithSigners = CompilableTransaction &\n ITransactionWithSigners &\n Partial<ITransactionWithSignatures>;\n\n/**\n * Signs a transaction using any signers that may be stored in IAccountSignerMeta instruction accounts\n * as well as any signers provided explicitly to this function.\n * It will ignore TransactionSendingSigners since this function does not send the transaction.\n */\nexport async function partiallySignTransactionWithSigners<\n TTransaction extends CompilableTransactionWithSigners = CompilableTransactionWithSigners,\n>(\n transaction: TTransaction,\n config: { abortSignal?: AbortSignal } = {},\n): Promise<ITransactionWithSignatures & TTransaction> {\n const { partialSigners, modifyingSigners } = categorizeTransactionSigners(\n deduplicateSigners(getSignersFromTransaction(transaction).filter(isTransactionSigner)),\n { identifySendingSigner: false },\n );\n\n return signModifyingAndPartialTransactionSigners(transaction, modifyingSigners, partialSigners, config.abortSignal);\n}\n\n/**\n * Signs a transaction using any signers that may be stored in IAccountSignerMeta instruction accounts\n * as well as any signers provided explicitly to this function.\n * It will assert that the transaction is fully signed before returning.\n * It will ignore TransactionSendingSigners since this function does not send the transaction.\n */\nexport async function signTransactionWithSigners<\n TTransaction extends CompilableTransactionWithSigners = CompilableTransactionWithSigners,\n>(\n transaction: TTransaction,\n config: { abortSignal?: AbortSignal } = {},\n): Promise<IFullySignedTransaction & TTransaction> {\n const signedTransaction = await partiallySignTransactionWithSigners(transaction, config);\n assertTransactionIsFullySigned(signedTransaction);\n return signedTransaction;\n}\n\n/**\n * Signs and sends a transaction using any signers that may be stored in IAccountSignerMeta\n * instruction accounts as well as any signers provided explicitly to this function.\n * It will identify a single TransactionSendingSigners to use for sending the transaction, if any.\n * Otherwise, it will send the transaction using the provided fallbackSender.\n */\nexport async function signAndSendTransactionWithSigners<\n TTransaction extends CompilableTransactionWithSigners &\n ITransactionWithSingleSendingSigner = CompilableTransactionWithSigners & ITransactionWithSingleSendingSigner,\n>(transaction: TTransaction, config: { abortSignal?: AbortSignal } = {}): Promise<SignatureBytes> {\n const abortSignal = config.abortSignal;\n const { partialSigners, modifyingSigners, sendingSigner } = categorizeTransactionSigners(\n deduplicateSigners(getSignersFromTransaction(transaction).filter(isTransactionSigner)),\n );\n\n abortSignal?.throwIfAborted();\n const signedTransaction = await signModifyingAndPartialTransactionSigners(\n transaction,\n modifyingSigners,\n partialSigners,\n abortSignal,\n );\n\n if (!sendingSigner) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING);\n }\n\n abortSignal?.throwIfAborted();\n const [signature] = await sendingSigner.signAndSendTransactions([signedTransaction], { abortSignal });\n abortSignal?.throwIfAborted();\n\n return signature;\n}\n\n/**\n * Identifies each provided TransactionSigner and categorizes them into their respective types.\n * When a signer implements multiple interface, it will try to used to most powerful interface\n * but fallback to the least powerful interface when necessary.\n * For instance, if a signer implements TransactionSendingSigner and TransactionModifyingSigner,\n * it will be categorized as a TransactionSendingSigner if and only if no other signers implement\n * the TransactionSendingSigner interface.\n */\nfunction categorizeTransactionSigners(\n signers: readonly TransactionSigner[],\n config: { identifySendingSigner?: boolean } = {},\n): Readonly<{\n modifyingSigners: readonly TransactionModifyingSigner[];\n partialSigners: readonly TransactionPartialSigner[];\n sendingSigner: TransactionSendingSigner | null;\n}> {\n // Identify the unique sending signer that should be used.\n const identifySendingSigner = config.identifySendingSigner ?? true;\n const sendingSigner = identifySendingSigner ? identifyTransactionSendingSigner(signers) : null;\n\n // Now, focus on the other signers.\n // I.e. the modifying or partial signers that are not the identified sending signer.\n // Note that any other sending only signers will be discarded.\n const otherSigners = signers.filter(\n (signer): signer is TransactionModifyingSigner | TransactionPartialSigner =>\n signer !== sendingSigner && (isTransactionModifyingSigner(signer) || isTransactionPartialSigner(signer)),\n );\n\n // Identify the modifying signers from the other signers.\n const modifyingSigners = identifyTransactionModifyingSigners(otherSigners);\n\n // Use any remaining signers as partial signers.\n const partialSigners = otherSigners\n .filter(isTransactionPartialSigner)\n .filter(signer => !(modifyingSigners as typeof otherSigners).includes(signer));\n\n return Object.freeze({ modifyingSigners, partialSigners, sendingSigner });\n}\n\n/** Identifies the best signer to use as a TransactionSendingSigner, if any */\nfunction identifyTransactionSendingSigner(signers: readonly TransactionSigner[]): TransactionSendingSigner | null {\n // Ensure there are any TransactionSendingSigners in the first place.\n const sendingSigners = signers.filter(isTransactionSendingSigner);\n if (sendingSigners.length === 0) return null;\n\n // Prefer sending signers that do not offer other interfaces.\n const sendingOnlySigners = sendingSigners.filter(\n signer => !isTransactionModifyingSigner(signer) && !isTransactionPartialSigner(signer),\n );\n if (sendingOnlySigners.length > 0) {\n return sendingOnlySigners[0];\n }\n\n // Otherwise, choose any sending signer.\n return sendingSigners[0];\n}\n\n/** Identifies the best signers to use as TransactionModifyingSigners, if any */\nfunction identifyTransactionModifyingSigners(\n signers: readonly (TransactionModifyingSigner | TransactionPartialSigner)[],\n): readonly TransactionModifyingSigner[] {\n // Ensure there are any TransactionModifyingSigner in the first place.\n const modifyingSigners = signers.filter(isTransactionModifyingSigner);\n if (modifyingSigners.length === 0) return [];\n\n // Prefer modifying signers that do not offer partial signing.\n const nonPartialSigners = modifyingSigners.filter(signer => !isTransactionPartialSigner(signer));\n if (nonPartialSigners.length > 0) return nonPartialSigners;\n\n // Otherwise, choose only one modifying signer (whichever).\n return [modifyingSigners[0]];\n}\n\n/**\n * Signs a transaction using the provided TransactionModifyingSigners\n * sequentially followed by the TransactionPartialSigners in parallel.\n */\nasync function signModifyingAndPartialTransactionSigners<\n TTransaction extends CompilableTransactionWithSigners = CompilableTransactionWithSigners,\n>(\n transaction: TTransaction,\n modifyingSigners: readonly TransactionModifyingSigner[] = [],\n partialSigners: readonly TransactionPartialSigner[] = [],\n abortSignal?: AbortSignal,\n): Promise<ITransactionWithSignatures & TTransaction> {\n // Handle modifying signers sequentially.\n const modifiedTransaction = await modifyingSigners.reduce(\n async (transaction, modifyingSigner) => {\n abortSignal?.throwIfAborted();\n const [tx] = await modifyingSigner.modifyAndSignTransactions([await transaction], { abortSignal });\n return Object.freeze(tx);\n },\n Promise.resolve(transaction) as Promise<TTransaction>,\n );\n\n // Handle partial signers in parallel.\n abortSignal?.throwIfAborted();\n const signatureDictionaries = await Promise.all(\n partialSigners.map(async partialSigner => {\n const [signatures] = await partialSigner.signTransactions([modifiedTransaction], { abortSignal });\n return signatures;\n }),\n );\n const signedTransaction: ITransactionWithSignatures & TTransaction = {\n ...modifiedTransaction,\n signatures: Object.freeze(\n signatureDictionaries.reduce((signatures, signatureDictionary) => {\n return { ...signatures, ...signatureDictionary };\n }, modifiedTransaction.signatures ?? {}),\n ),\n };\n\n return Object.freeze(signedTransaction);\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER, SolanaError } from '@solana/errors';\nimport { CompilableTransaction } from '@solana/transactions';\n\nimport { BaseSignerConfig } from './types';\n\nexport type TransactionModifyingSignerConfig = BaseSignerConfig;\n\n/** Defines a signer capable of signing transactions. */\nexport type TransactionModifyingSigner<TAddress extends string = string> = Readonly<{\n address: Address<TAddress>;\n modifyAndSignTransactions<TTransaction extends CompilableTransaction>(\n transactions: readonly TTransaction[],\n config?: TransactionModifyingSignerConfig,\n ): Promise<readonly TTransaction[]>;\n}>;\n\n/** Checks whether the provided value implements the {@link TransactionModifyingSigner} interface. */\nexport function isTransactionModifyingSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): value is TransactionModifyingSigner<TAddress> {\n return 'modifyAndSignTransactions' in value && typeof value.modifyAndSignTransactions === 'function';\n}\n\n/** Asserts that the provided value implements the {@link TransactionModifyingSigner} interface. */\nexport function assertIsTransactionModifyingSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): asserts value is TransactionModifyingSigner<TAddress> {\n if (!isTransactionModifyingSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER, SolanaError } from '@solana/errors';\nimport { SignatureBytes } from '@solana/keys';\nimport { CompilableTransaction } from '@solana/transactions';\n\nimport { BaseSignerConfig } from './types';\n\nexport type TransactionSendingSignerConfig = BaseSignerConfig;\n\n/** Defines a signer capable of signing and sending transactions simultaneously. */\nexport type TransactionSendingSigner<TAddress extends string = string> = Readonly<{\n address: Address<TAddress>;\n signAndSendTransactions(\n transactions: readonly CompilableTransaction[],\n config?: TransactionSendingSignerConfig,\n ): Promise<readonly SignatureBytes[]>;\n}>;\n\n/** Checks whether the provided value implements the {@link TransactionSendingSigner} interface. */\nexport function isTransactionSendingSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): value is TransactionSendingSigner<TAddress> {\n return 'signAndSendTransactions' in value && typeof value.signAndSendTransactions === 'function';\n}\n\n/** Asserts that the provided value implements the {@link TransactionSendingSigner} interface. */\nexport function assertIsTransactionSendingSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): asserts value is TransactionSendingSigner<TAddress> {\n if (!isTransactionSendingSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER, {\n address: value.address,\n });\n }\n}\n","import { Address } from '@solana/addresses';\nimport { SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER, SolanaError } from '@solana/errors';\n\nimport { isTransactionModifyingSigner, TransactionModifyingSigner } from './transaction-modifying-signer';\nimport { isTransactionPartialSigner, TransactionPartialSigner } from './transaction-partial-signer';\nimport { isTransactionSendingSigner, TransactionSendingSigner } from './transaction-sending-signer';\n\n/** Defines a signer capable of signing transactions. */\nexport type TransactionSigner<TAddress extends string = string> =\n | TransactionModifyingSigner<TAddress>\n | TransactionPartialSigner<TAddress>\n | TransactionSendingSigner<TAddress>;\n\n/** Checks whether the provided value implements the {@link TransactionSigner} interface. */\nexport function isTransactionSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): value is TransactionSigner<TAddress> {\n return (\n isTransactionPartialSigner(value) || isTransactionModifyingSigner(value) || isTransactionSendingSigner(value)\n );\n}\n\n/** Asserts that the provided value implements the {@link TransactionSigner} interface. */\nexport function assertIsTransactionSigner<TAddress extends string>(value: {\n [key: string]: unknown;\n address: Address<TAddress>;\n}): asserts value is TransactionSigner<TAddress> {\n if (!isTransactionSigner(value)) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER, {\n address: value.address,\n });\n }\n}\n","export const TextDecoder = globalThis.TextDecoder;\nexport const TextEncoder = globalThis.TextEncoder;\n","import { TextEncoder } from '@solana/text-encoding-impl';\n\nimport { SignatureDictionary } from './types';\n\n/** Defines a message that needs signing and its current set of signatures if any. */\nexport type SignableMessage = Readonly<{\n content: Uint8Array;\n signatures: SignatureDictionary;\n}>;\n\n/**\n * Creates a signable message from a provided content.\n * If a string is provided, it will be UTF-8 encoded.\n */\nexport function createSignableMessage(\n content: Uint8Array | string,\n signatures: SignatureDictionary = {},\n): SignableMessage {\n return Object.freeze({\n content: typeof content === 'string' ? new TextEncoder().encode(content) : content,\n signatures: Object.freeze({ ...signatures }),\n });\n}\n","import {\n SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS,\n SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING,\n SolanaError,\n} from '@solana/errors';\nimport { CompilableTransaction } from '@solana/transactions';\n\nimport { getSignersFromTransaction, ITransactionWithSigners } from './account-signer-meta';\nimport { isTransactionModifyingSigner } from './transaction-modifying-signer';\nimport { isTransactionPartialSigner } from './transaction-partial-signer';\nimport { isTransactionSendingSigner } from './transaction-sending-signer';\n\n/** Defines a transaction with exactly one {@link TransactionSendingSigner}. */\nexport type ITransactionWithSingleSendingSigner = ITransactionWithSigners & {\n readonly __transactionWithSingleSendingSigner: unique symbol;\n};\n\n/** Checks whether the provided transaction has exactly one {@link TransactionSendingSigner}. */\nexport function isTransactionWithSingleSendingSigner<TTransaction extends CompilableTransaction>(\n transaction: TTransaction,\n): transaction is ITransactionWithSingleSendingSigner & TTransaction {\n try {\n assertIsTransactionWithSingleSendingSigner(transaction);\n return true;\n } catch {\n return false;\n }\n}\n\n/** Asserts that the provided transaction has exactly one {@link TransactionSendingSigner}. */\nexport function assertIsTransactionWithSingleSendingSigner<TTransaction extends CompilableTransaction>(\n transaction: TTransaction,\n): asserts transaction is ITransactionWithSingleSendingSigner & TTransaction {\n const signers = getSignersFromTransaction(transaction);\n const sendingSigners = signers.filter(isTransactionSendingSigner);\n\n if (sendingSigners.length === 0) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING);\n }\n\n // When identifying if there are multiple sending signers, we only need to check for\n // sending signers that do not implement other transaction signer interfaces as\n // they will be used as these other signer interfaces in case of a conflict.\n const sendingOnlySigners = sendingSigners.filter(\n signer => !isTransactionPartialSigner(signer) && !isTransactionModifyingSigner(signer),\n );\n\n if (sendingOnlySigners.length > 1) {\n throw new SolanaError(SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS);\n }\n}\n"]}
@@ -6,7 +6,7 @@ export interface IAccountSignerMeta<TAddress extends string = string, TSigner ex
6
6
  readonly role: AccountRole.READONLY_SIGNER | AccountRole.WRITABLE_SIGNER;
7
7
  readonly signer: TSigner;
8
8
  }
9
- type IAccountMetaWithSigner<TSigner extends TransactionSigner = TransactionSigner> = IAccountMeta | IAccountLookupMeta | IAccountSignerMeta<string, TSigner>;
9
+ type IAccountMetaWithSigner<TSigner extends TransactionSigner = TransactionSigner> = IAccountLookupMeta | IAccountMeta | IAccountSignerMeta<string, TSigner>;
10
10
  /** A variation of the instruction type that allows IAccountSignerMeta in its account metas. */
11
11
  export type IInstructionWithSigners<TSigner extends TransactionSigner = TransactionSigner, TAccounts extends readonly IAccountMetaWithSigner<TSigner>[] = readonly IAccountMetaWithSigner<TSigner>[]> = Pick<IInstruction<string, TAccounts>, 'accounts'>;
12
12
  /** A variation of the transaction type that allows IAccountSignerMeta in its account metas. */
@@ -1 +1 @@
1
- {"version":3,"file":"account-signer-meta.d.ts","sourceRoot":"","sources":["../../src/account-signer-meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,wFAAwF;AACxF,MAAM,WAAW,kBAAkB,CAC/B,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,OAAO,SAAS,iBAAiB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAC3E,SAAQ,YAAY,CAAC,QAAQ,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,eAAe,GAAG,WAAW,CAAC,eAAe,CAAC;IACzE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC5B;AAED,KAAK,sBAAsB,CAAC,OAAO,SAAS,iBAAiB,GAAG,iBAAiB,IAC3E,YAAY,GACZ,kBAAkB,GAClB,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,+FAA+F;AAC/F,MAAM,MAAM,uBAAuB,CAC/B,OAAO,SAAS,iBAAiB,GAAG,iBAAiB,EACrD,SAAS,SAAS,SAAS,sBAAsB,CAAC,OAAO,CAAC,EAAE,GAAG,SAAS,sBAA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D,YAAY,SAAS,uBAAuB,CAAC,OAAO,CAAC,GAAG,uBAAuB,CAAC,OAAO,CAAC,EAC1F,WAAW,EAAE,YAAY,GAAG,SAAS,OAAO,EAAE,CAK/C"}
@@ -3,7 +3,7 @@ import { BaseTransaction } from '@solana/transactions';
3
3
  import { IInstructionWithSigners, ITransactionWithSigners } from './account-signer-meta.js';
4
4
  import { TransactionSigner } from './transaction-signer.js';
5
5
  /** Attaches the provided signers to the account metas of an instruction when applicable. */
6
- export declare function addSignersToInstruction<TInstruction extends IInstruction>(signers: TransactionSigner[], instruction: TInstruction | (TInstruction & IInstructionWithSigners)): TInstruction & IInstructionWithSigners;
6
+ export declare function addSignersToInstruction<TInstruction extends IInstruction>(signers: TransactionSigner[], instruction: TInstruction | (IInstructionWithSigners & TInstruction)): IInstructionWithSigners & TInstruction;
7
7
  /** Attaches the provided signers to the account metas of a transaction when applicable. */
8
- export declare function addSignersToTransaction<TTransaction extends BaseTransaction>(signers: TransactionSigner[], transaction: TTransaction | (TTransaction & ITransactionWithSigners)): TTransaction & ITransactionWithSigners;
8
+ export declare function addSignersToTransaction<TTransaction extends BaseTransaction>(signers: TransactionSigner[], transaction: TTransaction | (ITransactionWithSigners & TTransaction)): ITransactionWithSigners & TTransaction;
9
9
  //# sourceMappingURL=add-signers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-signers.d.ts","sourceRoot":"","sources":["../../src/add-signers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAsB,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAE7G,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,4FAA4F;AAC5F,wBAAgB,uBAAuB,CAAC,YAAY,SAAS,YAAY,EACrE,OAAO,EAAE,iBAAiB,EAAE,EAC5B,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,uBAAuB,CAAC,GACrE,YAAY,GAAG,uBAAuB,CAgBxC;AAED,2FAA2F;AAC3F,wBAAgB,uBAAuB,CAAC,YAAY,SAAS,eAAe,EACxE,OAAO,EAAE,iBAAiB,EAAE,EAC5B,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,uBAAuB,CAAC,GACrE,YAAY,GAAG,uBAAuB,CASxC"}
1
+ {"version":3,"file":"add-signers.d.ts","sourceRoot":"","sources":["../../src/add-signers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAsB,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAE7G,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,4FAA4F;AAC5F,wBAAgB,uBAAuB,CAAC,YAAY,SAAS,YAAY,EACrE,OAAO,EAAE,iBAAiB,EAAE,EAC5B,WAAW,EAAE,YAAY,GAAG,CAAC,uBAAuB,GAAG,YAAY,CAAC,GACrE,uBAAuB,GAAG,YAAY,CAgBxC;AAED,2FAA2F;AAC3F,wBAAgB,uBAAuB,CAAC,YAAY,SAAS,eAAe,EACxE,OAAO,EAAE,iBAAiB,EAAE,EAC5B,WAAW,EAAE,YAAY,GAAG,CAAC,uBAAuB,GAAG,YAAY,CAAC,GACrE,uBAAuB,GAAG,YAAY,CASxC"}
@@ -5,6 +5,6 @@ export interface ITransactionWithFeePayerSigner<TAddress extends string = string
5
5
  readonly feePayer: Address<TAddress>;
6
6
  readonly feePayerSigner: TSigner;
7
7
  }
8
- export declare function setTransactionFeePayerSigner<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayerSigner: TransactionSigner<TFeePayerAddress>, transaction: (TTransaction & ITransactionWithSignatures) | (TTransaction & ITransactionWithFeePayer<string> & ITransactionWithSignatures)): Omit<TTransaction, keyof ITransactionWithSignatures> & ITransactionWithFeePayerSigner<TFeePayerAddress>;
9
- export declare function setTransactionFeePayerSigner<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayerSigner: TransactionSigner<TFeePayerAddress>, transaction: TTransaction | (TTransaction & ITransactionWithFeePayer<string>)): TTransaction & ITransactionWithFeePayerSigner<TFeePayerAddress>;
8
+ export declare function setTransactionFeePayerSigner<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayerSigner: TransactionSigner<TFeePayerAddress>, transaction: (ITransactionWithFeePayer<string> & ITransactionWithSignatures & TTransaction) | (ITransactionWithSignatures & TTransaction)): ITransactionWithFeePayerSigner<TFeePayerAddress> & Omit<TTransaction, keyof ITransactionWithSignatures>;
9
+ export declare function setTransactionFeePayerSigner<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayerSigner: TransactionSigner<TFeePayerAddress>, transaction: TTransaction | (ITransactionWithFeePayer<string> & TTransaction)): ITransactionWithFeePayerSigner<TFeePayerAddress> & TTransaction;
10
10
  //# sourceMappingURL=fee-payer-signer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fee-payer-signer.d.ts","sourceRoot":"","sources":["../../src/fee-payer-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACH,eAAe,EAEf,wBAAwB,EACxB,0BAA0B,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,8BAA8B,CAC3C,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,OAAO,SAAS,iBAAiB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC;IAEzE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,QAAQ,CAAC,cAAc,EAAE,OAAO,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,CAAC,gBAAgB,CAAC,EACnD,WAAW,EACL,CAAC,wBAAwB,CAAC,MAAM,CAAC,GAAG,0BAA0B,GAAG,YAAY,CAAC,GAC9E,CAAC,0BAA0B,GAAG,YAAY,CAAC,GAClD,8BAA8B,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,0BAA0B,CAAC,CAAC;AAE3G,wBAAgB,4BAA4B,CAAC,gBAAgB,SAAS,MAAM,EAAE,YAAY,SAAS,eAAe,EAC9G,cAAc,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,EACnD,WAAW,EAAE,YAAY,GAAG,CAAC,wBAAwB,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,GAC9E,8BAA8B,CAAC,gBAAgB,CAAC,GAAG,YAAY,CAAC"}
@@ -7,13 +7,13 @@ export type KeyPairSigner<TAddress extends string = string> = MessagePartialSign
7
7
  };
8
8
  /** Checks whether the provided value implements the {@link KeyPairSigner} interface. */
9
9
  export declare function isKeyPairSigner<TAddress extends string>(value: {
10
- address: Address<TAddress>;
11
10
  [key: string]: unknown;
11
+ address: Address<TAddress>;
12
12
  }): value is KeyPairSigner<TAddress>;
13
13
  /** Asserts that the provided value implements the {@link KeyPairSigner} interface. */
14
14
  export declare function assertIsKeyPairSigner<TAddress extends string>(value: {
15
- address: Address<TAddress>;
16
15
  [key: string]: unknown;
16
+ address: Address<TAddress>;
17
17
  }): asserts value is KeyPairSigner<TAddress>;
18
18
  /** Creates a KeyPairSigner from the provided Crypto KeyPair. */
19
19
  export declare function createSignerFromKeyPair(keyPair: CryptoKeyPair): Promise<KeyPairSigner>;
@@ -1 +1 @@
1
- {"version":3,"file":"keypair-signer.d.ts","sourceRoot":"","sources":["../../src/keypair-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA2B,MAAM,mBAAmB,CAAC;AAKrE,OAAO,EAA0B,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAA8B,wBAAwB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,8BAA8B,CAAC;AAEpG,2FAA2F;AAC3F,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GACxF,wBAAwB,CAAC,QAAQ,CAAC,GAAG;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC;AAEpE,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IAC5D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,KAAK,IAAI,aAAa,CAAC,QAAQ,CAAC,CAOnC;AAED,sFAAsF;AACtF,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IAClE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,OAAO,CAAC,KAAK,IAAI,aAAa,CAAC,QAAQ,CAAC,CAM3C;AAED,gEAAgE;AAChE,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAqB5F;AAED,uGAAuG;AACvG,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,aAAa,CAAC,CAEpE;AAED,qGAAqG;AACrG,wBAAsB,4BAA4B,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAEnH"}
@@ -9,12 +9,12 @@ export type MessageModifyingSigner<TAddress extends string = string> = Readonly<
9
9
  }>;
10
10
  /** Checks whether the provided value implements the {@link MessageModifyingSigner} interface. */
11
11
  export declare function isMessageModifyingSigner<TAddress extends string>(value: {
12
- address: Address<TAddress>;
13
12
  [key: string]: unknown;
13
+ address: Address<TAddress>;
14
14
  }): value is MessageModifyingSigner<TAddress>;
15
15
  /** Asserts that the provided value implements the {@link MessageModifyingSigner} interface. */
16
16
  export declare function assertIsMessageModifyingSigner<TAddress extends string>(value: {
17
- address: Address<TAddress>;
18
17
  [key: string]: unknown;
18
+ address: Address<TAddress>;
19
19
  }): asserts value is MessageModifyingSigner<TAddress>;
20
20
  //# sourceMappingURL=message-modifying-signer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message-modifying-signer.d.ts","sourceRoot":"","sources":["../../src/message-modifying-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAa,MAAM,mBAAmB,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,CAAC;AAE5D,oDAAoD;AACpD,MAAM,MAAM,sBAAsB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IAC5E,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,qBAAqB,CACjB,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,MAAM,CAAC,EAAE,4BAA4B,GACtC,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAAC;CAC1C,CAAC,CAAC;AAEH,iGAAiG;AACjG,wBAAgB,wBAAwB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IACrE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,GAAG,KAAK,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAM5C;AAED,+FAA+F;AAC/F,wBAAgB,8BAA8B,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IAC3E,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,KAAK,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAMpD"}
1
+ {"version":3,"file":"message-modifying-signer.d.ts","sourceRoot":"","sources":["../../src/message-modifying-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAa,MAAM,mBAAmB,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,CAAC;AAE5D,oDAAoD;AACpD,MAAM,MAAM,sBAAsB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IAC5E,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,qBAAqB,CACjB,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,MAAM,CAAC,EAAE,4BAA4B,GACtC,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAAC;CAC1C,CAAC,CAAC;AAEH,iGAAiG;AACjG,wBAAgB,wBAAwB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IACrE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,KAAK,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAM5C;AAED,+FAA+F;AAC/F,wBAAgB,8BAA8B,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IAC3E,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,OAAO,CAAC,KAAK,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAMpD"}
@@ -9,12 +9,12 @@ export type MessagePartialSigner<TAddress extends string = string> = Readonly<{
9
9
  }>;
10
10
  /** Checks whether the provided value implements the {@link MessagePartialSigner} interface. */
11
11
  export declare function isMessagePartialSigner<TAddress extends string>(value: {
12
- address: Address<TAddress>;
13
12
  [key: string]: unknown;
13
+ address: Address<TAddress>;
14
14
  }): value is MessagePartialSigner<TAddress>;
15
15
  /** Asserts that the provided value implements the {@link MessagePartialSigner} interface. */
16
16
  export declare function assertIsMessagePartialSigner<TAddress extends string>(value: {
17
- address: Address<TAddress>;
18
17
  [key: string]: unknown;
18
+ address: Address<TAddress>;
19
19
  }): asserts value is MessagePartialSigner<TAddress>;
20
20
  //# sourceMappingURL=message-partial-signer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message-partial-signer.d.ts","sourceRoot":"","sources":["../../src/message-partial-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEhE,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAE1D,oDAAoD;AACpD,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IAC1E,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,YAAY,CACR,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,MAAM,CAAC,EAAE,0BAA0B,GACpC,OAAO,CAAC,SAAS,mBAAmB,EAAE,CAAC,CAAC;CAC9C,CAAC,CAAC;AAEH,+FAA+F;AAC/F,wBAAgB,sBAAsB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IACnE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,GAAG,KAAK,IAAI,oBAAoB,CAAC,QAAQ,CAAC,C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AAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,OAAO,CAAC,KAAK,IAAI,oBAAoB,CAAC,QAAQ,CAAC,CAMlD"}
@@ -2,15 +2,15 @@ import { Address } from '@solana/addresses';
2
2
  import { MessageModifyingSigner } from './message-modifying-signer.js';
3
3
  import { MessagePartialSigner } from './message-partial-signer.js';
4
4
  /** Defines a signer capable of signing messages. */
5
- export type MessageSigner<TAddress extends string = string> = MessagePartialSigner<TAddress> | MessageModifyingSigner<TAddress>;
5
+ export type MessageSigner<TAddress extends string = string> = MessageModifyingSigner<TAddress> | MessagePartialSigner<TAddress>;
6
6
  /** Checks whether the provided value implements the {@link MessageSigner} interface. */
7
7
  export declare function isMessageSigner<TAddress extends string>(value: {
8
- address: Address<TAddress>;
9
8
  [key: string]: unknown;
9
+ address: Address<TAddress>;
10
10
  }): value is MessageSigner<TAddress>;
11
11
  /** Asserts that the provided value implements the {@link MessageSigner} interface. */
12
12
  export declare function assertIsMessageSigner<TAddress extends string>(value: {
13
- address: Address<TAddress>;
14
13
  [key: string]: unknown;
14
+ address: Address<TAddress>;
15
15
  }): asserts value is MessageSigner<TAddress>;
16
16
  //# sourceMappingURL=message-signer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message-signer.d.ts","sourceRoot":"","sources":["../../src/message-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAA4B,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAA0B,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAExF,oDAAoD;AACpD,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IACpD,oBAAoB,CAAC,QAAQ,CAAC,GAC9B,sBAAsB,CAAC,QAAQ,CAAC,CAAC;AAEvC,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,E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,KAAK,IAAI,aAAa,CAAC,QAAQ,CAAC,CAM3C"}
@@ -10,7 +10,7 @@ type CompilableTransactionWithSigners = CompilableTransaction & ITransactionWith
10
10
  */
11
11
  export declare function partiallySignTransactionWithSigners<TTransaction extends CompilableTransactionWithSigners = CompilableTransactionWithSigners>(transaction: TTransaction, config?: {
12
12
  abortSignal?: AbortSignal;
13
- }): Promise<TTransaction & ITransactionWithSignatures>;
13
+ }): Promise<ITransactionWithSignatures & TTransaction>;
14
14
  /**
15
15
  * Signs a transaction using any signers that may be stored in IAccountSignerMeta instruction accounts
16
16
  * as well as any signers provided explicitly to this function.
@@ -19,7 +19,7 @@ export declare function partiallySignTransactionWithSigners<TTransaction extends
19
19
  */
20
20
  export declare function signTransactionWithSigners<TTransaction extends CompilableTransactionWithSigners = CompilableTransactionWithSigners>(transaction: TTransaction, config?: {
21
21
  abortSignal?: AbortSignal;
22
- }): Promise<TTransaction & IFullySignedTransaction>;
22
+ }): Promise<IFullySignedTransaction & TTransaction>;
23
23
  /**
24
24
  * Signs and sends a transaction using any signers that may be stored in IAccountSignerMeta
25
25
  * instruction accounts as well as any signers provided explicitly to this function.
@@ -1 +1 @@
1
- {"version":3,"file":"sign-transaction.d.ts","sourceRoot":"","sources":["../../src/sign-transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAEH,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAA6B,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAM3F,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAE/F,KAAK,gCAAgC,GAAG,qBAAqB,GACzD,uBAAuB,GACvB,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAExC;;;;GAIG;AACH,wBAAsB,mCAAmC,CACrD,YAAY,SAAS,gCAAgC,GAAG,gCAAgC,EAExF,WAAW,EAAE,YA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,YAAY,SAAS,gCAAgC,GAAG,gCAAgC,EAExF,WAAW,EAAE,YAAY,EACzB,MAAM,GAAE;IAAE,WAAW,CAAC,EAAE,WAAW,CAAA;CAAO,GAC3C,OAAO,CAAC,uBAAuB,GAAG,YAAY,CAAC,CAIjD;AAED;;;;;GAKG;AACH,wBAAsB,iCAAiC,CACnD,YAAY,SAAS,gCAAgC,GACjD,mCAAmC,GAAG,gCAAgC,GAAG,mCAAmC,EAClH,WAAW,EAAE,YAAY,EAAE,MAAM,GAAE;IAAE,WAAW,CAAC,EAAE,WAAW,CAAA;CAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAuBhG"}
@@ -8,5 +8,5 @@ export type SignableMessage = Readonly<{
8
8
  * Creates a signable message from a provided content.
9
9
  * If a string is provided, it will be UTF-8 encoded.
10
10
  */
11
- export declare function createSignableMessage(content: string | Uint8Array, signatures?: SignatureDictionary): SignableMessage;
11
+ export declare function createSignableMessage(content: Uint8Array | string, signatures?: SignatureDictionary): SignableMessage;
12
12
  //# sourceMappingURL=signable-message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signable-message.d.ts","sourceRoot":"","sources":["../../src/signable-message.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,qFAAqF;AACrF,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACnC,OAAO,EAAE,UAAU,CAAC;IACpB,UAAU,EAAE,mBAAmB,CAAC;CACnC,CAAC,CAAC;AAEH;;;GAGG;AACH,wBAAgB,qBAAqB,CACjC,OAAO,EAAE,MAAM,GAAG,UAAU,EAC5B,UAAU,GAAE,mBAAwB,GACrC,eAAe,CAKjB"}
1
+ {"version":3,"file":"signable-message.d.ts","sourceRoot":"","sources":["../../src/signable-message.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,qFAAqF;AACrF,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACnC,OAAO,EAAE,UAAU,CAAC;IACpB,UAAU,EAAE,mBAAmB,CAAC;CACnC,CAAC,CAAC;AAEH;;;GAGG;AACH,wBAAgB,qBAAqB,CACjC,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,UAAU,GAAE,mBAAwB,GACrC,eAAe,CAKjB"}
@@ -9,12 +9,12 @@ export type TransactionModifyingSigner<TAddress extends string = string> = Reado
9
9
  }>;
10
10
  /** Checks whether the provided value implements the {@link TransactionModifyingSigner} interface. */
11
11
  export declare function isTransactionModifyingSigner<TAddress extends string>(value: {
12
- address: Address<TAddress>;
13
12
  [key: string]: unknown;
13
+ address: Address<TAddress>;
14
14
  }): value is TransactionModifyingSigner<TAddress>;
15
15
  /** Asserts that the provided value implements the {@link TransactionModifyingSigner} interface. */
16
16
  export declare function assertIsTransactionModifyingSigner<TAddress extends string>(value: {
17
- address: Address<TAddress>;
18
17
  [key: string]: unknown;
18
+ address: Address<TAddress>;
19
19
  }): asserts value is TransactionModifyingSigner<TAddress>;
20
20
  //# sourceMappingURL=transaction-modifying-signer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-modifying-signer.d.ts","sourceRoot":"","sources":["../../src/transaction-modifying-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,MAAM,gCAAgC,GAAG,gBAAgB,CAAC;AAEhE,wDAAwD;AACxD,MAAM,MAAM,0BAA0B,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IAChF,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,yBAAyB,CAAC,YAAY,SAAS,qBAAqB,EAChE,YAAY,EAAE,SAAS,YAAY,EAAE,EACrC,MAAM,CAAC,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AAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IACzE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,KAAK,IAAI,0BAA0B,CAAC,QAAQ,CAAC,CAEhD;AAED,mGAAmG;AACnG,wBAAgB,kCAAkC,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IAC/E,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,OAAO,CAAC,KAAK,IAAI,0BAA0B,CAAC,QAAQ,CAAC,CAMxD"}
@@ -9,12 +9,12 @@ export type TransactionPartialSigner<TAddress extends string = string> = Readonl
9
9
  }>;
10
10
  /** Checks whether the provided value implements the {@link TransactionPartialSigner} interface. */
11
11
  export declare function isTransactionPartialSigner<TAddress extends string>(value: {
12
- address: Address<TAddress>;
13
12
  [key: string]: unknown;
13
+ address: Address<TAddress>;
14
14
  }): value is TransactionPartialSigner<TAddress>;
15
15
  /** Asserts that the provided value implements the {@link TransactionPartialSigner} interface. */
16
16
  export declare function assertIsTransactionPartialSigner<TAddress extends string>(value: {
17
- address: Address<TAddress>;
18
17
  [key: string]: unknown;
18
+ address: Address<TAddress>;
19
19
  }): asserts value is TransactionPartialSigner<TAddress>;
20
20
  //# sourceMappingURL=transaction-partial-signer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-partial-signer.d.ts","sourceRoot":"","sources":["../../src/transaction-partial-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEhE,MAAM,MAAM,8BAA8B,GAAG,gBAAgB,CAAC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AC,QAAQ,CAAC,CAAC;IAC3B,gBAAgB,CACZ,YAAY,EAAE,SAAS,qBAAqB,EAAE,EAC9C,MAAM,CAAC,EAAE,8BAA8B,GACxC,OAAO,CAAC,SAAS,mBAAmB,EAAE,CAAC,CAAC;CAC9C,CAAC,CAAC;AAEH,mGAAmG;AACnG,wBAAgB,0BAA0B,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IACvE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,KAAK,IAAI,wBAAwB,CAAC,QAAQ,CAAC,CAE9C;AAED,iGAAiG;AACjG,wBAAgB,gCAAgC,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IAC7E,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,OAAO,CAAC,KAAK,IAAI,wBAAwB,CAAC,QAAQ,CAAC,CAMtD"}
@@ -10,12 +10,12 @@ export type TransactionSendingSigner<TAddress extends string = string> = Readonl
10
10
  }>;
11
11
  /** Checks whether the provided value implements the {@link TransactionSendingSigner} interface. */
12
12
  export declare function isTransactionSendingSigner<TAddress extends string>(value: {
13
- address: Address<TAddress>;
14
13
  [key: string]: unknown;
14
+ address: Address<TAddress>;
15
15
  }): value is TransactionSendingSigner<TAddress>;
16
16
  /** Asserts that the provided value implements the {@link TransactionSendingSigner} interface. */
17
17
  export declare function assertIsTransactionSendingSigner<TAddress extends string>(value: {
18
- address: Address<TAddress>;
19
18
  [key: string]: unknown;
19
+ address: Address<TAddress>;
20
20
  }): asserts value is TransactionSendingSigner<TAddress>;
21
21
  //# sourceMappingURL=transaction-sending-signer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-sending-signer.d.ts","sourceRoot":"","sources":["../../src/transaction-sending-signer.ts"],"names":[],"mappings":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AAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,MAAM,8BAA8B,GAAG,gBAAgB,CAAC;AAE9D,mFAAmF;AACnF,MAAM,MAAM,wBAAwB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IAC9E,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,uBAAuB,CACnB,YAAY,EAAE,SAAS,qBAAqB,EAAE,EAC9C,MAAM,CAAC,EAAE,8BAA8B,GACxC,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC,CAAC;CACzC,CAAC,CAAC;AAEH,mGAAmG;AACnG,wBAAgB,0BAA0B,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IACvE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,KAAK,IAAI,wBAAwB,CAAC,QAAQ,CAAC,CAE9C;AAED,iGAAiG;AACjG,wBAAgB,gCAAgC,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IAC7E,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,OAAO,CAAC,KAAK,IAAI,wBAAwB,CAAC,QAAQ,CAAC,CAMtD"}
@@ -3,15 +3,15 @@ import { TransactionModifyingSigner } from './transaction-modifying-signer.js';
3
3
  import { TransactionPartialSigner } from './transaction-partial-signer.js';
4
4
  import { TransactionSendingSigner } from './transaction-sending-signer.js';
5
5
  /** Defines a signer capable of signing transactions. */
6
- export type TransactionSigner<TAddress extends string = string> = TransactionPartialSigner<TAddress> | TransactionModifyingSigner<TAddress> | TransactionSendingSigner<TAddress>;
6
+ export type TransactionSigner<TAddress extends string = string> = TransactionModifyingSigner<TAddress> | TransactionPartialSigner<TAddress> | TransactionSendingSigner<TAddress>;
7
7
  /** Checks whether the provided value implements the {@link TransactionSigner} interface. */
8
8
  export declare function isTransactionSigner<TAddress extends string>(value: {
9
- address: Address<TAddress>;
10
9
  [key: string]: unknown;
10
+ address: Address<TAddress>;
11
11
  }): value is TransactionSigner<TAddress>;
12
12
  /** Asserts that the provided value implements the {@link TransactionSigner} interface. */
13
13
  export declare function assertIsTransactionSigner<TAddress extends string>(value: {
14
- address: Address<TAddress>;
15
14
  [key: string]: unknown;
15
+ address: Address<TAddress>;
16
16
  }): asserts value is TransactionSigner<TAddress>;
17
17
  //# sourceMappingURL=transaction-signer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-signer.d.ts","sourceRoot":"","sources":["../../src/transaction-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAgC,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC1G,OAAO,EAA8B,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACpG,OAAO,EAA8B,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAEpG,wDAAwD;AACxD,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IACxD,wBAAwB,CAAC,QAAQ,CAAC,GAClC,0BAA0B,CAAC,QAAQ,CAAC,GACpC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;AAEzC,4FAA4F;AAC5F,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IAChE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,GAAG,KAAK,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAIvC;AAED,0FAA0F;AAC1F,wBAAgB,yBAAyB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IACtE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,KAAK,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAM/C"}
1
+ {"version":3,"file":"transaction-signer.d.ts","sourceRoot":"","sources":["../../src/transaction-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAgC,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC1G,OAAO,EAA8B,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACpG,OAAO,EAA8B,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAEpG,wDAAwD;AACxD,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IACxD,0BAA0B,CAAC,QAAQ,CAAC,GACpC,wBAAwB,CAAC,QAAQ,CAAC,GAClC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;AAEzC,4FAA4F;AAC5F,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IAChE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,KAAK,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAIvC;AAED,0FAA0F;AAC1F,wBAAgB,yBAAyB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE;IACtE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,GAAG,OAAO,CAAC,KAAK,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAM/C"}
@@ -5,7 +5,7 @@ export type ITransactionWithSingleSendingSigner = ITransactionWithSigners & {
5
5
  readonly __transactionWithSingleSendingSigner: unique symbol;
6
6
  };
7
7
  /** Checks whether the provided transaction has exactly one {@link TransactionSendingSigner}. */
8
- export declare function isTransactionWithSingleSendingSigner<TTransaction extends CompilableTransaction>(transaction: TTransaction): transaction is TTransaction & ITransactionWithSingleSendingSigner;
8
+ export declare function isTransactionWithSingleSendingSigner<TTransaction extends CompilableTransaction>(transaction: TTransaction): transaction is ITransactionWithSingleSendingSigner & TTransaction;
9
9
  /** Asserts that the provided transaction has exactly one {@link TransactionSendingSigner}. */
10
- export declare function assertIsTransactionWithSingleSendingSigner<TTransaction extends CompilableTransaction>(transaction: TTransaction): asserts transaction is TTransaction & ITransactionWithSingleSendingSigner;
10
+ export declare function assertIsTransactionWithSingleSendingSigner<TTransaction extends CompilableTransaction>(transaction: TTransaction): asserts transaction is ITransactionWithSingleSendingSigner & TTransaction;
11
11
  //# sourceMappingURL=transaction-with-single-sending-signer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-with-single-sending-signer.d.ts","sourceRoot":"","sources":["../../src/transaction-with-single-sending-signer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAA6B,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAK3F,+EAA+E;AAC/E,MAAM,MAAM,mCAAmC,GAAG,uBAAuB,GAAG;IACxE,QAAQ,CAAC,oCAAoC,EAAE,OAAO,MAAM,CAAC;CAChE,CAAC;AAEF,gGAAgG;AAChG,wBAAgB,oCAAoC,CAAC,YAAY,SAAS,qBAAqB,EAC3F,WAAW,EAAE,YAAY,GAC1B,WAAW,IAAI,YAAY,GAAG,mCAAmC,CAOnE;AAED,8FAA8F;AAC9F,wBAAgB,0CAA0C,CAAC,YAAY,SAAS,qBAAqB,EACjG,WAAW,EAAE,YAAY,GAC1B,OAAO,CAAC,WAAW,IAAI,YAAY,GAAG,mCAAmC,CAkB3E"}
1
+ {"version":3,"file":"transaction-with-single-sending-signer.d.ts","sourceRoot":"","sources":["../../src/transaction-with-single-sending-signer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAA6B,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAK3F,+EAA+E;AAC/E,MAAM,MAAM,mCAAmC,GAAG,uBAAuB,GAAG;IACxE,QAAQ,CAAC,oCAAoC,EAAE,OAAO,MAAM,CAAC;CAChE,CAAC;AAEF,gGAAgG;AAChG,wBAAgB,oCAAoC,CAAC,YAAY,SAAS,qBAAqB,EAC3F,WAAW,EAAE,YAAY,GAC1B,WAAW,IAAI,mCAAmC,GAAG,YAAY,CAOnE;AAED,8FAA8F;AAC9F,wBAAgB,0CAA0C,CAAC,YAAY,SAAS,qBAAqB,EACjG,WAAW,EAAE,YAAY,GAC1B,OAAO,CAAC,WAAW,IAAI,mCAAmC,GAAG,YAAY,CAkB3E"}