signet.js 0.0.10-beta12 → 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/browser/index.browser.cjs +1 -1
- package/browser/index.browser.cjs.map +1 -1
- package/browser/index.browser.js +1 -1
- package/browser/index.browser.js.map +1 -1
- package/node/index.node.cjs +1 -1
- package/node/index.node.cjs.map +1 -1
- package/node/index.node.js +1 -1
- package/node/index.node.js.map +1 -1
- package/package.json +1 -1
- package/types/index.d.cts +14 -13
- package/types/index.d.ts +14 -13
package/package.json
CHANGED
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
|
|
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,
|
|
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
|
-
|
|
1121
|
-
}
|
|
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
|
|
@@ -1128,16 +1133,12 @@ declare class ChainSignatureContract extends ChainSignatureContract$3 {
|
|
|
1128
1133
|
requestId: string;
|
|
1129
1134
|
payload: number[];
|
|
1130
1135
|
path: string;
|
|
1131
|
-
options?: RetryOptions
|
|
1132
|
-
requesterAddress?: string;
|
|
1133
|
-
};
|
|
1136
|
+
options?: RetryOptions;
|
|
1134
1137
|
}): Promise<RSVSignature | SignatureErrorData$1 | undefined>;
|
|
1135
1138
|
/**
|
|
1136
1139
|
* Generates the request ID for a signature request allowing to track the response.
|
|
1137
1140
|
*/
|
|
1138
|
-
getRequestId(args: SignArgs, options?: SignOptions['sign']
|
|
1139
|
-
requesterAddress?: string;
|
|
1140
|
-
}): string;
|
|
1141
|
+
getRequestId(args: SignArgs, options?: SignOptions['sign']): string;
|
|
1141
1142
|
}
|
|
1142
1143
|
|
|
1143
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
|
|
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,
|
|
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
|
-
|
|
1121
|
-
}
|
|
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
|
|
@@ -1128,16 +1133,12 @@ declare class ChainSignatureContract extends ChainSignatureContract$3 {
|
|
|
1128
1133
|
requestId: string;
|
|
1129
1134
|
payload: number[];
|
|
1130
1135
|
path: string;
|
|
1131
|
-
options?: RetryOptions
|
|
1132
|
-
requesterAddress?: string;
|
|
1133
|
-
};
|
|
1136
|
+
options?: RetryOptions;
|
|
1134
1137
|
}): Promise<RSVSignature | SignatureErrorData$1 | undefined>;
|
|
1135
1138
|
/**
|
|
1136
1139
|
* Generates the request ID for a signature request allowing to track the response.
|
|
1137
1140
|
*/
|
|
1138
|
-
getRequestId(args: SignArgs, options?: SignOptions['sign']
|
|
1139
|
-
requesterAddress?: string;
|
|
1140
|
-
}): string;
|
|
1141
|
+
getRequestId(args: SignArgs, options?: SignOptions['sign']): string;
|
|
1141
1142
|
}
|
|
1142
1143
|
|
|
1143
1144
|
declare const utils: {
|