@solana/transactions 2.0.0-experimental.0108bc7 → 2.0.0-experimental.025ef21

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 (66) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +272 -5
  3. package/dist/index.browser.cjs +492 -292
  4. package/dist/index.browser.cjs.map +1 -1
  5. package/dist/index.browser.js +479 -293
  6. package/dist/index.browser.js.map +1 -1
  7. package/dist/index.native.js +479 -293
  8. package/dist/index.native.js.map +1 -1
  9. package/dist/index.node.cjs +490 -292
  10. package/dist/index.node.cjs.map +1 -1
  11. package/dist/index.node.js +477 -293
  12. package/dist/index.node.js.map +1 -1
  13. package/dist/types/accounts.d.ts +3 -3
  14. package/dist/types/accounts.d.ts.map +1 -1
  15. package/dist/types/blockhash.d.ts +5 -7
  16. package/dist/types/blockhash.d.ts.map +1 -1
  17. package/dist/types/compilable-transaction.d.ts +7 -0
  18. package/dist/types/compilable-transaction.d.ts.map +1 -0
  19. package/dist/types/compile-address-table-lookups.d.ts +3 -3
  20. package/dist/types/compile-address-table-lookups.d.ts.map +1 -1
  21. package/dist/types/compile-header.d.ts +1 -1
  22. package/dist/types/compile-instructions.d.ts +1 -1
  23. package/dist/types/compile-lifetime-token.d.ts +1 -1
  24. package/dist/types/compile-static-accounts.d.ts +3 -3
  25. package/dist/types/compile-static-accounts.d.ts.map +1 -1
  26. package/dist/types/compile-transaction.d.ts +6 -7
  27. package/dist/types/compile-transaction.d.ts.map +1 -1
  28. package/dist/types/create-transaction.d.ts +1 -1
  29. package/dist/types/decompile-transaction.d.ts +13 -0
  30. package/dist/types/decompile-transaction.d.ts.map +1 -0
  31. package/dist/types/durable-nonce.d.ts +11 -10
  32. package/dist/types/durable-nonce.d.ts.map +1 -1
  33. package/dist/types/fee-payer.d.ts +6 -5
  34. package/dist/types/fee-payer.d.ts.map +1 -1
  35. package/dist/types/index.d.ts +13 -8
  36. package/dist/types/index.d.ts.map +1 -1
  37. package/dist/types/instructions.d.ts +2 -2
  38. package/dist/types/message.d.ts +6 -10
  39. package/dist/types/message.d.ts.map +1 -1
  40. package/dist/types/serializers/address-table-lookup.d.ts +5 -3
  41. package/dist/types/serializers/address-table-lookup.d.ts.map +1 -1
  42. package/dist/types/serializers/header.d.ts +5 -3
  43. package/dist/types/serializers/header.d.ts.map +1 -1
  44. package/dist/types/serializers/index.d.ts +3 -0
  45. package/dist/types/serializers/index.d.ts.map +1 -0
  46. package/dist/types/serializers/instruction.d.ts +5 -3
  47. package/dist/types/serializers/instruction.d.ts.map +1 -1
  48. package/dist/types/serializers/message.d.ts +5 -5
  49. package/dist/types/serializers/message.d.ts.map +1 -1
  50. package/dist/types/serializers/transaction-version.d.ts +5 -5
  51. package/dist/types/serializers/transaction-version.d.ts.map +1 -1
  52. package/dist/types/serializers/transaction.d.ts +9 -5
  53. package/dist/types/serializers/transaction.d.ts.map +1 -1
  54. package/dist/types/signatures.d.ts +10 -6
  55. package/dist/types/signatures.d.ts.map +1 -1
  56. package/dist/types/types.d.ts +13 -13
  57. package/dist/types/types.d.ts.map +1 -1
  58. package/dist/types/unsigned-transaction.d.ts +1 -1
  59. package/dist/types/wire-transaction.d.ts +3 -3
  60. package/dist/types/wire-transaction.d.ts.map +1 -1
  61. package/package.json +26 -18
  62. package/dist/index.development.js +0 -1327
  63. package/dist/index.development.js.map +0 -1
  64. package/dist/index.production.min.js +0 -20
  65. package/dist/types/serializers/unimplemented.d.ts +0 -3
  66. package/dist/types/serializers/unimplemented.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decompile-transaction.d.ts","sourceRoot":"","sources":["../../src/decompile-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAmB,MAAM,mBAAmB,CAAC;AAO7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAM5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AA+C1D,MAAM,MAAM,6BAA6B,GAAG;IAAE,CAAC,kBAAkB,EAAE,OAAO,GAAG,OAAO,EAAE,CAAA;CAAE,CAAC;AA4HzF,MAAM,MAAM,0BAA0B,GAAG;IACrC,6BAA6B,CAAC,EAAE,6BAA6B,CAAC;IAC9D,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,wBAAgB,oBAAoB,CAChC,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,CAAC,EAAE,0BAA0B,GACpC,qBAAqB,GAAG,CAAC,qBAAqB,GAAG,0BAA0B,CAAC,CA0C9E"}
@@ -1,22 +1,22 @@
1
- import { Base58EncodedAddress } from '@solana/addresses';
2
- import { IInstruction, IInstructionWithAccounts, IInstructionWithData } from '@solana/instructions';
3
- import { ReadonlyAccount, ReadonlySignerAccount, WritableAccount } from '@solana/instructions/dist/types/accounts';
4
- import { BaseTransaction } from './types';
1
+ import { Address } from '@solana/addresses';
2
+ import { IInstruction, IInstructionWithAccounts, IInstructionWithData, ReadonlyAccount, ReadonlySignerAccount, WritableAccount, WritableSignerAccount } from '@solana/instructions';
3
+ import { ITransactionWithSignatures } from './signatures.js';
4
+ import { BaseTransaction } from './types.js';
5
5
  type AdvanceNonceAccountInstruction<TNonceAccountAddress extends string = string, TNonceAuthorityAddress extends string = string> = IInstruction<'11111111111111111111111111111111'> & IInstructionWithAccounts<readonly [
6
6
  WritableAccount<TNonceAccountAddress>,
7
7
  ReadonlyAccount<'SysvarRecentB1ockHashes11111111111111111111'>,
8
- ReadonlySignerAccount<TNonceAuthorityAddress>
8
+ ReadonlySignerAccount<TNonceAuthorityAddress> | WritableSignerAccount<TNonceAuthorityAddress>
9
9
  ]> & IInstructionWithData<AdvanceNonceAccountInstructionData>;
10
10
  type AdvanceNonceAccountInstructionData = Uint8Array & {
11
- readonly __advanceNonceAccountInstructionData: unique symbol;
11
+ readonly __brand: unique symbol;
12
12
  };
13
13
  type DurableNonceConfig<TNonceAccountAddress extends string = string, TNonceAuthorityAddress extends string = string, TNonceValue extends string = string> = Readonly<{
14
14
  readonly nonce: Nonce<TNonceValue>;
15
- readonly nonceAccountAddress: Base58EncodedAddress<TNonceAccountAddress>;
16
- readonly nonceAuthorityAddress: Base58EncodedAddress<TNonceAuthorityAddress>;
15
+ readonly nonceAccountAddress: Address<TNonceAccountAddress>;
16
+ readonly nonceAuthorityAddress: Address<TNonceAuthorityAddress>;
17
17
  }>;
18
18
  export type Nonce<TNonceValue extends string = string> = TNonceValue & {
19
- readonly __nonce: unique symbol;
19
+ readonly __brand: unique symbol;
20
20
  };
21
21
  type NonceLifetimeConstraint<TNonceValue extends string = string> = Readonly<{
22
22
  nonce: Nonce<TNonceValue>;
@@ -29,6 +29,7 @@ export interface IDurableNonceTransaction<TNonceAccountAddress extends string =
29
29
  readonly lifetimeConstraint: NonceLifetimeConstraint<TNonceValue>;
30
30
  }
31
31
  export declare function assertIsDurableNonceTransaction(transaction: BaseTransaction | (BaseTransaction & IDurableNonceTransaction)): asserts transaction is BaseTransaction & IDurableNonceTransaction;
32
- export declare function setTransactionLifetimeUsingDurableNonce<TTransaction extends BaseTransaction, TNonceAccountAddress extends string = string, TNonceAuthorityAddress extends string = string, TNonceValue extends string = string>({ nonce, nonceAccountAddress, nonceAuthorityAddress, }: DurableNonceConfig<TNonceAccountAddress, TNonceAuthorityAddress, TNonceValue>, transaction: TTransaction | (TTransaction & IDurableNonceTransaction)): TTransaction & IDurableNonceTransaction<TNonceAccountAddress, TNonceAuthorityAddress, TNonceValue>;
32
+ export declare function isAdvanceNonceAccountInstruction(instruction: IInstruction): instruction is AdvanceNonceAccountInstruction;
33
+ export declare function setTransactionLifetimeUsingDurableNonce<TTransaction extends BaseTransaction, TNonceAccountAddress extends string = string, TNonceAuthorityAddress extends string = string, TNonceValue extends string = string>({ nonce, nonceAccountAddress, nonceAuthorityAddress, }: DurableNonceConfig<TNonceAccountAddress, TNonceAuthorityAddress, TNonceValue>, transaction: TTransaction | (TTransaction & IDurableNonceTransaction)): Omit<TTransaction, keyof ITransactionWithSignatures> & IDurableNonceTransaction<TNonceAccountAddress, TNonceAuthorityAddress, TNonceValue>;
33
34
  export {};
34
35
  //# sourceMappingURL=durable-nonce.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"durable-nonce.d.ts","sourceRoot":"","sources":["../../src/durable-nonce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAe,YAAY,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjH,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEnH,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,KAAK,8BAA8B,CAC/B,oBAAoB,SAAS,MAAM,GAAG,MAAM,EAC5C,sBAAsB,SAAS,MAAM,GAAG,MAAM,IAC9C,YAAY,CAAC,kCAAkC,CAAC,GAChD,wBAAwB,CACpB,SAAS;IACL,eAAe,CAAC,oBAAoB,CAAC;IACrC,eAAe,CAAC,6CAA6C,CAAC;IAC9D,qBAAqB,CAAC,sBAAsB,CAAC;CAChD,CACJ,GACD,oBAAoB,CAAC,kCAAkC,CAAC,CAAC;AAC7D,KAAK,kCAAkC,GAAG,UAAU,GAAG;IACnD,QAAQ,CAAC,oCAAoC,EAAE,OAAO,MAAM,CAAC;CAChE,CAAC;AACF,KAAK,kBAAkB,CACnB,oBAAoB,SAAS,MAAM,GAAG,MAAM,EAC5C,sBAAsB,SAAS,MAAM,GAAG,MAAM,EAC9C,WAAW,SAAS,MAAM,GAAG,MAAM,IACnC,QAAQ,CAAC;IACT,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACnC,QAAQ,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;IACz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,wBAAwB,CAAC,oBAAoB,EAAE,sBAAsB,EAAE,WAAW,CAAC,CAwCtF"}
@@ -1,8 +1,9 @@
1
- import { Base58EncodedAddress } from '@solana/addresses';
2
- import { ITransactionWithSignatures } from './signatures';
3
- import { BaseTransaction } from './types';
1
+ import { Address } from '@solana/addresses';
2
+ import { ITransactionWithSignatures } from './signatures.js';
3
+ import { BaseTransaction } from './types.js';
4
4
  export interface ITransactionWithFeePayer<TAddress extends string = string> {
5
- readonly feePayer: Base58EncodedAddress<TAddress>;
5
+ readonly feePayer: Address<TAddress>;
6
6
  }
7
- export declare function setTransactionFeePayer<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayer: Base58EncodedAddress<TFeePayerAddress>, transaction: TTransaction | (TTransaction & ITransactionWithFeePayer<TFeePayerAddress>) | (TTransaction & ITransactionWithSignatures) | (TTransaction & ITransactionWithFeePayer<TFeePayerAddress> & ITransactionWithSignatures)): (TTransaction & ITransactionWithFeePayer<TFeePayerAddress>) | (Omit<TTransaction, keyof ITransactionWithSignatures> & ITransactionWithFeePayer<TFeePayerAddress>);
7
+ export declare function setTransactionFeePayer<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayer: Address<TFeePayerAddress>, transaction: (TTransaction & ITransactionWithSignatures) | (TTransaction & ITransactionWithFeePayer<string> & ITransactionWithSignatures)): Omit<TTransaction, keyof ITransactionWithSignatures> & ITransactionWithFeePayer<TFeePayerAddress>;
8
+ export declare function setTransactionFeePayer<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayer: Address<TFeePayerAddress>, transaction: TTransaction | (TTransaction & ITransactionWithFeePayer<string>)): TTransaction & ITransactionWithFeePayer<TFeePayerAddress>;
8
9
  //# sourceMappingURL=fee-payer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fee-payer.d.ts","sourceRoot":"","sources":["../../src/fee-payer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE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G,0BAA0B,CAAC,GAC3C,CAAC,YAAY,GAAG,wBAAwB,CAAC,MAAM,CAAC,GAAG,0BAA0B,CAAC,GACrF,IAAI,CAAC,YAAY,EAAE,MAAM,0BAA0B,CAAC,GAAG,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;AAErG,wBAAgB,sBAAsB,CAAC,gBAAgB,SAAS,MAAM,EAAE,YAAY,SAAS,eAAe,EACxG,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,EACnC,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC,GAC9E,YAAY,GAAG,wBAAwB,CAAC,gBAAgB,CAAC,CAAC"}
@@ -1,9 +1,14 @@
1
- export * from './blockhash';
2
- export * from './create-transaction';
3
- export * from './durable-nonce';
4
- export * from './fee-payer';
5
- export * from './instructions';
6
- export * from './signatures';
7
- export * from './types';
8
- export * from './wire-transaction';
1
+ export * from './blockhash.js';
2
+ export * from './compilable-transaction.js';
3
+ export * from './create-transaction.js';
4
+ export * from './decompile-transaction.js';
5
+ export * from './durable-nonce.js';
6
+ export * from './fee-payer.js';
7
+ export * from './instructions.js';
8
+ export * from './message.js';
9
+ export * from './serializers/index.js';
10
+ export * from './signatures.js';
11
+ export * from './types.js';
12
+ export * from './unsigned-transaction.js';
13
+ export * from './wire-transaction.js';
9
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { ITransactionWithSignatures } from './signatures';
2
- import { BaseTransaction } from './types';
1
+ import { ITransactionWithSignatures } from './signatures.js';
2
+ import { BaseTransaction } from './types.js';
3
3
  export declare function appendTransactionInstruction<TTransaction extends BaseTransaction>(instruction: TTransaction['instructions'][number], transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): TTransaction | Omit<TTransaction, keyof ITransactionWithSignatures>;
4
4
  export declare function prependTransactionInstruction<TTransaction extends BaseTransaction>(instruction: TTransaction['instructions'][number], transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): TTransaction | Omit<TTransaction, keyof ITransactionWithSignatures>;
5
5
  //# sourceMappingURL=instructions.d.ts.map
@@ -1,19 +1,15 @@
1
- import { ITransactionWithBlockhashLifetime } from './blockhash';
2
- import { getCompiledAddressTableLookups } from './compile-address-table-lookups';
3
- import { getCompiledMessageHeader } from './compile-header';
4
- import { getCompiledInstructions } from './compile-instructions';
5
- import { getCompiledLifetimeToken } from './compile-lifetime-token';
6
- import { getCompiledStaticAccounts } from './compile-static-accounts';
7
- import { IDurableNonceTransaction } from './durable-nonce';
8
- import { ITransactionWithFeePayer } from './fee-payer';
9
- import { BaseTransaction } from './types';
1
+ import { CompilableTransaction } from './compilable-transaction.js';
2
+ import { getCompiledAddressTableLookups } from './compile-address-table-lookups.js';
3
+ import { getCompiledMessageHeader } from './compile-header.js';
4
+ import { getCompiledInstructions } from './compile-instructions.js';
5
+ import { getCompiledLifetimeToken } from './compile-lifetime-token.js';
6
+ import { getCompiledStaticAccounts } from './compile-static-accounts.js';
10
7
  type BaseCompiledMessage = Readonly<{
11
8
  header: ReturnType<typeof getCompiledMessageHeader>;
12
9
  instructions: ReturnType<typeof getCompiledInstructions>;
13
10
  lifetimeToken: ReturnType<typeof getCompiledLifetimeToken>;
14
11
  staticAccounts: ReturnType<typeof getCompiledStaticAccounts>;
15
12
  }>;
16
- type CompilableTransaction = BaseTransaction & ITransactionWithFeePayer & (ITransactionWithBlockhashLifetime | IDurableNonceTransaction);
17
13
  export type CompiledMessage = LegacyCompiledMessage | VersionedCompiledMessage;
18
14
  type LegacyCompiledMessage = BaseCompiledMessage & Readonly<{
19
15
  version: 'legacy';
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/message.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,KAAK,mBAAmB,GAAG,QAAQ,CAAC;IAChC,MAAM,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;IACpD,YAAY,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;IACzD,aAAa,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;IAC3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AC;IACzD,aAAa,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;IAC3D,cAAc,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;CAChE,CAAC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG,wBAAwB,CAAC;AAE/E,KAAK,qBAAqB,GAAG,mBAAmB,GAC5C,QAAQ,CAAC;IACL,OAAO,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEP,KAAK,wBAAwB,GAAG,mBAAmB,GAC/C,QAAQ,CAAC;IACL,mBAAmB,CAAC,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;IACxE,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC,CAAC;AAEP,wBAAgB,cAAc,CAC1B,WAAW,EAAE,qBAAqB,GAAG,QAAQ,CAAC;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC,GACrE,qBAAqB,CAAC;AACzB,wBAAgB,cAAc,CAAC,WAAW,EAAE,qBAAqB,GAAG,wBAAwB,CAAC"}
@@ -1,6 +1,8 @@
1
- import { Serializer } from '@metaplex-foundation/umi-serializers';
2
- import { getCompiledAddressTableLookups } from '../compile-address-table-lookups';
1
+ import { type VariableSizeCodec, type VariableSizeDecoder, type VariableSizeEncoder } from '@solana/codecs-core';
2
+ import type { getCompiledAddressTableLookups } from '../compile-address-table-lookups.js';
3
3
  type AddressTableLookup = ReturnType<typeof getCompiledAddressTableLookups>[number];
4
- export declare function getAddressTableLookupCodec(): Serializer<AddressTableLookup>;
4
+ export declare function getAddressTableLookupEncoder(): VariableSizeEncoder<AddressTableLookup>;
5
+ export declare function getAddressTableLookupDecoder(): VariableSizeDecoder<AddressTableLookup>;
6
+ export declare function getAddressTableLookupCodec(): VariableSizeCodec<AddressTableLookup>;
5
7
  export {};
6
8
  //# sourceMappingURL=address-table-lookup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"address-table-lookup.d.ts","sourceRoot":"","sources":["../../../src/serializers/address-table-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAiD,MAAM,sCAAsC,CAAC;AAGxH,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpF,wBAAgB,0BAA0B,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAkD3E"}
1
+ {"version":3,"file":"address-table-lookup.d.ts","sourceRoot":"","sources":["../../../src/serializers/address-table-lookup.ts"],"names":[],"mappings":"AACA,OAAO,EAGH,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAC3B,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAEvF,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAGpF,wBAAgB,4BAA4B,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CAgBtF;AAGD,wBAAgB,4BAA4B,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CAUtF;AAED,wBAAgB,0BAA0B,IAAI,iBAAiB,CAAC,kBAAkB,CAAC,CAElF"}
@@ -1,6 +1,8 @@
1
- import { Serializer } from '@metaplex-foundation/umi-serializers';
2
- import { getCompiledMessageHeader } from '../compile-header';
1
+ import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
2
+ import { getCompiledMessageHeader } from '../compile-header.js';
3
3
  type MessageHeader = ReturnType<typeof getCompiledMessageHeader>;
4
- export declare function getMessageHeaderCodec(): Serializer<MessageHeader>;
4
+ export declare function getMessageHeaderEncoder(): FixedSizeEncoder<MessageHeader, 3>;
5
+ export declare function getMessageHeaderDecoder(): FixedSizeDecoder<MessageHeader, 3>;
6
+ export declare function getMessageHeaderCodec(): FixedSizeCodec<MessageHeader, MessageHeader, 3>;
5
7
  export {};
6
8
  //# sourceMappingURL=header.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/serializers/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEjE,wBAAgB,qBAAqB,IAAI,UAAU,CAAC,aAAa,CAAC,CA4CjE"}
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/serializers/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAoBjE,wBAAgB,uBAAuB,IAAI,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAC,CAM5E;AAED,wBAAgB,uBAAuB,IAAI,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAC,CAM5E;AAED,wBAAgB,qBAAqB,IAAI,cAAc,CAAC,aAAa,EAAE,aAAa,EAAE,CAAC,CAAC,CAMvF"}
@@ -0,0 +1,3 @@
1
+ export * from './message.js';
2
+ export * from './transaction.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/serializers/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
@@ -1,6 +1,8 @@
1
- import { Serializer } from '@metaplex-foundation/umi-serializers';
2
- import { getCompiledInstructions } from '../compile-instructions';
1
+ import { VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder } from '@solana/codecs-core';
2
+ import { getCompiledInstructions } from '../compile-instructions.js';
3
3
  type Instruction = ReturnType<typeof getCompiledInstructions>[number];
4
- export declare function getInstructionCodec(): Serializer<Instruction>;
4
+ export declare function getInstructionEncoder(): VariableSizeEncoder<Instruction>;
5
+ export declare function getInstructionDecoder(): VariableSizeDecoder<Instruction>;
6
+ export declare function getInstructionCodec(): VariableSizeCodec<Instruction>;
5
7
  export {};
6
8
  //# sourceMappingURL=instruction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instruction.d.ts","sourceRoot":"","sources":["../../../src/serializers/instruction.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,UAAU,EAAwB,MAAM,sCAAsC,CAAC;AAErH,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,wBAAgB,mBAAmB,IAAI,UAAU,CAAC,WAAW,CAAC,CAgE7D"}
1
+ {"version":3,"file":"instruction.d.ts","sourceRoot":"","sources":["../../../src/serializers/instruction.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAW7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAGtE,wBAAgB,qBAAqB,IAAI,mBAAmB,CAAC,WAAW,CAAC,CAuBxE;AAGD,wBAAgB,qBAAqB,IAAI,mBAAmB,CAAC,WAAW,CAAC,CAuBxE;AAED,wBAAgB,mBAAmB,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAEpE"}
@@ -1,6 +1,6 @@
1
- import { Serializer } from '@metaplex-foundation/umi-serializers';
2
- import { CompiledMessage } from '../message';
3
- export declare function getCompiledMessageEncoder(): Serializer<CompiledMessage>;
4
- export declare function getCompiledMessageDecoder(): Serializer<CompiledMessage>;
5
- export declare function getCompiledMessageCodec(): Serializer<CompiledMessage>;
1
+ import { VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder } from '@solana/codecs-core';
2
+ import { CompiledMessage } from '../message.js';
3
+ export declare function getCompiledMessageEncoder(): VariableSizeEncoder<CompiledMessage>;
4
+ export declare function getCompiledMessageDecoder(): VariableSizeDecoder<CompiledMessage>;
5
+ export declare function getCompiledMessageCodec(): VariableSizeCodec<CompiledMessage>;
6
6
  //# sourceMappingURL=message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/serializers/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,UAAU,EAKb,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA6F7C,wBAAgB,yBAAyB,IAAI,UAAU,CAAC,eAAe,CAAC,CAMvE;AAED,wBAAgB,yBAAyB,IAAI,UAAU,CAAC,eAAe,CAAC,CAMvE;AAED,wBAAgB,uBAAuB,IAAI,UAAU,CAAC,eAAe,CAAC,CAMrE"}
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/serializers/message.ts"],"names":[],"mappings":"AACA,OAAO,EAMH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAa7B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA2D7C,wBAAgB,yBAAyB,IAAI,mBAAmB,CAAC,eAAe,CAAC,CAiBhF;AAED,wBAAgB,yBAAyB,IAAI,mBAAmB,CAAC,eAAe,CAAC,CAOhF;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAAC,eAAe,CAAC,CAE5E"}
@@ -1,6 +1,6 @@
1
- import { Serializer } from '@metaplex-foundation/umi-serializers';
2
- import { TransactionVersion } from '../types';
3
- export declare function getTransactionVersionDecoder(): Serializer<TransactionVersion>;
4
- export declare function getTransactionVersionEncoder(): Serializer<TransactionVersion>;
5
- export declare function getTransactionVersionCodec(): Serializer<TransactionVersion>;
1
+ import { VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder } from '@solana/codecs-core';
2
+ import { TransactionVersion } from '../types.js';
3
+ export declare function getTransactionVersionEncoder(): VariableSizeEncoder<TransactionVersion>;
4
+ export declare function getTransactionVersionDecoder(): VariableSizeDecoder<TransactionVersion>;
5
+ export declare function getTransactionVersionCodec(): VariableSizeCodec<TransactionVersion>;
6
6
  //# sourceMappingURL=transaction-version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-version.d.ts","sourceRoot":"","sources":["../../../src/serializers/transaction-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAiC9C,wBAAgB,4BAA4B,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAM7E;AAED,wBAAgB,4BAA4B,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAM7E;AAED,wBAAgB,0BAA0B,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAM3E"}
1
+ {"version":3,"file":"transaction-version.d.ts","sourceRoot":"","sources":["../../../src/serializers/transaction-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,wBAAgB,4BAA4B,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CAgBtF;AAED,wBAAgB,4BAA4B,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CActF;AAED,wBAAgB,0BAA0B,IAAI,iBAAiB,CAAC,kBAAkB,CAAC,CAElF"}
@@ -1,6 +1,10 @@
1
- import { Serializer } from '@metaplex-foundation/umi-serializers';
2
- import { getCompiledTransaction } from '../compile-transaction';
3
- type SerializableTransaction = Parameters<typeof getCompiledTransaction>[0];
4
- export declare function getTransactionEncoder(): Serializer<SerializableTransaction>;
5
- export {};
1
+ import { VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder } from '@solana/codecs-core';
2
+ import { CompilableTransaction } from '../compilable-transaction.js';
3
+ import { CompiledTransaction } from '../compile-transaction.js';
4
+ import { DecompileTransactionConfig } from '../decompile-transaction.js';
5
+ import { ITransactionWithSignatures } from '../signatures.js';
6
+ export declare function getCompiledTransactionDecoder(): VariableSizeDecoder<CompiledTransaction>;
7
+ export declare function getTransactionEncoder(): VariableSizeEncoder<CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures)>;
8
+ export declare function getTransactionDecoder(config?: DecompileTransactionConfig): VariableSizeDecoder<CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures)>;
9
+ export declare function getTransactionCodec(config?: DecompileTransactionConfig): VariableSizeCodec<CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures)>;
6
10
  //# sourceMappingURL=transaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/serializers/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAoB,MAAM,sCAAsC,CAAC;AAElG,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAUhE,KAAK,uBAAuB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AAgB5E,wBAAgB,qBAAqB,IAAI,UAAU,CAAC,uBAAuB,CAAC,CAM3E"}
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/serializers/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAY7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAA0B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAwB,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAU3D,wBAAgB,6BAA6B,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,CAUxF;AAED,wBAAgB,qBAAqB,IAAI,mBAAmB,CACxD,qBAAqB,GAAG,CAAC,qBAAqB,GAAG,0BAA0B,CAAC,CAC/E,CAEA;AAED,wBAAgB,qBAAqB,CACjC,MAAM,CAAC,EAAE,0BAA0B,GACpC,mBAAmB,CAAC,qBAAqB,GAAG,CAAC,qBAAqB,GAAG,0BAA0B,CAAC,CAAC,CAInG;AAED,wBAAgB,mBAAmB,CAC/B,MAAM,CAAC,EAAE,0BAA0B,GACpC,iBAAiB,CAAC,qBAAqB,GAAG,CAAC,qBAAqB,GAAG,0BAA0B,CAAC,CAAC,CAEjG"}
@@ -1,11 +1,15 @@
1
- import { Base58EncodedAddress } from '@solana/addresses';
2
- import { Ed25519Signature } from '@solana/keys';
3
- import { compileMessage } from './message';
1
+ import { Address } from '@solana/addresses';
2
+ import { Signature, SignatureBytes } from '@solana/keys';
3
+ import { CompilableTransaction } from './compilable-transaction.js';
4
+ import { ITransactionWithFeePayer } from './fee-payer.js';
4
5
  export interface IFullySignedTransaction extends ITransactionWithSignatures {
5
- readonly __fullySignedTransaction: unique symbol;
6
+ readonly __brand: unique symbol;
6
7
  }
7
8
  export interface ITransactionWithSignatures {
8
- readonly signatures: Readonly<Record<Base58EncodedAddress, Ed25519Signature>>;
9
+ readonly signatures: Readonly<Record<Address, SignatureBytes>>;
9
10
  }
10
- export declare function signTransaction<TTransaction extends Parameters<typeof compileMessage>[0]>(keyPair: CryptoKeyPair, transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): Promise<TTransaction & ITransactionWithSignatures>;
11
+ export declare function getSignatureFromTransaction(transaction: ITransactionWithFeePayer & ITransactionWithSignatures): Signature;
12
+ export declare function partiallySignTransaction<TTransaction extends CompilableTransaction>(keyPairs: CryptoKeyPair[], transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): Promise<TTransaction & ITransactionWithSignatures>;
13
+ export declare function signTransaction<TTransaction extends CompilableTransaction>(keyPairs: CryptoKeyPair[], transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): Promise<TTransaction & IFullySignedTransaction>;
14
+ export declare function assertTransactionIsFullySigned<TTransaction extends CompilableTransaction>(transaction: TTransaction & ITransactionWithSignatures): asserts transaction is TTransaction & IFullySignedTransaction;
11
15
  //# sourceMappingURL=signatures.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signatures.d.ts","sourceRoot":"","sources":["../../src/signatures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAwC,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAa,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAmB,cAAc,EAAE,MAAM,WAAW,CAAC;AAG5D,MAAM,WAAW,uBAAwB,SAAQ,0BAA0B;IACvE,QAAQ,CAAC,wBAAwB,EAAE,OAAO,MAAM,CAAC;CACpD;AACD,MAAM,WAAW,0BAA0B;IACvC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC,CAAC;CACjF;AAQD,wBAAsB,eAAe,CAAC,YAAY,SAAS,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,EAC3F,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,0BAA0B,CAAC,GACxE,OAAO,CAAC,YAAY,GAAG,0BAA0B,CAAC,CAgBpD"}
1
+ {"version":3,"file":"signatures.d.ts","sourceRoot":"","sources":["../../src/signatures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA2B,MAAM,mBAAmB,CAAC;AASrE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAa,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAIvD,MAAM,WAAW,uBAAwB,SAAQ,0BAA0B;IACvE,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAC;CACnC;AACD,MAAM,WAAW,0BAA0B;IACvC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;CAClE;AAID,wBAAgB,2BAA2B,CACvC,WAAW,EAAE,wBAAwB,GAAG,0BAA0B,GACnE,SAAS,CASX;AAED,wBAAsB,wBAAwB,CAAC,YAAY,SAAS,qBAAqB,EACrF,QAAQ,EAAE,aAAa,EAAE,EACzB,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,0BAA0B,CAAC,GACxE,OAAO,CAAC,YAAY,GAAG,0BAA0B,CAAC,CAmBpD;AAED,wBAAsB,eAAe,CAAC,YAAY,SAAS,qBAAqB,EAC5E,QAAQ,EAAE,aAAa,EAAE,EACzB,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,0BAA0B,CAAC,GACxE,OAAO,CAAC,YAAY,GAAG,uBAAuB,CAAC,CAKjD;AAED,wBAAgB,8BAA8B,CAAC,YAAY,SAAS,qBAAqB,EACrF,WAAW,EAAE,YAAY,GAAG,0BAA0B,GACvD,OAAO,CAAC,WAAW,IAAI,YAAY,GAAG,uBAAuB,CAkB/D"}
@@ -1,18 +1,18 @@
1
1
  import { IAccountMeta, IInstruction } from '@solana/instructions';
2
- export type BaseTransaction = Readonly<{
3
- instructions: readonly IInstruction[];
4
- version: TransactionVersion;
5
- }>;
6
- type LegacyTransaction = BaseTransaction & Readonly<{
7
- instructions: readonly (Omit<IInstruction, 'accounts'> & Readonly<{
8
- readonly accounts?: readonly IAccountMeta[];
9
- }>)[];
10
- version: 'legacy';
11
- }>;
12
- type V0Transaction = BaseTransaction & Readonly<{
13
- instructions: readonly IInstruction[];
14
- version: 0;
2
+ /** A string of bytes that are definitely a serialized message */
3
+ export type SerializedMessageBytes = Uint8Array & {
4
+ readonly __serializedMessageBytes: unique symbol;
5
+ };
6
+ export type SerializedMessageBytesBase64 = string & {
7
+ readonly __serializedMessageBytesBase64: unique symbol;
8
+ };
9
+ export type BaseTransaction<TVersion extends TransactionVersion = TransactionVersion, TInstruction extends IInstruction = IInstruction> = Readonly<{
10
+ instructions: readonly TInstruction[];
11
+ version: TVersion;
15
12
  }>;
13
+ type ILegacyInstruction<TProgramAddress extends string = string> = IInstruction<TProgramAddress, readonly IAccountMeta[]>;
14
+ type LegacyTransaction = BaseTransaction<'legacy', ILegacyInstruction>;
15
+ type V0Transaction = BaseTransaction<0, IInstruction>;
16
16
  export type Transaction = LegacyTransaction | V0Transaction;
17
17
  export type TransactionVersion = 'legacy' | 0;
18
18
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACnC,YAAY,EAAE,SAAS,YAAY,EAAE,CAAC;IACtC,OAAO,EAAE,kBAAkB,CAAC;CAC/B,CAAC,CAAC;AAEH,KAAK,iBAAiB,GAAG,eAAe,GACpC,QAAQ,CAAC;IACL,YAAY,EAAE,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,GAClD,QAAQ,CAAC;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;KAAE,CAAC,CAAC,EAAE,CAAC;IACjE,OAAO,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEP,KAAK,aAAa,GAAG,eA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seTransaction } from './types';
2
+ import { BaseTransaction } from './types.js';
3
3
  export declare function getUnsignedTransaction<TTransaction extends BaseTransaction>(transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): TTransaction | Omit<TTransaction & ITransactionWithSignatures, keyof ITransactionWithSignatures>;
4
4
  //# sourceMappingURL=unsigned-transaction.d.ts.map
@@ -1,6 +1,6 @@
1
- import { getTransactionEncoder } from './serializers/transaction';
1
+ import { getTransactionEncoder } from './serializers/transaction.js';
2
2
  export type Base64EncodedWireTransaction = string & {
3
- readonly __base64EncodedWireTransaction: unique symbol;
3
+ readonly __brand: unique symbol;
4
4
  };
5
- export declare function getBase64EncodedWireTransaction(transaction: Parameters<ReturnType<typeof getTransactionEncoder>['serialize']>[0]): Base64EncodedWireTransaction;
5
+ export declare function getBase64EncodedWireTransaction(transaction: Parameters<ReturnType<typeof getTransactionEncoder>['encode']>[0]): Base64EncodedWireTransaction;
6
6
  //# sourceMappingURL=wire-transaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wire-transaction.d.ts","sourceRoot":"","sources":["../../src/wire-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG;IAChD,QAAQ,CAAC,8BAA8B,EAAE,OAAO,MAAM,CAAC;CAC1D,CAAC;AAEF,wBAAgB,+BAA+B,CAC3C,WAAW,EAAE,UAAU,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GAClF,4BAA4B,CAO9B"}
1
+ {"version":3,"file":"wire-transaction.d.ts","sourceRoot":"","sources":["../../src/wire-transaction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG;IAChD,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAgB,+BAA+B,CAC3C,WAAW,EAAE,UAAU,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAC/E,4BAA4B,CAG9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/transactions",
3
- "version": "2.0.0-experimental.0108bc7",
3
+ "version": "2.0.0-experimental.025ef21",
4
4
  "description": "Helpers for creating and serializing transactions",
5
5
  "exports": {
6
6
  "browser": {
@@ -46,28 +46,35 @@
46
46
  "maintained node versions"
47
47
  ],
48
48
  "dependencies": {
49
- "@metaplex-foundation/umi-serializers": "^0.8.5",
50
- "@solana/addresses": "2.0.0-experimental.0108bc7",
51
- "@solana/keys": "2.0.0-experimental.0108bc7"
49
+ "@solana/addresses": "2.0.0-experimental.025ef21",
50
+ "@solana/codecs-core": "2.0.0-experimental.025ef21",
51
+ "@solana/codecs-data-structures": "2.0.0-experimental.025ef21",
52
+ "@solana/codecs-numbers": "2.0.0-experimental.025ef21",
53
+ "@solana/codecs-strings": "2.0.0-experimental.025ef21",
54
+ "@solana/errors": "2.0.0-experimental.025ef21",
55
+ "@solana/functional": "2.0.0-experimental.025ef21",
56
+ "@solana/keys": "2.0.0-experimental.025ef21"
52
57
  },
53
58
  "devDependencies": {
54
59
  "@solana/eslint-config-solana": "^1.0.2",
55
- "@swc/jest": "^0.2.27",
56
- "@types/jest": "^29.5.3",
57
- "@typescript-eslint/eslint-plugin": "^6.3.0",
58
- "@typescript-eslint/parser": "^6.0.0",
60
+ "@swc/jest": "^0.2.29",
61
+ "@types/jest": "^29.5.11",
62
+ "@types/node": "18.11.19",
63
+ "@typescript-eslint/eslint-plugin": "^6.13.2",
64
+ "@typescript-eslint/parser": "^6.3.0",
59
65
  "agadoo": "^3.0.0",
60
66
  "eslint": "^8.45.0",
61
67
  "eslint-plugin-sort-keys-fix": "^1.1.2",
62
- "jest": "^29.6.1",
63
- "jest-runner-eslint": "^2.1.0",
68
+ "jest": "^29.7.0",
69
+ "jest-runner-eslint": "^2.1.2",
64
70
  "jest-runner-prettier": "^1.0.0",
65
- "prettier": "^3.0.1",
66
- "tsup": "7.2.0",
67
- "typescript": "^5.1.6",
71
+ "prettier": "^3.1",
72
+ "tsup": "^8.0.1",
73
+ "typescript": "^5.2.2",
68
74
  "version-from-git": "^1.1.1",
69
- "@solana/instructions": "2.0.0-experimental.0108bc7",
75
+ "@solana/instructions": "2.0.0-experimental.025ef21",
70
76
  "build-scripts": "0.0.0",
77
+ "@solana/rpc-types": "2.0.0-experimental.025ef21",
71
78
  "test-config": "0.0.0",
72
79
  "test-matchers": "0.0.0",
73
80
  "tsconfig": "0.0.0"
@@ -81,15 +88,16 @@
81
88
  ]
82
89
  },
83
90
  "scripts": {
84
- "compile:js": "tsup --config build-scripts/tsup.config.library.ts",
85
- "compile:typedefs": "tsc -p ./tsconfig.declarations.json",
91
+ "compile:js": "tsup --config build-scripts/tsup.config.package.ts",
92
+ "compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/build-scripts/add-js-extension-to-types.mjs",
86
93
  "dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
87
94
  "publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
95
+ "style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
88
96
  "test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
89
97
  "test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
90
98
  "test:treeshakability:browser": "agadoo dist/index.browser.js",
91
- "test:treeshakability:native": "agadoo dist/index.node.js",
92
- "test:treeshakability:node": "agadoo dist/index.native.js",
99
+ "test:treeshakability:native": "agadoo dist/index.native.js",
100
+ "test:treeshakability:node": "agadoo dist/index.node.js",
93
101
  "test:typecheck": "tsc --noEmit",
94
102
  "test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --rootDir . --silent",
95
103
  "test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --rootDir . --silent"