Script Trigger Reference of GS2-Money

Reference of event triggers that call extended scripts

Trigger

createWallet

wallet creation

Synchronous Execution Script

The script is executed synchronously before the wallet creation process.

Request
TypeDescription
namespaceNamespaceNamespace
walletWalletWallet
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow wallet creation
initialAmountint
0 ~ 2147483645Initial Wallet balance - will be credited as a free grant
Implementation Example
namespace = args.namespace
wallet = args.wallet

result = {
  permit=permit,
  initialAmount=initialAmount
}

Asynchronous Execution Script

The script executes asynchronously after the wallet creation.

Request
TypeDescription
namespaceNamespaceNamespace
walletWalletWallet
Implementation Example
namespace = args.namespace
wallet = args.wallet

result = {
}

deposit

Wallet balance addition

Synchronous Execution Script

The script is executed synchronously before the wallet balance addition process.

Request
TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before deposit
newWalletWalletWallet after deposit
pricefloatPurchase Price
depositCountintQuantity of premium currency to be granted
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow wallet balance addition
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
price = args.price
depositCount = args.depositCount

result = {
  permit=permit
}

Asynchronous Execution Script

The script executes asynchronously after the Wallet balance addition.

Request
TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before deposit
newWalletWalletWallet after deposit
pricefloatPurchase Price
depositCountintQuantity of premium currency to be granted
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
price = args.price
depositCount = args.depositCount

result = {
}

withdraw

Wallet balance consumption

Synchronous Execution Script

The script is executed synchronously before the wallet balance consumption process.

Request
TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before withdraw
newWalletWalletWallet after withdraw
withdrawCountintQuantity of premium currency to be consumed
paidOnlyboolOnly for paid currency
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow wallet balance consumption
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
withdrawCount = args.withdrawCount
paidOnly = args.paidOnly

result = {
  permit=permit
}

Asynchronous Execution Script

The script executes asynchronously after the Wallet balance consumption.

Request
TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before withdraw
newWalletWalletWallet after withdraw
withdrawCountintQuantity of premium currency to be consumed
paidOnlyboolOnly for paid currency
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
withdrawCount = args.withdrawCount
paidOnly = args.paidOnly

result = {
}