Skip to content

Commit

Permalink
sdk changes (#7)
Browse files Browse the repository at this point in the history
* mainnet with audit fixes

* add apy function

* sdk refactor

* fix

* support the weight hook
  • Loading branch information
0xripleys authored Oct 29, 2024
1 parent 01cd244 commit e58552f
Show file tree
Hide file tree
Showing 24 changed files with 2,154 additions and 1,063 deletions.
14 changes: 14 additions & 0 deletions contracts/Move.lock
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,17 @@ dependencies = [
compiler-version = "1.34.2"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x054acc66b4e75276f5c0adc18468170b9d46ccd83cfd00d148af82982a2c0fc6"
latest-published-id = "0x054acc66b4e75276f5c0adc18468170b9d46ccd83cfd00d148af82982a2c0fc6"
published-version = "1"

[env.mainnet]
chain-id = "35834a8a"
original-published-id = "0xcfbcad8e0444ca85ad7ee28054585d12a7487bdbd83569ded988ca13441bf16e"
latest-published-id = "0xcfbcad8e0444ca85ad7ee28054585d12a7487bdbd83569ded988ca13441bf16e"
published-version = "1"
8 changes: 4 additions & 4 deletions sdk/src/_generated/_dependencies/source/0x2/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ export function registerClasses(loader: StructClassLoader) {
loader.register(tableVec.TableVec);
loader.register(priorityQueue.Entry);
loader.register(priorityQueue.PriorityQueue);
loader.register(package_.Publisher);
loader.register(package_.UpgradeCap);
loader.register(package_.UpgradeReceipt);
loader.register(package_.UpgradeTicket);
loader.register(authenticatorState.ActiveJwk);
loader.register(authenticatorState.AuthenticatorState);
loader.register(authenticatorState.AuthenticatorStateInner);
Expand All @@ -89,10 +93,6 @@ export function registerClasses(loader: StructClassLoader) {
loader.register(borrow.Borrow);
loader.register(borrow.Referent);
loader.register(clock.Clock);
loader.register(package_.Publisher);
loader.register(package_.UpgradeCap);
loader.register(package_.UpgradeReceipt);
loader.register(package_.UpgradeTicket);
loader.register(display.Display);
loader.register(display.DisplayCreated);
loader.register(display.VersionUpdated);
Expand Down
42 changes: 21 additions & 21 deletions sdk/src/_generated/_dependencies/source/0x3/genesis/structs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from "../../../../_framework/util";
import { Vector } from "../../../../_framework/vector";
import { Option } from "../../0x1/option/structs";
import { PKG_V15 } from "../index";
import { PKG_V16 } from "../index";
import { bcs } from "@mysten/sui/bcs";
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
import { fromB64, fromHEX, toHEX } from "@mysten/sui/utils";
Expand All @@ -27,7 +27,7 @@ import { fromB64, fromHEX, toHEX } from "@mysten/sui/utils";

export function isGenesisChainParameters(type: string): boolean {
type = compressSuiType(type);
return type === `${PKG_V15}::genesis::GenesisChainParameters`;
return type === `${PKG_V16}::genesis::GenesisChainParameters`;
}

export interface GenesisChainParametersFields {
Expand All @@ -53,12 +53,12 @@ export type GenesisChainParametersReified = Reified<
export class GenesisChainParameters implements StructClass {
__StructClass = true as const;

static readonly $typeName = `${PKG_V15}::genesis::GenesisChainParameters`;
static readonly $typeName = `${PKG_V16}::genesis::GenesisChainParameters`;
static readonly $numTypeParams = 0;
static readonly $isPhantom = [] as const;

readonly $typeName = GenesisChainParameters.$typeName;
readonly $fullTypeName: `${typeof PKG_V15}::genesis::GenesisChainParameters`;
readonly $fullTypeName: `${typeof PKG_V16}::genesis::GenesisChainParameters`;
readonly $typeArgs: [];
readonly $isPhantom = GenesisChainParameters.$isPhantom;

Expand All @@ -79,7 +79,7 @@ export class GenesisChainParameters implements StructClass {
this.$fullTypeName = composeSuiType(
GenesisChainParameters.$typeName,
...typeArgs,
) as `${typeof PKG_V15}::genesis::GenesisChainParameters`;
) as `${typeof PKG_V16}::genesis::GenesisChainParameters`;
this.$typeArgs = typeArgs;

this.protocolVersion = fields.protocolVersion;
Expand All @@ -103,7 +103,7 @@ export class GenesisChainParameters implements StructClass {
fullTypeName: composeSuiType(
GenesisChainParameters.$typeName,
...[],
) as `${typeof PKG_V15}::genesis::GenesisChainParameters`,
) as `${typeof PKG_V16}::genesis::GenesisChainParameters`,
typeArgs: [] as [],
isPhantom: GenesisChainParameters.$isPhantom,
reifiedTypeArgs: [],
Expand Down Expand Up @@ -403,7 +403,7 @@ export class GenesisChainParameters implements StructClass {

export function isGenesisValidatorMetadata(type: string): boolean {
type = compressSuiType(type);
return type === `${PKG_V15}::genesis::GenesisValidatorMetadata`;
return type === `${PKG_V16}::genesis::GenesisValidatorMetadata`;
}

export interface GenesisValidatorMetadataFields {
Expand Down Expand Up @@ -432,12 +432,12 @@ export type GenesisValidatorMetadataReified = Reified<
export class GenesisValidatorMetadata implements StructClass {
__StructClass = true as const;

static readonly $typeName = `${PKG_V15}::genesis::GenesisValidatorMetadata`;
static readonly $typeName = `${PKG_V16}::genesis::GenesisValidatorMetadata`;
static readonly $numTypeParams = 0;
static readonly $isPhantom = [] as const;

readonly $typeName = GenesisValidatorMetadata.$typeName;
readonly $fullTypeName: `${typeof PKG_V15}::genesis::GenesisValidatorMetadata`;
readonly $fullTypeName: `${typeof PKG_V16}::genesis::GenesisValidatorMetadata`;
readonly $typeArgs: [];
readonly $isPhantom = GenesisValidatorMetadata.$isPhantom;

Expand All @@ -461,7 +461,7 @@ export class GenesisValidatorMetadata implements StructClass {
this.$fullTypeName = composeSuiType(
GenesisValidatorMetadata.$typeName,
...typeArgs,
) as `${typeof PKG_V15}::genesis::GenesisValidatorMetadata`;
) as `${typeof PKG_V16}::genesis::GenesisValidatorMetadata`;
this.$typeArgs = typeArgs;

this.name = fields.name;
Expand All @@ -487,7 +487,7 @@ export class GenesisValidatorMetadata implements StructClass {
fullTypeName: composeSuiType(
GenesisValidatorMetadata.$typeName,
...[],
) as `${typeof PKG_V15}::genesis::GenesisValidatorMetadata`,
) as `${typeof PKG_V16}::genesis::GenesisValidatorMetadata`,
typeArgs: [] as [],
isPhantom: GenesisValidatorMetadata.$isPhantom,
reifiedTypeArgs: [],
Expand Down Expand Up @@ -813,7 +813,7 @@ export class GenesisValidatorMetadata implements StructClass {

export function isTokenAllocation(type: string): boolean {
type = compressSuiType(type);
return type === `${PKG_V15}::genesis::TokenAllocation`;
return type === `${PKG_V16}::genesis::TokenAllocation`;
}

export interface TokenAllocationFields {
Expand All @@ -830,12 +830,12 @@ export type TokenAllocationReified = Reified<
export class TokenAllocation implements StructClass {
__StructClass = true as const;

static readonly $typeName = `${PKG_V15}::genesis::TokenAllocation`;
static readonly $typeName = `${PKG_V16}::genesis::TokenAllocation`;
static readonly $numTypeParams = 0;
static readonly $isPhantom = [] as const;

readonly $typeName = TokenAllocation.$typeName;
readonly $fullTypeName: `${typeof PKG_V15}::genesis::TokenAllocation`;
readonly $fullTypeName: `${typeof PKG_V16}::genesis::TokenAllocation`;
readonly $typeArgs: [];
readonly $isPhantom = TokenAllocation.$isPhantom;

Expand All @@ -847,7 +847,7 @@ export class TokenAllocation implements StructClass {
this.$fullTypeName = composeSuiType(
TokenAllocation.$typeName,
...typeArgs,
) as `${typeof PKG_V15}::genesis::TokenAllocation`;
) as `${typeof PKG_V16}::genesis::TokenAllocation`;
this.$typeArgs = typeArgs;

this.recipientAddress = fields.recipientAddress;
Expand All @@ -861,7 +861,7 @@ export class TokenAllocation implements StructClass {
fullTypeName: composeSuiType(
TokenAllocation.$typeName,
...[],
) as `${typeof PKG_V15}::genesis::TokenAllocation`,
) as `${typeof PKG_V16}::genesis::TokenAllocation`,
typeArgs: [] as [],
isPhantom: TokenAllocation.$isPhantom,
reifiedTypeArgs: [],
Expand Down Expand Up @@ -1041,7 +1041,7 @@ export class TokenAllocation implements StructClass {

export function isTokenDistributionSchedule(type: string): boolean {
type = compressSuiType(type);
return type === `${PKG_V15}::genesis::TokenDistributionSchedule`;
return type === `${PKG_V16}::genesis::TokenDistributionSchedule`;
}

export interface TokenDistributionScheduleFields {
Expand All @@ -1057,12 +1057,12 @@ export type TokenDistributionScheduleReified = Reified<
export class TokenDistributionSchedule implements StructClass {
__StructClass = true as const;

static readonly $typeName = `${PKG_V15}::genesis::TokenDistributionSchedule`;
static readonly $typeName = `${PKG_V16}::genesis::TokenDistributionSchedule`;
static readonly $numTypeParams = 0;
static readonly $isPhantom = [] as const;

readonly $typeName = TokenDistributionSchedule.$typeName;
readonly $fullTypeName: `${typeof PKG_V15}::genesis::TokenDistributionSchedule`;
readonly $fullTypeName: `${typeof PKG_V16}::genesis::TokenDistributionSchedule`;
readonly $typeArgs: [];
readonly $isPhantom = TokenDistributionSchedule.$isPhantom;

Expand All @@ -1073,7 +1073,7 @@ export class TokenDistributionSchedule implements StructClass {
this.$fullTypeName = composeSuiType(
TokenDistributionSchedule.$typeName,
...typeArgs,
) as `${typeof PKG_V15}::genesis::TokenDistributionSchedule`;
) as `${typeof PKG_V16}::genesis::TokenDistributionSchedule`;
this.$typeArgs = typeArgs;

this.stakeSubsidyFundMist = fields.stakeSubsidyFundMist;
Expand All @@ -1086,7 +1086,7 @@ export class TokenDistributionSchedule implements StructClass {
fullTypeName: composeSuiType(
TokenDistributionSchedule.$typeName,
...[],
) as `${typeof PKG_V15}::genesis::TokenDistributionSchedule`,
) as `${typeof PKG_V16}::genesis::TokenDistributionSchedule`,
typeArgs: [] as [],
isPhantom: TokenDistributionSchedule.$isPhantom,
reifiedTypeArgs: [],
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/_generated/_dependencies/source/0x3/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const PACKAGE_ID = "0x3";
export const PUBLISHED_AT = "0x3";
export const PKG_V15 = "0x3";
export const PKG_V16 = "0x3";
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { Bag } from "../../0x2/bag/structs";
import { Balance } from "../../0x2/balance/structs";
import { SUI } from "../../0x2/sui/structs";
import { PKG_V15 } from "../index";
import { PKG_V16 } from "../index";
import { bcs } from "@mysten/sui/bcs";
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
import { fromB64 } from "@mysten/sui/utils";
Expand All @@ -28,7 +28,7 @@ import { fromB64 } from "@mysten/sui/utils";

export function isStakeSubsidy(type: string): boolean {
type = compressSuiType(type);
return type === `${PKG_V15}::stake_subsidy::StakeSubsidy`;
return type === `${PKG_V16}::stake_subsidy::StakeSubsidy`;
}

export interface StakeSubsidyFields {
Expand All @@ -45,12 +45,12 @@ export type StakeSubsidyReified = Reified<StakeSubsidy, StakeSubsidyFields>;
export class StakeSubsidy implements StructClass {
__StructClass = true as const;

static readonly $typeName = `${PKG_V15}::stake_subsidy::StakeSubsidy`;
static readonly $typeName = `${PKG_V16}::stake_subsidy::StakeSubsidy`;
static readonly $numTypeParams = 0;
static readonly $isPhantom = [] as const;

readonly $typeName = StakeSubsidy.$typeName;
readonly $fullTypeName: `${typeof PKG_V15}::stake_subsidy::StakeSubsidy`;
readonly $fullTypeName: `${typeof PKG_V16}::stake_subsidy::StakeSubsidy`;
readonly $typeArgs: [];
readonly $isPhantom = StakeSubsidy.$isPhantom;

Expand All @@ -65,7 +65,7 @@ export class StakeSubsidy implements StructClass {
this.$fullTypeName = composeSuiType(
StakeSubsidy.$typeName,
...typeArgs,
) as `${typeof PKG_V15}::stake_subsidy::StakeSubsidy`;
) as `${typeof PKG_V16}::stake_subsidy::StakeSubsidy`;
this.$typeArgs = typeArgs;

this.balance = fields.balance;
Expand All @@ -82,7 +82,7 @@ export class StakeSubsidy implements StructClass {
fullTypeName: composeSuiType(
StakeSubsidy.$typeName,
...[],
) as `${typeof PKG_V15}::stake_subsidy::StakeSubsidy`,
) as `${typeof PKG_V16}::stake_subsidy::StakeSubsidy`,
typeArgs: [] as [],
isPhantom: StakeSubsidy.$isPhantom,
reifiedTypeArgs: [],
Expand Down
Loading

0 comments on commit e58552f

Please sign in to comment.