@metaplex-foundation/mpl-token-metadata
Advanced tools
Comparing version 2.7.0 to 2.8.0
@@ -101,3 +101,3 @@ "use strict"; | ||
} | ||
catch (err) { | ||
catch (e) { | ||
return [null, NONE_BYTE_SIZE, true]; | ||
@@ -104,0 +104,0 @@ } |
@@ -15,2 +15,3 @@ /// <reference types="node" /> | ||
delegateRole: beet.COption<TokenDelegateRole>; | ||
lockedTransfer: beet.COption<web3.PublicKey>; | ||
}; | ||
@@ -24,2 +25,3 @@ export declare class TokenRecord implements TokenRecordArgs { | ||
readonly delegateRole: beet.COption<TokenDelegateRole>; | ||
readonly lockedTransfer: beet.COption<web3.PublicKey>; | ||
private constructor(); | ||
@@ -41,4 +43,5 @@ static fromArgs(args: TokenRecordArgs): TokenRecord; | ||
delegateRole: TokenDelegateRole; | ||
lockedTransfer: web3.PublicKey; | ||
}; | ||
} | ||
export declare const tokenRecordBeet: beet.FixableBeetStruct<TokenRecord, TokenRecordArgs>; |
@@ -33,4 +33,5 @@ "use strict"; | ||
const TokenDelegateRole_1 = require("../types/TokenDelegateRole"); | ||
const customSerializer = __importStar(require("../../custom/token-record-deserializer")); | ||
class TokenRecord { | ||
constructor(key, bump, state, ruleSetRevision, delegate, delegateRole) { | ||
constructor(key, bump, state, ruleSetRevision, delegate, delegateRole, lockedTransfer) { | ||
this.key = key; | ||
@@ -42,5 +43,6 @@ this.bump = bump; | ||
this.delegateRole = delegateRole; | ||
this.lockedTransfer = lockedTransfer; | ||
} | ||
static fromArgs(args) { | ||
return new TokenRecord(args.key, args.bump, args.state, args.ruleSetRevision, args.delegate, args.delegateRole); | ||
return new TokenRecord(args.key, args.bump, args.state, args.ruleSetRevision, args.delegate, args.delegateRole, args.lockedTransfer); | ||
} | ||
@@ -61,6 +63,6 @@ static fromAccountInfo(accountInfo, offset = 0) { | ||
static deserialize(buf, offset = 0) { | ||
return exports.tokenRecordBeet.deserialize(buf, offset); | ||
return resolvedDeserialize(buf, offset); | ||
} | ||
serialize() { | ||
return exports.tokenRecordBeet.serialize(this); | ||
return resolvedSerialize(this); | ||
} | ||
@@ -82,2 +84,3 @@ static byteSize(args) { | ||
delegateRole: this.delegateRole, | ||
lockedTransfer: this.lockedTransfer, | ||
}; | ||
@@ -94,3 +97,11 @@ } | ||
['delegateRole', beet.coption(TokenDelegateRole_1.tokenDelegateRoleBeet)], | ||
['lockedTransfer', beet.coption(beetSolana.publicKey)], | ||
], TokenRecord.fromArgs, 'TokenRecord'); | ||
const serializer = customSerializer; | ||
const resolvedSerialize = typeof serializer.serialize === 'function' | ||
? serializer.serialize.bind(serializer) | ||
: exports.tokenRecordBeet.serialize.bind(exports.tokenRecordBeet); | ||
const resolvedDeserialize = typeof serializer.deserialize === 'function' | ||
? serializer.deserialize.bind(serializer) | ||
: exports.tokenRecordBeet.deserialize.bind(exports.tokenRecordBeet); | ||
//# sourceMappingURL=TokenRecord.js.map |
@@ -850,4 +850,29 @@ type ErrorWithCode = Error & { | ||
} | ||
export declare class InvalidDelegateArgsError extends Error { | ||
readonly code: number; | ||
readonly name: string; | ||
constructor(); | ||
} | ||
export declare class MissingLockedTransferAddressError extends Error { | ||
readonly code: number; | ||
readonly name: string; | ||
constructor(); | ||
} | ||
export declare class InvalidLockedTransferAddressError extends Error { | ||
readonly code: number; | ||
readonly name: string; | ||
constructor(); | ||
} | ||
export declare class DataIncrementLimitExceededError extends Error { | ||
readonly code: number; | ||
readonly name: string; | ||
constructor(); | ||
} | ||
export declare class CannotUpdateAssetWithDelegateError extends Error { | ||
readonly code: number; | ||
readonly name: string; | ||
constructor(); | ||
} | ||
export declare function errorFromCode(code: number): MaybeErrorWithCode; | ||
export declare function errorFromName(name: string): MaybeErrorWithCode; | ||
export {}; |
import * as beet from '@metaplex-foundation/beet'; | ||
import * as web3 from '@solana/web3.js'; | ||
import { AuthorizationData } from './AuthorizationData'; | ||
@@ -29,2 +30,7 @@ export type DelegateArgsRecord = { | ||
}; | ||
LockedTransferV1: { | ||
amount: beet.bignum; | ||
lockedAddress: web3.PublicKey; | ||
authorizationData: beet.COption<AuthorizationData>; | ||
}; | ||
}; | ||
@@ -85,2 +91,11 @@ export type DelegateArgs = beet.DataEnumKeyAsKind<DelegateArgsRecord>; | ||
}; | ||
export declare const isDelegateArgsLockedTransferV1: (x: DelegateArgs) => x is { | ||
__kind: "LockedTransferV1"; | ||
} & Omit<{ | ||
amount: beet.bignum; | ||
lockedAddress: web3.PublicKey; | ||
authorizationData: beet.COption<AuthorizationData>; | ||
}, "void"> & { | ||
__kind: 'LockedTransferV1'; | ||
}; | ||
export declare const delegateArgsBeet: beet.FixableBeet<DelegateArgs, DelegateArgs>; |
@@ -26,4 +26,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.delegateArgsBeet = exports.isDelegateArgsStandardV1 = exports.isDelegateArgsStakingV1 = exports.isDelegateArgsUtilityV1 = exports.isDelegateArgsUpdateV1 = exports.isDelegateArgsTransferV1 = exports.isDelegateArgsSaleV1 = exports.isDelegateArgsCollectionV1 = void 0; | ||
exports.delegateArgsBeet = exports.isDelegateArgsLockedTransferV1 = exports.isDelegateArgsStandardV1 = exports.isDelegateArgsStakingV1 = exports.isDelegateArgsUtilityV1 = exports.isDelegateArgsUpdateV1 = exports.isDelegateArgsTransferV1 = exports.isDelegateArgsSaleV1 = exports.isDelegateArgsCollectionV1 = void 0; | ||
const beet = __importStar(require("@metaplex-foundation/beet")); | ||
const beetSolana = __importStar(require("@metaplex-foundation/beet-solana")); | ||
const AuthorizationData_1 = require("./AuthorizationData"); | ||
@@ -44,2 +45,4 @@ const isDelegateArgsCollectionV1 = (x) => x.__kind === 'CollectionV1'; | ||
exports.isDelegateArgsStandardV1 = isDelegateArgsStandardV1; | ||
const isDelegateArgsLockedTransferV1 = (x) => x.__kind === 'LockedTransferV1'; | ||
exports.isDelegateArgsLockedTransferV1 = isDelegateArgsLockedTransferV1; | ||
exports.delegateArgsBeet = beet.dataEnum([ | ||
@@ -86,3 +89,11 @@ [ | ||
], | ||
[ | ||
'LockedTransferV1', | ||
new beet.FixableBeetArgsStruct([ | ||
['amount', beet.u64], | ||
['lockedAddress', beetSolana.publicKey], | ||
['authorizationData', beet.coption(AuthorizationData_1.authorizationDataBeet)], | ||
], 'DelegateArgsRecord["LockedTransferV1"]'), | ||
], | ||
]); | ||
//# sourceMappingURL=DelegateArgs.js.map |
@@ -9,4 +9,5 @@ import * as beet from '@metaplex-foundation/beet'; | ||
StakingV1 = 5, | ||
StandardV1 = 6 | ||
StandardV1 = 6, | ||
LockedTransferV1 = 7 | ||
} | ||
export declare const revokeArgsBeet: beet.FixedSizeBeet<RevokeArgs, RevokeArgs>; |
@@ -37,4 +37,5 @@ "use strict"; | ||
RevokeArgs[RevokeArgs["StandardV1"] = 6] = "StandardV1"; | ||
RevokeArgs[RevokeArgs["LockedTransferV1"] = 7] = "LockedTransferV1"; | ||
})(RevokeArgs = exports.RevokeArgs || (exports.RevokeArgs = {})); | ||
exports.revokeArgsBeet = beet.fixedScalarEnum(RevokeArgs); | ||
//# sourceMappingURL=RevokeArgs.js.map |
@@ -8,4 +8,5 @@ import * as beet from '@metaplex-foundation/beet'; | ||
Standard = 4, | ||
Migration = 5 | ||
LockedTransfer = 5, | ||
Migration = 6 | ||
} | ||
export declare const tokenDelegateRoleBeet: beet.FixedSizeBeet<TokenDelegateRole, TokenDelegateRole>; |
@@ -35,5 +35,6 @@ "use strict"; | ||
TokenDelegateRole[TokenDelegateRole["Standard"] = 4] = "Standard"; | ||
TokenDelegateRole[TokenDelegateRole["Migration"] = 5] = "Migration"; | ||
TokenDelegateRole[TokenDelegateRole["LockedTransfer"] = 5] = "LockedTransfer"; | ||
TokenDelegateRole[TokenDelegateRole["Migration"] = 6] = "Migration"; | ||
})(TokenDelegateRole = exports.TokenDelegateRole || (exports.TokenDelegateRole = {})); | ||
exports.tokenDelegateRoleBeet = beet.fixedScalarEnum(TokenDelegateRole); | ||
//# sourceMappingURL=TokenDelegateRole.js.map |
{ | ||
"name": "@metaplex-foundation/mpl-token-metadata", | ||
"version": "2.7.0", | ||
"contractVersion": "1.7.0", | ||
"version": "2.8.0", | ||
"contractVersion": "1.8.0", | ||
"description": "MPL Token Metadata JavaScript API.", | ||
@@ -6,0 +6,0 @@ "main": "dist/src/mpl-token-metadata.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
823284
393
14190