@rialo/ts-cdk 0.3.0 → 0.4.0-alpha.0
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/dist/index.d.mts +143 -11
- package/dist/index.d.ts +143 -11
- package/dist/index.js +380 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +364 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6957,11 +6957,11 @@ var QueryRpcClient = class extends BaseRpcClient {
|
|
|
6957
6957
|
return result.value.map((v) => ({
|
|
6958
6958
|
commission: BigInt(v.commission),
|
|
6959
6959
|
pubkey: v.pubkey,
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6960
|
+
signingKey: v.signing_key,
|
|
6961
|
+
withdrawalKey: v.withdrawal_key,
|
|
6962
|
+
stake: BigInt(v.stake),
|
|
6963
|
+
address: v.address,
|
|
6964
|
+
stateSyncAddress: v.state_sync_address
|
|
6965
6965
|
}));
|
|
6966
6966
|
}
|
|
6967
6967
|
/**
|
|
@@ -10875,6 +10875,364 @@ var KeypairSigner = class {
|
|
|
10875
10875
|
return this.keypair.sign(message);
|
|
10876
10876
|
}
|
|
10877
10877
|
};
|
|
10878
|
+
|
|
10879
|
+
// src/program/constants.ts
|
|
10880
|
+
var RISCV_LOADER_PROGRAM_ID = "RiscVLoader11111111111111111111111111111111";
|
|
10881
|
+
var LOADER_V4_PROGRAM_ID = "LoaderV411111111111111111111111111111111111";
|
|
10882
|
+
var DEFAULT_CHUNK_SIZE = 3700;
|
|
10883
|
+
var DEFAULT_MAX_RETRIES2 = 350;
|
|
10884
|
+
var DEFAULT_RETRY_BASE_DELAY_MS = 50;
|
|
10885
|
+
var DEFAULT_RETRY_MAX_DELAY_MS = 1e3;
|
|
10886
|
+
var DEFAULT_CONFIRMATION_BATCH_SIZE = 25;
|
|
10887
|
+
var BUFFER_BALANCE_FACTOR = 1.2;
|
|
10888
|
+
var PROGRAM_DATA_OFFSET = 48;
|
|
10889
|
+
|
|
10890
|
+
// src/program/deployment.ts
|
|
10891
|
+
init_base();
|
|
10892
|
+
|
|
10893
|
+
// src/program/errors.ts
|
|
10894
|
+
var DeploymentErrorCode = /* @__PURE__ */ ((DeploymentErrorCode2) => {
|
|
10895
|
+
DeploymentErrorCode2["EMPTY_PROGRAM_DATA"] = "EMPTY_PROGRAM_DATA";
|
|
10896
|
+
DeploymentErrorCode2["INVALID_CHUNK_SIZE"] = "INVALID_CHUNK_SIZE";
|
|
10897
|
+
DeploymentErrorCode2["OWNER_MISMATCH"] = "OWNER_MISMATCH";
|
|
10898
|
+
DeploymentErrorCode2["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
|
|
10899
|
+
DeploymentErrorCode2["TRANSACTION_TIMEOUT"] = "TRANSACTION_TIMEOUT";
|
|
10900
|
+
DeploymentErrorCode2["RPC_ERROR"] = "RPC_ERROR";
|
|
10901
|
+
DeploymentErrorCode2["BUFFER_NOT_READY"] = "BUFFER_NOT_READY";
|
|
10902
|
+
return DeploymentErrorCode2;
|
|
10903
|
+
})(DeploymentErrorCode || {});
|
|
10904
|
+
var DeploymentError = class _DeploymentError extends Error {
|
|
10905
|
+
constructor(code, message, details) {
|
|
10906
|
+
super(message);
|
|
10907
|
+
this.code = code;
|
|
10908
|
+
this.details = details;
|
|
10909
|
+
this.name = "DeploymentError";
|
|
10910
|
+
}
|
|
10911
|
+
static emptyProgramData() {
|
|
10912
|
+
return new _DeploymentError(
|
|
10913
|
+
"EMPTY_PROGRAM_DATA" /* EMPTY_PROGRAM_DATA */,
|
|
10914
|
+
"Program data must not be empty."
|
|
10915
|
+
);
|
|
10916
|
+
}
|
|
10917
|
+
static invalidChunkSize(chunkSize) {
|
|
10918
|
+
return new _DeploymentError(
|
|
10919
|
+
"INVALID_CHUNK_SIZE" /* INVALID_CHUNK_SIZE */,
|
|
10920
|
+
`chunkSize must be greater than 0, got ${chunkSize}.`,
|
|
10921
|
+
{ chunkSize }
|
|
10922
|
+
);
|
|
10923
|
+
}
|
|
10924
|
+
static ownerMismatch(owner) {
|
|
10925
|
+
return new _DeploymentError(
|
|
10926
|
+
"OWNER_MISMATCH" /* OWNER_MISMATCH */,
|
|
10927
|
+
`Existing account is not owned by RISC-V Loader (owner: ${owner}).`,
|
|
10928
|
+
{ owner }
|
|
10929
|
+
);
|
|
10930
|
+
}
|
|
10931
|
+
static transactionFailed(err2, details) {
|
|
10932
|
+
return new _DeploymentError(
|
|
10933
|
+
"TRANSACTION_FAILED" /* TRANSACTION_FAILED */,
|
|
10934
|
+
`Transaction failed: ${err2}`,
|
|
10935
|
+
details
|
|
10936
|
+
);
|
|
10937
|
+
}
|
|
10938
|
+
static transactionTimeout(message, details) {
|
|
10939
|
+
return new _DeploymentError(
|
|
10940
|
+
"TRANSACTION_TIMEOUT" /* TRANSACTION_TIMEOUT */,
|
|
10941
|
+
`Transaction confirmation timed out: ${message}`,
|
|
10942
|
+
details
|
|
10943
|
+
);
|
|
10944
|
+
}
|
|
10945
|
+
static rpcError(message, details) {
|
|
10946
|
+
return new _DeploymentError(
|
|
10947
|
+
"RPC_ERROR" /* RPC_ERROR */,
|
|
10948
|
+
`RPC error during deployment: ${message}`,
|
|
10949
|
+
details
|
|
10950
|
+
);
|
|
10951
|
+
}
|
|
10952
|
+
static bufferNotReady(maxRetries) {
|
|
10953
|
+
return new _DeploymentError(
|
|
10954
|
+
"BUFFER_NOT_READY" /* BUFFER_NOT_READY */,
|
|
10955
|
+
`Buffer account not ready after ${maxRetries} attempts.`,
|
|
10956
|
+
{ maxRetries }
|
|
10957
|
+
);
|
|
10958
|
+
}
|
|
10959
|
+
toJSON() {
|
|
10960
|
+
return {
|
|
10961
|
+
code: this.code,
|
|
10962
|
+
message: this.message,
|
|
10963
|
+
details: this.details
|
|
10964
|
+
};
|
|
10965
|
+
}
|
|
10966
|
+
};
|
|
10967
|
+
|
|
10968
|
+
// src/program/instructions.ts
|
|
10969
|
+
var RiscVLoaderInstruction = /* @__PURE__ */ ((RiscVLoaderInstruction2) => {
|
|
10970
|
+
RiscVLoaderInstruction2[RiscVLoaderInstruction2["Write"] = 0] = "Write";
|
|
10971
|
+
RiscVLoaderInstruction2[RiscVLoaderInstruction2["Copy"] = 1] = "Copy";
|
|
10972
|
+
RiscVLoaderInstruction2[RiscVLoaderInstruction2["SetProgramLength"] = 2] = "SetProgramLength";
|
|
10973
|
+
RiscVLoaderInstruction2[RiscVLoaderInstruction2["Deploy"] = 3] = "Deploy";
|
|
10974
|
+
RiscVLoaderInstruction2[RiscVLoaderInstruction2["Retract"] = 4] = "Retract";
|
|
10975
|
+
RiscVLoaderInstruction2[RiscVLoaderInstruction2["TransferAuthority"] = 5] = "TransferAuthority";
|
|
10976
|
+
RiscVLoaderInstruction2[RiscVLoaderInstruction2["Finalize"] = 6] = "Finalize";
|
|
10977
|
+
return RiscVLoaderInstruction2;
|
|
10978
|
+
})(RiscVLoaderInstruction || {});
|
|
10979
|
+
var LOADER_PROGRAM_ID = PublicKey.fromString(RISCV_LOADER_PROGRAM_ID);
|
|
10980
|
+
function writeInstruction(programAddress, authority, offset, bytes2) {
|
|
10981
|
+
const writer = new BincodeWriter(4 + 4 + 8 + bytes2.length);
|
|
10982
|
+
writer.writeVariant(0 /* Write */);
|
|
10983
|
+
writer.writeU32(offset);
|
|
10984
|
+
writer.writeVecBytes(bytes2);
|
|
10985
|
+
return {
|
|
10986
|
+
programId: LOADER_PROGRAM_ID,
|
|
10987
|
+
accounts: [
|
|
10988
|
+
{ pubkey: programAddress, isSigner: false, isWritable: true },
|
|
10989
|
+
{ pubkey: authority, isSigner: true, isWritable: false }
|
|
10990
|
+
],
|
|
10991
|
+
data: writer.toBytes()
|
|
10992
|
+
};
|
|
10993
|
+
}
|
|
10994
|
+
function setProgramLengthInstruction(programAddress, authority, newSize, recipientAddress) {
|
|
10995
|
+
const writer = new BincodeWriter(8);
|
|
10996
|
+
writer.writeVariant(2 /* SetProgramLength */);
|
|
10997
|
+
writer.writeU32(newSize);
|
|
10998
|
+
return {
|
|
10999
|
+
programId: LOADER_PROGRAM_ID,
|
|
11000
|
+
accounts: [
|
|
11001
|
+
{ pubkey: programAddress, isSigner: false, isWritable: true },
|
|
11002
|
+
{ pubkey: authority, isSigner: true, isWritable: false },
|
|
11003
|
+
{ pubkey: recipientAddress, isSigner: false, isWritable: true }
|
|
11004
|
+
],
|
|
11005
|
+
data: writer.toBytes()
|
|
11006
|
+
};
|
|
11007
|
+
}
|
|
11008
|
+
function deployInstruction(programAddress, authority) {
|
|
11009
|
+
const writer = new BincodeWriter(4);
|
|
11010
|
+
writer.writeVariant(3 /* Deploy */);
|
|
11011
|
+
return {
|
|
11012
|
+
programId: LOADER_PROGRAM_ID,
|
|
11013
|
+
accounts: [
|
|
11014
|
+
{ pubkey: programAddress, isSigner: false, isWritable: true },
|
|
11015
|
+
{ pubkey: authority, isSigner: true, isWritable: false }
|
|
11016
|
+
],
|
|
11017
|
+
data: writer.toBytes()
|
|
11018
|
+
};
|
|
11019
|
+
}
|
|
11020
|
+
function retractInstruction(programAddress, authority) {
|
|
11021
|
+
const writer = new BincodeWriter(4);
|
|
11022
|
+
writer.writeVariant(4 /* Retract */);
|
|
11023
|
+
return {
|
|
11024
|
+
programId: LOADER_PROGRAM_ID,
|
|
11025
|
+
accounts: [
|
|
11026
|
+
{ pubkey: programAddress, isSigner: false, isWritable: true },
|
|
11027
|
+
{ pubkey: authority, isSigner: true, isWritable: false }
|
|
11028
|
+
],
|
|
11029
|
+
data: writer.toBytes()
|
|
11030
|
+
};
|
|
11031
|
+
}
|
|
11032
|
+
|
|
11033
|
+
// src/program/deployment.ts
|
|
11034
|
+
function calculateBackoff2(attempt, baseDelayMs, maxDelayMs) {
|
|
11035
|
+
const delay = baseDelayMs * 1.15 ** attempt;
|
|
11036
|
+
return Math.min(delay, maxDelayMs);
|
|
11037
|
+
}
|
|
11038
|
+
var ProgramDeployment = class {
|
|
11039
|
+
programData;
|
|
11040
|
+
programKeypair;
|
|
11041
|
+
chunkSize;
|
|
11042
|
+
maxRetries;
|
|
11043
|
+
retryBaseDelayMs;
|
|
11044
|
+
retryMaxDelayMs;
|
|
11045
|
+
confirmationBatchSize;
|
|
11046
|
+
constructor(options) {
|
|
11047
|
+
if (options.programData.length === 0) {
|
|
11048
|
+
throw DeploymentError.emptyProgramData();
|
|
11049
|
+
}
|
|
11050
|
+
this.programData = options.programData;
|
|
11051
|
+
this.programKeypair = options.programKeypair;
|
|
11052
|
+
const chunkSize = options.config?.chunkSize ?? DEFAULT_CHUNK_SIZE;
|
|
11053
|
+
if (chunkSize <= 0) {
|
|
11054
|
+
throw DeploymentError.invalidChunkSize(chunkSize);
|
|
11055
|
+
}
|
|
11056
|
+
this.chunkSize = chunkSize;
|
|
11057
|
+
this.maxRetries = options.config?.maxRetries ?? DEFAULT_MAX_RETRIES2;
|
|
11058
|
+
this.retryBaseDelayMs = options.config?.retryBaseDelayMs ?? DEFAULT_RETRY_BASE_DELAY_MS;
|
|
11059
|
+
this.retryMaxDelayMs = options.config?.retryMaxDelayMs ?? DEFAULT_RETRY_MAX_DELAY_MS;
|
|
11060
|
+
this.confirmationBatchSize = options.config?.confirmationBatchSize ?? DEFAULT_CONFIRMATION_BATCH_SIZE;
|
|
11061
|
+
}
|
|
11062
|
+
/**
|
|
11063
|
+
* Deploy the program to the blockchain.
|
|
11064
|
+
*
|
|
11065
|
+
* @param client - RPC client
|
|
11066
|
+
* @param payerKeypair - Keypair that pays for transactions and becomes the program authority
|
|
11067
|
+
* @returns The program's public key (derived from programKeypair)
|
|
11068
|
+
*/
|
|
11069
|
+
async deploy(client, payerKeypair) {
|
|
11070
|
+
const programPubkey = this.programKeypair.publicKey;
|
|
11071
|
+
const payerPubkey = payerKeypair.publicKey;
|
|
11072
|
+
const loaderPubkey = PublicKey.fromString(RISCV_LOADER_PROGRAM_ID);
|
|
11073
|
+
const configHashPrefix = await client.getConfigHashPrefix();
|
|
11074
|
+
const rentExempt = await client.getMinimumBalanceForRentExemption(
|
|
11075
|
+
BigInt(PROGRAM_DATA_OFFSET + this.programData.length)
|
|
11076
|
+
);
|
|
11077
|
+
const bufferBalance = BigInt(Math.floor(Number(rentExempt) * BUFFER_BALANCE_FACTOR));
|
|
11078
|
+
const validFrom = BigInt(Date.now());
|
|
11079
|
+
const existing = await client.getAccountInfo(programPubkey).catch((e) => {
|
|
11080
|
+
if (e instanceof Error && e.message.startsWith("Account does not exist")) {
|
|
11081
|
+
return null;
|
|
11082
|
+
}
|
|
11083
|
+
throw e;
|
|
11084
|
+
});
|
|
11085
|
+
if (existing) {
|
|
11086
|
+
if (existing.owner.toString() !== RISCV_LOADER_PROGRAM_ID) {
|
|
11087
|
+
throw DeploymentError.ownerMismatch(existing.owner.toString());
|
|
11088
|
+
}
|
|
11089
|
+
const ixs = [];
|
|
11090
|
+
if (existing.kelvin < bufferBalance) {
|
|
11091
|
+
const deficit = bufferBalance - existing.kelvin;
|
|
11092
|
+
ixs.push(transferInstruction(payerPubkey, programPubkey, deficit));
|
|
11093
|
+
}
|
|
11094
|
+
if (existing.executable) {
|
|
11095
|
+
ixs.push(retractInstruction(programPubkey, payerPubkey));
|
|
11096
|
+
}
|
|
11097
|
+
ixs.push(
|
|
11098
|
+
setProgramLengthInstruction(
|
|
11099
|
+
programPubkey,
|
|
11100
|
+
payerPubkey,
|
|
11101
|
+
this.programData.length,
|
|
11102
|
+
payerPubkey
|
|
11103
|
+
)
|
|
11104
|
+
);
|
|
11105
|
+
const builder = TransactionBuilder.create().setPayer(payerPubkey).setValidFrom(validFrom).setConfigHashPrefix(configHashPrefix);
|
|
11106
|
+
for (const ix of ixs) {
|
|
11107
|
+
builder.addInstruction(ix);
|
|
11108
|
+
}
|
|
11109
|
+
const tx = builder.build().sign(payerKeypair);
|
|
11110
|
+
await this.sendAndConfirm(client, tx.serialize());
|
|
11111
|
+
} else {
|
|
11112
|
+
const createIx = createAccount(
|
|
11113
|
+
payerPubkey,
|
|
11114
|
+
programPubkey,
|
|
11115
|
+
bufferBalance,
|
|
11116
|
+
0n,
|
|
11117
|
+
// space=0, the loader manages sizing via SetProgramLength
|
|
11118
|
+
loaderPubkey
|
|
11119
|
+
);
|
|
11120
|
+
const setLengthIx = setProgramLengthInstruction(
|
|
11121
|
+
programPubkey,
|
|
11122
|
+
payerPubkey,
|
|
11123
|
+
this.programData.length,
|
|
11124
|
+
payerPubkey
|
|
11125
|
+
);
|
|
11126
|
+
const tx = TransactionBuilder.create().setPayer(payerPubkey).setValidFrom(validFrom).setConfigHashPrefix(configHashPrefix).addInstruction(createIx).addInstruction(setLengthIx).build().signAll([payerKeypair, this.programKeypair]);
|
|
11127
|
+
await this.sendAndConfirm(client, tx.serialize());
|
|
11128
|
+
}
|
|
11129
|
+
await this.waitForBufferReady(client, programPubkey);
|
|
11130
|
+
const chunks = this.splitIntoChunks(this.programData);
|
|
11131
|
+
const batchSignatures = [];
|
|
11132
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
11133
|
+
const offset = i * this.chunkSize;
|
|
11134
|
+
const ix = writeInstruction(programPubkey, payerPubkey, offset, chunks[i]);
|
|
11135
|
+
const chunkValidFrom = BigInt(Date.now());
|
|
11136
|
+
const tx = TransactionBuilder.create().setPayer(payerPubkey).setValidFrom(chunkValidFrom).setConfigHashPrefix(configHashPrefix).addInstruction(ix).build().sign(payerKeypair);
|
|
11137
|
+
let sig;
|
|
11138
|
+
try {
|
|
11139
|
+
sig = await client.sendTransaction(tx.serialize());
|
|
11140
|
+
} catch (e) {
|
|
11141
|
+
throw this.toDeploymentError(e);
|
|
11142
|
+
}
|
|
11143
|
+
batchSignatures.push(base58.encode(sig));
|
|
11144
|
+
const isBatchComplete = batchSignatures.length >= this.confirmationBatchSize;
|
|
11145
|
+
const isLastChunk = i === chunks.length - 1;
|
|
11146
|
+
if (isBatchComplete || isLastChunk) {
|
|
11147
|
+
await this.confirmBatch(client, batchSignatures);
|
|
11148
|
+
batchSignatures.length = 0;
|
|
11149
|
+
}
|
|
11150
|
+
}
|
|
11151
|
+
const deployIx = deployInstruction(programPubkey, payerPubkey);
|
|
11152
|
+
const deployValidFrom = BigInt(Date.now());
|
|
11153
|
+
const deployTx = TransactionBuilder.create().setPayer(payerPubkey).setValidFrom(deployValidFrom).setConfigHashPrefix(configHashPrefix).addInstruction(deployIx).build().sign(payerKeypair);
|
|
11154
|
+
await this.sendAndConfirm(client, deployTx.serialize());
|
|
11155
|
+
return programPubkey;
|
|
11156
|
+
}
|
|
11157
|
+
splitIntoChunks(data) {
|
|
11158
|
+
const chunks = [];
|
|
11159
|
+
for (let offset = 0; offset < data.length; offset += this.chunkSize) {
|
|
11160
|
+
chunks.push(data.subarray(offset, offset + this.chunkSize));
|
|
11161
|
+
}
|
|
11162
|
+
return chunks;
|
|
11163
|
+
}
|
|
11164
|
+
async sendAndConfirm(client, transaction) {
|
|
11165
|
+
let result;
|
|
11166
|
+
try {
|
|
11167
|
+
result = await client.sendAndConfirmTransaction(transaction, {
|
|
11168
|
+
confirmMaxRetries: this.maxRetries,
|
|
11169
|
+
confirmRetryDelayMs: this.retryBaseDelayMs
|
|
11170
|
+
});
|
|
11171
|
+
} catch (e) {
|
|
11172
|
+
throw this.toDeploymentError(e);
|
|
11173
|
+
}
|
|
11174
|
+
if (!result.executed) {
|
|
11175
|
+
throw DeploymentError.transactionFailed(result.err ?? "unknown error");
|
|
11176
|
+
}
|
|
11177
|
+
}
|
|
11178
|
+
async confirmBatch(client, signatures) {
|
|
11179
|
+
let results;
|
|
11180
|
+
try {
|
|
11181
|
+
results = await Promise.all(
|
|
11182
|
+
signatures.map((sig) => client.confirmTransaction(sig, {
|
|
11183
|
+
maxRetries: this.maxRetries,
|
|
11184
|
+
retryDelayMs: this.retryBaseDelayMs
|
|
11185
|
+
}))
|
|
11186
|
+
);
|
|
11187
|
+
} catch (e) {
|
|
11188
|
+
throw this.toDeploymentError(e);
|
|
11189
|
+
}
|
|
11190
|
+
for (const result of results) {
|
|
11191
|
+
if (!result.executed) {
|
|
11192
|
+
throw DeploymentError.transactionFailed(result.err ?? "unknown error", {
|
|
11193
|
+
signature: result.signature
|
|
11194
|
+
});
|
|
11195
|
+
}
|
|
11196
|
+
}
|
|
11197
|
+
}
|
|
11198
|
+
toDeploymentError(e) {
|
|
11199
|
+
if (e instanceof DeploymentError) return e;
|
|
11200
|
+
if (e instanceof RpcError) {
|
|
11201
|
+
const details = { rpcCode: e.code, retryable: e.retryable, ...e.details };
|
|
11202
|
+
switch (e.code) {
|
|
11203
|
+
case "TRANSACTION_CONFIRMATION_TIMEOUT" /* TRANSACTION_CONFIRMATION_TIMEOUT */:
|
|
11204
|
+
return DeploymentError.transactionTimeout(e.message, details);
|
|
11205
|
+
case "TRANSACTION_REJECTED" /* TRANSACTION_REJECTED */:
|
|
11206
|
+
case "INSUFFICIENT_FUNDS" /* INSUFFICIENT_FUNDS */:
|
|
11207
|
+
return DeploymentError.transactionFailed(e.message, details);
|
|
11208
|
+
default:
|
|
11209
|
+
return DeploymentError.rpcError(e.message, details);
|
|
11210
|
+
}
|
|
11211
|
+
}
|
|
11212
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
11213
|
+
return DeploymentError.rpcError(message, {
|
|
11214
|
+
cause: e instanceof Error ? e.constructor.name : void 0
|
|
11215
|
+
});
|
|
11216
|
+
}
|
|
11217
|
+
async waitForBufferReady(client, programPubkey) {
|
|
11218
|
+
const expectedSize = PROGRAM_DATA_OFFSET + this.programData.length;
|
|
11219
|
+
for (let attempt = 0; attempt < this.maxRetries; attempt++) {
|
|
11220
|
+
try {
|
|
11221
|
+
const account = await client.getAccountInfo(programPubkey);
|
|
11222
|
+
if (account.owner.toString() === RISCV_LOADER_PROGRAM_ID && account.space >= BigInt(expectedSize)) {
|
|
11223
|
+
return;
|
|
11224
|
+
}
|
|
11225
|
+
} catch (e) {
|
|
11226
|
+
if (!(e instanceof Error && e.message.startsWith("Account does not exist"))) {
|
|
11227
|
+
throw e;
|
|
11228
|
+
}
|
|
11229
|
+
}
|
|
11230
|
+
const delay = calculateBackoff2(attempt, this.retryBaseDelayMs, this.retryMaxDelayMs);
|
|
11231
|
+
await sleep(delay);
|
|
11232
|
+
}
|
|
11233
|
+
throw DeploymentError.bufferNotReady(this.maxRetries);
|
|
11234
|
+
}
|
|
11235
|
+
};
|
|
10878
11236
|
/*! Bundled license information:
|
|
10879
11237
|
|
|
10880
11238
|
@scure/base/index.js:
|
|
@@ -10893,13 +11251,21 @@ var KeypairSigner = class {
|
|
|
10893
11251
|
|
|
10894
11252
|
exports.AccountMetaTable = AccountMetaTable;
|
|
10895
11253
|
exports.BASE_DERIVATION_PATH = BASE_DERIVATION_PATH;
|
|
11254
|
+
exports.BUFFER_BALANCE_FACTOR = BUFFER_BALANCE_FACTOR;
|
|
10896
11255
|
exports.BaseRpcClient = BaseRpcClient;
|
|
10897
11256
|
exports.BincodeReader = BincodeReader;
|
|
10898
11257
|
exports.BincodeWriter = BincodeWriter;
|
|
10899
11258
|
exports.CHACHA20_POLY1305_TAG_LENGTH = CHACHA20_POLY1305_TAG_LENGTH;
|
|
10900
11259
|
exports.CryptoError = CryptoError;
|
|
10901
11260
|
exports.CryptoErrorCode = CryptoErrorCode;
|
|
11261
|
+
exports.DEFAULT_CHUNK_SIZE = DEFAULT_CHUNK_SIZE;
|
|
11262
|
+
exports.DEFAULT_CONFIRMATION_BATCH_SIZE = DEFAULT_CONFIRMATION_BATCH_SIZE;
|
|
11263
|
+
exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES2;
|
|
10902
11264
|
exports.DEFAULT_NUM_ACCOUNTS = DEFAULT_NUM_ACCOUNTS;
|
|
11265
|
+
exports.DEFAULT_RETRY_BASE_DELAY_MS = DEFAULT_RETRY_BASE_DELAY_MS;
|
|
11266
|
+
exports.DEFAULT_RETRY_MAX_DELAY_MS = DEFAULT_RETRY_MAX_DELAY_MS;
|
|
11267
|
+
exports.DeploymentError = DeploymentError;
|
|
11268
|
+
exports.DeploymentErrorCode = DeploymentErrorCode;
|
|
10903
11269
|
exports.ED25519_PUBLIC_KEY_LENGTH = ED25519_PUBLIC_KEY_LENGTH;
|
|
10904
11270
|
exports.HPKE_ENC_LENGTH = HPKE_ENC_LENGTH;
|
|
10905
11271
|
exports.HPKE_OVERHEAD_LENGTH = HPKE_OVERHEAD_LENGTH;
|
|
@@ -10909,20 +11275,25 @@ exports.HttpTransport = HttpTransport;
|
|
|
10909
11275
|
exports.KELVIN_PER_RLO = KELVIN_PER_RLO;
|
|
10910
11276
|
exports.Keypair = Keypair;
|
|
10911
11277
|
exports.KeypairSigner = KeypairSigner;
|
|
11278
|
+
exports.LOADER_V4_PROGRAM_ID = LOADER_V4_PROGRAM_ID;
|
|
10912
11279
|
exports.Message = Message;
|
|
10913
11280
|
exports.Mnemonic = Mnemonic;
|
|
11281
|
+
exports.PROGRAM_DATA_OFFSET = PROGRAM_DATA_OFFSET;
|
|
10914
11282
|
exports.PUBLIC_KEY_LENGTH = PUBLIC_KEY_LENGTH;
|
|
11283
|
+
exports.ProgramDeployment = ProgramDeployment;
|
|
10915
11284
|
exports.PublicKey = PublicKey;
|
|
10916
11285
|
exports.QueryRpcClient = QueryRpcClient;
|
|
10917
11286
|
exports.RIALO_DEVNET_CHAIN = RIALO_DEVNET_CHAIN;
|
|
10918
11287
|
exports.RIALO_LOCALNET_CHAIN = RIALO_LOCALNET_CHAIN;
|
|
10919
11288
|
exports.RIALO_MAINNET_CHAIN = RIALO_MAINNET_CHAIN;
|
|
10920
11289
|
exports.RIALO_TESTNET_CHAIN = RIALO_TESTNET_CHAIN;
|
|
11290
|
+
exports.RISCV_LOADER_PROGRAM_ID = RISCV_LOADER_PROGRAM_ID;
|
|
10921
11291
|
exports.RexValue = RexValue;
|
|
10922
11292
|
exports.RexValueVariant = RexValueVariant;
|
|
10923
11293
|
exports.RialoClient = RialoClient;
|
|
10924
11294
|
exports.RialoError = RialoError;
|
|
10925
11295
|
exports.RialoErrorType = RialoErrorType;
|
|
11296
|
+
exports.RiscVLoaderInstruction = RiscVLoaderInstruction;
|
|
10926
11297
|
exports.RpcError = RpcError;
|
|
10927
11298
|
exports.RpcErrorCode = RpcErrorCode;
|
|
10928
11299
|
exports.SECRET_KEY_LENGTH = SECRET_KEY_LENGTH;
|
|
@@ -10950,6 +11321,7 @@ exports.concatBytes = concatBytes2;
|
|
|
10950
11321
|
exports.createAccount = createAccount;
|
|
10951
11322
|
exports.createBorshInstruction = createBorshInstruction;
|
|
10952
11323
|
exports.createRialoClient = createRialoClient;
|
|
11324
|
+
exports.deployInstruction = deployInstruction;
|
|
10953
11325
|
exports.deserialize = deserialize;
|
|
10954
11326
|
exports.deserializeBorsh = deserializeBorsh;
|
|
10955
11327
|
exports.deserializeCompactU16 = deserializeCompactU162;
|
|
@@ -10969,14 +11341,17 @@ exports.hpkeEncrypt = hpkeEncrypt;
|
|
|
10969
11341
|
exports.isOnCurve = isOnCurve;
|
|
10970
11342
|
exports.isValidCiphertextLength = isValidCiphertextLength;
|
|
10971
11343
|
exports.option = option;
|
|
11344
|
+
exports.retractInstruction = retractInstruction;
|
|
10972
11345
|
exports.seedToBytes = seedToBytes;
|
|
10973
11346
|
exports.serialize = serialize;
|
|
10974
11347
|
exports.serializeBorsh = serializeBorsh;
|
|
10975
11348
|
exports.serializeCompactU16 = serializeCompactU16;
|
|
11349
|
+
exports.setProgramLengthInstruction = setProgramLengthInstruction;
|
|
10976
11350
|
exports.sleep = sleep;
|
|
10977
11351
|
exports.toBase64 = toBase64;
|
|
10978
11352
|
exports.transferInstruction = transferInstruction;
|
|
10979
11353
|
exports.vec = vec;
|
|
10980
11354
|
exports.writeCompactU16 = writeCompactU16;
|
|
11355
|
+
exports.writeInstruction = writeInstruction;
|
|
10981
11356
|
//# sourceMappingURL=index.js.map
|
|
10982
11357
|
//# sourceMappingURL=index.js.map
|