@ar.io/sdk 4.0.0-solana.38 → 4.0.0-solana.39

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.
@@ -53,7 +53,7 @@
53
53
  * registry's signer) acts as the rent payer for everything bundled here.
54
54
  */
55
55
  import { address, } from '@solana/kit';
56
- import { getAddAclPageInstruction, getCloseAclConfigInstruction, getCloseAclPageInstruction, getRecordAclControllerInstructionAsync, getRecordAclOwnerInstruction, getRegisterAclConfigInstruction, getRemoveAclControllerInstructionAsync, getRemoveAclOwnerInstruction, } from '@ar.io/solana-contracts/ant';
56
+ import { getAddAclPageInstruction, getCloseAclConfigInstruction, getCloseAclPageInstruction, getRecordAclControllerInstructionAsync, getRecordAclOwnerInstructionAsync, getRegisterAclConfigInstruction, getRemoveAclControllerInstructionAsync, getRemoveAclOwnerInstructionAsync, } from '@ar.io/solana-contracts/ant';
57
57
  import { SolanaANTRegistryReadable, } from './ant-registry-readable.js';
58
58
  import { ACL_ROLE_CONTROLLER, ACL_ROLE_OWNER, MAX_ACL_PAGE_ENTRIES, } from './constants.js';
59
59
  import { deserializeAclConfig, deserializeAclPage } from './deserialize.js';
@@ -204,7 +204,7 @@ export class SolanaANTRegistryWriteable extends SolanaANTRegistryReadable {
204
204
  const [aclConfig] = await getAclConfigPDA(params.user, this.antProgram);
205
205
  const [aclPage] = await getAclPagePDA(params.user, params.pageIdx, this.antProgram);
206
206
  if (params.role === 'owner') {
207
- return getRecordAclOwnerInstruction({ asset: params.asset, aclConfig, aclPage, payer: this.signer }, { programAddress: this.antProgram });
207
+ return getRecordAclOwnerInstructionAsync({ asset: params.asset, aclConfig, aclPage, payer: this.signer }, { programAddress: this.antProgram });
208
208
  }
209
209
  return getRecordAclControllerInstructionAsync({ asset: params.asset, aclConfig, aclPage, payer: this.signer }, { programAddress: this.antProgram });
210
210
  }
@@ -213,7 +213,7 @@ export class SolanaANTRegistryWriteable extends SolanaANTRegistryReadable {
213
213
  const [aclConfig] = await getAclConfigPDA(params.user, this.antProgram);
214
214
  const [aclPage] = await getAclPagePDA(params.user, params.pageIdx, this.antProgram);
215
215
  if (params.role === 'owner') {
216
- return getRemoveAclOwnerInstruction({ asset: params.asset, aclConfig, aclPage, payer: this.signer }, { programAddress: this.antProgram });
216
+ return getRemoveAclOwnerInstructionAsync({ asset: params.asset, aclConfig, aclPage, payer: this.signer }, { programAddress: this.antProgram });
217
217
  }
218
218
  return getRemoveAclControllerInstructionAsync({ asset: params.asset, aclConfig, aclPage, payer: this.signer }, { programAddress: this.antProgram });
219
219
  }
@@ -1193,6 +1193,16 @@ export class SolanaARIOWriteable extends SolanaARIOReadable {
1193
1193
  arnsProgram: this.arnsProgram,
1194
1194
  demandFactor: demandFactorAddr,
1195
1195
  });
1196
+ // Roll the demand factor to the current period BEFORE pricing. The
1197
+ // `GetTokenCost` view reads the STORED demand factor, which is stale until a
1198
+ // crank (or a buy/extend) rolls it — but the `*FromFundingPlan` handlers
1199
+ // roll it inline before computing the cost. Without this, at a period
1200
+ // rollover the plan is sized to the old factor while the program charges
1201
+ // the new one → FundingPlanAmountMismatch (#6066). `update_demand_factor`
1202
+ // is permissionless + idempotent (no-op within the same period), and the
1203
+ // write is local to this simulation; the subsequent `GetTokenCost` in the
1204
+ // same tx sees the rolled value.
1205
+ const updateDfIx = getUpdateDemandFactorInstruction({ demandFactor: demandFactorAddr, payer: this.signer }, { programAddress: this.arnsProgram });
1196
1206
  const ix = await getGetTokenCostInstructionAsync({
1197
1207
  demandFactor: demandFactorAddr,
1198
1208
  payer: this.signer,
@@ -1205,7 +1215,7 @@ export class SolanaARIOWriteable extends SolanaARIOReadable {
1205
1215
  const { value: latestBlockhash } = await this.rpc
1206
1216
  .getLatestBlockhash()
1207
1217
  .send();
1208
- const message = pipe(createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(this.signer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m), (m) => appendTransactionMessageInstructions([ix], m));
1218
+ const message = pipe(createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(this.signer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m), (m) => appendTransactionMessageInstructions([updateDfIx, ix], m));
1209
1219
  const compiled = compileTransaction(message);
1210
1220
  const wire = getBase64EncodedWireTransaction(compiled);
1211
1221
  const sim = await this.rpc
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '4.0.0-solana.38';
17
+ export const version = '4.0.0-solana.39';
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const version = "4.0.0-solana.37";
16
+ export declare const version = "4.0.0-solana.38";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "4.0.0-solana.38",
3
+ "version": "4.0.0-solana.39",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"
@@ -114,7 +114,7 @@
114
114
  "typescript": "^5.1.6"
115
115
  },
116
116
  "dependencies": {
117
- "@ar.io/solana-contracts": "0.7.0-staging.17",
117
+ "@ar.io/solana-contracts": "0.8.0-staging.18",
118
118
  "@noble/hashes": "^1.8.0",
119
119
  "@solana-program/address-lookup-table": "^0.11.0",
120
120
  "@solana-program/compute-budget": "^0.15.0",