signet.js 0.0.10-beta11 → 0.0.10-beta13

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signet.js",
3
- "version": "0.0.10-beta11",
3
+ "version": "0.0.10-beta13",
4
4
  "description": "A TypeScript library for handling multi-chain transactions and signatures using Signet MPC",
5
5
  "type": "module",
6
6
  "exports": {
package/types/index.d.cts CHANGED
@@ -9,8 +9,8 @@ import { TxExecutionStatus } from '@near-js/types';
9
9
  import { NetworkId, Action, FinalExecutionOutcome } from '@near-wallet-selector/core';
10
10
  import { KeyPair as KeyPair$1 } from 'near-api-js';
11
11
  import * as _solana_web3_js from '@solana/web3.js';
12
- import { PublicKey } from '@solana/web3.js';
13
- import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
12
+ import { PublicKey, AccountMeta, TransactionInstruction } from '@solana/web3.js';
13
+ import { AnchorProvider } from '@coral-xyz/anchor';
14
14
 
15
15
  interface SignArgs {
16
16
  /** The payload to sign as an array of 32 bytes */
@@ -107,7 +107,6 @@ declare const ENVS: {
107
107
  readonly TESTNET_DEV: "TESTNET_DEV";
108
108
  readonly TESTNET: "TESTNET";
109
109
  readonly MAINNET: "MAINNET";
110
- readonly SOLANA_STUB: "SOLANA_STUB";
111
110
  };
112
111
  declare const CHAINS: {
113
112
  readonly ETHEREUM: "ETHEREUM";
@@ -140,7 +139,7 @@ declare const KDF_CHAIN_IDS: {
140
139
  *
141
140
  * @see ChainSignatureContract documentation for implementation details
142
141
  */
143
- declare const CONTRACT_ADDRESSES: Record<keyof typeof CHAINS, Partial<Record<keyof typeof ENVS, string>>>;
142
+ declare const CONTRACT_ADDRESSES: Record<keyof typeof CHAINS, Record<keyof typeof ENVS, string>>;
144
143
 
145
144
  declare const constants_CHAINS: typeof CHAINS;
146
145
  declare const constants_CONTRACT_ADDRESSES: typeof CONTRACT_ADDRESSES;
@@ -1084,6 +1083,7 @@ declare class ChainSignatureContract extends ChainSignatureContract$3 {
1084
1083
  private readonly program;
1085
1084
  private readonly programId;
1086
1085
  private readonly rootPublicKey;
1086
+ private readonly requesterAddress;
1087
1087
  /**
1088
1088
  * Creates a new instance of the ChainSignatureContract for Solana chains.
1089
1089
  *
@@ -1091,11 +1091,13 @@ declare class ChainSignatureContract extends ChainSignatureContract$3 {
1091
1091
  * @param args.provider - An Anchor Provider for interacting with Solana
1092
1092
  * @param args.programId - The program ID as a string or PublicKey
1093
1093
  * @param args.rootPublicKey - Optional root public key. If not provided, it will be derived from the program ID
1094
+ * @param args.requesterAddress - Provider wallet address is always the fee payer but can be overridden
1094
1095
  */
1095
1096
  constructor(args: {
1096
1097
  provider: AnchorProvider;
1097
1098
  programId: string | PublicKey;
1098
1099
  rootPublicKey?: NajPublicKey;
1100
+ requesterAddress?: string;
1099
1101
  });
1100
1102
  /**
1101
1103
  * Gets the connection from the provider
@@ -1111,14 +1113,17 @@ declare class ChainSignatureContract extends ChainSignatureContract$3 {
1111
1113
  predecessor: string;
1112
1114
  }): Promise<UncompressedPubKeySEC1>;
1113
1115
  getPublicKey(): Promise<UncompressedPubKeySEC1>;
1116
+ getSignRequestInstruction(args: SignArgs, options?: SignOptions & {
1117
+ remainingAccounts?: Array<AccountMeta>;
1118
+ }): Promise<TransactionInstruction>;
1114
1119
  /**
1115
1120
  * Sends a transaction to the program to request a signature, then
1116
1121
  * polls for the signature result. If the signature is not found within the retry
1117
1122
  * parameters, it will throw an error.
1118
1123
  */
1119
- sign(args: SignArgs & {
1120
- feePayer?: Wallet;
1121
- }, options?: SignOptions): Promise<RSVSignature>;
1124
+ sign(args: SignArgs, options?: SignOptions & {
1125
+ remainingAccounts?: Array<AccountMeta>;
1126
+ }): Promise<RSVSignature>;
1122
1127
  /**
1123
1128
  * Listens for signature or error events matching the given requestId.
1124
1129
  * Sets up listeners for both event types and returns a promise that resolves when
@@ -1133,9 +1138,7 @@ declare class ChainSignatureContract extends ChainSignatureContract$3 {
1133
1138
  /**
1134
1139
  * Generates the request ID for a signature request allowing to track the response.
1135
1140
  */
1136
- getRequestId(args: SignArgs, options?: SignOptions['sign'] & {
1137
- requesterAddress?: string;
1138
- }): string;
1141
+ getRequestId(args: SignArgs, options?: SignOptions['sign']): string;
1139
1142
  }
1140
1143
 
1141
1144
  declare const utils: {
package/types/index.d.ts CHANGED
@@ -9,8 +9,8 @@ import { TxExecutionStatus } from '@near-js/types';
9
9
  import { NetworkId, Action, FinalExecutionOutcome } from '@near-wallet-selector/core';
10
10
  import { KeyPair as KeyPair$1 } from 'near-api-js';
11
11
  import * as _solana_web3_js from '@solana/web3.js';
12
- import { PublicKey } from '@solana/web3.js';
13
- import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
12
+ import { PublicKey, AccountMeta, TransactionInstruction } from '@solana/web3.js';
13
+ import { AnchorProvider } from '@coral-xyz/anchor';
14
14
 
15
15
  interface SignArgs {
16
16
  /** The payload to sign as an array of 32 bytes */
@@ -107,7 +107,6 @@ declare const ENVS: {
107
107
  readonly TESTNET_DEV: "TESTNET_DEV";
108
108
  readonly TESTNET: "TESTNET";
109
109
  readonly MAINNET: "MAINNET";
110
- readonly SOLANA_STUB: "SOLANA_STUB";
111
110
  };
112
111
  declare const CHAINS: {
113
112
  readonly ETHEREUM: "ETHEREUM";
@@ -140,7 +139,7 @@ declare const KDF_CHAIN_IDS: {
140
139
  *
141
140
  * @see ChainSignatureContract documentation for implementation details
142
141
  */
143
- declare const CONTRACT_ADDRESSES: Record<keyof typeof CHAINS, Partial<Record<keyof typeof ENVS, string>>>;
142
+ declare const CONTRACT_ADDRESSES: Record<keyof typeof CHAINS, Record<keyof typeof ENVS, string>>;
144
143
 
145
144
  declare const constants_CHAINS: typeof CHAINS;
146
145
  declare const constants_CONTRACT_ADDRESSES: typeof CONTRACT_ADDRESSES;
@@ -1084,6 +1083,7 @@ declare class ChainSignatureContract extends ChainSignatureContract$3 {
1084
1083
  private readonly program;
1085
1084
  private readonly programId;
1086
1085
  private readonly rootPublicKey;
1086
+ private readonly requesterAddress;
1087
1087
  /**
1088
1088
  * Creates a new instance of the ChainSignatureContract for Solana chains.
1089
1089
  *
@@ -1091,11 +1091,13 @@ declare class ChainSignatureContract extends ChainSignatureContract$3 {
1091
1091
  * @param args.provider - An Anchor Provider for interacting with Solana
1092
1092
  * @param args.programId - The program ID as a string or PublicKey
1093
1093
  * @param args.rootPublicKey - Optional root public key. If not provided, it will be derived from the program ID
1094
+ * @param args.requesterAddress - Provider wallet address is always the fee payer but can be overridden
1094
1095
  */
1095
1096
  constructor(args: {
1096
1097
  provider: AnchorProvider;
1097
1098
  programId: string | PublicKey;
1098
1099
  rootPublicKey?: NajPublicKey;
1100
+ requesterAddress?: string;
1099
1101
  });
1100
1102
  /**
1101
1103
  * Gets the connection from the provider
@@ -1111,14 +1113,17 @@ declare class ChainSignatureContract extends ChainSignatureContract$3 {
1111
1113
  predecessor: string;
1112
1114
  }): Promise<UncompressedPubKeySEC1>;
1113
1115
  getPublicKey(): Promise<UncompressedPubKeySEC1>;
1116
+ getSignRequestInstruction(args: SignArgs, options?: SignOptions & {
1117
+ remainingAccounts?: Array<AccountMeta>;
1118
+ }): Promise<TransactionInstruction>;
1114
1119
  /**
1115
1120
  * Sends a transaction to the program to request a signature, then
1116
1121
  * polls for the signature result. If the signature is not found within the retry
1117
1122
  * parameters, it will throw an error.
1118
1123
  */
1119
- sign(args: SignArgs & {
1120
- feePayer?: Wallet;
1121
- }, options?: SignOptions): Promise<RSVSignature>;
1124
+ sign(args: SignArgs, options?: SignOptions & {
1125
+ remainingAccounts?: Array<AccountMeta>;
1126
+ }): Promise<RSVSignature>;
1122
1127
  /**
1123
1128
  * Listens for signature or error events matching the given requestId.
1124
1129
  * Sets up listeners for both event types and returns a promise that resolves when
@@ -1133,9 +1138,7 @@ declare class ChainSignatureContract extends ChainSignatureContract$3 {
1133
1138
  /**
1134
1139
  * Generates the request ID for a signature request allowing to track the response.
1135
1140
  */
1136
- getRequestId(args: SignArgs, options?: SignOptions['sign'] & {
1137
- requesterAddress?: string;
1138
- }): string;
1141
+ getRequestId(args: SignArgs, options?: SignOptions['sign']): string;
1139
1142
  }
1140
1143
 
1141
1144
  declare const utils: {