@solana/instructions
Advanced tools
Comparing version 2.0.0-experimental.b8df7b4 to 2.0.0-experimental.fbdf21a
@@ -0,3 +1,39 @@ | ||
// src/roles.ts | ||
var AccountRole = /* @__PURE__ */ ((AccountRole2) => { | ||
AccountRole2[AccountRole2["WRITABLE_SIGNER"] = /* 3 */ | ||
3] = "WRITABLE_SIGNER"; | ||
AccountRole2[AccountRole2["READONLY_SIGNER"] = /* 2 */ | ||
2] = "READONLY_SIGNER"; | ||
AccountRole2[AccountRole2["WRITABLE"] = /* 1 */ | ||
1] = "WRITABLE"; | ||
AccountRole2[AccountRole2["READONLY"] = /* 0 */ | ||
0] = "READONLY"; | ||
return AccountRole2; | ||
})(AccountRole || {}); | ||
var IS_SIGNER_BITMASK = 2; | ||
var IS_WRITABLE_BITMASK = 1; | ||
function downgradeRoleToNonSigner(role) { | ||
return role & ~IS_SIGNER_BITMASK; | ||
} | ||
function downgradeRoleToReadonly(role) { | ||
return role & ~IS_WRITABLE_BITMASK; | ||
} | ||
function isSignerRole(role) { | ||
return role >= 2 /* READONLY_SIGNER */; | ||
} | ||
function isWritableRole(role) { | ||
return (role & IS_WRITABLE_BITMASK) !== 0; | ||
} | ||
function mergeRoles(roleA, roleB) { | ||
return roleA | roleB; | ||
} | ||
function upgradeRoleToSigner(role) { | ||
return role | IS_SIGNER_BITMASK; | ||
} | ||
function upgradeRoleToWritable(role) { | ||
return role | IS_WRITABLE_BITMASK; | ||
} | ||
export { AccountRole, downgradeRoleToNonSigner, downgradeRoleToReadonly, isSignerRole, isWritableRole, mergeRoles, upgradeRoleToSigner, upgradeRoleToWritable }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.browser.js.map |
@@ -1,8 +0,54 @@ | ||
(function () { | ||
'use strict'; | ||
this.globalThis = this.globalThis || {}; | ||
this.globalThis.solanaWeb3 = (function (exports) { | ||
'use strict'; | ||
// src/roles.ts | ||
var AccountRole = /* @__PURE__ */ ((AccountRole2) => { | ||
AccountRole2[AccountRole2["WRITABLE_SIGNER"] = /* 3 */ | ||
3] = "WRITABLE_SIGNER"; | ||
AccountRole2[AccountRole2["READONLY_SIGNER"] = /* 2 */ | ||
2] = "READONLY_SIGNER"; | ||
AccountRole2[AccountRole2["WRITABLE"] = /* 1 */ | ||
1] = "WRITABLE"; | ||
AccountRole2[AccountRole2["READONLY"] = /* 0 */ | ||
0] = "READONLY"; | ||
return AccountRole2; | ||
})(AccountRole || {}); | ||
var IS_SIGNER_BITMASK = 2; | ||
var IS_WRITABLE_BITMASK = 1; | ||
function downgradeRoleToNonSigner(role) { | ||
return role & ~IS_SIGNER_BITMASK; | ||
} | ||
function downgradeRoleToReadonly(role) { | ||
return role & ~IS_WRITABLE_BITMASK; | ||
} | ||
function isSignerRole(role) { | ||
return role >= 2 /* READONLY_SIGNER */; | ||
} | ||
function isWritableRole(role) { | ||
return (role & IS_WRITABLE_BITMASK) !== 0; | ||
} | ||
function mergeRoles(roleA, roleB) { | ||
return roleA | roleB; | ||
} | ||
function upgradeRoleToSigner(role) { | ||
return role | IS_SIGNER_BITMASK; | ||
} | ||
function upgradeRoleToWritable(role) { | ||
return role | IS_WRITABLE_BITMASK; | ||
} | ||
exports.AccountRole = AccountRole; | ||
exports.downgradeRoleToNonSigner = downgradeRoleToNonSigner; | ||
exports.downgradeRoleToReadonly = downgradeRoleToReadonly; | ||
exports.isSignerRole = isSignerRole; | ||
exports.isWritableRole = isWritableRole; | ||
exports.mergeRoles = mergeRoles; | ||
exports.upgradeRoleToSigner = upgradeRoleToSigner; | ||
exports.upgradeRoleToWritable = upgradeRoleToWritable; | ||
})(); | ||
return exports; | ||
})({}); | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.development.js.map |
@@ -0,3 +1,39 @@ | ||
// src/roles.ts | ||
var AccountRole = /* @__PURE__ */ ((AccountRole2) => { | ||
AccountRole2[AccountRole2["WRITABLE_SIGNER"] = /* 3 */ | ||
3] = "WRITABLE_SIGNER"; | ||
AccountRole2[AccountRole2["READONLY_SIGNER"] = /* 2 */ | ||
2] = "READONLY_SIGNER"; | ||
AccountRole2[AccountRole2["WRITABLE"] = /* 1 */ | ||
1] = "WRITABLE"; | ||
AccountRole2[AccountRole2["READONLY"] = /* 0 */ | ||
0] = "READONLY"; | ||
return AccountRole2; | ||
})(AccountRole || {}); | ||
var IS_SIGNER_BITMASK = 2; | ||
var IS_WRITABLE_BITMASK = 1; | ||
function downgradeRoleToNonSigner(role) { | ||
return role & ~IS_SIGNER_BITMASK; | ||
} | ||
function downgradeRoleToReadonly(role) { | ||
return role & ~IS_WRITABLE_BITMASK; | ||
} | ||
function isSignerRole(role) { | ||
return role >= 2 /* READONLY_SIGNER */; | ||
} | ||
function isWritableRole(role) { | ||
return (role & IS_WRITABLE_BITMASK) !== 0; | ||
} | ||
function mergeRoles(roleA, roleB) { | ||
return roleA | roleB; | ||
} | ||
function upgradeRoleToSigner(role) { | ||
return role | IS_SIGNER_BITMASK; | ||
} | ||
function upgradeRoleToWritable(role) { | ||
return role | IS_WRITABLE_BITMASK; | ||
} | ||
export { AccountRole, downgradeRoleToNonSigner, downgradeRoleToReadonly, isSignerRole, isWritableRole, mergeRoles, upgradeRoleToSigner, upgradeRoleToWritable }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.native.js.map |
@@ -0,3 +1,39 @@ | ||
// src/roles.ts | ||
var AccountRole = /* @__PURE__ */ ((AccountRole2) => { | ||
AccountRole2[AccountRole2["WRITABLE_SIGNER"] = /* 3 */ | ||
3] = "WRITABLE_SIGNER"; | ||
AccountRole2[AccountRole2["READONLY_SIGNER"] = /* 2 */ | ||
2] = "READONLY_SIGNER"; | ||
AccountRole2[AccountRole2["WRITABLE"] = /* 1 */ | ||
1] = "WRITABLE"; | ||
AccountRole2[AccountRole2["READONLY"] = /* 0 */ | ||
0] = "READONLY"; | ||
return AccountRole2; | ||
})(AccountRole || {}); | ||
var IS_SIGNER_BITMASK = 2; | ||
var IS_WRITABLE_BITMASK = 1; | ||
function downgradeRoleToNonSigner(role) { | ||
return role & ~IS_SIGNER_BITMASK; | ||
} | ||
function downgradeRoleToReadonly(role) { | ||
return role & ~IS_WRITABLE_BITMASK; | ||
} | ||
function isSignerRole(role) { | ||
return role >= 2 /* READONLY_SIGNER */; | ||
} | ||
function isWritableRole(role) { | ||
return (role & IS_WRITABLE_BITMASK) !== 0; | ||
} | ||
function mergeRoles(roleA, roleB) { | ||
return roleA | roleB; | ||
} | ||
function upgradeRoleToSigner(role) { | ||
return role | IS_SIGNER_BITMASK; | ||
} | ||
function upgradeRoleToWritable(role) { | ||
return role | IS_WRITABLE_BITMASK; | ||
} | ||
export { AccountRole, downgradeRoleToNonSigner, downgradeRoleToReadonly, isSignerRole, isWritableRole, mergeRoles, upgradeRoleToSigner, upgradeRoleToWritable }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.node.js.map |
@@ -1,6 +0,18 @@ | ||
(function () { | ||
this.globalThis = this.globalThis || {}; | ||
this.globalThis.solanaWeb3 = (function (exports) { | ||
'use strict'; | ||
var n=(e=>(e[e.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",e[e.READONLY_SIGNER=2]="READONLY_SIGNER",e[e.WRITABLE=1]="WRITABLE",e[e.READONLY=0]="READONLY",e))(n||{});function l(o){return o&-3}function A(o){return o&-2}function r(o){return o>=2}function u(o){return (o&1)!==0}function E(o,R){return o|R}function I(o){return o|2}function N(o){return o|1} | ||
exports.AccountRole = n; | ||
exports.downgradeRoleToNonSigner = l; | ||
exports.downgradeRoleToReadonly = A; | ||
exports.isSignerRole = r; | ||
exports.isWritableRole = u; | ||
exports.mergeRoles = E; | ||
exports.upgradeRoleToSigner = I; | ||
exports.upgradeRoleToWritable = N; | ||
})(); | ||
return exports; | ||
})({}); |
import { Base58EncodedAddress } from '@solana/keys'; | ||
import { AccountRole } from './roles'; | ||
export interface IAccountMeta<TAddress extends string = string> { | ||
readonly address: Base58EncodedAddress<TAddress>; | ||
readonly isSigner: boolean; | ||
readonly isWritable: boolean; | ||
readonly role: AccountRole; | ||
} | ||
export type ReadonlyAccount<TAddress extends string = string> = IAccountMeta<TAddress> & Readonly<{ | ||
isSigner: false; | ||
isWritable: false; | ||
}>; | ||
export type WritableAccount<TAddress extends string = string> = IAccountMeta<TAddress> & Readonly<{ | ||
isSigner: false; | ||
isWritable: true; | ||
}>; | ||
export type ReadonlySignerAccount<TAddress extends string = string> = IAccountMeta<TAddress> & Readonly<{ | ||
isSigner: true; | ||
isWritable: false; | ||
}>; | ||
export type WritableSignerAccount<TAddress extends string = string> = IAccountMeta<TAddress> & Readonly<{ | ||
isSigner: true; | ||
isWritable: true; | ||
}>; | ||
export type ReadonlyAccount<TAddress extends string = string> = IAccountMeta<TAddress> & { | ||
readonly role: AccountRole.READONLY; | ||
}; | ||
export type WritableAccount<TAddress extends string = string> = IAccountMeta<TAddress> & { | ||
role: AccountRole.WRITABLE; | ||
}; | ||
export type ReadonlySignerAccount<TAddress extends string = string> = IAccountMeta<TAddress> & { | ||
role: AccountRole.READONLY_SIGNER; | ||
}; | ||
export type WritableSignerAccount<TAddress extends string = string> = IAccountMeta<TAddress> & { | ||
role: AccountRole.WRITABLE_SIGNER; | ||
}; | ||
export interface IAccountLookupMeta<TAddress extends string = string, TLookupTableAddress extends string = string> { | ||
@@ -27,10 +23,10 @@ readonly address: Base58EncodedAddress<TAddress>; | ||
readonly lookupTableAddress: Base58EncodedAddress<TLookupTableAddress>; | ||
readonly isWritable: boolean; | ||
readonly role: AccountRole.READONLY | AccountRole.WRITABLE; | ||
} | ||
export type ReadonlyAccountLookup<TAddress extends string = string, TLookupTableAddress extends string = string> = IAccountLookupMeta<TAddress, TLookupTableAddress> & Readonly<{ | ||
isWritable: false; | ||
}>; | ||
export type WritableAccountLookup<TAddress extends string = string, TLookupTableAddress extends string = string> = IAccountLookupMeta<TAddress, TLookupTableAddress> & Readonly<{ | ||
isWritable: true; | ||
}>; | ||
export type ReadonlyAccountLookup<TAddress extends string = string, TLookupTableAddress extends string = string> = IAccountLookupMeta<TAddress, TLookupTableAddress> & { | ||
readonly role: AccountRole.READONLY; | ||
}; | ||
export type WritableAccountLookup<TAddress extends string = string, TLookupTableAddress extends string = string> = IAccountLookupMeta<TAddress, TLookupTableAddress> & { | ||
readonly role: AccountRole.WRITABLE; | ||
}; | ||
//# sourceMappingURL=accounts.d.ts.map |
export * from './accounts'; | ||
export * from './instruction'; | ||
export * from './roles'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@solana/instructions", | ||
"version": "2.0.0-experimental.b8df7b4", | ||
"version": "2.0.0-experimental.fbdf21a", | ||
"description": "Helpers for creating transaction instructions", | ||
@@ -67,4 +67,4 @@ "exports": { | ||
"version-from-git": "^1.1.1", | ||
"@solana/keys": "2.0.0-development", | ||
"build-scripts": "0.0.0", | ||
"@solana/keys": "2.0.0-experimental.fbdf21a", | ||
"test-config": "0.0.0", | ||
@@ -91,4 +91,6 @@ "tsconfig": "0.0.0" | ||
"test:treeshakability:node": "agadoo dist/index.native.js", | ||
"test:typecheck": "tsc --noEmit" | ||
"test:typecheck": "tsc --noEmit", | ||
"test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --rootDir . --silent", | ||
"test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --rootDir . --silent" | ||
} | ||
} |
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
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
53256
25
389
1